target
stringlengths 5
300
| feat_repo_name
stringlengths 6
76
| text
stringlengths 26
1.05M
|
---|---|---|
src/js/components/icons/base/BottomCorner.js | kylebyerly-hp/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}-bottom-corner`,
className,
{
[`${CLASS_ROOT}--${size}`]: size,
[`${CLASS_ROOT}--responsive`]: responsive,
[`${COLOR_INDEX}-${colorIndex}`]: colorIndex
}
);
a11yTitle = a11yTitle || Intl.getMessage(intl, 'bottom-corner');
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}><polyline fill="none" stroke="#000" strokeWidth="2" points="8 20 20 20 20 8"/></svg>;
}
};
Icon.contextTypes = {
intl: PropTypes.object
};
Icon.defaultProps = {
responsive: true
};
Icon.displayName = 'BottomCorner';
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/compose/components/upload_progress.js | maa123/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import Motion from '../../ui/util/optional_motion';
import spring from 'react-motion/lib/spring';
import Icon from 'mastodon/components/icon';
export default class UploadProgress extends React.PureComponent {
static propTypes = {
active: PropTypes.bool,
progress: PropTypes.number,
icon: PropTypes.string.isRequired,
message: PropTypes.node.isRequired,
};
render () {
const { active, progress, icon, message } = this.props;
if (!active) {
return null;
}
return (
<div className='upload-progress'>
<div className='upload-progress__icon'>
<Icon id={icon} />
</div>
<div className='upload-progress__message'>
{message}
<div className='upload-progress__backdrop'>
<Motion defaultStyle={{ width: 0 }} style={{ width: spring(progress) }}>
{({ width }) =>
<div className='upload-progress__tracker' style={{ width: `${width}%` }} />
}
</Motion>
</div>
</div>
</div>
);
}
}
|
ajax/libs/react-instantsearch/6.5.0/Core.min.js | cdnjs/cdnjs | /*! React InstantSearch 6.5.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(((e=e||self).ReactInstantSearch=e.ReactInstantSearch||{},e.ReactInstantSearch.Core={}),e.React)}(this,function(e,s){"use strict";var u="default"in s?s.default:s;function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(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)}}function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e){return(y="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?function(e){return t(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var p="undefined"!=typeof Element,v="function"==typeof Map,m="function"==typeof Set,S="function"==typeof ArrayBuffer;var P=function(e,t){try{return function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(v&&t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!r.has(o.value[0]))return!1;for(i=t.entries();!(o=i.next()).done;)if(!e(o.value[1],r.get(o.value[0])))return!1;return!0}if(m&&t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!r.has(o.value[0]))return!1;return!0}if(S&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(t[o]!==r[o])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;if(p&&t instanceof Element)return!1;for(o=n;0!=o--;)if(!("_owner"===a[o]&&t.$$typeof||e(t[a[o]],r[a[o]])))return!1;return!0}return t!=t&&r!=r}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}},O=function(e,t){if(e===t)return!0;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a<r.length;a++)if(!o.call(t,r[a])||e[r[a]]!==t[r[a]])return!1;return!0},x=function o(a){return Object.keys(a).forEach(function(e){var t,r,n=a[e];"object"!==y(t=n)||null===t||Array.isArray(t)||((r=n)&&0<Object.keys(r).length?o(n):delete a[e])}),a};var r=s.createContext({onInternalStateUpdate:function(){},createHrefForState:function(){return"#"},onSearchForFacetValues:function(){},onSearchStateChange:function(){},onSearchParameters:function(){},store:{},widgetsManager:{},mainTargetedIndex:""}),o=r.Consumer,n=(r.Provider,s.createContext(void 0)),a=n.Consumer;n.Provider;function i(p){if(!p.displayName)throw new Error("`createConnector` requires you to provide a `displayName` property.");var i="function"==typeof p.getSearchParameters||"function"==typeof p.getMetadata||"function"==typeof p.transitionState;return function(a){var e,t=function(e){function n(e){var o,t,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t=this,r=g(n).call(this,e),l(d(o=!r||"object"!==y(r)&&"function"!=typeof r?d(t):r),"unsubscribe",void 0),l(d(o),"unregisterWidget",void 0),l(d(o),"isUnmounting",!1),l(d(o),"state",{providedProps:o.getProvidedProps(o.props)}),l(d(o),"refine",function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];o.props.contextValue.onInternalStateUpdate((e=p.refine).call.apply(e,[d(o),o.props,o.props.contextValue.store.getState().widgets].concat(r)))}),l(d(o),"createURL",function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return o.props.contextValue.createHrefForState((e=p.refine).call.apply(e,[d(o),o.props,o.props.contextValue.store.getState().widgets].concat(r)))}),l(d(o),"searchForFacetValues",function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];o.props.contextValue.onSearchForFacetValues((e=p.searchForFacetValues).call.apply(e,[d(o),o.props,o.props.contextValue.store.getState().widgets].concat(r)))}),p.getSearchParameters&&o.props.contextValue.onSearchParameters(p.getSearchParameters.bind(d(o)),{ais:o.props.contextValue,multiIndexContext:o.props.indexContextValue},o.props),o}var t,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(n,s.Component),t=n,(r=[{key:"componentDidMount",value:function(){var e=this;this.unsubscribe=this.props.contextValue.store.subscribe(function(){e.isUnmounting||e.setState({providedProps:e.getProvidedProps(e.props)})}),i&&(this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this))}},{key:"shouldComponentUpdate",value:function(e,t){if("function"==typeof p.shouldComponentUpdate)return p.shouldComponentUpdate.call(this,this.props,e,this.state,t);var r=O(this.props,e);return null===this.state.providedProps||null===t.providedProps?this.state.providedProps!==t.providedProps||!r:!r||!O(this.state.providedProps,t.providedProps)}},{key:"componentDidUpdate",value:function(e){P(e,this.props)||(this.setState({providedProps:this.getProvidedProps(this.props)}),i&&(this.props.contextValue.widgetsManager.update(),"function"==typeof p.transitionState&&this.props.contextValue.onSearchStateChange(p.transitionState.call(this,this.props,this.props.contextValue.store.getState().widgets,this.props.contextValue.store.getState().widgets))))}},{key:"componentWillUnmount",value:function(){if(this.isUnmounting=!0,this.unsubscribe&&this.unsubscribe(),this.unregisterWidget&&(this.unregisterWidget(),"function"==typeof p.cleanUp)){var e=p.cleanUp.call(this,this.props,this.props.contextValue.store.getState().widgets);this.props.contextValue.store.setState(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(e){l(t,e,r[e])})}return t}({},this.props.contextValue.store.getState(),{widgets:e})),this.props.contextValue.onSearchStateChange(x(e))}}},{key:"getProvidedProps",value:function(e){var t=this.props.contextValue.store.getState(),r=t.widgets,n=t.results,o=t.resultsFacetValues,a=t.searching,i=t.searchingForFacetValues,s=t.isSearchStalled,u=t.metadata,c={results:n,searching:a,searchingForFacetValues:i,isSearchStalled:s,error:t.error};return p.getProvidedProps.call(this,e,r,c,u,o)}},{key:"getSearchParameters",value:function(e){return"function"==typeof p.getSearchParameters?p.getSearchParameters.call(this,e,this.props,this.props.contextValue.store.getState().widgets):null}},{key:"getMetadata",value:function(e){return"function"==typeof p.getMetadata?p.getMetadata.call(this,this.props,e):{}}},{key:"transitionState",value:function(e,t){return"function"==typeof p.transitionState?p.transitionState.call(this,this.props,e,t):t}},{key:"render",value:function(){var e=this.props,t=(e.contextValue,f(e,["contextValue"])),r=this.state.providedProps;if(null===r)return null;var n="function"==typeof p.refine?{refine:this.refine,createURL:this.createURL}:{},o="function"==typeof p.searchForFacetValues?{searchForItems:this.searchForFacetValues}:{};return u.createElement(a,c({},t,r,n,o))}}])&&h(t.prototype,r),o&&h(t,o),n}();return l(t,"displayName","".concat(p.displayName,"(").concat((e=a).displayName||e.name||"UnknownComponent",")")),l(t,"propTypes",p.propTypes),l(t,"defaultProps",p.defaultProps),t}}e.createConnector=function(t){return function(e){var n=i(t)(e);return function(r){return u.createElement(o,null,function(t){return u.createElement(a,null,function(e){return u.createElement(n,c({contextValue:t,indexContextValue:e},r))})})}}},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=Core.min.js.map
|
packages/material-ui-icons/src/Mms.js | allanalexandre/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM5 14l3.5-4.5 2.5 3.01L14.5 8l4.5 6H5z" /><path fill="none" d="M0 0h24v24H0z" /></React.Fragment>
, 'Mms');
|
ajax/libs/react-bootstrap-table/0.3.1/react-bootstrap-table.min.js | seogi1004/cdnjs | !function e(t,n,o){function a(s,l){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!l&&c)return c(s,!0);if(r)return r(s,!0);var i=new Error("Cannot find module '"+s+"'");throw i.code="MODULE_NOT_FOUND",i}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return a(n?n:e)},u,u.exports,e,t,n,o)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<o.length;s++)a(o[s]);return a}({"./src/index.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=o(e("./BootstrapTable")),r=o(e("./TableHeaderColumn"));window.BootstrapTable=a,window.TableHeaderColumn=r,t.exports={BootstrapTable:a,TableHeaderColumn:r}},{"./BootstrapTable":"/home/allen/workspace/react-bootstrap-table/src/BootstrapTable.js","./TableHeaderColumn":"/home/allen/workspace/react-bootstrap-table/src/TableHeaderColumn.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/classnames/index.js":[function(e,t,n){function o(){for(var e,t="",n=0;n<arguments.length;n++)if(e=arguments[n])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+o.apply(null,e);else if("object"==typeof e)for(var a in e)e.hasOwnProperty(a)&&e[a]&&(t+=" "+a);return t.substr(1)}"undefined"!=typeof t&&t.exports&&(t.exports=o)},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js":[function(e,t,n){"use strict";var o=e("./focusNode"),a={componentDidMount:function(){this.props.autoFocus&&o(this.getDOMNode())}};t.exports=a},{"./focusNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/focusNode.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/BeforeInputEventPlugin.js":[function(e,t,n){"use strict";function o(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function a(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function r(e){switch(e){case P.topCompositionStart:return O.compositionStart;case P.topCompositionEnd:return O.compositionEnd;case P.topCompositionUpdate:return O.compositionUpdate}}function s(e,t){return e===P.topKeyDown&&t.keyCode===w}function l(e,t){switch(e){case P.topKeyUp:return-1!==_.indexOf(t.keyCode);case P.topKeyDown:return t.keyCode!==w;case P.topKeyPress:case P.topMouseDown:case P.topBlur:return!0;default:return!1}}function c(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function i(e,t,n,o){var a,i;if(E?a=r(e):D?l(e,o)&&(a=O.compositionEnd):s(e,o)&&(a=O.compositionStart),!a)return null;k&&(D||a!==O.compositionStart?a===O.compositionEnd&&D&&(i=D.getData()):D=f.getPooled(t));var u=v.getPooled(a,n,o);if(i)u.data=i;else{var p=c(o);null!==p&&(u.data=p)}return b.accumulateTwoPhaseDispatches(u),u}function u(e,t){switch(e){case P.topCompositionEnd:return c(t);case P.topKeyPress:var n=t.which;return n!==j?null:(x=!0,M);case P.topTextInput:var o=t.data;return o===M&&x?null:o;default:return null}}function p(e,t){if(D){if(e===P.topCompositionEnd||l(e,t)){var n=D.getData();return f.release(D),D=null,n}return null}switch(e){case P.topPaste:return null;case P.topKeyPress:return t.which&&!a(t)?String.fromCharCode(t.which):null;case P.topCompositionEnd:return k?null:t.data;default:return null}}function d(e,t,n,o){var a;if(a=R?u(e,o):p(e,o),!a)return null;var r=g.getPooled(O.beforeInput,n,o);return r.data=a,b.accumulateTwoPhaseDispatches(r),r}var m=e("./EventConstants"),b=e("./EventPropagators"),h=e("./ExecutionEnvironment"),f=e("./FallbackCompositionState"),v=e("./SyntheticCompositionEvent"),g=e("./SyntheticInputEvent"),y=e("./keyOf"),_=[9,13,27,32],w=229,E=h.canUseDOM&&"CompositionEvent"in window,C=null;h.canUseDOM&&"documentMode"in document&&(C=document.documentMode);var R=h.canUseDOM&&"TextEvent"in window&&!C&&!o(),k=h.canUseDOM&&(!E||C&&C>8&&11>=C),j=32,M=String.fromCharCode(j),P=m.topLevelTypes,O={beforeInput:{phasedRegistrationNames:{bubbled:y({onBeforeInput:null}),captured:y({onBeforeInputCapture:null})},dependencies:[P.topCompositionEnd,P.topKeyPress,P.topTextInput,P.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:y({onCompositionEnd:null}),captured:y({onCompositionEndCapture:null})},dependencies:[P.topBlur,P.topCompositionEnd,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:y({onCompositionStart:null}),captured:y({onCompositionStartCapture:null})},dependencies:[P.topBlur,P.topCompositionStart,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:y({onCompositionUpdate:null}),captured:y({onCompositionUpdateCapture:null})},dependencies:[P.topBlur,P.topCompositionUpdate,P.topKeyDown,P.topKeyPress,P.topKeyUp,P.topMouseDown]}},x=!1,D=null,T={eventTypes:O,extractEvents:function(e,t,n,o){return[i(e,t,n,o),d(e,t,n,o)]}};t.exports=T},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./FallbackCompositionState":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/FallbackCompositionState.js","./SyntheticCompositionEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticCompositionEvent.js","./SyntheticInputEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticInputEvent.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CSSProperty.js":[function(e,t,n){"use strict";function o(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var a={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},r=["Webkit","ms","Moz","O"];Object.keys(a).forEach(function(e){r.forEach(function(t){a[o(t,e)]=a[e]})});var s={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!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}},l={isUnitlessNumber:a,shorthandPropertyExpansions:s};t.exports=l},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js":[function(e,t,n){"use strict";var o=e("./CSSProperty"),a=e("./ExecutionEnvironment"),r=(e("./camelizeStyleName"),e("./dangerousStyleValue")),s=e("./hyphenateStyleName"),l=e("./memoizeStringOnly"),c=(e("./warning"),l(function(e){return s(e)})),i="cssFloat";a.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(i="styleFloat");var u={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];null!=o&&(t+=c(n)+":",t+=r(n,o)+";")}return t||null},setValueForStyles:function(e,t){var n=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=r(a,t[a]);if("float"===a&&(a=i),s)n[a]=s;else{var l=o.shorthandPropertyExpansions[a];if(l)for(var c in l)n[c]="";else n[a]=""}}}};t.exports=u},{"./CSSProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CSSProperty.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./camelizeStyleName":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/camelizeStyleName.js","./dangerousStyleValue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/dangerousStyleValue.js","./hyphenateStyleName":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/hyphenateStyleName.js","./memoizeStringOnly":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/memoizeStringOnly.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js":[function(e,t,n){"use strict";function o(){this._callbacks=null,this._contexts=null}var a=e("./PooledClass"),r=e("./Object.assign"),s=e("./invariant");r(o.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){s(e.length===t.length),this._callbacks=null,this._contexts=null;for(var n=0,o=e.length;o>n;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),a.addPoolingTo(o),t.exports=o},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ChangeEventPlugin.js":[function(e,t,n){"use strict";function o(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function a(e){var t=C.getPooled(P.change,x,e);_.accumulateTwoPhaseDispatches(t),E.batchedUpdates(r,t)}function r(e){y.enqueueEvents(e),y.processEventQueue()}function s(e,t){O=e,x=t,O.attachEvent("onchange",a)}function l(){O&&(O.detachEvent("onchange",a),O=null,x=null)}function c(e,t,n){return e===M.topChange?n:void 0}function i(e,t,n){e===M.topFocus?(l(),s(t,n)):e===M.topBlur&&l()}function u(e,t){O=e,x=t,D=e.value,T=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(O,"value",N),O.attachEvent("onpropertychange",d)}function p(){O&&(delete O.value,O.detachEvent("onpropertychange",d),O=null,x=null,D=null,T=null)}function d(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==D&&(D=t,a(e))}}function m(e,t,n){return e===M.topInput?n:void 0}function b(e,t,n){e===M.topFocus?(p(),u(t,n)):e===M.topBlur&&p()}function h(e,t,n){return e!==M.topSelectionChange&&e!==M.topKeyUp&&e!==M.topKeyDown||!O||O.value===D?void 0:(D=O.value,x)}function f(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===M.topClick?n:void 0}var g=e("./EventConstants"),y=e("./EventPluginHub"),_=e("./EventPropagators"),w=e("./ExecutionEnvironment"),E=e("./ReactUpdates"),C=e("./SyntheticEvent"),R=e("./isEventSupported"),k=e("./isTextInputElement"),j=e("./keyOf"),M=g.topLevelTypes,P={change:{phasedRegistrationNames:{bubbled:j({onChange:null}),captured:j({onChangeCapture:null})},dependencies:[M.topBlur,M.topChange,M.topClick,M.topFocus,M.topInput,M.topKeyDown,M.topKeyUp,M.topSelectionChange]}},O=null,x=null,D=null,T=null,I=!1;w.canUseDOM&&(I=R("change")&&(!("documentMode"in document)||document.documentMode>8));var S=!1;w.canUseDOM&&(S=R("input")&&(!("documentMode"in document)||document.documentMode>9));var N={get:function(){return T.get.call(this)},set:function(e){D=""+e,T.set.call(this,e)}},A={eventTypes:P,extractEvents:function(e,t,n,a){var r,s;if(o(t)?I?r=c:s=i:k(t)?S?r=m:(r=h,s=b):f(t)&&(r=v),r){var l=r(e,t,n);if(l){var u=C.getPooled(P.change,l,a);return _.accumulateTwoPhaseDispatches(u),u}}s&&s(e,t,n)}};t.exports=A},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./EventPropagators":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./isEventSupported":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isEventSupported.js","./isTextInputElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ClientReactRootIndex.js":[function(e,t,n){"use strict";var o=0,a={createReactRootIndex:function(){return o++}};t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js":[function(e,t,n){"use strict";function o(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var a=e("./Danger"),r=e("./ReactMultiChildUpdateTypes"),s=e("./setTextContent"),l=e("./invariant"),c={dangerouslyReplaceNodeWithMarkup:a.dangerouslyReplaceNodeWithMarkup,updateTextContent:s,processUpdates:function(e,t){for(var n,c=null,i=null,u=0;u<e.length;u++)if(n=e[u],n.type===r.MOVE_EXISTING||n.type===r.REMOVE_NODE){var p=n.fromIndex,d=n.parentNode.childNodes[p],m=n.parentID;l(d),c=c||{},c[m]=c[m]||[],c[m][p]=d,i=i||[],i.push(d)}var b=a.dangerouslyRenderMarkup(t);if(i)for(var h=0;h<i.length;h++)i[h].parentNode.removeChild(i[h]);for(var f=0;f<e.length;f++)switch(n=e[f],n.type){case r.INSERT_MARKUP:o(n.parentNode,b[n.markupIndex],n.toIndex);break;case r.MOVE_EXISTING:o(n.parentNode,c[n.parentID][n.fromIndex],n.toIndex);break;case r.TEXT_CONTENT:s(n.parentNode,n.textContent);break;case r.REMOVE_NODE:}}};t.exports=c},{"./Danger":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Danger.js","./ReactMultiChildUpdateTypes":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./setTextContent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/setTextContent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js":[function(e,t,n){"use strict";function o(e,t){return(e&t)===t}var a=e("./invariant"),r={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=e.Properties||{},n=e.DOMAttributeNames||{},s=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&l._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var i in t){a(!l.isStandardName.hasOwnProperty(i)),l.isStandardName[i]=!0;var u=i.toLowerCase();if(l.getPossibleStandardName[u]=i,n.hasOwnProperty(i)){var p=n[i];l.getPossibleStandardName[p]=i,l.getAttributeName[i]=p}else l.getAttributeName[i]=u;l.getPropertyName[i]=s.hasOwnProperty(i)?s[i]:i,c.hasOwnProperty(i)?l.getMutationMethod[i]=c[i]:l.getMutationMethod[i]=null;var d=t[i];l.mustUseAttribute[i]=o(d,r.MUST_USE_ATTRIBUTE),l.mustUseProperty[i]=o(d,r.MUST_USE_PROPERTY),l.hasSideEffects[i]=o(d,r.HAS_SIDE_EFFECTS),l.hasBooleanValue[i]=o(d,r.HAS_BOOLEAN_VALUE),l.hasNumericValue[i]=o(d,r.HAS_NUMERIC_VALUE),l.hasPositiveNumericValue[i]=o(d,r.HAS_POSITIVE_NUMERIC_VALUE),l.hasOverloadedBooleanValue[i]=o(d,r.HAS_OVERLOADED_BOOLEAN_VALUE),a(!l.mustUseAttribute[i]||!l.mustUseProperty[i]),a(l.mustUseProperty[i]||!l.hasSideEffects[i]),a(!!l.hasBooleanValue[i]+!!l.hasNumericValue[i]+!!l.hasOverloadedBooleanValue[i]<=1)}}},s={},l={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<l._isCustomAttributeFunctions.length;t++){var n=l._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,o=s[e];return o||(s[e]=o={}),t in o||(n=document.createElement(e),o[t]=n[t]),o[t]},injection:r};t.exports=l},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js":[function(e,t,n){"use strict";function o(e,t){return null==t||a.hasBooleanValue[e]&&!t||a.hasNumericValue[e]&&isNaN(t)||a.hasPositiveNumericValue[e]&&1>t||a.hasOverloadedBooleanValue[e]&&t===!1}var a=e("./DOMProperty"),r=e("./quoteAttributeValueForBrowser"),s=(e("./warning"),{createMarkupForID:function(e){return a.ID_ATTRIBUTE_NAME+"="+r(e)},createMarkupForProperty:function(e,t){if(a.isStandardName.hasOwnProperty(e)&&a.isStandardName[e]){if(o(e,t))return"";var n=a.getAttributeName[e];return a.hasBooleanValue[e]||a.hasOverloadedBooleanValue[e]&&t===!0?n:n+"="+r(t)}return a.isCustomAttribute(e)?null==t?"":e+"="+r(t):null},setValueForProperty:function(e,t,n){if(a.isStandardName.hasOwnProperty(t)&&a.isStandardName[t]){var r=a.getMutationMethod[t];if(r)r(e,n);else if(o(t,n))this.deleteValueForProperty(e,t);else if(a.mustUseAttribute[t])e.setAttribute(a.getAttributeName[t],""+n);else{var s=a.getPropertyName[t];a.hasSideEffects[t]&&""+e[s]==""+n||(e[s]=n)}}else a.isCustomAttribute(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){if(a.isStandardName.hasOwnProperty(t)&&a.isStandardName[t]){var n=a.getMutationMethod[t];if(n)n(e,void 0);else if(a.mustUseAttribute[t])e.removeAttribute(a.getAttributeName[t]);else{var o=a.getPropertyName[t],r=a.getDefaultValueForProperty(e.nodeName,o);a.hasSideEffects[t]&&""+e[o]===r||(e[o]=r)}}else a.isCustomAttribute(t)&&e.removeAttribute(t)}});t.exports=s},{"./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./quoteAttributeValueForBrowser":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/quoteAttributeValueForBrowser.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Danger.js":[function(e,t,n){"use strict";function o(e){return e.substring(1,e.indexOf(" "))}var a=e("./ExecutionEnvironment"),r=e("./createNodesFromMarkup"),s=e("./emptyFunction"),l=e("./getMarkupWrap"),c=e("./invariant"),i=/^(<[^ \/>]+)/,u="data-danger-index",p={dangerouslyRenderMarkup:function(e){c(a.canUseDOM);for(var t,n={},p=0;p<e.length;p++)c(e[p]),t=o(e[p]),t=l(t)?t:"*",n[t]=n[t]||[],n[t][p]=e[p];var d=[],m=0;for(t in n)if(n.hasOwnProperty(t)){var b,h=n[t];for(b in h)if(h.hasOwnProperty(b)){var f=h[b];h[b]=f.replace(i,"$1 "+u+'="'+b+'" ')}for(var v=r(h.join(""),s),g=0;g<v.length;++g){var y=v[g];y.hasAttribute&&y.hasAttribute(u)&&(b=+y.getAttribute(u),y.removeAttribute(u),c(!d.hasOwnProperty(b)),d[b]=y,m+=1)}}return c(m===d.length),c(d.length===e.length),d},dangerouslyReplaceNodeWithMarkup:function(e,t){c(a.canUseDOM),c(t),c("html"!==e.tagName.toLowerCase());var n=r(t,s)[0];e.parentNode.replaceChild(n,e)}};t.exports=p},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./createNodesFromMarkup":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/createNodesFromMarkup.js","./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js","./getMarkupWrap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getMarkupWrap.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DefaultEventPluginOrder.js":[function(e,t,n){"use strict";var o=e("./keyOf"),a=[o({ResponderEventPlugin:null}),o({SimpleEventPlugin:null}),o({TapEventPlugin:null}),o({EnterLeaveEventPlugin:null}),o({ChangeEventPlugin:null}),o({SelectEventPlugin:null}),o({BeforeInputEventPlugin:null}),o({AnalyticsEventPlugin:null}),o({MobileSafariClickEventPlugin:null})];t.exports=a},{"./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EnterLeaveEventPlugin.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),a=e("./EventPropagators"),r=e("./SyntheticMouseEvent"),s=e("./ReactMount"),l=e("./keyOf"),c=o.topLevelTypes,i=s.getFirstReactDOM,u={mouseEnter:{registrationName:l({onMouseEnter:null}),dependencies:[c.topMouseOut,c.topMouseOver]},mouseLeave:{registrationName:l({onMouseLeave:null}),dependencies:[c.topMouseOut,c.topMouseOver]}},p=[null,null],d={eventTypes:u,extractEvents:function(e,t,n,o){if(e===c.topMouseOver&&(o.relatedTarget||o.fromElement))return null;if(e!==c.topMouseOut&&e!==c.topMouseOver)return null;var l;if(t.window===t)l=t;else{var d=t.ownerDocument;l=d?d.defaultView||d.parentWindow:window}var m,b;if(e===c.topMouseOut?(m=t,b=i(o.relatedTarget||o.toElement)||l):(m=l,b=t),m===b)return null;var h=m?s.getID(m):"",f=b?s.getID(b):"",v=r.getPooled(u.mouseLeave,h,o);v.type="mouseleave",v.target=m,v.relatedTarget=b;var g=r.getPooled(u.mouseEnter,f,o);return g.type="mouseenter",g.target=b,g.relatedTarget=m,a.accumulateEnterLeaveDispatches(v,g,h,f),p[0]=v,p[1]=g,p}};t.exports=d},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./SyntheticMouseEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js":[function(e,t,n){"use strict";var o=e("./keyMirror"),a=o({bubbled:null,captured:null}),r=o({topBlur: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,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),s={topLevelTypes:r,PropagationPhases:a};t.exports=s},{"./keyMirror":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventListener.js":[function(e,t,n){var o=e("./emptyFunction"),a={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:o}},registerDefault:function(){}};t.exports=a},{"./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js":[function(e,t,n){"use strict";var o=e("./EventPluginRegistry"),a=e("./EventPluginUtils"),r=e("./accumulateInto"),s=e("./forEachAccumulated"),l=e("./invariant"),c={},i=null,u=function(e){if(e){var t=a.executeDispatch,n=o.getPluginModuleForEvent(e);n&&n.executeDispatch&&(t=n.executeDispatch),a.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},p=null,d={injection:{injectMount:a.injection.injectMount,injectInstanceHandle:function(e){p=e},getInstanceHandle:function(){return p},injectEventPluginOrder:o.injectEventPluginOrder,injectEventPluginsByName:o.injectEventPluginsByName},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:function(e,t,n){l(!n||"function"==typeof n);var o=c[t]||(c[t]={});o[e]=n},getListener:function(e,t){var n=c[t];return n&&n[e]},deleteListener:function(e,t){var n=c[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in c)delete c[t][e]},extractEvents:function(e,t,n,a){for(var s,l=o.plugins,c=0,i=l.length;i>c;c++){var u=l[c];if(u){var p=u.extractEvents(e,t,n,a);p&&(s=r(s,p))}}return s},enqueueEvents:function(e){e&&(i=r(i,e))},processEventQueue:function(){var e=i;i=null,s(e,u),l(!i)},__purge:function(){c={}},__getListenerBank:function(){return c}};t.exports=d},{"./EventPluginRegistry":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js","./EventPluginUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./accumulateInto":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js":[function(e,t,n){"use strict";function o(){if(l)for(var e in c){var t=c[e],n=l.indexOf(e);if(s(n>-1),!i.plugins[n]){s(t.extractEvents),i.plugins[n]=t;var o=t.eventTypes;for(var r in o)s(a(o[r],t,r))}}}function a(e,t,n){s(!i.eventNameDispatchConfigs.hasOwnProperty(n)),i.eventNameDispatchConfigs[n]=e;var o=e.phasedRegistrationNames;if(o){for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];r(l,t,n)}return!0}return e.registrationName?(r(e.registrationName,t,n),!0):!1}function r(e,t,n){s(!i.registrationNameModules[e]),i.registrationNameModules[e]=t,i.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var s=e("./invariant"),l=null,c={},i={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s(!l),l=Array.prototype.slice.call(e),o()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];c.hasOwnProperty(n)&&c[n]===a||(s(!c[n]),c[n]=a,t=!0)}t&&o()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return i.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var o=i.registrationNameModules[t.phasedRegistrationNames[n]];if(o)return o}return null},_resetEventPlugins:function(){l=null;for(var e in c)c.hasOwnProperty(e)&&delete c[e];i.plugins.length=0;var t=i.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var o=i.registrationNameModules;for(var a in o)o.hasOwnProperty(a)&&delete o[a]}};t.exports=i},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js":[function(e,t,n){"use strict";function o(e){return e===f.topMouseUp||e===f.topTouchEnd||e===f.topTouchCancel}function a(e){return e===f.topMouseMove||e===f.topTouchMove}function r(e){return e===f.topMouseDown||e===f.topTouchStart}function s(e,t){var n=e._dispatchListeners,o=e._dispatchIDs;if(Array.isArray(n))for(var a=0;a<n.length&&!e.isPropagationStopped();a++)t(e,n[a],o[a]);else n&&t(e,n,o)}function l(e,t,n){e.currentTarget=h.Mount.getNode(n);var o=t(e,n);return e.currentTarget=null,o}function c(e,t){s(e,t),e._dispatchListeners=null,e._dispatchIDs=null}function i(e){var t=e._dispatchListeners,n=e._dispatchIDs;if(Array.isArray(t)){for(var o=0;o<t.length&&!e.isPropagationStopped();o++)if(t[o](e,n[o]))return n[o]}else if(t&&t(e,n))return n;return null}function u(e){var t=i(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function p(e){var t=e._dispatchListeners,n=e._dispatchIDs;b(!Array.isArray(t));var o=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,o}function d(e){return!!e._dispatchListeners}var m=e("./EventConstants"),b=e("./invariant"),h={Mount:null,injectMount:function(e){h.Mount=e}},f=m.topLevelTypes,v={isEndish:o,isMoveish:a,isStartish:r,executeDirectDispatch:p,executeDispatch:l,executeDispatchesInOrder:c,executeDispatchesInOrderStopAtTrue:u,hasDispatches:d,injection:h,useTouchEvents:!1};t.exports=v},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPropagators.js":[function(e,t,n){"use strict";function o(e,t,n){var o=t.dispatchConfig.phasedRegistrationNames[n];return f(e,o)}function a(e,t,n){var a=t?h.bubbled:h.captured,r=o(e,n,a);r&&(n._dispatchListeners=m(n._dispatchListeners,r),n._dispatchIDs=m(n._dispatchIDs,e))}function r(e){e&&e.dispatchConfig.phasedRegistrationNames&&d.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,a,e)}function s(e,t,n){if(n&&n.dispatchConfig.registrationName){var o=n.dispatchConfig.registrationName,a=f(e,o);a&&(n._dispatchListeners=m(n._dispatchListeners,a),n._dispatchIDs=m(n._dispatchIDs,e))}}function l(e){e&&e.dispatchConfig.registrationName&&s(e.dispatchMarker,null,e)}function c(e){b(e,r)}function i(e,t,n,o){d.injection.getInstanceHandle().traverseEnterLeave(n,o,s,e,t)}function u(e){b(e,l)}var p=e("./EventConstants"),d=e("./EventPluginHub"),m=e("./accumulateInto"),b=e("./forEachAccumulated"),h=p.PropagationPhases,f=d.getListener,v={accumulateTwoPhaseDispatches:c,accumulateDirectDispatches:u,accumulateEnterLeaveDispatches:i};t.exports=v},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./accumulateInto":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js":[function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),a={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/FallbackCompositionState.js":[function(e,t,n){"use strict";function o(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var a=e("./PooledClass"),r=e("./Object.assign"),s=e("./getTextContentAccessor");r(o.prototype,{getText:function(){return"value"in this._root?this._root.value:this._root[s()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,o=n.length,a=this.getText(),r=a.length;for(e=0;o>e&&n[e]===a[e];e++);var s=o-e;for(t=1;s>=t&&n[o-t]===a[r-t];t++);var l=t>1?1-t:void 0;return this._fallbackText=a.slice(e,l),this._fallbackText}}),a.addPoolingTo(o),t.exports=o},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js",
"./getTextContentAccessor":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/HTMLDOMPropertyConfig.js":[function(e,t,n){"use strict";var o,a=e("./DOMProperty"),r=e("./ExecutionEnvironment"),s=a.injection.MUST_USE_ATTRIBUTE,l=a.injection.MUST_USE_PROPERTY,c=a.injection.HAS_BOOLEAN_VALUE,i=a.injection.HAS_SIDE_EFFECTS,u=a.injection.HAS_NUMERIC_VALUE,p=a.injection.HAS_POSITIVE_NUMERIC_VALUE,d=a.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(r.canUseDOM){var m=document.implementation;o=m&&m.hasFeature&&m.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var b={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:s|c,allowTransparency:s,alt:null,async:c,autoComplete:null,autoPlay:c,cellPadding:null,cellSpacing:null,charSet:s,checked:l|c,classID:s,className:o?s:l,cols:s|p,colSpan:null,content:null,contentEditable:null,contextMenu:s,controls:l|c,coords:null,crossOrigin:null,data:null,dateTime:s,defer:c,dir:null,disabled:s|c,download:d,draggable:null,encType:null,form:s,formAction:s,formEncType:s,formMethod:s,formNoValidate:c,formTarget:s,frameBorder:s,headers:null,height:s,hidden:s|c,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:l,label:null,lang:null,list:s,loop:l|c,manifest:s,marginHeight:null,marginWidth:null,max:null,maxLength:s,media:s,mediaGroup:null,method:null,min:null,multiple:l|c,muted:l|c,name:null,noValidate:c,open:c,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:l|c,rel:null,required:c,role:s,rows:s|p,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:s|c,selected:l|c,shape:null,size:s|p,sizes:s,span:p,spellCheck:null,src:null,srcDoc:l,srcSet:s,start:u,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:l|i,width:s,wmode:s,autoCapitalize:null,autoCorrect:null,itemProp:s,itemScope:s|c,itemType:s,itemID:s,itemRef:s,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=b},{"./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js":[function(e,t,n){"use strict";function o(e){i(null==e.props.checkedLink||null==e.props.valueLink)}function a(e){o(e),i(null==e.props.value&&null==e.props.onChange)}function r(e){o(e),i(null==e.props.checked&&null==e.props.onChange)}function s(e){this.props.valueLink.requestChange(e.target.value)}function l(e){this.props.checkedLink.requestChange(e.target.checked)}var c=e("./ReactPropTypes"),i=e("./invariant"),u={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},p={Mixin:{propTypes:{value:function(e,t,n){return!e[t]||u[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:c.func}},getValue:function(e){return e.props.valueLink?(a(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(r(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(a(e),s):e.props.checkedLink?(r(e),l):e.props.onChange}};t.exports=p},{"./ReactPropTypes":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js":[function(e,t,n){"use strict";function o(e){e.remove()}var a=e("./ReactBrowserEventEmitter"),r=e("./accumulateInto"),s=e("./forEachAccumulated"),l=e("./invariant"),c={trapBubbledEvent:function(e,t){l(this.isMounted());var n=this.getDOMNode();l(n);var o=a.trapBubbledEvent(e,t,n);this._localEventListeners=r(this._localEventListeners,o)},componentWillUnmount:function(){this._localEventListeners&&s(this._localEventListeners,o)}};t.exports=c},{"./ReactBrowserEventEmitter":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./accumulateInto":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/accumulateInto.js","./forEachAccumulated":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/MobileSafariClickEventPlugin.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),a=e("./emptyFunction"),r=o.topLevelTypes,s={eventTypes:null,extractEvents:function(e,t,n,o){if(e===r.topTouchStart){var s=o.target;s&&!s.onclick&&(s.onclick=a)}}};t.exports=s},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js":[function(e,t,n){"use strict";function o(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),o=Object.prototype.hasOwnProperty,a=1;a<arguments.length;a++){var r=arguments[a];if(null!=r){var s=Object(r);for(var l in s)o.call(s,l)&&(n[l]=s[l])}}return n}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js":[function(e,t,n){"use strict";var o=e("./invariant"),a=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},r=function(e,t){var n=this;if(n.instancePool.length){var o=n.instancePool.pop();return n.call(o,e,t),o}return new n(e,t)},s=function(e,t,n){var o=this;if(o.instancePool.length){var a=o.instancePool.pop();return o.call(a,e,t,n),a}return new o(e,t,n)},l=function(e,t,n,o,a){var r=this;if(r.instancePool.length){var s=r.instancePool.pop();return r.call(s,e,t,n,o,a),s}return new r(e,t,n,o,a)},c=function(e){var t=this;o(e instanceof t),e.destructor&&e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},i=10,u=a,p=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||u,n.poolSize||(n.poolSize=i),n.release=c,n},d={addPoolingTo:p,oneArgumentPooler:a,twoArgumentPooler:r,threeArgumentPooler:s,fiveArgumentPooler:l};t.exports=d},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/React.js":[function(e,t,n){"use strict";var o=e("./EventPluginUtils"),a=e("./ReactChildren"),r=e("./ReactComponent"),s=e("./ReactClass"),l=e("./ReactContext"),c=e("./ReactCurrentOwner"),i=e("./ReactElement"),u=(e("./ReactElementValidator"),e("./ReactDOM")),p=e("./ReactDOMTextComponent"),d=e("./ReactDefaultInjection"),m=e("./ReactInstanceHandles"),b=e("./ReactMount"),h=e("./ReactPerf"),f=e("./ReactPropTypes"),v=e("./ReactReconciler"),g=e("./ReactServerRendering"),y=e("./Object.assign"),_=e("./findDOMNode"),w=e("./onlyChild");d.inject();var E=i.createElement,C=i.createFactory,R=i.cloneElement,k=h.measure("React","render",b.render),j={Children:{map:a.map,forEach:a.forEach,count:a.count,only:w},Component:r,DOM:u,PropTypes:f,initializeTouchEvents:function(e){o.useTouchEvents=e},createClass:s.createClass,createElement:E,cloneElement:R,createFactory:C,createMixin:function(e){return e},constructAndRenderComponent:b.constructAndRenderComponent,constructAndRenderComponentByID:b.constructAndRenderComponentByID,findDOMNode:_,render:k,renderToString:g.renderToString,renderToStaticMarkup:g.renderToStaticMarkup,unmountComponentAtNode:b.unmountComponentAtNode,isValidElement:i.isValidElement,withContext:l.withContext,__spread:y};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:c,InstanceHandles:m,Mount:b,Reconciler:v,TextComponent:p});j.version="0.13.1",t.exports=j},{"./EventPluginUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactChildren":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactChildren.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponent.js","./ReactContext":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactDOM":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOM.js","./ReactDOMTextComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDefaultInjection":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactInstanceHandles":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactPropTypes":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js","./ReactReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactServerRendering":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactServerRendering.js","./findDOMNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/findDOMNode.js","./onlyChild":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/onlyChild.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js":[function(e,t,n){"use strict";var o=e("./findDOMNode"),a={getDOMNode:function(){return o(this)}};t.exports=a},{"./findDOMNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/findDOMNode.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js":[function(e,t,n){"use strict";function o(e){return Object.prototype.hasOwnProperty.call(e,h)||(e[h]=m++,p[e[h]]={}),p[e[h]]}var a=e("./EventConstants"),r=e("./EventPluginHub"),s=e("./EventPluginRegistry"),l=e("./ReactEventEmitterMixin"),c=e("./ViewportMetrics"),i=e("./Object.assign"),u=e("./isEventSupported"),p={},d=!1,m=0,b={topBlur:"blur",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",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topWheel:"wheel"},h="_reactListenersID"+String(Math.random()).slice(2),f=i({},l,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(f.handleTopLevel),f.ReactEventListener=e}},setEnabled:function(e){f.ReactEventListener&&f.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!f.ReactEventListener||!f.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,r=o(n),l=s.registrationNameDependencies[e],c=a.topLevelTypes,i=0,p=l.length;p>i;i++){var d=l[i];r.hasOwnProperty(d)&&r[d]||(d===c.topWheel?u("wheel")?f.ReactEventListener.trapBubbledEvent(c.topWheel,"wheel",n):u("mousewheel")?f.ReactEventListener.trapBubbledEvent(c.topWheel,"mousewheel",n):f.ReactEventListener.trapBubbledEvent(c.topWheel,"DOMMouseScroll",n):d===c.topScroll?u("scroll",!0)?f.ReactEventListener.trapCapturedEvent(c.topScroll,"scroll",n):f.ReactEventListener.trapBubbledEvent(c.topScroll,"scroll",f.ReactEventListener.WINDOW_HANDLE):d===c.topFocus||d===c.topBlur?(u("focus",!0)?(f.ReactEventListener.trapCapturedEvent(c.topFocus,"focus",n),f.ReactEventListener.trapCapturedEvent(c.topBlur,"blur",n)):u("focusin")&&(f.ReactEventListener.trapBubbledEvent(c.topFocus,"focusin",n),f.ReactEventListener.trapBubbledEvent(c.topBlur,"focusout",n)),r[c.topBlur]=!0,r[c.topFocus]=!0):b.hasOwnProperty(d)&&f.ReactEventListener.trapBubbledEvent(d,b[d],n),r[d]=!0)}},trapBubbledEvent:function(e,t,n){return f.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return f.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!d){var e=c.refreshScrollValues;f.ReactEventListener.monitorScrollValue(e),d=!0}},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:r.putListener,getListener:r.getListener,deleteListener:r.deleteListener,deleteAllListeners:r.deleteAllListeners});t.exports=f},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginHub":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./EventPluginRegistry":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginRegistry.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactEventEmitterMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEventEmitterMixin.js","./ViewportMetrics":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js","./isEventSupported":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isEventSupported.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactChildReconciler.js":[function(e,t,n){"use strict";var o=e("./ReactReconciler"),a=e("./flattenChildren"),r=e("./instantiateReactComponent"),s=e("./shouldUpdateReactComponent"),l={instantiateChildren:function(e,t,n){var o=a(e);for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],c=r(l,null);o[s]=c}return o},updateChildren:function(e,t,n,l){var c=a(t);if(!c&&!e)return null;var i;for(i in c)if(c.hasOwnProperty(i)){var u=e&&e[i],p=u&&u._currentElement,d=c[i];if(s(p,d))o.receiveComponent(u,d,n,l),c[i]=u;else{u&&o.unmountComponent(u,i);var m=r(d,null);c[i]=m}}for(i in e)!e.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||o.unmountComponent(e[i]);return c},unmountChildren:function(e){for(var t in e){var n=e[t];o.unmountComponent(n)}}};t.exports=l},{"./ReactReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./flattenChildren":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/flattenChildren.js","./instantiateReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./shouldUpdateReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactChildren.js":[function(e,t,n){"use strict";function o(e,t){this.forEachFunction=e,this.forEachContext=t}function a(e,t,n,o){var a=e;a.forEachFunction.call(a.forEachContext,t,o)}function r(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);m(e,a,r),o.release(r)}function s(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function l(e,t,n,o){var a=e,r=a.mapResult,s=!r.hasOwnProperty(n);if(s){var l=a.mapFunction.call(a.mapContext,t,o);r[n]=l}}function c(e,t,n){if(null==e)return e;var o={},a=s.getPooled(o,t,n);return m(e,l,a),s.release(a),d.create(o)}function i(e,t,n,o){return null}function u(e,t){return m(e,i,null)}var p=e("./PooledClass"),d=e("./ReactFragment"),m=e("./traverseAllChildren"),b=(e("./warning"),p.twoArgumentPooler),h=p.threeArgumentPooler;p.addPoolingTo(o,b),p.addPoolingTo(s,h);var f={forEach:r,map:c,count:u};t.exports=f},{"./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactFragment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./traverseAllChildren":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js":[function(e,t,n){"use strict";function o(e,t){var n=R.hasOwnProperty(t)?R[t]:null;j.hasOwnProperty(t)&&g(n===E.OVERRIDE_BASE),e.hasOwnProperty(t)&&g(n===E.DEFINE_MANY||n===E.DEFINE_MANY_MERGED)}function a(e,t){if(t){g("function"!=typeof t),g(!d.isValidElement(t));var n=e.prototype;t.hasOwnProperty(w)&&k.mixins(e,t.mixins);for(var a in t)if(t.hasOwnProperty(a)&&a!==w){var r=t[a];if(o(n,a),k.hasOwnProperty(a))k[a](e,r);else{var s=R.hasOwnProperty(a),i=n.hasOwnProperty(a),u=r&&r.__reactDontBind,p="function"==typeof r,m=p&&!s&&!i&&!u;if(m)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[a]=r,n[a]=r;else if(i){var b=R[a];g(s&&(b===E.DEFINE_MANY_MERGED||b===E.DEFINE_MANY)),b===E.DEFINE_MANY_MERGED?n[a]=l(n[a],r):b===E.DEFINE_MANY&&(n[a]=c(n[a],r))}else n[a]=r}}}}function r(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var a=n in k;g(!a);var r=n in e;g(!r),e[n]=o}}}function s(e,t){g(e&&t&&"object"==typeof e&&"object"==typeof t);for(var n in t)t.hasOwnProperty(n)&&(g(void 0===e[n]),e[n]=t[n]);return e}function l(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var a={};return s(a,n),s(a,o),a}}function c(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function i(e,t){var n=t.bind(e);return n}function u(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=i(e,m.guard(n,e.constructor.displayName+"."+t))}}var p=e("./ReactComponent"),d=(e("./ReactCurrentOwner"),e("./ReactElement")),m=e("./ReactErrorUtils"),b=e("./ReactInstanceMap"),h=e("./ReactLifeCycle"),f=(e("./ReactPropTypeLocations"),e("./ReactPropTypeLocationNames"),e("./ReactUpdateQueue")),v=e("./Object.assign"),g=e("./invariant"),y=e("./keyMirror"),_=e("./keyOf"),w=(e("./warning"),_({mixins:null})),E=y({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),C=[],R={mixins:E.DEFINE_MANY,statics:E.DEFINE_MANY,propTypes:E.DEFINE_MANY,contextTypes:E.DEFINE_MANY,childContextTypes:E.DEFINE_MANY,getDefaultProps:E.DEFINE_MANY_MERGED,getInitialState:E.DEFINE_MANY_MERGED,getChildContext:E.DEFINE_MANY_MERGED,render:E.DEFINE_ONCE,componentWillMount:E.DEFINE_MANY,componentDidMount:E.DEFINE_MANY,componentWillReceiveProps:E.DEFINE_MANY,shouldComponentUpdate:E.DEFINE_ONCE,componentWillUpdate:E.DEFINE_MANY,componentDidUpdate:E.DEFINE_MANY,componentWillUnmount:E.DEFINE_MANY,updateComponent:E.OVERRIDE_BASE},k={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)a(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=v({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=v({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=l(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=v({},e.propTypes,t)},statics:function(e,t){r(e,t)}},j={replaceState:function(e,t){f.enqueueReplaceState(this,e),t&&f.enqueueCallback(this,t)},isMounted:function(){var e=b.get(this);return e&&e!==h.currentlyMountingInstance},setProps:function(e,t){f.enqueueSetProps(this,e),t&&f.enqueueCallback(this,t)},replaceProps:function(e,t){f.enqueueReplaceProps(this,e),t&&f.enqueueCallback(this,t)}},M=function(){};v(M.prototype,p.prototype,j);var P={createClass:function(e){var t=function(e,t){this.__reactAutoBindMap&&u(this),this.props=e,this.context=t,this.state=null;var n=this.getInitialState?this.getInitialState():null;g("object"==typeof n&&!Array.isArray(n)),this.state=n};t.prototype=new M,t.prototype.constructor=t,C.forEach(a.bind(null,t)),a(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),g(t.prototype.render);for(var n in R)t.prototype[n]||(t.prototype[n]=null);return t.type=t,t},injection:{injectMixin:function(e){C.push(e)}}};t.exports=P},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponent.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactErrorUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js","./ReactInstanceMap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactLifeCycle":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js","./ReactPropTypeLocationNames":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./ReactUpdateQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./keyMirror":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyMirror.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponent.js":[function(e,t,n){"use strict";function o(e,t){this.props=e,this.context=t}var a=e("./ReactUpdateQueue"),r=e("./invariant");e("./warning");o.prototype.setState=function(e,t){r("object"==typeof e||"function"==typeof e||null==e),a.enqueueSetState(this,e),t&&a.enqueueCallback(this,t)},o.prototype.forceUpdate=function(e){a.enqueueForceUpdate(this),e&&a.enqueueCallback(this,e)};t.exports=o},{"./ReactUpdateQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js":[function(e,t,n){"use strict";var o=e("./ReactDOMIDOperations"),a=e("./ReactMount"),r={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:o.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){a.purgeID(e)}};t.exports=r},{"./ReactDOMIDOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js":[function(e,t,n){"use strict";var o=e("./invariant"),a=!1,r={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o(!a),r.unmountIDFromEnvironment=e.unmountIDFromEnvironment,r.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,r.processChildrenUpdates=e.processChildrenUpdates,a=!0}}};t.exports=r},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCompositeComponent.js":[function(e,t,n){"use strict";function o(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}var a=e("./ReactComponentEnvironment"),r=e("./ReactContext"),s=e("./ReactCurrentOwner"),l=e("./ReactElement"),c=(e("./ReactElementValidator"),e("./ReactInstanceMap")),i=e("./ReactLifeCycle"),u=e("./ReactNativeComponent"),p=e("./ReactPerf"),d=e("./ReactPropTypeLocations"),m=(e("./ReactPropTypeLocationNames"),e("./ReactReconciler")),b=e("./ReactUpdates"),h=e("./Object.assign"),f=e("./emptyObject"),v=e("./invariant"),g=e("./shouldUpdateReactComponent"),y=(e("./warning"),1),_={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._isTopLevel=!1,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=y++,this._rootNodeID=e;var o=this._processProps(this._currentElement.props),a=this._processContext(this._currentElement._context),r=u.getComponentClassForElement(this._currentElement),s=new r(o,a);s.props=o,s.context=a,s.refs=f,this._instance=s,c.set(s,this);var l=s.state;void 0===l&&(s.state=l=null),v("object"==typeof l&&!Array.isArray(l)),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var p,d=i.currentlyMountingInstance;i.currentlyMountingInstance=this;try{s.componentWillMount&&(s.componentWillMount(),this._pendingStateQueue&&(s.state=this._processPendingState(s.props,s.context))),p=this._renderValidatedComponent()}finally{i.currentlyMountingInstance=d}this._renderedComponent=this._instantiateReactComponent(p,this._currentElement.type);var b=m.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return s.componentDidMount&&t.getReactMountReady().enqueue(s.componentDidMount,s),b},unmountComponent:function(){var e=this._instance;if(e.componentWillUnmount){var t=i.currentlyUnmountingInstance;i.currentlyUnmountingInstance=this;try{e.componentWillUnmount()}finally{i.currentlyUnmountingInstance=t}}m.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,c.remove(e)},_setPropsInternal:function(e,t){var n=this._pendingElement||this._currentElement;this._pendingElement=l.cloneAndReplaceProps(n,h({},n.props,e)),b.enqueueUpdate(this,t)},_maskContext:function(e){var t=null;if("string"==typeof this._currentElement.type)return f;var n=this._currentElement.type.contextTypes;if(!n)return f;t={};for(var o in n)t[o]=e[o];return t},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t=this._instance,n=t.getChildContext&&t.getChildContext();if(n){v("object"==typeof t.constructor.childContextTypes);for(var o in n)v(o in t.constructor.childContextTypes);return h({},e,n)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,n){var a=this.getName();for(var r in e)if(e.hasOwnProperty(r)){var s;try{v("function"==typeof e[r]),s=e[r](t,r,a,n)}catch(l){s=l}if(s instanceof Error){o(this);n===d.prop}}},receiveComponent:function(e,t,n){var o=this._currentElement,a=this._context;this._pendingElement=null,this.updateComponent(t,o,e,a,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&m.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)},_warnIfContextsDiffer:function(e,t){e=this._maskContext(e),t=this._maskContext(t);for(var n=Object.keys(t).sort(),o=(this.getName()||"ReactCompositeComponent",0);o<n.length;o++){n[o]}},updateComponent:function(e,t,n,o,a){var r=this._instance,s=r.context,l=r.props;t!==n&&(s=this._processContext(n._context),l=this._processProps(n.props),r.componentWillReceiveProps&&r.componentWillReceiveProps(l,s));var c=this._processPendingState(l,s),i=this._pendingForceUpdate||!r.shouldComponentUpdate||r.shouldComponentUpdate(l,c,s);i?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,c,s,e,a)):(this._currentElement=n,this._context=a,r.props=l,r.state=c,r.context=s)},_processPendingState:function(e,t){var n=this._instance,o=this._pendingStateQueue,a=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!o)return n.state;for(var r=h({},a?o[0]:n.state),s=a?1:0;s<o.length;s++){var l=o[s];h(r,"function"==typeof l?l.call(n,r,e,t):l)}return r},_performComponentUpdate:function(e,t,n,o,a,r){var s=this._instance,l=s.props,c=s.state,i=s.context;s.componentWillUpdate&&s.componentWillUpdate(t,n,o),this._currentElement=e,this._context=r,s.props=t,s.state=n,s.context=o,this._updateRenderedComponent(a,r),s.componentDidUpdate&&a.getReactMountReady().enqueue(s.componentDidUpdate.bind(s,l,c,i),s)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,o=n._currentElement,a=this._renderValidatedComponent();if(g(o,a))m.receiveComponent(n,a,e,this._processChildContext(t));else{var r=this._rootNodeID,s=n._rootNodeID;m.unmountComponent(n),this._renderedComponent=this._instantiateReactComponent(a,this._currentElement.type);var l=m.mountComponent(this._renderedComponent,r,e,t);this._replaceNodeWithMarkupByID(s,l)}},_replaceNodeWithMarkupByID:function(e,t){a.replaceNodeWithMarkupByID(e,t)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance,t=e.render();return t},_renderValidatedComponent:function(){var e,t=r.current;r.current=this._processChildContext(this._currentElement._context),s.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{r.current=t,s.current=null}return v(null===e||e===!1||l.isValidElement(e)),e},attachRef:function(e,t){var n=this.getPublicInstance(),o=n.refs===f?n.refs={}:n.refs;o[e]=t.getPublicInstance()},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(){return this._instance},_instantiateReactComponent:null};p.measureMethods(_,"ReactCompositeComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent",_renderValidatedComponent:"_renderValidatedComponent"});var w={Mixin:_};t.exports=w},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponentEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactContext":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactInstanceMap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactLifeCycle":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js","./ReactNativeComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactPropTypeLocationNames":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./ReactReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./emptyObject":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./shouldUpdateReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactContext.js":[function(e,t,n){"use strict";var o=e("./Object.assign"),a=e("./emptyObject"),r=(e("./warning"),{current:a,withContext:function(e,t){var n,a=r.current;r.current=o({},a,e);try{n=t()}finally{r.current=a}return n}});t.exports=r},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./emptyObject":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js":[function(e,t,n){"use strict";var o={current:null};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOM.js":[function(e,t,n){"use strict";function o(e){return a.createFactory(e)}var a=e("./ReactElement"),r=(e("./ReactElementValidator"),e("./mapObject")),s=r({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",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",defs:"defs",ellipse:"ellipse",g:"g",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"},o);t.exports=s},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./mapObject":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/mapObject.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMButton.js":[function(e,t,n){"use strict";var o=e("./AutoFocusMixin"),a=e("./ReactBrowserComponentMixin"),r=e("./ReactClass"),s=e("./ReactElement"),l=e("./keyMirror"),c=s.createFactory("button"),i=l({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),u=r.createClass({displayName:"ReactDOMButton",tagName:"BUTTON",mixins:[o,a],render:function(){var e={};for(var t in this.props)!this.props.hasOwnProperty(t)||this.props.disabled&&i[t]||(e[t]=this.props[t]);return c(e,this.props.children)}});t.exports=u},{"./AutoFocusMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./keyMirror":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js":[function(e,t,n){"use strict";function o(e){e&&(null!=e.dangerouslySetInnerHTML&&(v(null==e.children),v(null!=e.dangerouslySetInnerHTML.__html)),v(null==e.style||"object"==typeof e.style))}function a(e,t,n,o){var a=d.findReactContainerForID(e);if(a){var r=a.nodeType===R?a.ownerDocument:a;_(t,r)}o.getPutListenerQueue().enqueuePutListener(e,t,n)}function r(e){O.call(P,e)||(v(M.test(e)),P[e]=!0)}function s(e){r(e),this._tag=e,this._renderedChildren=null,this._previousStyleCopy=null,this._rootNodeID=null}var l=e("./CSSPropertyOperations"),c=e("./DOMProperty"),i=e("./DOMPropertyOperations"),u=e("./ReactBrowserEventEmitter"),p=e("./ReactComponentBrowserEnvironment"),d=e("./ReactMount"),m=e("./ReactMultiChild"),b=e("./ReactPerf"),h=e("./Object.assign"),f=e("./escapeTextContentForBrowser"),v=e("./invariant"),g=(e("./isEventSupported"),e("./keyOf")),y=(e("./warning"),u.deleteListener),_=u.listenTo,w=u.registrationNameModules,E={string:!0,number:!0},C=g({style:null}),R=1,k=null,j={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},M=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P={},O={}.hasOwnProperty;s.displayName="ReactDOMComponent",s.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e,o(this._currentElement.props);var a=j[this._tag]?"":"</"+this._tag+">";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,n)+a},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var r=t[o];if(null!=r)if(w.hasOwnProperty(o))a(this._rootNodeID,o,r,e);else{o===C&&(r&&(r=this._previousStyleCopy=h({},t.style)),r=l.createMarkupForStyles(r));var s=i.createMarkupForProperty(o,r);s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n+">";var c=i.createMarkupForID(this._rootNodeID);return n+" "+c+">"},_createContentMarkup:function(e,t){var n="";"listing"!==this._tag&&"pre"!==this._tag&&"textarea"!==this._tag||(n="\n");var o=this._currentElement.props,a=o.dangerouslySetInnerHTML;if(null!=a){if(null!=a.__html)return n+a.__html}else{var r=E[typeof o.children]?o.children:null,s=null!=r?null:o.children;if(null!=r)return n+f(r);if(null!=s){var l=this.mountChildren(s,e,t);return n+l.join("")}}return n},receiveComponent:function(e,t,n){var o=this._currentElement;this._currentElement=e,this.updateComponent(t,o,e,n)},updateComponent:function(e,t,n,a){o(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,a)},_updateDOMProperties:function(e,t){var n,o,r,s=this._currentElement.props;for(n in e)if(!s.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===C){var l=this._previousStyleCopy;for(o in l)l.hasOwnProperty(o)&&(r=r||{},r[o]="");this._previousStyleCopy=null}else w.hasOwnProperty(n)?y(this._rootNodeID,n):(c.isStandardName[n]||c.isCustomAttribute(n))&&k.deletePropertyByID(this._rootNodeID,n);for(n in s){var i=s[n],u=n===C?this._previousStyleCopy:e[n];if(s.hasOwnProperty(n)&&i!==u)if(n===C)if(i&&(i=this._previousStyleCopy=h({},i)),u){for(o in u)!u.hasOwnProperty(o)||i&&i.hasOwnProperty(o)||(r=r||{},r[o]="");for(o in i)i.hasOwnProperty(o)&&u[o]!==i[o]&&(r=r||{},r[o]=i[o])}else r=i;else w.hasOwnProperty(n)?a(this._rootNodeID,n,i,t):(c.isStandardName[n]||c.isCustomAttribute(n))&&k.updatePropertyByID(this._rootNodeID,n,i)}r&&k.updateStylesByID(this._rootNodeID,r)},_updateDOMChildren:function(e,t,n){var o=this._currentElement.props,a=E[typeof e.children]?e.children:null,r=E[typeof o.children]?o.children:null,s=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,l=o.dangerouslySetInnerHTML&&o.dangerouslySetInnerHTML.__html,c=null!=a?null:e.children,i=null!=r?null:o.children,u=null!=a||null!=s,p=null!=r||null!=l;null!=c&&null==i?this.updateChildren(null,t,n):u&&!p&&this.updateTextContent(""),null!=r?a!==r&&this.updateTextContent(""+r):null!=l?s!==l&&k.updateInnerHTMLByID(this._rootNodeID,l):null!=i&&this.updateChildren(i,t,n)},unmountComponent:function(){this.unmountChildren(),u.deleteAllListeners(this._rootNodeID),p.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},b.measureMethods(s,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),h(s.prototype,s.Mixin,m.Mixin),s.injection={injectIDOperations:function(e){s.BackendIDOperations=k=e}},t.exports=s},{"./CSSPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js","./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./DOMPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserEventEmitter":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactComponentBrowserEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactMultiChild":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMultiChild.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./escapeTextContentForBrowser":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./isEventSupported":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isEventSupported.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMForm.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),a=e("./LocalEventTrapMixin"),r=e("./ReactBrowserComponentMixin"),s=e("./ReactClass"),l=e("./ReactElement"),c=l.createFactory("form"),i=s.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[r,a],render:function(){return c(this.props)},componentDidMount:function(){this.trapBubbledEvent(o.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(o.topLevelTypes.topSubmit,"submit")}});t.exports=i},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js":[function(e,t,n){"use strict";var o=e("./CSSPropertyOperations"),a=e("./DOMChildrenOperations"),r=e("./DOMPropertyOperations"),s=e("./ReactMount"),l=e("./ReactPerf"),c=e("./invariant"),i=e("./setInnerHTML"),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},p={updatePropertyByID:function(e,t,n){var o=s.getNode(e);c(!u.hasOwnProperty(t)),null!=n?r.setValueForProperty(o,t,n):r.deleteValueForProperty(o,t)},deletePropertyByID:function(e,t,n){var o=s.getNode(e);c(!u.hasOwnProperty(t)),r.deleteValueForProperty(o,t,n)},updateStylesByID:function(e,t){var n=s.getNode(e);o.setValueForStyles(n,t)},updateInnerHTMLByID:function(e,t){var n=s.getNode(e);i(n,t)},updateTextContentByID:function(e,t){var n=s.getNode(e);a.updateTextContent(n,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=s.getNode(e);a.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=s.getNode(e[n].parentID);a.processUpdates(e,t)}};l.measureMethods(p,"ReactDOMIDOperations",{updatePropertyByID:"updatePropertyByID",deletePropertyByID:"deletePropertyByID",updateStylesByID:"updateStylesByID",updateInnerHTMLByID:"updateInnerHTMLByID",updateTextContentByID:"updateTextContentByID",dangerouslyReplaceNodeWithMarkupByID:"dangerouslyReplaceNodeWithMarkupByID",dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),t.exports=p},{"./CSSPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CSSPropertyOperations.js","./DOMChildrenOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMChildrenOperations.js","./DOMPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./setInnerHTML":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMIframe.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),a=e("./LocalEventTrapMixin"),r=e("./ReactBrowserComponentMixin"),s=e("./ReactClass"),l=e("./ReactElement"),c=l.createFactory("iframe"),i=s.createClass({displayName:"ReactDOMIframe",tagName:"IFRAME",mixins:[r,a],render:function(){return c(this.props)},componentDidMount:function(){this.trapBubbledEvent(o.topLevelTypes.topLoad,"load")}});t.exports=i},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMImg.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),a=e("./LocalEventTrapMixin"),r=e("./ReactBrowserComponentMixin"),s=e("./ReactClass"),l=e("./ReactElement"),c=l.createFactory("img"),i=s.createClass({displayName:"ReactDOMImg",tagName:"IMG",mixins:[r,a],render:function(){return c(this.props)},componentDidMount:function(){this.trapBubbledEvent(o.topLevelTypes.topLoad,"load"),this.trapBubbledEvent(o.topLevelTypes.topError,"error")}});t.exports=i},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./LocalEventTrapMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LocalEventTrapMixin.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMInput.js":[function(e,t,n){"use strict";function o(){this.isMounted()&&this.forceUpdate()}var a=e("./AutoFocusMixin"),r=e("./DOMPropertyOperations"),s=e("./LinkedValueUtils"),l=e("./ReactBrowserComponentMixin"),c=e("./ReactClass"),i=e("./ReactElement"),u=e("./ReactMount"),p=e("./ReactUpdates"),d=e("./Object.assign"),m=e("./invariant"),b=i.createFactory("input"),h={},f=c.createClass({displayName:"ReactDOMInput",tagName:"INPUT",mixins:[a,s.Mixin,l],getInitialState:function(){var e=this.props.defaultValue;return{initialChecked:this.props.defaultChecked||!1,initialValue:null!=e?e:null}},render:function(){var e=d({},this.props);e.defaultChecked=null,e.defaultValue=null;var t=s.getValue(this);e.value=null!=t?t:this.state.initialValue;var n=s.getChecked(this);return e.checked=null!=n?n:this.state.initialChecked,e.onChange=this._handleChange,b(e,this.props.children)},componentDidMount:function(){var e=u.getID(this.getDOMNode());h[e]=this},componentWillUnmount:function(){var e=this.getDOMNode(),t=u.getID(e);delete h[t]},componentDidUpdate:function(e,t,n){var o=this.getDOMNode();null!=this.props.checked&&r.setValueForProperty(o,"checked",this.props.checked||!1);var a=s.getValue(this);null!=a&&r.setValueForProperty(o,"value",""+a)},_handleChange:function(e){var t,n=s.getOnChange(this);n&&(t=n.call(this,e)),p.asap(o,this);var a=this.props.name;if("radio"===this.props.type&&null!=a){for(var r=this.getDOMNode(),l=r;l.parentNode;)l=l.parentNode;for(var c=l.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),i=0,d=c.length;d>i;i++){var b=c[i];if(b!==r&&b.form===r.form){var f=u.getID(b);m(f);var v=h[f];m(v),p.asap(o,v)}}}return t}});t.exports=f},{"./AutoFocusMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMOption.js":[function(e,t,n){"use strict";var o=e("./ReactBrowserComponentMixin"),a=e("./ReactClass"),r=e("./ReactElement"),s=(e("./warning"),r.createFactory("option")),l=a.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[o],componentWillMount:function(){},render:function(){return s(this.props,this.props.children)}});t.exports=l},{"./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js":[function(e,t,n){"use strict";function o(){if(this._pendingUpdate){this._pendingUpdate=!1;var e=l.getValue(this);null!=e&&this.isMounted()&&r(this,e)}}function a(e,t,n){if(null==e[t])return null;if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be an array if `multiple` is true.")}else if(Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be a scalar value if `multiple` is false.")}function r(e,t){var n,o,a,r=e.getDOMNode().options;if(e.props.multiple){for(n={},o=0,a=t.length;a>o;o++)n[""+t[o]]=!0;for(o=0,a=r.length;a>o;o++){var s=n.hasOwnProperty(r[o].value);r[o].selected!==s&&(r[o].selected=s)}}else{for(n=""+t,o=0,a=r.length;a>o;o++)if(r[o].value===n)return void(r[o].selected=!0);r.length&&(r[0].selected=!0)}}var s=e("./AutoFocusMixin"),l=e("./LinkedValueUtils"),c=e("./ReactBrowserComponentMixin"),i=e("./ReactClass"),u=e("./ReactElement"),p=e("./ReactUpdates"),d=e("./Object.assign"),m=u.createFactory("select"),b=i.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[s,l.Mixin,c],propTypes:{defaultValue:a,value:a},render:function(){var e=d({},this.props);return e.onChange=this._handleChange,e.value=null,m(e,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var e=l.getValue(this);null!=e?r(this,e):null!=this.props.defaultValue&&r(this,this.props.defaultValue)},componentDidUpdate:function(e){var t=l.getValue(this);null!=t?(this._pendingUpdate=!1,r(this,t)):!e.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?r(this,this.props.defaultValue):r(this,this.props.multiple?[]:""))},_handleChange:function(e){var t,n=l.getOnChange(this);return n&&(t=n.call(this,e)),this._pendingUpdate=!0,p.asap(o,this),t}});t.exports=b},{"./AutoFocusMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./LinkedValueUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMSelection.js":[function(e,t,n){"use strict";function o(e,t,n,o){return e===n&&t===o}function a(e){var t=document.selection,n=t.createRange(),o=n.text.length,a=n.duplicate();a.moveToElementText(e),a.setEndPoint("EndToStart",n);var r=a.text.length,s=r+o;return{start:r,end:s}}function r(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,a=t.anchorOffset,r=t.focusNode,s=t.focusOffset,l=t.getRangeAt(0),c=o(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),i=c?0:l.toString().length,u=l.cloneRange();u.selectNodeContents(e),u.setEnd(l.startContainer,l.startOffset);var p=o(u.startContainer,u.startOffset,u.endContainer,u.endOffset),d=p?0:u.toString().length,m=d+i,b=document.createRange();b.setStart(n,a),b.setEnd(r,s);var h=b.collapsed;return{start:h?m:d,end:h?d:m}}function s(e,t){var n,o,a=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,o=n):t.start>t.end?(n=t.end,o=t.start):(n=t.start,o=t.end),a.moveToElementText(e),a.moveStart("character",n),a.setEndPoint("EndToStart",a),a.moveEnd("character",o-n),a.select()}function l(e,t){if(window.getSelection){var n=window.getSelection(),o=e[u()].length,a=Math.min(t.start,o),r="undefined"==typeof t.end?a:Math.min(t.end,o);if(!n.extend&&a>r){var s=r;r=a,a=s}var l=i(e,a),c=i(e,r);if(l&&c){var p=document.createRange();p.setStart(l.node,l.offset),n.removeAllRanges(),a>r?(n.addRange(p),n.extend(c.node,c.offset)):(p.setEnd(c.node,c.offset),n.addRange(p))}}}var c=e("./ExecutionEnvironment"),i=e("./getNodeForCharacterOffset"),u=e("./getTextContentAccessor"),p=c.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:p?a:r,setOffsets:p?s:l};t.exports=d},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./getNodeForCharacterOffset":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getNodeForCharacterOffset.js","./getTextContentAccessor":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js":[function(e,t,n){"use strict";var o=e("./DOMPropertyOperations"),a=e("./ReactComponentBrowserEnvironment"),r=e("./ReactDOMComponent"),s=e("./Object.assign"),l=e("./escapeTextContentForBrowser"),c=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){this._rootNodeID=e;var a=l(this._stringText);return t.renderToStaticMarkup?a:"<span "+o.createMarkupForID(e)+">"+a+"</span>"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;n!==this._stringText&&(this._stringText=n,r.BackendIDOperations.updateTextContentByID(this._rootNodeID,n))}},unmountComponent:function(){a.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=c},{"./DOMPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactComponentBrowserEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./escapeTextContentForBrowser":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMTextarea.js":[function(e,t,n){"use strict";function o(){this.isMounted()&&this.forceUpdate()}var a=e("./AutoFocusMixin"),r=e("./DOMPropertyOperations"),s=e("./LinkedValueUtils"),l=e("./ReactBrowserComponentMixin"),c=e("./ReactClass"),i=e("./ReactElement"),u=e("./ReactUpdates"),p=e("./Object.assign"),d=e("./invariant"),m=(e("./warning"),i.createFactory("textarea")),b=c.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[a,s.Mixin,l],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(d(null==e),Array.isArray(t)&&(d(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=s.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=p({},this.props);return d(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,m(e,this.state.initialValue)},componentDidUpdate:function(e,t,n){var o=s.getValue(this);if(null!=o){var a=this.getDOMNode();r.setValueForProperty(a,"value",""+o)}},_handleChange:function(e){var t,n=s.getOnChange(this);return n&&(t=n.call(this,e)),u.asap(o,this),t}});t.exports=b},{"./AutoFocusMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/AutoFocusMixin.js","./DOMPropertyOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMPropertyOperations.js","./LinkedValueUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/LinkedValueUtils.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js":[function(e,t,n){"use strict";function o(){this.reinitializeTransaction()}var a=e("./ReactUpdates"),r=e("./Transaction"),s=e("./Object.assign"),l=e("./emptyFunction"),c={initialize:l,close:function(){d.isBatchingUpdates=!1}},i={initialize:l,close:a.flushBatchedUpdates.bind(a)},u=[i,c];s(o.prototype,r.Mixin,{getTransactionWrappers:function(){return u}});var p=new o,d={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,o,a){var r=d.isBatchingUpdates;d.isBatchingUpdates=!0,r?e(t,n,o,a):p.perform(e,null,t,n,o,a)}};t.exports=d},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./Transaction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Transaction.js","./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultInjection.js":[function(e,t,n){"use strict";function o(e){return b.createClass({tagName:e.toUpperCase(),render:function(){return new P(e,null,null,null,null,this.props)}})}function a(){x.EventEmitter.injectReactEventListener(O),x.EventPluginHub.injectEventPluginOrder(c),x.EventPluginHub.injectInstanceHandle(D),x.EventPluginHub.injectMount(T),x.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:A,EnterLeaveEventPlugin:i,ChangeEventPlugin:s,MobileSafariClickEventPlugin:d,SelectEventPlugin:S,BeforeInputEventPlugin:r}),
x.NativeComponent.injectGenericComponentClass(v),x.NativeComponent.injectTextComponentClass(M),x.NativeComponent.injectAutoWrapper(o),x.Class.injectMixin(m),x.NativeComponent.injectComponentClasses({button:g,form:y,iframe:E,img:_,input:C,option:R,select:k,textarea:j,html:U("html"),head:U("head"),body:U("body")}),x.DOMProperty.injectDOMPropertyConfig(p),x.DOMProperty.injectDOMPropertyConfig(L),x.EmptyComponent.injectEmptyComponent("noscript"),x.Updates.injectReconcileTransaction(I),x.Updates.injectBatchingStrategy(f),x.RootIndex.injectCreateReactRootIndex(u.canUseDOM?l.createReactRootIndex:N.createReactRootIndex),x.Component.injectEnvironment(h),x.DOMComponent.injectIDOperations(w)}var r=e("./BeforeInputEventPlugin"),s=e("./ChangeEventPlugin"),l=e("./ClientReactRootIndex"),c=e("./DefaultEventPluginOrder"),i=e("./EnterLeaveEventPlugin"),u=e("./ExecutionEnvironment"),p=e("./HTMLDOMPropertyConfig"),d=e("./MobileSafariClickEventPlugin"),m=e("./ReactBrowserComponentMixin"),b=e("./ReactClass"),h=e("./ReactComponentBrowserEnvironment"),f=e("./ReactDefaultBatchingStrategy"),v=e("./ReactDOMComponent"),g=e("./ReactDOMButton"),y=e("./ReactDOMForm"),_=e("./ReactDOMImg"),w=e("./ReactDOMIDOperations"),E=e("./ReactDOMIframe"),C=e("./ReactDOMInput"),R=e("./ReactDOMOption"),k=e("./ReactDOMSelect"),j=e("./ReactDOMTextarea"),M=e("./ReactDOMTextComponent"),P=e("./ReactElement"),O=e("./ReactEventListener"),x=e("./ReactInjection"),D=e("./ReactInstanceHandles"),T=e("./ReactMount"),I=e("./ReactReconcileTransaction"),S=e("./SelectEventPlugin"),N=e("./ServerReactRootIndex"),A=e("./SimpleEventPlugin"),L=e("./SVGDOMPropertyConfig"),U=e("./createFullPageComponent");t.exports={inject:a}},{"./BeforeInputEventPlugin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/BeforeInputEventPlugin.js","./ChangeEventPlugin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ChangeEventPlugin.js","./ClientReactRootIndex":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ClientReactRootIndex.js","./DefaultEventPluginOrder":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DefaultEventPluginOrder.js","./EnterLeaveEventPlugin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EnterLeaveEventPlugin.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./HTMLDOMPropertyConfig":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/HTMLDOMPropertyConfig.js","./MobileSafariClickEventPlugin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/MobileSafariClickEventPlugin.js","./ReactBrowserComponentMixin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserComponentMixin.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponentBrowserEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentBrowserEnvironment.js","./ReactDOMButton":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMButton.js","./ReactDOMComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./ReactDOMForm":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMForm.js","./ReactDOMIDOperations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMIDOperations.js","./ReactDOMIframe":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMIframe.js","./ReactDOMImg":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMImg.js","./ReactDOMInput":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMInput.js","./ReactDOMOption":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMOption.js","./ReactDOMSelect":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMSelect.js","./ReactDOMTextComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMTextComponent.js","./ReactDOMTextarea":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMTextarea.js","./ReactDefaultBatchingStrategy":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultBatchingStrategy.js","./ReactDefaultPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerf.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactEventListener":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEventListener.js","./ReactInjection":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInjection.js","./ReactInstanceHandles":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactReconcileTransaction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconcileTransaction.js","./SVGDOMPropertyConfig":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SVGDOMPropertyConfig.js","./SelectEventPlugin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SelectEventPlugin.js","./ServerReactRootIndex":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ServerReactRootIndex.js","./SimpleEventPlugin":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SimpleEventPlugin.js","./createFullPageComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/createFullPageComponent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerf.js":[function(e,t,n){"use strict";function o(e){return Math.floor(100*e)/100}function a(e,t,n){e[t]=(e[t]||0)+n}var r=e("./DOMProperty"),s=e("./ReactDefaultPerfAnalysis"),l=e("./ReactMount"),c=e("./ReactPerf"),i=e("./performanceNow"),u={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){u._injected||c.injection.injectMeasure(u.measure),u._allMeasurements.length=0,c.enableMeasure=!0},stop:function(){c.enableMeasure=!1},getLastMeasurements:function(){return u._allMeasurements},printExclusive:function(e){e=e||u._allMeasurements;var t=s.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":o(e.inclusive),"Exclusive mount time (ms)":o(e.exclusive),"Exclusive render time (ms)":o(e.render),"Mount time per instance (ms)":o(e.exclusive/e.count),"Render time per instance (ms)":o(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||u._allMeasurements;var t=s.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":o(e.time),Instances:e.count}})),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},getMeasurementsSummaryMap:function(e){var t=s.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||u._allMeasurements,console.table(u.getMeasurementsSummaryMap(e)),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||u._allMeasurements;var t=s.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[r.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",s.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,n,o){var a=u._allMeasurements[u._allMeasurements.length-1].writes;a[e]=a[e]||[],a[e].push({type:t,time:n,args:o})},measure:function(e,t,n){return function(){for(var o=[],r=0,s=arguments.length;s>r;r++)o.push(arguments[r]);var c,p,d;if("_renderNewRootComponent"===t||"flushBatchedUpdates"===t)return u._allMeasurements.push({exclusive:{},inclusive:{},render:{},counts:{},writes:{},displayNames:{},totalTime:0}),d=i(),p=n.apply(this,o),u._allMeasurements[u._allMeasurements.length-1].totalTime=i()-d,p;if("_mountImageIntoNode"===t||"ReactDOMIDOperations"===e){if(d=i(),p=n.apply(this,o),c=i()-d,"_mountImageIntoNode"===t){var m=l.getID(o[1]);u._recordWrite(m,t,c,o[0])}else"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]),u._recordWrite(e.parentID,e.type,c,t)}):u._recordWrite(o[0],t,c,Array.prototype.slice.call(o,1));return p}if("ReactCompositeComponent"!==e||"mountComponent"!==t&&"updateComponent"!==t&&"_renderValidatedComponent"!==t)return n.apply(this,o);if("string"==typeof this._currentElement.type)return n.apply(this,o);var b="mountComponent"===t?o[0]:this._rootNodeID,h="_renderValidatedComponent"===t,f="mountComponent"===t,v=u._mountStack,g=u._allMeasurements[u._allMeasurements.length-1];if(h?a(g.counts,b,1):f&&v.push(0),d=i(),p=n.apply(this,o),c=i()-d,h)a(g.render,b,c);else if(f){var y=v.pop();v[v.length-1]+=c,a(g.exclusive,b,c-y),a(g.inclusive,b,c)}else a(g.inclusive,b,c);return g.displayNames[b]={current:this.getName(),owner:this._currentElement._owner?this._currentElement._owner.getName():"<root>"},p}}};t.exports=u},{"./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ReactDefaultPerfAnalysis":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerfAnalysis.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./performanceNow":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/performanceNow.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDefaultPerfAnalysis.js":[function(e,t,n){function o(e){for(var t=0,n=0;n<e.length;n++){var o=e[n];t+=o.totalTime}return t}function a(e){for(var t=[],n=0;n<e.length;n++){var o,a=e[n];for(o in a.writes)a.writes[o].forEach(function(e){t.push({id:o,type:u[e.type]||e.type,args:e.args})})}return t}function r(e){for(var t,n={},o=0;o<e.length;o++){var a=e[o],r=c({},a.exclusive,a.inclusive);for(var s in r)t=a.displayNames[s].current,n[t]=n[t]||{componentName:t,inclusive:0,exclusive:0,render:0,count:0},a.render[s]&&(n[t].render+=a.render[s]),a.exclusive[s]&&(n[t].exclusive+=a.exclusive[s]),a.inclusive[s]&&(n[t].inclusive+=a.inclusive[s]),a.counts[s]&&(n[t].count+=a.counts[s])}var l=[];for(t in n)n[t].exclusive>=i&&l.push(n[t]);return l.sort(function(e,t){return t.exclusive-e.exclusive}),l}function s(e,t){for(var n,o={},a=0;a<e.length;a++){var r,s=e[a],u=c({},s.exclusive,s.inclusive);t&&(r=l(s));for(var p in u)if(!t||r[p]){var d=s.displayNames[p];n=d.owner+" > "+d.current,o[n]=o[n]||{componentName:n,time:0,count:0},s.inclusive[p]&&(o[n].time+=s.inclusive[p]),s.counts[p]&&(o[n].count+=s.counts[p])}}var m=[];for(n in o)o[n].time>=i&&m.push(o[n]);return m.sort(function(e,t){return t.time-e.time}),m}function l(e){var t={},n=Object.keys(e.writes),o=c({},e.exclusive,e.inclusive);for(var a in o){for(var r=!1,s=0;s<n.length;s++)if(0===n[s].indexOf(a)){r=!0;break}!r&&e.counts[a]>0&&(t[a]=!0)}return t}var c=e("./Object.assign"),i=1.2,u={_mountImageIntoNode:"set innerHTML",INSERT_MARKUP:"set innerHTML",MOVE_EXISTING:"move",REMOVE_NODE:"remove",TEXT_CONTENT:"set textContent",updatePropertyByID:"update attribute",deletePropertyByID:"delete attribute",updateStylesByID:"update styles",updateInnerHTMLByID:"set innerHTML",dangerouslyReplaceNodeWithMarkupByID:"replace"},p={getExclusiveSummary:r,getInclusiveSummary:s,getDOMSummary:a,getTotalTime:o};t.exports=p},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js":[function(e,t,n){"use strict";var o=e("./ReactContext"),a=e("./ReactCurrentOwner"),r=e("./Object.assign"),s=(e("./warning"),{key:!0,ref:!0}),l=function(e,t,n,o,a,r){this.type=e,this.key=t,this.ref=n,this._owner=o,this._context=a,this.props=r};l.prototype={_isReactElement:!0},l.createElement=function(e,t,n){var r,c={},i=null,u=null;if(null!=t){u=void 0===t.ref?null:t.ref,i=void 0===t.key?null:""+t.key;for(r in t)t.hasOwnProperty(r)&&!s.hasOwnProperty(r)&&(c[r]=t[r])}var p=arguments.length-2;if(1===p)c.children=n;else if(p>1){for(var d=Array(p),m=0;p>m;m++)d[m]=arguments[m+2];c.children=d}if(e&&e.defaultProps){var b=e.defaultProps;for(r in b)"undefined"==typeof c[r]&&(c[r]=b[r])}return new l(e,i,u,a.current,o.current,c)},l.createFactory=function(e){var t=l.createElement.bind(null,e);return t.type=e,t},l.cloneAndReplaceProps=function(e,t){var n=new l(e.type,e.key,e.ref,e._owner,e._context,t);return n},l.cloneElement=function(e,t,n){var o,c=r({},e.props),i=e.key,u=e.ref,p=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,p=a.current),void 0!==t.key&&(i=""+t.key);for(o in t)t.hasOwnProperty(o)&&!s.hasOwnProperty(o)&&(c[o]=t[o])}var d=arguments.length-2;if(1===d)c.children=n;else if(d>1){for(var m=Array(d),b=0;d>b;b++)m[b]=arguments[b+2];c.children=m}return new l(e.type,i,u,p,e._context,c)},l.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=l},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactContext":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactContext.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js":[function(e,t,n){"use strict";function o(){if(g.current){var e=g.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function a(e){var t=e&&e.getPublicInstance();if(t){var n=t.constructor;if(n)return n.displayName||n.name||void 0}}function r(){var e=g.current;return e&&a(e)||void 0}function s(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,c('Each child in an array or iterator should have a unique "key" prop.',e,t))}function l(e,t,n){R.test(e)&&c("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function c(e,t,n){var o=r(),s="string"==typeof n?n:n.displayName||n.name,l=o||s,c=E[e]||(E[e]={});if(!c.hasOwnProperty(l)){c[l]=!0;var i="";if(t&&t._owner&&t._owner!==g.current){var u=a(t._owner);i=" It was passed a child from "+u+"."}}}function i(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++){var o=e[n];h.isValidElement(o)&&s(o,t)}else if(h.isValidElement(e))e._store.validated=!0;else if(e){var a=_(e);if(a){if(a!==e.entries)for(var r,c=a.call(e);!(r=c.next()).done;)h.isValidElement(r.value)&&s(r.value,t)}else if("object"==typeof e){var i=f.extractIfFragment(e);for(var u in i)i.hasOwnProperty(u)&&l(u,i[u],t)}}}function u(e,t,n,a){for(var r in t)if(t.hasOwnProperty(r)){var s;try{w("function"==typeof t[r]),s=t[r](n,r,e,a)}catch(l){s=l}if(s instanceof Error&&!(s.message in C)){C[s.message]=!0;o(this)}}}function p(e,t){var n=t.type,o="string"==typeof n?n:n.displayName,a=t._owner?t._owner.getPublicInstance().constructor.displayName:null,r=e+"|"+o+"|"+a;if(!k.hasOwnProperty(r)){k[r]=!0;var s="";o&&(s=" <"+o+" />");var l="";a&&(l=" The element was created by "+a+".")}}function d(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function m(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var o in n)n.hasOwnProperty(o)&&(t.hasOwnProperty(o)&&d(t[o],n[o])||(p(o,e),t[o]=n[o]))}}function b(e){if(null!=e.type){var t=y.getComponentClassForElement(e),n=t.displayName||t.name;t.propTypes&&u(n,t.propTypes,e.props,v.prop),"function"==typeof t.getDefaultProps}}var h=e("./ReactElement"),f=e("./ReactFragment"),v=e("./ReactPropTypeLocations"),g=(e("./ReactPropTypeLocationNames"),e("./ReactCurrentOwner")),y=e("./ReactNativeComponent"),_=e("./getIteratorFn"),w=e("./invariant"),E=(e("./warning"),{}),C={},R=/^\d+$/,k={},j={checkAndWarnForMutatedProps:m,createElement:function(e,t,n){var o=h.createElement.apply(this,arguments);if(null==o)return o;for(var a=2;a<arguments.length;a++)i(arguments[a],e);return b(o),o},createFactory:function(e){var t=j.createElement.bind(null,e);return t.type=e,t},cloneElement:function(e,t,n){for(var o=h.cloneElement.apply(this,arguments),a=2;a<arguments.length;a++)i(arguments[a],o.type);return b(o),o}};t.exports=j},{"./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactFragment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./ReactNativeComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPropTypeLocationNames":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./ReactPropTypeLocations":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js","./getIteratorFn":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js":[function(e,t,n){"use strict";function o(e){u[e]=!0}function a(e){delete u[e]}function r(e){return!!u[e]}var s,l=e("./ReactElement"),c=e("./ReactInstanceMap"),i=e("./invariant"),u={},p={injectEmptyComponent:function(e){s=l.createFactory(e)}},d=function(){};d.prototype.componentDidMount=function(){var e=c.get(this);e&&o(e._rootNodeID)},d.prototype.componentWillUnmount=function(){var e=c.get(this);e&&a(e._rootNodeID)},d.prototype.render=function(){return i(s),s()};var m=l.createElement(d),b={emptyElement:m,injection:p,isNullComponentID:r};t.exports=b},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactErrorUtils.js":[function(e,t,n){"use strict";var o={guard:function(e,t){return e}};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEventEmitterMixin.js":[function(e,t,n){"use strict";function o(e){a.enqueueEvents(e),a.processEventQueue()}var a=e("./EventPluginHub"),r={handleTopLevel:function(e,t,n,r){var s=a.extractEvents(e,t,n,r);o(s)}};t.exports=r},{"./EventPluginHub":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEventListener.js":[function(e,t,n){"use strict";function o(e){var t=p.getID(e),n=u.getReactRootIDFromNodeID(t),o=p.findReactContainerForID(n),a=p.getFirstReactDOM(o);return a}function a(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function r(e){for(var t=p.getFirstReactDOM(b(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=o(n);for(var a=0,r=e.ancestors.length;r>a;a++){t=e.ancestors[a];var s=p.getID(t)||"";f._handleTopLevel(e.topLevelType,t,s,e.nativeEvent)}}function s(e){var t=h(window);e(t)}var l=e("./EventListener"),c=e("./ExecutionEnvironment"),i=e("./PooledClass"),u=e("./ReactInstanceHandles"),p=e("./ReactMount"),d=e("./ReactUpdates"),m=e("./Object.assign"),b=e("./getEventTarget"),h=e("./getUnboundedScrollPosition");m(a.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),i.addPoolingTo(a,i.twoArgumentPooler);var f={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:c.canUseDOM?window:null,setHandleTopLevel:function(e){f._handleTopLevel=e},setEnabled:function(e){f._enabled=!!e},isEnabled:function(){return f._enabled},trapBubbledEvent:function(e,t,n){var o=n;return o?l.listen(o,t,f.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var o=n;return o?l.capture(o,t,f.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=s.bind(null,e);l.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(f._enabled){var n=a.getPooled(e,t);try{d.batchedUpdates(r,n)}finally{a.release(n)}}}};t.exports=f},{"./EventListener":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventListener.js","./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactInstanceHandles":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./getEventTarget":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventTarget.js","./getUnboundedScrollPosition":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getUnboundedScrollPosition.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactFragment.js":[function(e,t,n){"use strict";var o=(e("./ReactElement"),e("./warning"),{create:function(e){return e},extract:function(e){return e},extractIfFragment:function(e){return e}});t.exports=o},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInjection.js":[function(e,t,n){"use strict";var o=e("./DOMProperty"),a=e("./EventPluginHub"),r=e("./ReactComponentEnvironment"),s=e("./ReactClass"),l=e("./ReactEmptyComponent"),c=e("./ReactBrowserEventEmitter"),i=e("./ReactNativeComponent"),u=e("./ReactDOMComponent"),p=e("./ReactPerf"),d=e("./ReactRootIndex"),m=e("./ReactUpdates"),b={Component:r.injection,Class:s.injection,DOMComponent:u.injection,DOMProperty:o.injection,EmptyComponent:l.injection,EventPluginHub:a.injection,EventEmitter:c.injection,NativeComponent:i.injection,Perf:p.injection,RootIndex:d.injection,Updates:m.injection};t.exports=b},{"./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./EventPluginHub":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginHub.js","./ReactBrowserEventEmitter":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactComponentEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactDOMComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMComponent.js","./ReactEmptyComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactRootIndex":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js":[function(e,t,n){"use strict";function o(e){return r(document.documentElement,e)}var a=e("./ReactDOMSelection"),r=e("./containsNode"),s=e("./focusNode"),l=e("./getActiveElement"),c={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=l();return{focusedElem:e,selectionRange:c.hasSelectionCapabilities(e)?c.getSelection(e):null}},restoreSelection:function(e){var t=l(),n=e.focusedElem,a=e.selectionRange;t!==n&&o(n)&&(c.hasSelectionCapabilities(n)&&c.setSelection(n,a),s(n))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){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=a.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var r=e.createTextRange();r.collapse(!0),r.moveStart("character",n),r.moveEnd("character",o-n),r.select()}else a.setOffsets(e,t)}};t.exports=c},{"./ReactDOMSelection":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactDOMSelection.js","./containsNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/containsNode.js","./focusNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/focusNode.js","./getActiveElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getActiveElement.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js":[function(e,t,n){"use strict";function o(e){return m+e.toString(36)}function a(e,t){return e.charAt(t)===m||t===e.length}function r(e){return""===e||e.charAt(0)===m&&e.charAt(e.length-1)!==m}function s(e,t){return 0===t.indexOf(e)&&a(t,e.length)}function l(e){return e?e.substr(0,e.lastIndexOf(m)):""}function c(e,t){if(d(r(e)&&r(t)),d(s(e,t)),e===t)return e;var n,o=e.length+b;for(n=o;n<t.length&&!a(t,n);n++);return t.substr(0,n)}function i(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var o=0,s=0;n>=s;s++)if(a(e,s)&&a(t,s))o=s;else if(e.charAt(s)!==t.charAt(s))break;var l=e.substr(0,o);return d(r(l)),l}function u(e,t,n,o,a,r){e=e||"",t=t||"",d(e!==t);var i=s(t,e);d(i||s(e,t));for(var u=0,p=i?l:c,m=e;;m=p(m,t)){var b;if(a&&m===e||r&&m===t||(b=n(m,i,o)),b===!1||m===t)break;d(u++<h)}}var p=e("./ReactRootIndex"),d=e("./invariant"),m=".",b=m.length,h=100,f={createReactRootID:function(){return o(p.createReactRootIndex())},createReactID:function(e,t){return e+t},getReactRootIDFromNodeID:function(e){if(e&&e.charAt(0)===m&&e.length>1){var t=e.indexOf(m,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,o,a){var r=i(e,t);r!==e&&u(e,r,n,o,!1,!0),r!==t&&u(r,t,n,a,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(u("",e,t,n,!0,!1),u(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){u("",e,t,n,!0,!1)},_getFirstCommonAncestorID:i,_getNextDescendantID:c,isAncestorIDOf:s,SEPARATOR:m};t.exports=f},{"./ReactRootIndex":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js":[function(e,t,n){"use strict";var o={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=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js":[function(e,t,n){"use strict";var o={currentlyMountingInstance:null,currentlyUnmountingInstance:null};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js":[function(e,t,n){"use strict";var o=e("./adler32"),a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=o(e);return e.replace(">"," "+a.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var r=o(e);return r===n}};t.exports=a},{"./adler32":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/adler32.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js":[function(e,t,n){"use strict";function o(e,t){for(var n=Math.min(e.length,t.length),o=0;n>o;o++)if(e.charAt(o)!==t.charAt(o))return o;return e.length===t.length?-1:n}function a(e){var t=O(e);return t&&W.getID(t)}function r(e){var t=s(e);if(t)if(A.hasOwnProperty(t)){var n=A[t];n!==e&&(D(!u(n,t)),A[t]=e)}else A[t]=e;return t}function s(e){return e&&e.getAttribute&&e.getAttribute(N)||""}function l(e,t){var n=s(e);n!==t&&delete A[n],e.setAttribute(N,t),A[t]=e}function c(e){return A.hasOwnProperty(e)&&u(A[e],e)||(A[e]=W.findReactNodeByID(e)),A[e]}function i(e){var t=w.get(e)._rootNodeID;return y.isNullComponentID(t)?null:(A.hasOwnProperty(t)&&u(A[t],t)||(A[t]=W.findReactNodeByID(t)),A[t])}function u(e,t){if(e){D(s(e)===t);var n=W.findReactContainerForID(t);if(n&&P(n,e))return!0}return!1}function p(e){delete A[e]}function d(e){var t=A[e];return t&&u(t,e)?void(H=t):!1}function m(e){H=null,_.traverseAncestors(e,d);var t=H;return H=null,t}function b(e,t,n,o,a){var r=R.mountComponent(e,t,o,M);e._isTopLevel=!0,W._mountImageIntoNode(r,n,a)}function h(e,t,n,o){var a=j.ReactReconcileTransaction.getPooled();a.perform(b,null,e,t,n,a,o),j.ReactReconcileTransaction.release(a)}var f=e("./DOMProperty"),v=e("./ReactBrowserEventEmitter"),g=(e("./ReactCurrentOwner"),e("./ReactElement")),y=(e("./ReactElementValidator"),e("./ReactEmptyComponent")),_=e("./ReactInstanceHandles"),w=e("./ReactInstanceMap"),E=e("./ReactMarkupChecksum"),C=e("./ReactPerf"),R=e("./ReactReconciler"),k=e("./ReactUpdateQueue"),j=e("./ReactUpdates"),M=e("./emptyObject"),P=e("./containsNode"),O=e("./getReactRootElementInContainer"),x=e("./instantiateReactComponent"),D=e("./invariant"),T=e("./setInnerHTML"),I=e("./shouldUpdateReactComponent"),S=(e("./warning"),_.SEPARATOR),N=f.ID_ATTRIBUTE_NAME,A={},L=1,U=9,F={},B={},V=[],H=null,W={_instancesByReactRootID:F,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,o){return W.scrollMonitor(n,function(){k.enqueueElementInternal(e,t),o&&k.enqueueCallbackInternal(e,o)}),e},_registerComponent:function(e,t){D(t&&(t.nodeType===L||t.nodeType===U)),v.ensureScrollValueMonitoring();var n=W.registerContainer(t);return F[n]=e,n},_renderNewRootComponent:function(e,t,n){var o=x(e,null),a=W._registerComponent(o,t);return j.batchedUpdates(h,o,a,t,n),o},render:function(e,t,n){D(g.isValidElement(e));var o=F[a(t)];if(o){var r=o._currentElement;if(I(r,e))return W._updateRootComponent(o,e,t,n).getPublicInstance();W.unmountComponentAtNode(t)}var s=O(t),l=s&&W.isRenderedByReact(s),c=l&&!o,i=W._renderNewRootComponent(e,t,c).getPublicInstance();return n&&n.call(i),i},constructAndRenderComponent:function(e,t,n){var o=g.createElement(e,t);return W.render(o,n)},constructAndRenderComponentByID:function(e,t,n){var o=document.getElementById(n);return D(o),W.constructAndRenderComponent(e,t,o)},registerContainer:function(e){var t=a(e);return t&&(t=_.getReactRootIDFromNodeID(t)),t||(t=_.createReactRootID()),B[t]=e,t},unmountComponentAtNode:function(e){D(e&&(e.nodeType===L||e.nodeType===U));var t=a(e),n=F[t];return n?(W.unmountComponentFromNode(n,e),delete F[t],delete B[t],!0):!1},unmountComponentFromNode:function(e,t){for(R.unmountComponent(e),
t.nodeType===U&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=_.getReactRootIDFromNodeID(e),n=B[t];return n},findReactNodeByID:function(e){var t=W.findReactContainerForID(e);return W.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=W.getID(e);return t?t.charAt(0)===S:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(W.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=V,o=0,a=m(t)||e;for(n[0]=a.firstChild,n.length=1;o<n.length;){for(var r,s=n[o++];s;){var l=W.getID(s);l?t===l?r=s:_.isAncestorIDOf(l,t)&&(n.length=o=0,n.push(s.firstChild)):n.push(s.firstChild),s=s.nextSibling}if(r)return n.length=0,r}n.length=0,D(!1)},_mountImageIntoNode:function(e,t,n){if(D(t&&(t.nodeType===L||t.nodeType===U)),n){var a=O(t);if(E.canReuseMarkup(e,a))return;var r=a.getAttribute(E.CHECKSUM_ATTR_NAME);a.removeAttribute(E.CHECKSUM_ATTR_NAME);var s=a.outerHTML;a.setAttribute(E.CHECKSUM_ATTR_NAME,r);var l=o(e,s);" (client) "+e.substring(l-20,l+20)+"\n (server) "+s.substring(l-20,l+20);D(t.nodeType!==U)}D(t.nodeType!==U),T(t,e)},getReactRootID:a,getID:r,setID:l,getNode:c,getNodeFromInstance:i,purgeID:p};C.measureMethods(W,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),t.exports=W},{"./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js","./ReactBrowserEventEmitter":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactElementValidator":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactEmptyComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactInstanceHandles":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactInstanceMap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactMarkupChecksum":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./ReactUpdateQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./containsNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/containsNode.js","./emptyObject":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./getReactRootElementInContainer":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getReactRootElementInContainer.js","./instantiateReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./setInnerHTML":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js","./shouldUpdateReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMultiChild.js":[function(e,t,n){"use strict";function o(e,t,n){b.push({parentID:e,parentNode:null,type:u.INSERT_MARKUP,markupIndex:h.push(t)-1,textContent:null,fromIndex:null,toIndex:n})}function a(e,t,n){b.push({parentID:e,parentNode:null,type:u.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:t,toIndex:n})}function r(e,t){b.push({parentID:e,parentNode:null,type:u.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:t,toIndex:null})}function s(e,t){b.push({parentID:e,parentNode:null,type:u.TEXT_CONTENT,markupIndex:null,textContent:t,fromIndex:null,toIndex:null})}function l(){b.length&&(i.processChildrenUpdates(b,h),c())}function c(){b.length=0,h.length=0}var i=e("./ReactComponentEnvironment"),u=e("./ReactMultiChildUpdateTypes"),p=e("./ReactReconciler"),d=e("./ReactChildReconciler"),m=0,b=[],h=[],f={Mixin:{mountChildren:function(e,t,n){var o=d.instantiateChildren(e,t,n);this._renderedChildren=o;var a=[],r=0;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s],c=this._rootNodeID+s,i=p.mountComponent(l,c,t,n);l._mountIndex=r,a.push(i),r++}return a},updateTextContent:function(e){m++;var t=!0;try{var n=this._renderedChildren;d.unmountChildren(n);for(var o in n)n.hasOwnProperty(o)&&this._unmountChildByName(n[o],o);this.setTextContent(e),t=!1}finally{m--,m||(t?c():l())}},updateChildren:function(e,t,n){m++;var o=!0;try{this._updateChildren(e,t,n),o=!1}finally{m--,m||(o?c():l())}},_updateChildren:function(e,t,n){var o=this._renderedChildren,a=d.updateChildren(o,e,t,n);if(this._renderedChildren=a,a||o){var r,s=0,l=0;for(r in a)if(a.hasOwnProperty(r)){var c=o&&o[r],i=a[r];c===i?(this.moveChild(c,l,s),s=Math.max(c._mountIndex,s),c._mountIndex=l):(c&&(s=Math.max(c._mountIndex,s),this._unmountChildByName(c,r)),this._mountChildByNameAtIndex(i,r,l,t,n)),l++}for(r in o)!o.hasOwnProperty(r)||a&&a.hasOwnProperty(r)||this._unmountChildByName(o[r],r)}},unmountChildren:function(){var e=this._renderedChildren;d.unmountChildren(e),this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&a(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){o(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){r(this._rootNodeID,e._mountIndex)},setTextContent:function(e){s(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,o,a){var r=this._rootNodeID+t,s=p.mountComponent(e,r,o,a);e._mountIndex=n,this.createChild(e,s)},_unmountChildByName:function(e,t){this.removeChild(e),e._mountIndex=null}}};t.exports=f},{"./ReactChildReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactChildReconciler.js","./ReactComponentEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactComponentEnvironment.js","./ReactMultiChildUpdateTypes":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js","./ReactReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMultiChildUpdateTypes.js":[function(e,t,n){"use strict";var o=e("./keyMirror"),a=o({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});t.exports=a},{"./keyMirror":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js":[function(e,t,n){"use strict";function o(e){if("function"==typeof e.type)return e.type;var t=e.type,n=p[t];return null==n&&(p[t]=n=i(t)),n}function a(e){return c(u),new u(e.type,e.props)}function r(e){return new d(e)}function s(e){return e instanceof d}var l=e("./Object.assign"),c=e("./invariant"),i=null,u=null,p={},d=null,m={injectGenericComponentClass:function(e){u=e},injectTextComponentClass:function(e){d=e},injectComponentClasses:function(e){l(p,e)},injectAutoWrapper:function(e){i=e}},b={getComponentClassForElement:o,createInternalComponent:a,createInstanceForText:r,isTextComponent:s,injection:m};t.exports=b},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactOwner.js":[function(e,t,n){"use strict";var o=e("./invariant"),a={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,n){o(a.isValidOwner(n)),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){o(a.isValidOwner(n)),n.getPublicInstance().refs[t]===e.getPublicInstance()&&n.detachRef(t)}};t.exports=a},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js":[function(e,t,n){"use strict";function o(e,t,n){return n}var a={enableMeasure:!1,storedMeasure:o,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){a.storedMeasure=e}}};t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js":[function(e,t,n){"use strict";var o={};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocations.js":[function(e,t,n){"use strict";var o=e("./keyMirror"),a=o({prop:null,context:null,childContext:null});t.exports=a},{"./keyMirror":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyMirror.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypes.js":[function(e,t,n){"use strict";function o(e){function t(t,n,o,a,r){if(a=a||w,null==n[o]){var s=y[r];return t?new Error("Required "+s+" `"+o+"` was not specified in "+("`"+a+"`.")):null}return e(n,o,a,r)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){function t(t,n,o,a){var r=t[n],s=h(r);if(s!==e){var l=y[a],c=f(r);return new Error("Invalid "+l+" `"+n+"` of type `"+c+"` "+("supplied to `"+o+"`, expected `"+e+"`."))}return null}return o(t)}function r(){return o(_.thatReturns(null))}function s(e){function t(t,n,o,a){var r=t[n];if(!Array.isArray(r)){var s=y[a],l=h(r);return new Error("Invalid "+s+" `"+n+"` of type "+("`"+l+"` supplied to `"+o+"`, expected an array."))}for(var c=0;c<r.length;c++){var i=e(r,c,o,a);if(i instanceof Error)return i}return null}return o(t)}function l(){function e(e,t,n,o){if(!v.isValidElement(e[t])){var a=y[o];return new Error("Invalid "+a+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactElement."))}return null}return o(e)}function c(e){function t(t,n,o,a){if(!(t[n]instanceof e)){var r=y[a],s=e.name||w;return new Error("Invalid "+r+" `"+n+"` supplied to "+("`"+o+"`, expected instance of `"+s+"`."))}return null}return o(t)}function i(e){function t(t,n,o,a){for(var r=t[n],s=0;s<e.length;s++)if(r===e[s])return null;var l=y[a],c=JSON.stringify(e);return new Error("Invalid "+l+" `"+n+"` of value `"+r+"` "+("supplied to `"+o+"`, expected one of "+c+"."))}return o(t)}function u(e){function t(t,n,o,a){var r=t[n],s=h(r);if("object"!==s){var l=y[a];return new Error("Invalid "+l+" `"+n+"` of type "+("`"+s+"` supplied to `"+o+"`, expected an object."))}for(var c in r)if(r.hasOwnProperty(c)){var i=e(r,c,o,a);if(i instanceof Error)return i}return null}return o(t)}function p(e){function t(t,n,o,a){for(var r=0;r<e.length;r++){var s=e[r];if(null==s(t,n,o,a))return null}var l=y[a];return new Error("Invalid "+l+" `"+n+"` supplied to "+("`"+o+"`."))}return o(t)}function d(){function e(e,t,n,o){if(!b(e[t])){var a=y[o];return new Error("Invalid "+a+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return null}return o(e)}function m(e){function t(t,n,o,a){var r=t[n],s=h(r);if("object"!==s){var l=y[a];return new Error("Invalid "+l+" `"+n+"` of type `"+s+"` "+("supplied to `"+o+"`, expected `object`."))}for(var c in e){var i=e[c];if(i){var u=i(r,c,o,a);if(u)return u}}return null}return o(t)}function b(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(b);if(null===e||v.isValidElement(e))return!0;e=g.extractIfFragment(e);for(var t in e)if(!b(e[t]))return!1;return!0;default:return!1}}function h(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function f(e){var t=h(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}var v=e("./ReactElement"),g=e("./ReactFragment"),y=e("./ReactPropTypeLocationNames"),_=e("./emptyFunction"),w="<<anonymous>>",E=l(),C=d(),R={array:a("array"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),any:r(),arrayOf:s,element:E,instanceOf:c,node:C,objectOf:u,oneOf:i,oneOfType:p,shape:m};t.exports=R},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactFragment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./ReactPropTypeLocationNames":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPropTypeLocationNames.js","./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPutListenerQueue.js":[function(e,t,n){"use strict";function o(){this.listenersToPut=[]}var a=e("./PooledClass"),r=e("./ReactBrowserEventEmitter"),s=e("./Object.assign");s(o.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e<this.listenersToPut.length;e++){var t=this.listenersToPut[e];r.putListener(t.rootNodeID,t.propKey,t.propValue)}},reset:function(){this.listenersToPut.length=0},destructor:function(){this.reset()}}),a.addPoolingTo(o),t.exports=o},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconcileTransaction.js":[function(e,t,n){"use strict";function o(){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=a.getPooled(null),this.putListenerQueue=c.getPooled()}var a=e("./CallbackQueue"),r=e("./PooledClass"),s=e("./ReactBrowserEventEmitter"),l=e("./ReactInputSelection"),c=e("./ReactPutListenerQueue"),i=e("./Transaction"),u=e("./Object.assign"),p={initialize:l.getSelectionInformation,close:l.restoreSelection},d={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},m={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},b={initialize:function(){this.putListenerQueue.reset()},close:function(){this.putListenerQueue.putListeners()}},h=[b,p,d,m],f={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){a.release(this.reactMountReady),this.reactMountReady=null,c.release(this.putListenerQueue),this.putListenerQueue=null}};u(o.prototype,i.Mixin,f),r.addPoolingTo(o),t.exports=o},{"./CallbackQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactBrowserEventEmitter":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactBrowserEventEmitter.js","./ReactInputSelection":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js","./ReactPutListenerQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Transaction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js":[function(e,t,n){"use strict";function o(){a.attachRefs(this,this._currentElement)}var a=e("./ReactRef"),r=(e("./ReactElementValidator"),{mountComponent:function(e,t,n,a){var r=e.mountComponent(t,n,a);return n.getReactMountReady().enqueue(o,e),r},unmountComponent:function(e){a.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,r){var s=e._currentElement;if(t!==s||null==t._owner){var l=a.shouldUpdateRefs(s,t);l&&a.detachRefs(e,s),e.receiveComponent(t,n,r),l&&n.getReactMountReady().enqueue(o,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}});t.exports=r},{"./ReactElementValidator":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElementValidator.js","./ReactRef":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactRef.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactRef.js":[function(e,t,n){"use strict";function o(e,t,n){"function"==typeof e?e(t.getPublicInstance()):r.addComponentAsRefTo(t,e,n)}function a(e,t,n){"function"==typeof e?e(null):r.removeComponentAsRefFrom(t,e,n)}var r=e("./ReactOwner"),s={};s.attachRefs=function(e,t){var n=t.ref;null!=n&&o(n,e,t._owner)},s.shouldUpdateRefs=function(e,t){return t._owner!==e._owner||t.ref!==e.ref},s.detachRefs=function(e,t){var n=t.ref;null!=n&&a(n,e,t._owner)},t.exports=s},{"./ReactOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactOwner.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactRootIndex.js":[function(e,t,n){"use strict";var o={injectCreateReactRootIndex:function(e){a.createReactRootIndex=e}},a={createReactRootIndex:null,injection:o};t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactServerRendering.js":[function(e,t,n){"use strict";function o(e){p(r.isValidElement(e));var t;try{var n=s.createReactRootID();return t=c.getPooled(!1),t.perform(function(){var o=u(e,null),a=o.mountComponent(n,t,i);return l.addChecksumToMarkup(a)},null)}finally{c.release(t)}}function a(e){p(r.isValidElement(e));var t;try{var n=s.createReactRootID();return t=c.getPooled(!0),t.perform(function(){var o=u(e,null);return o.mountComponent(n,t,i)},null)}finally{c.release(t)}}var r=e("./ReactElement"),s=e("./ReactInstanceHandles"),l=e("./ReactMarkupChecksum"),c=e("./ReactServerRenderingTransaction"),i=e("./emptyObject"),u=e("./instantiateReactComponent"),p=e("./invariant");t.exports={renderToString:o,renderToStaticMarkup:a}},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceHandles":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./ReactMarkupChecksum":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMarkupChecksum.js","./ReactServerRenderingTransaction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactServerRenderingTransaction.js","./emptyObject":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyObject.js","./instantiateReactComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactServerRenderingTransaction.js":[function(e,t,n){"use strict";function o(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=r.getPooled(null),this.putListenerQueue=s.getPooled()}var a=e("./PooledClass"),r=e("./CallbackQueue"),s=e("./ReactPutListenerQueue"),l=e("./Transaction"),c=e("./Object.assign"),i=e("./emptyFunction"),u={initialize:function(){this.reactMountReady.reset()},close:i},p={initialize:function(){this.putListenerQueue.reset()},close:i},d=[p,u],m={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){r.release(this.reactMountReady),this.reactMountReady=null,s.release(this.putListenerQueue),this.putListenerQueue=null}};c(o.prototype,l.Mixin,m),a.addPoolingTo(o),t.exports=o},{"./CallbackQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactPutListenerQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPutListenerQueue.js","./Transaction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Transaction.js","./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdateQueue.js":[function(e,t,n){"use strict";function o(e){e!==r.currentlyMountingInstance&&i.enqueueUpdate(e)}function a(e,t){p(null==s.current);var n=c.get(e);return n?n===r.currentlyUnmountingInstance?null:n:null}var r=e("./ReactLifeCycle"),s=e("./ReactCurrentOwner"),l=e("./ReactElement"),c=e("./ReactInstanceMap"),i=e("./ReactUpdates"),u=e("./Object.assign"),p=e("./invariant"),d=(e("./warning"),{enqueueCallback:function(e,t){p("function"==typeof t);var n=a(e);return n&&n!==r.currentlyMountingInstance?(n._pendingCallbacks?n._pendingCallbacks.push(t):n._pendingCallbacks=[t],void o(n)):null},enqueueCallbackInternal:function(e,t){p("function"==typeof t),e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],o(e)},enqueueForceUpdate:function(e){var t=a(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,o(t))},enqueueReplaceState:function(e,t){var n=a(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,o(n))},enqueueSetState:function(e,t){var n=a(e,"setState");if(n){var r=n._pendingStateQueue||(n._pendingStateQueue=[]);r.push(t),o(n)}},enqueueSetProps:function(e,t){var n=a(e,"setProps");if(n){p(n._isTopLevel);var r=n._pendingElement||n._currentElement,s=u({},r.props,t);n._pendingElement=l.cloneAndReplaceProps(r,s),o(n)}},enqueueReplaceProps:function(e,t){var n=a(e,"replaceProps");if(n){p(n._isTopLevel);var r=n._pendingElement||n._currentElement;n._pendingElement=l.cloneAndReplaceProps(r,t),o(n)}},enqueueElementInternal:function(e,t){e._pendingElement=t,o(e)}});t.exports=d},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactInstanceMap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactLifeCycle":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactLifeCycle.js","./ReactUpdates":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactUpdates.js":[function(e,t,n){"use strict";function o(){f(j.ReactReconcileTransaction&&_)}function a(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=u.getPooled(),this.reconcileTransaction=j.ReactReconcileTransaction.getPooled()}function r(e,t,n,a,r){o(),_.batchedUpdates(e,t,n,a,r)}function s(e,t){return e._mountOrder-t._mountOrder}function l(e){var t=e.dirtyComponentsLength;f(t===v.length),v.sort(s);for(var n=0;t>n;n++){var o=v[n],a=o._pendingCallbacks;if(o._pendingCallbacks=null,m.performUpdateIfNecessary(o,e.reconcileTransaction),a)for(var r=0;r<a.length;r++)e.callbackQueue.enqueue(a[r],o.getPublicInstance())}}function c(e){return o(),_.isBatchingUpdates?void v.push(e):void _.batchedUpdates(c,e)}function i(e,t){f(_.isBatchingUpdates),g.enqueue(e,t),y=!0}var u=e("./CallbackQueue"),p=e("./PooledClass"),d=(e("./ReactCurrentOwner"),e("./ReactPerf")),m=e("./ReactReconciler"),b=e("./Transaction"),h=e("./Object.assign"),f=e("./invariant"),v=(e("./warning"),[]),g=u.getPooled(),y=!1,_=null,w={initialize:function(){this.dirtyComponentsLength=v.length},close:function(){this.dirtyComponentsLength!==v.length?(v.splice(0,this.dirtyComponentsLength),R()):v.length=0}},E={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},C=[w,E];h(a.prototype,b.Mixin,{getTransactionWrappers:function(){return C},destructor:function(){this.dirtyComponentsLength=null,u.release(this.callbackQueue),this.callbackQueue=null,j.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return b.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),p.addPoolingTo(a);var R=function(){for(;v.length||y;){if(v.length){var e=a.getPooled();e.perform(l,null,e),a.release(e)}if(y){y=!1;var t=g;g=u.getPooled(),t.notifyAll(),u.release(t)}}};R=d.measure("ReactUpdates","flushBatchedUpdates",R);var k={injectReconcileTransaction:function(e){f(e),j.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){f(e),f("function"==typeof e.batchedUpdates),f("boolean"==typeof e.isBatchingUpdates),_=e}},j={ReactReconcileTransaction:null,batchedUpdates:r,enqueueUpdate:c,flushBatchedUpdates:R,injection:k,asap:i};t.exports=j},{"./CallbackQueue":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CallbackQueue.js","./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactPerf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactPerf.js","./ReactReconciler":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactReconciler.js","./Transaction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Transaction.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SVGDOMPropertyConfig.js":[function(e,t,n){"use strict";var o=e("./DOMProperty"),a=o.injection.MUST_USE_ATTRIBUTE,r={Properties:{cx:a,cy:a,d:a,dx:a,dy:a,fill:a,fillOpacity:a,fontFamily:a,fontSize:a,fx:a,fy:a,gradientTransform:a,gradientUnits:a,markerEnd:a,markerMid:a,markerStart:a,offset:a,opacity:a,patternContentUnits:a,patternUnits:a,points:a,preserveAspectRatio:a,r:a,rx:a,ry:a,spreadMethod:a,stopColor:a,stopOpacity:a,stroke:a,strokeDasharray:a,strokeLinecap:a,strokeOpacity:a,strokeWidth:a,textAnchor:a,transform:a,version:a,viewBox:a,x1:a,x2:a,x:a,y1:a,y2:a,y:a},DOMAttributeNames:{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"}};t.exports=r},{"./DOMProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/DOMProperty.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SelectEventPlugin.js":[function(e,t,n){"use strict";function o(e){if("selectionStart"in e&&l.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 a(e){if(g||null==h||h!==i())return null;var t=o(h);if(!v||!d(v,t)){v=t;var n=c.getPooled(b.select,f,e);return n.type="select",n.target=h,s.accumulateTwoPhaseDispatches(n),n}}var r=e("./EventConstants"),s=e("./EventPropagators"),l=e("./ReactInputSelection"),c=e("./SyntheticEvent"),i=e("./getActiveElement"),u=e("./isTextInputElement"),p=e("./keyOf"),d=e("./shallowEqual"),m=r.topLevelTypes,b={select:{phasedRegistrationNames:{bubbled:p({onSelect:null}),captured:p({onSelectCapture:null})},dependencies:[m.topBlur,m.topContextMenu,m.topFocus,m.topKeyDown,m.topMouseDown,m.topMouseUp,m.topSelectionChange]}},h=null,f=null,v=null,g=!1,y={eventTypes:b,extractEvents:function(e,t,n,o){switch(e){case m.topFocus:(u(t)||"true"===t.contentEditable)&&(h=t,f=n,v=null);break;case m.topBlur:h=null,f=null,v=null;break;case m.topMouseDown:g=!0;break;case m.topContextMenu:case m.topMouseUp:return g=!1,a(o);case m.topSelectionChange:case m.topKeyDown:case m.topKeyUp:return a(o)}}};t.exports=y},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPropagators":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./ReactInputSelection":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInputSelection.js","./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./getActiveElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getActiveElement.js","./isTextInputElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js","./shallowEqual":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/shallowEqual.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ServerReactRootIndex.js":[function(e,t,n){"use strict";var o=Math.pow(2,53),a={createReactRootIndex:function(){return Math.ceil(Math.random()*o)}};t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SimpleEventPlugin.js":[function(e,t,n){"use strict";var o=e("./EventConstants"),a=e("./EventPluginUtils"),r=e("./EventPropagators"),s=e("./SyntheticClipboardEvent"),l=e("./SyntheticEvent"),c=e("./SyntheticFocusEvent"),i=e("./SyntheticKeyboardEvent"),u=e("./SyntheticMouseEvent"),p=e("./SyntheticDragEvent"),d=e("./SyntheticTouchEvent"),m=e("./SyntheticUIEvent"),b=e("./SyntheticWheelEvent"),h=e("./getEventCharCode"),f=e("./invariant"),v=e("./keyOf"),g=(e("./warning"),o.topLevelTypes),y={blur:{phasedRegistrationNames:{bubbled:v({onBlur:!0}),captured:v({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:v({onClick:!0}),captured:v({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:v({onContextMenu:!0}),captured:v({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:v({onCopy:!0}),captured:v({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:v({onCut:!0}),captured:v({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:v({onDoubleClick:!0}),captured:v({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:v({onDrag:!0}),captured:v({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:v({onDragEnd:!0}),captured:v({onDragEndCapture:!0
})}},dragEnter:{phasedRegistrationNames:{bubbled:v({onDragEnter:!0}),captured:v({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:v({onDragExit:!0}),captured:v({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:v({onDragLeave:!0}),captured:v({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:v({onDragOver:!0}),captured:v({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:v({onDragStart:!0}),captured:v({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:v({onDrop:!0}),captured:v({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:v({onFocus:!0}),captured:v({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:v({onInput:!0}),captured:v({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:v({onKeyDown:!0}),captured:v({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:v({onKeyPress:!0}),captured:v({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:v({onKeyUp:!0}),captured:v({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:v({onLoad:!0}),captured:v({onLoadCapture:!0})}},error:{phasedRegistrationNames:{bubbled:v({onError:!0}),captured:v({onErrorCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:v({onMouseDown:!0}),captured:v({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:v({onMouseMove:!0}),captured:v({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:v({onMouseOut:!0}),captured:v({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:v({onMouseOver:!0}),captured:v({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:v({onMouseUp:!0}),captured:v({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:v({onPaste:!0}),captured:v({onPasteCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:v({onReset:!0}),captured:v({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:v({onScroll:!0}),captured:v({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:v({onSubmit:!0}),captured:v({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:v({onTouchCancel:!0}),captured:v({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:v({onTouchEnd:!0}),captured:v({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:v({onTouchMove:!0}),captured:v({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:v({onTouchStart:!0}),captured:v({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:v({onWheel:!0}),captured:v({onWheelCapture:!0})}}},_={topBlur:y.blur,topClick:y.click,topContextMenu:y.contextMenu,topCopy:y.copy,topCut:y.cut,topDoubleClick:y.doubleClick,topDrag:y.drag,topDragEnd:y.dragEnd,topDragEnter:y.dragEnter,topDragExit:y.dragExit,topDragLeave:y.dragLeave,topDragOver:y.dragOver,topDragStart:y.dragStart,topDrop:y.drop,topError:y.error,topFocus:y.focus,topInput:y.input,topKeyDown:y.keyDown,topKeyPress:y.keyPress,topKeyUp:y.keyUp,topLoad:y.load,topMouseDown:y.mouseDown,topMouseMove:y.mouseMove,topMouseOut:y.mouseOut,topMouseOver:y.mouseOver,topMouseUp:y.mouseUp,topPaste:y.paste,topReset:y.reset,topScroll:y.scroll,topSubmit:y.submit,topTouchCancel:y.touchCancel,topTouchEnd:y.touchEnd,topTouchMove:y.touchMove,topTouchStart:y.touchStart,topWheel:y.wheel};for(var w in _)_[w].dependencies=[w];var E={eventTypes:y,executeDispatch:function(e,t,n){var o=a.executeDispatch(e,t,n);o===!1&&(e.stopPropagation(),e.preventDefault())},extractEvents:function(e,t,n,o){var a=_[e];if(!a)return null;var v;switch(e){case g.topInput:case g.topLoad:case g.topError:case g.topReset:case g.topSubmit:v=l;break;case g.topKeyPress:if(0===h(o))return null;case g.topKeyDown:case g.topKeyUp:v=i;break;case g.topBlur:case g.topFocus:v=c;break;case g.topClick:if(2===o.button)return null;case g.topContextMenu:case g.topDoubleClick:case g.topMouseDown:case g.topMouseMove:case g.topMouseOut:case g.topMouseOver:case g.topMouseUp:v=u;break;case g.topDrag:case g.topDragEnd:case g.topDragEnter:case g.topDragExit:case g.topDragLeave:case g.topDragOver:case g.topDragStart:case g.topDrop:v=p;break;case g.topTouchCancel:case g.topTouchEnd:case g.topTouchMove:case g.topTouchStart:v=d;break;case g.topScroll:v=m;break;case g.topWheel:v=b;break;case g.topCopy:case g.topCut:case g.topPaste:v=s}f(v);var y=v.getPooled(a,n,o);return r.accumulateTwoPhaseDispatches(y),y}};t.exports=E},{"./EventConstants":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventConstants.js","./EventPluginUtils":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPluginUtils.js","./EventPropagators":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/EventPropagators.js","./SyntheticClipboardEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticClipboardEvent.js","./SyntheticDragEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticDragEvent.js","./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./SyntheticFocusEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticFocusEvent.js","./SyntheticKeyboardEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticKeyboardEvent.js","./SyntheticMouseEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js","./SyntheticTouchEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticTouchEvent.js","./SyntheticUIEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./SyntheticWheelEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticWheelEvent.js","./getEventCharCode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./keyOf":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticClipboardEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticEvent"),r={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};a.augmentClass(o,r),t.exports=o},{"./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticCompositionEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticEvent"),r={data:null};a.augmentClass(o,r),t.exports=o},{"./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticDragEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticMouseEvent"),r={dataTransfer:null};a.augmentClass(o,r),t.exports=o},{"./SyntheticMouseEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js":[function(e,t,n){"use strict";function o(e,t,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var a in o)if(o.hasOwnProperty(a)){var r=o[a];r?this[a]=r(n):this[a]=n[a]}var l=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;l?this.isDefaultPrevented=s.thatReturnsTrue:this.isDefaultPrevented=s.thatReturnsFalse,this.isPropagationStopped=s.thatReturnsFalse}var a=e("./PooledClass"),r=e("./Object.assign"),s=e("./emptyFunction"),l=e("./getEventTarget"),c={type:null,target:l,currentTarget:s.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};r(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=s.thatReturnsTrue},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=s.thatReturnsTrue},persist:function(){this.isPersistent=s.thatReturnsTrue},isPersistent:s.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}}),o.Interface=c,o.augmentClass=function(e,t){var n=this,o=Object.create(n.prototype);r(o,e.prototype),e.prototype=o,e.prototype.constructor=e,e.Interface=r({},n.Interface,t),e.augmentClass=n.augmentClass,a.addPoolingTo(e,a.threeArgumentPooler)},a.addPoolingTo(o,a.threeArgumentPooler),t.exports=o},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./PooledClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/PooledClass.js","./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js","./getEventTarget":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventTarget.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticFocusEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticUIEvent"),r={relatedTarget:null};a.augmentClass(o,r),t.exports=o},{"./SyntheticUIEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticInputEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticEvent"),r={data:null};a.augmentClass(o,r),t.exports=o},{"./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticKeyboardEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticUIEvent"),r=e("./getEventCharCode"),s=e("./getEventKey"),l=e("./getEventModifierState"),c={key:s,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:l,charCode:function(e){return"keypress"===e.type?r(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?r(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};a.augmentClass(o,c),t.exports=o},{"./SyntheticUIEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./getEventCharCode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js","./getEventKey":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventKey.js","./getEventModifierState":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticUIEvent"),r=e("./ViewportMetrics"),s=e("./getEventModifierState"),l={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:s,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+r.currentScrollLeft},pageY:function(e){return"pageY"in e?e.pageY:e.clientY+r.currentScrollTop}};a.augmentClass(o,l),t.exports=o},{"./SyntheticUIEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./ViewportMetrics":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js","./getEventModifierState":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticTouchEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticUIEvent"),r=e("./getEventModifierState"),s={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:r};a.augmentClass(o,s),t.exports=o},{"./SyntheticUIEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js","./getEventModifierState":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticUIEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticEvent"),r=e("./getEventTarget"),s={view:function(e){if(e.view)return e.view;var t=r(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}};a.augmentClass(o,s),t.exports=o},{"./SyntheticEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticEvent.js","./getEventTarget":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventTarget.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticWheelEvent.js":[function(e,t,n){"use strict";function o(e,t,n){a.call(this,e,t,n)}var a=e("./SyntheticMouseEvent"),r={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};a.augmentClass(o,r),t.exports=o},{"./SyntheticMouseEvent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/SyntheticMouseEvent.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Transaction.js":[function(e,t,n){"use strict";var o=e("./invariant"),a={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,a,r,s,l,c){o(!this.isInTransaction());var i,u;try{this._isInTransaction=!0,i=!0,this.initializeAll(0),u=e.call(t,n,a,r,s,l,c),i=!1}finally{try{if(i)try{this.closeAll(0)}catch(p){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return u},initializeAll:function(e){for(var t=this.transactionWrappers,n=e;n<t.length;n++){var o=t[n];try{this.wrapperInitData[n]=r.OBSERVED_ERROR,this.wrapperInitData[n]=o.initialize?o.initialize.call(this):null}finally{if(this.wrapperInitData[n]===r.OBSERVED_ERROR)try{this.initializeAll(n+1)}catch(a){}}}},closeAll:function(e){o(this.isInTransaction());for(var t=this.transactionWrappers,n=e;n<t.length;n++){var a,s=t[n],l=this.wrapperInitData[n];try{a=!0,l!==r.OBSERVED_ERROR&&s.close&&s.close.call(this,l),a=!1}finally{if(a)try{this.closeAll(n+1)}catch(c){}}}this.wrapperInitData.length=0}},r={Mixin:a,OBSERVED_ERROR:{}};t.exports=r},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ViewportMetrics.js":[function(e,t,n){"use strict";var o={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){o.currentScrollLeft=e.x,o.currentScrollTop=e.y}};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/accumulateInto.js":[function(e,t,n){"use strict";function o(e,t){if(a(null!=t),null==e)return t;var n=Array.isArray(e),o=Array.isArray(t);return n&&o?(e.push.apply(e,t),e):n?(e.push(t),e):o?[e].concat(t):[e,t]}var a=e("./invariant");t.exports=o},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/adler32.js":[function(e,t,n){"use strict";function o(e){for(var t=1,n=0,o=0;o<e.length;o++)t=(t+e.charCodeAt(o))%a,n=(n+t)%a;return t|n<<16}var a=65521;t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/camelize.js":[function(e,t,n){function o(e){return e.replace(a,function(e,t){return t.toUpperCase()})}var a=/-(.)/g;t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/camelizeStyleName.js":[function(e,t,n){"use strict";function o(e){return a(e.replace(r,"ms-"))}var a=e("./camelize"),r=/^-ms-/;t.exports=o},{"./camelize":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/camelize.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/containsNode.js":[function(e,t,n){function o(e,t){return e&&t?e===t?!0:a(e)?!1:a(t)?o(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var a=e("./isTextNode");t.exports=o},{"./isTextNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isTextNode.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/createArrayFromMixed.js":[function(e,t,n){function o(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 a(e){return o(e)?Array.isArray(e)?e.slice():r(e):[e]}var r=e("./toArray");t.exports=a},{"./toArray":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/toArray.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/createFullPageComponent.js":[function(e,t,n){"use strict";function o(e){var t=r.createFactory(e),n=a.createClass({tagName:e.toUpperCase(),displayName:"ReactFullPageComponent"+e,componentWillUnmount:function(){s(!1)},render:function(){return t(this.props)}});return n}var a=e("./ReactClass"),r=e("./ReactElement"),s=e("./invariant");t.exports=o},{"./ReactClass":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactClass.js","./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/createNodesFromMarkup.js":[function(e,t,n){function o(e){var t=e.match(u);return t&&t[1].toLowerCase()}function a(e,t){var n=i;c(!!i);var a=o(e),r=a&&l(a);if(r){n.innerHTML=r[1]+e+r[2];for(var u=r[0];u--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(c(t),s(p).forEach(t));for(var d=s(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return d}var r=e("./ExecutionEnvironment"),s=e("./createArrayFromMixed"),l=e("./getMarkupWrap"),c=e("./invariant"),i=r.canUseDOM?document.createElement("div"):null,u=/^\s*<(\w+)/;t.exports=a},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./createArrayFromMixed":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/createArrayFromMixed.js","./getMarkupWrap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getMarkupWrap.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/dangerousStyleValue.js":[function(e,t,n){"use strict";function o(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var o=isNaN(t);return o||0===t||r.hasOwnProperty(e)&&r[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var a=e("./CSSProperty"),r=a.isUnitlessNumber;t.exports=o},{"./CSSProperty":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/CSSProperty.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js":[function(e,t,n){function o(e){return function(){return e}}function a(){}a.thatReturns=o,a.thatReturnsFalse=o(!1),a.thatReturnsTrue=o(!0),a.thatReturnsNull=o(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyObject.js":[function(e,t,n){"use strict";var o={};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js":[function(e,t,n){"use strict";function o(e){return r[e]}function a(e){return(""+e).replace(s,o)}var r={"&":"&",">":">","<":"<",'"':""","'":"'"},s=/[&><"']/g;t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/findDOMNode.js":[function(e,t,n){"use strict";function o(e){return null==e?null:l(e)?e:a.has(e)?r.getNodeFromInstance(e):(s(null==e.render||"function"!=typeof e.render),void s(!1))}var a=(e("./ReactCurrentOwner"),e("./ReactInstanceMap")),r=e("./ReactMount"),s=e("./invariant"),l=e("./isNode");e("./warning");t.exports=o},{"./ReactCurrentOwner":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCurrentOwner.js","./ReactInstanceMap":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceMap.js","./ReactMount":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactMount.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./isNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isNode.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/flattenChildren.js":[function(e,t,n){"use strict";function o(e,t,n){var o=e,a=!o.hasOwnProperty(n);a&&null!=t&&(o[n]=t)}function a(e){if(null==e)return e;var t={};return r(e,o,t),t}var r=e("./traverseAllChildren");e("./warning");t.exports=a},{"./traverseAllChildren":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/focusNode.js":[function(e,t,n){"use strict";function o(e){try{e.focus()}catch(t){}}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/forEachAccumulated.js":[function(e,t,n){"use strict";var o=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getActiveElement.js":[function(e,t,n){function o(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js":[function(e,t,n){"use strict";function o(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=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventKey.js":[function(e,t,n){"use strict";function o(e){if(e.key){var t=r[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=a(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?s[e.keyCode]||"Unidentified":""}var a=e("./getEventCharCode"),r={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s={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=o},{"./getEventCharCode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventCharCode.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventModifierState.js":[function(e,t,n){"use strict";function o(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var o=r[e];return o?!!n[o]:!1}function a(e){return o}var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=a},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getEventTarget.js":[function(e,t,n){"use strict";function o(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js":[function(e,t,n){"use strict";function o(e){var t=e&&(a&&e[a]||e[r]);return"function"==typeof t?t:void 0}var a="function"==typeof Symbol&&Symbol.iterator,r="@@iterator";t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getMarkupWrap.js":[function(e,t,n){function o(e){return r(!!s),d.hasOwnProperty(e)||(e="*"),l.hasOwnProperty(e)||("*"===e?s.innerHTML="<link />":s.innerHTML="<"+e+"></"+e+">",l[e]=!s.firstChild),l[e]?d[e]:null}var a=e("./ExecutionEnvironment"),r=e("./invariant"),s=a.canUseDOM?document.createElement("div"):null,l={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},c=[1,'<select multiple="true">',"</select>"],i=[1,"<table>","</table>"],u=[3,"<table><tbody><tr>","</tr></tbody></table>"],p=[1,"<svg>","</svg>"],d={"*":[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:c,option:c,caption:i,colgroup:i,tbody:i,tfoot:i,thead:i,td:u,th:u,circle:p,defs:p,ellipse:p,g:p,line:p,linearGradient:p,path:p,polygon:p,polyline:p,radialGradient:p,rect:p,stop:p,text:p};t.exports=o},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getNodeForCharacterOffset.js":[function(e,t,n){"use strict";function o(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function a(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function r(e,t){for(var n=o(e),r=0,s=0;n;){if(3===n.nodeType){if(s=r+n.textContent.length,t>=r&&s>=t)return{node:n,offset:t-r};r=s}n=o(a(n))}}t.exports=r},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getReactRootElementInContainer.js":[function(e,t,n){"use strict";function o(e){return e?e.nodeType===a?e.documentElement:e.firstChild:null}var a=9;t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getTextContentAccessor.js":[function(e,t,n){"use strict";function o(){return!r&&a.canUseDOM&&(r="textContent"in document.documentElement?"textContent":"innerText"),r}var a=e("./ExecutionEnvironment"),r=null;t.exports=o},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getUnboundedScrollPosition.js":[function(e,t,n){"use strict";function o(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/hyphenate.js":[function(e,t,n){function o(e){return e.replace(a,"-$1").toLowerCase()}var a=/([A-Z])/g;t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/hyphenateStyleName.js":[function(e,t,n){"use strict";function o(e){return a(e).replace(r,"-ms-")}var a=e("./hyphenate"),r=/^ms-/;t.exports=o},{"./hyphenate":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/hyphenate.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/instantiateReactComponent.js":[function(e,t,n){"use strict";function o(e){return"function"==typeof e&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e,t){var n;if(null!==e&&e!==!1||(e=s.emptyElement),"object"==typeof e){var a=e;n=t===a.type&&"string"==typeof a.type?l.createInternalComponent(a):o(a.type)?new a.type(a):new u}else"string"==typeof e||"number"==typeof e?n=l.createInstanceForText(e):i(!1);return n.construct(e),n._mountIndex=0,n._mountImage=null,n}var r=e("./ReactCompositeComponent"),s=e("./ReactEmptyComponent"),l=e("./ReactNativeComponent"),c=e("./Object.assign"),i=e("./invariant"),u=(e("./warning"),function(){});c(u.prototype,r.Mixin,{_instantiateReactComponent:a}),t.exports=a},{"./Object.assign":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/Object.assign.js","./ReactCompositeComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactCompositeComponent.js","./ReactEmptyComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactEmptyComponent.js","./ReactNativeComponent":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactNativeComponent.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js":[function(e,t,n){"use strict";var o=function(e,t,n,o,a,r,s,l){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=[n,o,a,r,s,l],u=0;c=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return i[u++]}))}throw c.framesToPop=1,c}};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isEventSupported.js":[function(e,t,n){"use strict";function o(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,o=n in document;if(!o){var s=document.createElement("div");s.setAttribute(n,"return;"),o="function"==typeof s[n]}return!o&&a&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}var a,r=e("./ExecutionEnvironment");r.canUseDOM&&(a=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=o},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isNode.js":[function(e,t,n){function o(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isTextInputElement.js":[function(e,t,n){"use strict";function o(e){return e&&("INPUT"===e.nodeName&&a[e.type]||"TEXTAREA"===e.nodeName)}var a={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=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isTextNode.js":[function(e,t,n){function o(e){return a(e)&&3==e.nodeType}var a=e("./isNode");t.exports=o},{"./isNode":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/isNode.js"}],
"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyMirror.js":[function(e,t,n){"use strict";var o=e("./invariant"),a=function(e){var t,n={};o(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};t.exports=a},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/keyOf.js":[function(e,t,n){var o=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/mapObject.js":[function(e,t,n){"use strict";function o(e,t,n){if(!e)return null;var o={};for(var r in e)a.call(e,r)&&(o[r]=t.call(n,e[r],r,e));return o}var a=Object.prototype.hasOwnProperty;t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/memoizeStringOnly.js":[function(e,t,n){"use strict";function o(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/onlyChild.js":[function(e,t,n){"use strict";function o(e){return r(a.isValidElement(e)),e}var a=e("./ReactElement"),r=e("./invariant");t.exports=o},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/performance.js":[function(e,t,n){"use strict";var o,a=e("./ExecutionEnvironment");a.canUseDOM&&(o=window.performance||window.msPerformance||window.webkitPerformance),t.exports=o||{}},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/performanceNow.js":[function(e,t,n){var o=e("./performance");o&&o.now||(o=Date);var a=o.now.bind(o);t.exports=a},{"./performance":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/performance.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/quoteAttributeValueForBrowser.js":[function(e,t,n){"use strict";function o(e){return'"'+a(e)+'"'}var a=e("./escapeTextContentForBrowser");t.exports=o},{"./escapeTextContentForBrowser":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js":[function(e,t,n){"use strict";var o=e("./ExecutionEnvironment"),a=/^[ \r\n\t\f]/,r=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,s=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(s=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),o.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(s=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&r.test(t)){e.innerHTML="\ufeff"+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=s},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/setTextContent.js":[function(e,t,n){"use strict";var o=e("./ExecutionEnvironment"),a=e("./escapeTextContentForBrowser"),r=e("./setInnerHTML"),s=function(e,t){e.textContent=t};o.canUseDOM&&("textContent"in document.documentElement||(s=function(e,t){r(e,a(t))})),t.exports=s},{"./ExecutionEnvironment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ExecutionEnvironment.js","./escapeTextContentForBrowser":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/escapeTextContentForBrowser.js","./setInnerHTML":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/setInnerHTML.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/shallowEqual.js":[function(e,t,n){"use strict";function o(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=o},{}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/shouldUpdateReactComponent.js":[function(e,t,n){"use strict";function o(e,t){if(null!=e&&null!=t){var n=typeof e,o=typeof t;if("string"===n||"number"===n)return"string"===o||"number"===o;if("object"===o&&e.type===t.type&&e.key===t.key){var a=e._owner===t._owner;return a}}return!1}e("./warning");t.exports=o},{"./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/toArray.js":[function(e,t,n){function o(e){var t=e.length;if(a(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),a("number"==typeof t),a(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var o=Array(t),r=0;t>r;r++)o[r]=e[r];return o}var a=e("./invariant");t.exports=o},{"./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/traverseAllChildren.js":[function(e,t,n){"use strict";function o(e){return f[e]}function a(e,t){return e&&null!=e.key?s(e.key):t.toString(36)}function r(e){return(""+e).replace(v,o)}function s(e){return"$"+r(e)}function l(e,t,n,o,r){var c=typeof e;if("undefined"!==c&&"boolean"!==c||(e=null),null===e||"string"===c||"number"===c||i.isValidElement(e))return o(r,e,""===t?b+a(e,0):t,n),1;var p,f,v,g=0;if(Array.isArray(e))for(var y=0;y<e.length;y++)p=e[y],f=(""!==t?t+h:b)+a(p,y),v=n+g,g+=l(p,f,v,o,r);else{var _=d(e);if(_){var w,E=_.call(e);if(_!==e.entries)for(var C=0;!(w=E.next()).done;)p=w.value,f=(""!==t?t+h:b)+a(p,C++),v=n+g,g+=l(p,f,v,o,r);else for(;!(w=E.next()).done;){var R=w.value;R&&(p=R[1],f=(""!==t?t+h:b)+s(R[0])+h+a(p,0),v=n+g,g+=l(p,f,v,o,r))}}else if("object"===c){m(1!==e.nodeType);var k=u.extract(e);for(var j in k)k.hasOwnProperty(j)&&(p=k[j],f=(""!==t?t+h:b)+s(j)+h+a(p,0),v=n+g,g+=l(p,f,v,o,r))}}return g}function c(e,t,n){return null==e?0:l(e,"",0,t,n)}var i=e("./ReactElement"),u=e("./ReactFragment"),p=e("./ReactInstanceHandles"),d=e("./getIteratorFn"),m=e("./invariant"),b=(e("./warning"),p.SEPARATOR),h=":",f={"=":"=0",".":"=1",":":"=2"},v=/[=.:]/g;t.exports=c},{"./ReactElement":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactElement.js","./ReactFragment":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactFragment.js","./ReactInstanceHandles":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/ReactInstanceHandles.js","./getIteratorFn":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/getIteratorFn.js","./invariant":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/invariant.js","./warning":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/warning.js":[function(e,t,n){"use strict";var o=e("./emptyFunction"),a=o;t.exports=a},{"./emptyFunction":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/emptyFunction.js"}],"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js":[function(e,t,n){t.exports=e("./lib/React")},{"./lib/React":"/home/allen/workspace/react-bootstrap-table/node_modules/react/lib/React.js"}],"/home/allen/workspace/react-bootstrap-table/src/BootstrapTable.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function b(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:b(a,t,n)}if("value"in o&&o.writable)return o.value;var r=o.get;if(void 0!==r)return r.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=o(e("react")),i=(o(e("classnames")),o(e("./Const"))),u=o(e("./TableHeader")),p=o(e("./TableBody")),d=o(e("./pagination/PaginationList")),m=function(e){function t(e){l(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={data:this.props.data},this.sortTable=!1,this.order=i.SORT_DESC,this.sortField=null}return s(t,e),a(t,{componentWillMount:{value:function(){this.props.pagination&&this.handlePaginationData(1,i.SIZE_PER_PAGE)}},componentDidMount:{value:function(){this._adjustHeaderWidth()}},componentDidUpdate:{value:function(){this._adjustHeaderWidth()}},render:{value:function(){var e={height:this.props.height,marginBottom:"37px"},t=this.props.children.map(function(e,t){return e.props.dataSort&&(this.sortTable=!0),{name:e.props.dataField,align:e.props.dataAlign,sort:e.props.dataSort,format:e.props.dataFormat,index:t}},this),n=this.renderPagination();return c.createElement("div",null,c.createElement("div",{ref:"table",style:e},c.createElement(u,{onSort:this.handleSort.bind(this)},this.props.children),c.createElement(p,{data:this.state.data,columns:t,striped:this.props.striped,hover:this.props.hover,condensed:this.props.condensed})),c.createElement("div",null,n))}},handleSort:{value:function(e,t){this.order=e,this.sortField=t,this.setState({data:this._sort(this.state.data,e,t)})}},handlePaginationData:{value:function(e,t){for(var n=e*t-1,o=n-(t-1),a=[],r=o;n>=r&&(a.push(this.props.data[r]),r+1!=this.props.data.length);r++);this.sortTable&&null!=this.sortField&&(a=this._sort(a,this.order,this.sortField)),this.setState({data:a})}},_sort:{value:function(e,t,n){return e.sort(function(e,o){return t==i.SORT_ASC?e[n]>o[n]?-1:e[n]<o[n]?1:0:e[n]<o[n]?-1:e[n]>o[n]?1:0}),e}},_adjustHeaderWidth:{value:function(){this.refs.table.getDOMNode().childNodes[0].childNodes[0].style.width=this.refs.table.getDOMNode().childNodes[1].childNodes[0].offsetWidth-1+"px"}},renderPagination:{value:function(){return this.props.pagination?c.createElement(d,{changePage:this.handlePaginationData.bind(this),sizePerPage:i.SIZE_PER_PAGE,dataSize:this.props.data.length}):null}}}),t}(c.Component);m.propTypes={height:c.PropTypes.string,data:c.PropTypes.array,striped:c.PropTypes.bool,hover:c.PropTypes.bool,condensed:c.PropTypes.bool,pagination:c.PropTypes.bool},m.defaultProps={height:"100%",striped:!1,hover:!1,condensed:!1,pagination:!1},t.exports=m},{"./Const":"/home/allen/workspace/react-bootstrap-table/src/Const.js","./TableBody":"/home/allen/workspace/react-bootstrap-table/src/TableBody.js","./TableHeader":"/home/allen/workspace/react-bootstrap-table/src/TableHeader.js","./pagination/PaginationList":"/home/allen/workspace/react-bootstrap-table/src/pagination/PaginationList.js",classnames:"/home/allen/workspace/react-bootstrap-table/node_modules/classnames/index.js",react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/Const.js":[function(e,t,n){"use strict";t.exports={SORT_DESC:"desc",SORT_ASC:"asc",SIZE_PER_PAGE:10,SIZE_PER_LIST:5,NEXT_PAGE:">",LAST_PAGE:">>",PRE_PAGE:"<",FIRST_PAGE:"<<"}},{}],"/home/allen/workspace/react-bootstrap-table/src/TableBody.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),c=o(e("./TableRow")),i=o(e("./TableColumn")),u=o(e("classnames")),p=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),a(t,{render:{value:function(){var e=u("table-container"),t=u("table","table-bordered",{"table-striped":this.props.striped,"table-hover":this.props.hover,"table-condensed":this.props.condensed}),n=this.props.data.map(function(e){var t=this.props.columns.map(function(t){var n=e[t.name];return"undefined"!=typeof t.format?(n=t.format(n,e),l.createElement(i,{dataAlign:t.align},l.createElement("div",{dangerouslySetInnerHTML:{__html:n}}))):l.createElement(i,{dataAlign:t.align},n)});return l.createElement(c,null,t)},this);return l.createElement("div",{className:e},l.createElement("table",{className:t},l.createElement("tbody",null,n)))}}}),t}(l.Component);p.propTypes={data:l.PropTypes.array,columns:l.PropTypes.array,striped:l.PropTypes.bool,hover:l.PropTypes.bool,condensed:l.PropTypes.bool},t.exports=p},{"./TableColumn":"/home/allen/workspace/react-bootstrap-table/src/TableColumn.js","./TableRow":"/home/allen/workspace/react-bootstrap-table/src/TableRow.js",classnames:"/home/allen/workspace/react-bootstrap-table/node_modules/classnames/index.js",react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/TableColumn.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),c=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),a(t,{render:{value:function(){var e={textAlign:this.props.dataAlign};return l.createElement("td",{style:e},this.props.children)}}}),t}(l.Component);c.propTypes={dataAlign:l.PropTypes.string},c.defaultProps={dataAlign:"left"},t.exports=c},{react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/TableHeader.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function p(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:p(a,t,n)}if("value"in o&&o.writable)return o.value;var r=o.get;if(void 0!==r)return r.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=o(e("react")),i=o(e("classnames")),u=function(e){function t(e){l(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.props.children.forEach(function(e){e.props.clearSortCaret=this.clearSortCaret.bind(this)},this)}return s(t,e),a(t,{clearSortCaret:{value:function(e,t){for(var n=this.refs.header.getDOMNode(),o=0;o<n.childElementCount;o++){var a=n.childNodes[o].childNodes[0];a.getElementsByClassName("order").length>0&&a.removeChild(a.getElementsByClassName("order")[0])}this.props.onSort(e,t)}},render:{value:function(){var e=i("table-header"),t={borderBottomStyle:"hidden"};return c.createElement("div",{className:e},c.createElement("table",{className:"table table-hover table-bordered"},c.createElement("thead",null,c.createElement("tr",{ref:"header",style:t},this.props.children))))}}}),t}(c.Component);t.exports=u},{classnames:"/home/allen/workspace/react-bootstrap-table/node_modules/classnames/index.js",react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/TableHeaderColumn.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),c=o(e("classnames")),i=o(e("./Const")),u=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),a(t,{handleColumnClick:{value:function(e){this.props.dataSort&&(this.order=this.order==i.SORT_DESC?i.SORT_ASC:i.SORT_DESC,this.props.clearSortCaret(this.order,this.props.dataField),this.refs.innerDiv.getDOMNode().appendChild(this.renderSortCaret()))}},render:{value:function(){var e={textAlign:this.props.dataAlign},t=c(this.props.dataSort?"sort-column":"");return l.createElement("th",{className:t,style:e},l.createElement("div",{ref:"innerDiv",className:"th-inner table-header-column",onClick:this.handleColumnClick.bind(this)},this.props.children))}},renderSortCaret:{value:function(){var e=document.createElement("span");e.className="order",this.order==i.SORT_ASC&&(e.className+=" dropup");var t=document.createElement("span");return t.className="caret",t.style.margin="10px 5px",e.appendChild(t),e}}}),t}(l.Component);u.propTypes={dataField:l.PropTypes.string,dataAlign:l.PropTypes.string,dataSort:l.PropTypes.bool,clearSortCaret:l.PropTypes.func,dataFormat:l.PropTypes.func},u.defaultProps={dataAlign:"left",dataSort:!1,dataFormat:void 0},t.exports=u},{"./Const":"/home/allen/workspace/react-bootstrap-table/src/Const.js",classnames:"/home/allen/workspace/react-bootstrap-table/node_modules/classnames/index.js",react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/TableRow.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},s=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=o(e("react")),c=function(e){function t(){s(this,t),null!=e&&e.apply(this,arguments)}return r(t,e),a(t,{render:{value:function(){return l.createElement("tr",null,this.props.children)}}}),t}(l.Component);t.exports=c},{react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/pagination/PageButton.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function p(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:p(a,t,n)}if("value"in o&&o.writable)return o.value;var r=o.get;if(void 0!==r)return r.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=o(e("react")),i=o(e("classnames")),u=function(e){function t(e){l(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e)}return s(t,e),a(t,{pageBtnClick:{value:function(e){e.preventDefault(),this.props.changePage(e.currentTarget.text)}},render:{value:function(){var e=this.props.active?i("active"):null;return c.createElement("li",{className:e},c.createElement("a",{href:"#",onClick:this.pageBtnClick.bind(this)},this.props.children))}}}),t}(c.Component);u.propTypes={changePage:c.PropTypes.func,active:c.PropTypes.bool},t.exports=u},{classnames:"/home/allen/workspace/react-bootstrap-table/node_modules/classnames/index.js",react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}],"/home/allen/workspace/react-bootstrap-table/src/pagination/PaginationList.js":[function(e,t,n){"use strict";var o=function(e){return e&&e.__esModule?e["default"]:e},a=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function d(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:d(a,t,n)}if("value"in o&&o.writable)return o.value;var r=o.get;if(void 0!==r)return r.call(n)},s=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=o(e("react")),i=o(e("./PageButton.js")),u=o(e("../Const")),p=function(e){function t(e){l(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.sizePerList=u.SIZE_PER_LIST,this.totalPages=Math.ceil(this.props.dataSize/this.props.sizePerPage),this.state={currentPage:1,sizePerPage:this.props.sizePerPage}}return s(t,e),a(t,{changePage:{value:function(e){e=e==u.PRE_PAGE?this.state.currentPage-1<1?1:this.state.currentPage-1:e==u.NEXT_PAGE?this.state.currentPage+1>this.totalPages?this.totalPages:this.state.currentPage+1:e==u.LAST_PAGE?this.totalPages:e==u.FIRST_PAGE?1:parseInt(e),e!=this.state.currentPage&&(this.setState({currentPage:e}),this.props.changePage(e,this.state.sizePerPage))}},changeSizePerPage:{value:function(e){e.preventDefault();var t=parseInt(e.currentTarget.text);t!=this.state.sizePerPage&&(this.totalPages=Math.ceil(this.props.dataSize/t),this.state.currentPage>this.totalPages&&(this.state.currentPage=this.totalPages),this.setState({sizePerPage:t,currentPage:this.state.currentPage}),this.props.changePage(this.state.currentPage,t))}},render:{value:function(){var e=this.makePage(),t={marginTop:"0px"};return c.createElement("div",{className:"row"},c.createElement("div",{className:"col-md-1"},c.createElement("div",{className:"dropdown"},c.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"pageDropDown","data-toggle":"dropdown","aria-expanded":"true"},this.state.sizePerPage,c.createElement("span",{className:"caret"})),c.createElement("ul",{className:"dropdown-menu",role:"menu","aria-labelledby":"pageDropDown"},c.createElement("li",{role:"presentation"},c.createElement("a",{role:"menuitem",tabindex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"10")),c.createElement("li",{role:"presentation"},c.createElement("a",{role:"menuitem",tabindex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"25")),c.createElement("li",{role:"presentation"},c.createElement("a",{role:"menuitem",tabindex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"30")),c.createElement("li",{role:"presentation"},c.createElement("a",{role:"menuitem",tabindex:"-1",href:"#",onClick:this.changeSizePerPage.bind(this)},"50"))))),c.createElement("div",{className:"col-md-6"},c.createElement("ul",{className:"pagination",style:t},e)))}},makePage:{value:function(){var e=this.getPages();return e.map(function(e){var t=e==this.state.currentPage;return c.createElement(i,{changePage:this.changePage.bind(this),active:t},e)},this)}},getPages:{value:function(){var e=1,t=this.totalPages;e=Math.max(this.state.currentPage-Math.floor(this.sizePerList/2),1),t=e+this.sizePerList-1,t>this.totalPages&&(t=this.totalPages,e=t-this.sizePerList+1);for(var n=[u.FIRST_PAGE,u.PRE_PAGE],o=e;t>=o;o++)o>0&&n.push(o);return n.push(u.NEXT_PAGE),n.push(u.LAST_PAGE),n}}}),t}(c.Component);p.propTypes={sizePerPage:c.PropTypes["int"],dataSize:c.PropTypes["int"],changePage:c.PropTypes.func},p.defaultProps={sizePerPage:u.SIZE_PER_PAGE},t.exports=p},{"../Const":"/home/allen/workspace/react-bootstrap-table/src/Const.js","./PageButton.js":"/home/allen/workspace/react-bootstrap-table/src/pagination/PageButton.js",react:"/home/allen/workspace/react-bootstrap-table/node_modules/react/react.js"}]},{},["./src/index.js"]);
//# sourceMappingURL=react-bootstrap-table.min.js.map |
src/Irinamaps/EditButtons.js | guitarbeard/Irinamaps | import React, { Component } from 'react';
import './EditButtons.scss';
export default class EditButtons extends Component {
render() {
return (
<div>
<button onClick={() => this.props.onMoreInfoClick()} id="more-info" className="edit-button mdl-button mdl-js-button mdl-button--fab" type="button">
<i className="material-icons">help</i>
</button>
<div className="mdl-tooltip" htmlFor="more-info">More Info</div>
<button onClick={() => this.props.onEditLocationClick()} id="edit-home" className="edit-button mdl-button mdl-js-button mdl-button--fab">
<i className="material-icons">edit_location</i>
</button>
<div className="mdl-tooltip" htmlFor="edit-home">Edit Location</div>
<button onClick={() => this.props.onHomeClick()} id="take-me-home" className="edit-button mdl-button mdl-js-button mdl-button--fab" type="button">
<i className="material-icons">my_location</i>
</button>
<div className="mdl-tooltip" htmlFor="take-me-home">My Location</div>
</div>
);
}
}
|
src/svg-icons/content/content-cut.js | jacklam718/react-svg-iconx | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ContentContentCut = (props) => (
<SvgIcon {...props}>
<path d="M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z"/>
</SvgIcon>
);
ContentContentCut = pure(ContentContentCut);
ContentContentCut.displayName = 'ContentContentCut';
ContentContentCut.muiName = 'SvgIcon';
export default ContentContentCut;
|
node_modules/react-bootstrap/es/PaginationButton.js | cmccandless/SolRFrontEnd | import _extends from 'babel-runtime/helpers/extends';
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import classNames from 'classnames';
import React from 'react';
import elementType from 'react-prop-types/lib/elementType';
import SafeAnchor from './SafeAnchor';
import createChainedFunction from './utils/createChainedFunction';
// TODO: This should be `<Pagination.Item>`.
// TODO: This should use `componentClass` like other components.
var propTypes = {
componentClass: elementType,
className: React.PropTypes.string,
eventKey: React.PropTypes.any,
onSelect: React.PropTypes.func,
disabled: React.PropTypes.bool,
active: React.PropTypes.bool,
onClick: React.PropTypes.func
};
var defaultProps = {
componentClass: SafeAnchor,
active: false,
disabled: false
};
var PaginationButton = function (_React$Component) {
_inherits(PaginationButton, _React$Component);
function PaginationButton(props, context) {
_classCallCheck(this, PaginationButton);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.handleClick = _this.handleClick.bind(_this);
return _this;
}
PaginationButton.prototype.handleClick = function handleClick(event) {
var _props = this.props,
disabled = _props.disabled,
onSelect = _props.onSelect,
eventKey = _props.eventKey;
if (disabled) {
return;
}
if (onSelect) {
onSelect(eventKey, event);
}
};
PaginationButton.prototype.render = function render() {
var _props2 = this.props,
Component = _props2.componentClass,
active = _props2.active,
disabled = _props2.disabled,
onClick = _props2.onClick,
className = _props2.className,
style = _props2.style,
props = _objectWithoutProperties(_props2, ['componentClass', 'active', 'disabled', 'onClick', 'className', 'style']);
if (Component === SafeAnchor) {
// Assume that custom components want `eventKey`.
delete props.eventKey;
}
delete props.onSelect;
return React.createElement(
'li',
{
className: classNames(className, { active: active, disabled: disabled }),
style: style
},
React.createElement(Component, _extends({}, props, {
disabled: disabled,
onClick: createChainedFunction(onClick, this.handleClick)
}))
);
};
return PaginationButton;
}(React.Component);
PaginationButton.propTypes = propTypes;
PaginationButton.defaultProps = defaultProps;
export default PaginationButton; |
src/index.js | dadifeihong/react-gallery | import 'core-js/fn/object/assign';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/Main';
// Render the main component into the dom
ReactDOM.render(<App />, document.getElementById('app'));
|
packages/spust-koa/src/__tests__/Cors.js | michalkvasnicak/spust | // @flow
import React from 'react';
import test from 'supertest';
import Cors from '../Cors';
import Server from '../Server';
import serve from '../';
describe('Cors', () => {
it('provides session to middleware context', async () => {
const server = serve(
<Server port={3000}>
<Cors />
</Server>,
false,
);
await test(server.app.callback())
.options('/')
.set('Origin', 'http://test')
.set('Access-Control-Request-Method', 'GET')
.expect(204)
.expect('Access-Control-Allow-Origin', 'http://test');
});
});
|
code/require-context-usage/route-demo/src/app/modules/shop/Shop.js | wuchangming/blog | import React from 'react';
export default function() {
return (
<div>
商品购买页
</div>
);
}
|
fixtures/packaging/systemjs-builder/prod/input.js | maxschmeling/react | import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
React.createElement('h1', null, 'Hello World!'),
document.getElementById('container')
);
|
ajax/libs/material-ui/4.12.3/esm/RootRef/RootRef.js | cdnjs/cdnjs | import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import { exactProp, refType } from '@material-ui/utils';
import setRef from '../utils/setRef';
var warnedOnce = false;
/**
* ⚠️⚠️⚠️
* If you want the DOM element of a Material-UI component check out
* [FAQ: How can I access the DOM element?](/getting-started/faq/#how-can-i-access-the-dom-element)
* first.
*
* This component uses `findDOMNode` which is deprecated in React.StrictMode.
*
* Helper component to allow attaching a ref to a
* wrapped element to access the underlying DOM element.
*
* It's highly inspired by https://github.com/facebook/react/issues/11401#issuecomment-340543801.
* For example:
* ```jsx
* import React from 'react';
* import RootRef from '@material-ui/core/RootRef';
*
* function MyComponent() {
* const domRef = React.useRef();
*
* React.useEffect(() => {
* console.log(domRef.current); // DOM node
* }, []);
*
* return (
* <RootRef rootRef={domRef}>
* <SomeChildComponent />
* </RootRef>
* );
* }
* ```
*
* @deprecated
*/
var RootRef = /*#__PURE__*/function (_React$Component) {
_inherits(RootRef, _React$Component);
var _super = _createSuper(RootRef);
function RootRef() {
_classCallCheck(this, RootRef);
return _super.apply(this, arguments);
}
_createClass(RootRef, [{
key: "componentDidMount",
value: function componentDidMount() {
this.ref = ReactDOM.findDOMNode(this);
setRef(this.props.rootRef, this.ref);
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
var ref = ReactDOM.findDOMNode(this);
if (prevProps.rootRef !== this.props.rootRef || this.ref !== ref) {
if (prevProps.rootRef !== this.props.rootRef) {
setRef(prevProps.rootRef, null);
}
this.ref = ref;
setRef(this.props.rootRef, this.ref);
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.ref = null;
setRef(this.props.rootRef, null);
}
}, {
key: "render",
value: function render() {
if (process.env.NODE_ENV !== 'production') {
if (!warnedOnce) {
warnedOnce = true;
console.warn(['Material-UI: The RootRef component is deprecated.', 'The component relies on the ReactDOM.findDOMNode API which is deprecated in React.StrictMode.', 'Instead, you can get a reference to the underlying DOM node of the components via the `ref` prop.'].join('/n'));
}
}
return this.props.children;
}
}]);
return RootRef;
}(React.Component);
process.env.NODE_ENV !== "production" ? RootRef.propTypes = {
/**
* The wrapped element.
*/
children: PropTypes.element.isRequired,
/**
* A ref that points to the first DOM node of the wrapped element.
*/
rootRef: refType.isRequired
} : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== "production" ? RootRef.propTypes = exactProp(RootRef.propTypes) : void 0;
}
export default RootRef; |
app/javascript/mastodon/features/ui/components/modal_root.js | rekif/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import Base from '../../../components/modal_root';
import BundleContainer from '../containers/bundle_container';
import BundleModalError from './bundle_modal_error';
import ModalLoading from './modal_loading';
import ActionsModal from './actions_modal';
import MediaModal from './media_modal';
import VideoModal from './video_modal';
import BoostModal from './boost_modal';
import ConfirmationModal from './confirmation_modal';
import FocalPointModal from './focal_point_modal';
import {
OnboardingModal,
MuteModal,
ReportModal,
EmbedModal,
ListEditor,
} from '../../../features/ui/util/async-components';
const MODAL_COMPONENTS = {
'MEDIA': () => Promise.resolve({ default: MediaModal }),
'ONBOARDING': OnboardingModal,
'VIDEO': () => Promise.resolve({ default: VideoModal }),
'BOOST': () => Promise.resolve({ default: BoostModal }),
'CONFIRM': () => Promise.resolve({ default: ConfirmationModal }),
'MUTE': MuteModal,
'REPORT': ReportModal,
'ACTIONS': () => Promise.resolve({ default: ActionsModal }),
'EMBED': EmbedModal,
'LIST_EDITOR': ListEditor,
'FOCAL_POINT': () => Promise.resolve({ default: FocalPointModal }),
};
export default class ModalRoot extends React.PureComponent {
static propTypes = {
type: PropTypes.string,
props: PropTypes.object,
onClose: PropTypes.func.isRequired,
};
getSnapshotBeforeUpdate () {
return { visible: !!this.props.type };
}
componentDidUpdate (prevProps, prevState, { visible }) {
if (visible) {
document.body.classList.add('with-modals--active');
} else {
document.body.classList.remove('with-modals--active');
}
}
renderLoading = modalId => () => {
return ['MEDIA', 'VIDEO', 'BOOST', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null;
}
renderError = (props) => {
const { onClose } = this.props;
return <BundleModalError {...props} onClose={onClose} />;
}
render () {
const { type, props, onClose } = this.props;
const visible = !!type;
return (
<Base onClose={onClose}>
{visible && (
<BundleContainer fetchComponent={MODAL_COMPONENTS[type]} loading={this.renderLoading(type)} error={this.renderError} renderDelay={200}>
{(SpecificComponent) => <SpecificComponent {...props} onClose={onClose} />}
</BundleContainer>
)}
</Base>
);
}
}
|
test/components/ListItem.spec.js | martinkwan/HNGRY | import React from 'react';
import { shallow } from 'enzyme';
import ListItem from '../../src/components/listItem';
describe('(Component) ListItem', () => {
let wrapper;
const props = { place: {} };
beforeEach(() => {
wrapper = shallow(<ListItem {...props} />);
});
it('renders self successfully', () => {
expect(wrapper).to.have.length(1);
});
});
|
web/src/js/__tests__/components/common/DocsLinkSpec.js | StevenVanAcker/mitmproxy | import React from 'react'
import renderer from 'react-test-renderer'
import DocsLink from '../../../components/common/DocsLink'
describe('DocsLink Component', () => {
it('should be able to be rendered with children nodes', () => {
let docsLink = renderer.create(<DocsLink children="foo" resource="bar"></DocsLink>),
tree = docsLink.toJSON()
expect(tree).toMatchSnapshot()
})
it('should be able to be rendered without children nodes', () => {
let docsLink = renderer.create(<DocsLink resource="bar"></DocsLink>),
tree = docsLink.toJSON()
expect(tree).toMatchSnapshot()
})
})
|
packages/material-ui-icons/src/Brightness5Rounded.js | Kagami/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M20 15.31l2.6-2.6c.39-.39.39-1.02 0-1.41L20 8.69V5c0-.55-.45-1-1-1h-3.69l-2.6-2.6a.9959.9959 0 0 0-1.41 0L8.69 4H5c-.55 0-1 .45-1 1v3.69l-2.6 2.6c-.39.39-.39 1.02 0 1.41L4 15.3V19c0 .55.45 1 1 1h3.69l2.6 2.6c.39.39 1.02.39 1.41 0l2.6-2.6H19c.55 0 1-.45 1-1v-3.69zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6z" /></g></React.Fragment>
, 'Brightness5Rounded');
|
src/containers/TestButton.js | moazzamkhan/everything | import React from 'react'
import { connect } from 'react-redux'
import {
ActionCreaters
} from '../actions'
let AddItem = ({ dispatch }) => {
let input
return (
<div>
<button type="button" className="btn btn-default" onClick={e => {
e.preventDefault()
dispatch(ActionCreaters.createItem({
itemName: "New file 1",
mimetype: "text/plain",
username: "admin",
}))
}}>
AddItem
</button>
</div>
)
}
const TestButton = connect()(AddItem)
export default TestButton
|
public/javascripts/Search.js | chenjic215/search-doctor | import React from 'react';
import SearchHeader from './SearchHeader';
import SearchResults from './SearchResults';
var HttpServices = require("./services/HttpServices");
class Search extends React.Component {
constructor(props) {
super(props);
this.state = {
searchText : this.props.location.state.searchText,
userSelected: this.props.location.state.userSelected,
lastQueryResults: this.props.location.state.lastQueryResults
};
this.onUpdateSearch = this.onUpdateSearch.bind(this);
this.onSearch = this.onSearch.bind(this);
}
componentDidMount() {
// if (!this.state.lastQueryResults.data) {
// this.onSearch();
// }
}
onUpdateSearch(updateValue) {
this.setState({
searchText : updateValue.searchText,
userSelected : updateValue.userSelected,
lastQueryResults : updateValue.lastQueryResults
});
}
onSearch() {
HttpServices.getWithoutAuth(`http://localhost:3000/api/doctorsearch/name?name=${this.state.searchText}`, (err, res) => {
this.setState({
lastQueryResults: res
});
});
}
render() {
if (!this.state.lastQueryResults || this.state.lastQueryResults.searchedname != this.state.searchText) {
this.onSearch();
}
return (
<div className="Search-container">
<SearchHeader searchText={this.state.searchText} onUpdateSearch={(updateValue) => this.onUpdateSearch(updateValue)}/>
<SearchResults searchText={this.state.searchText} lastQueryResults={this.state.lastQueryResults} userSelected = {this.state.userSelected}/>
</div>
);
}
}
export default Search
|
ajax/libs/muicss/0.8.1/react/mui-react.min.js | iwdmb/cdnjs | !function(e){var t=e.babelHelpers={};t.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var l=t[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}return function(t,r,l){return r&&e(t.prototype,r),l&&e(t,l),t}}(),t.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},t.inherits=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},t.interopRequireDefault=function(e){return e&&e.__esModule?e:{default:e}},t.interopRequireWildcard=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},t.objectWithoutProperties=function(e,t){var r={};for(var l in e)t.indexOf(l)>=0||Object.prototype.hasOwnProperty.call(e,l)&&(r[l]=e[l]);return r},t.possibleConstructorReturn=function(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}}("undefined"==typeof global?self:global),function e(t,r,l){function n(a,s){if(!r[a]){if(!t[a]){var i="function"==typeof require&&require;if(!s&&i)return i(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var u=r[a]={exports:{}};t[a][0].call(u.exports,function(e){var r=t[a][1][e];return n(r?r:e)},u,u.exports,e,t,r,l)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<l.length;a++)n(l[a]);return n}({1:[function(e,t,r){"use strict";!function(t){if(!t._muiReactLoaded){t._muiReactLoaded=!0;var r=t.mui=t.mui||[],l=r.react={};l.Appbar=e("src/react/appbar"),l.Button=e("src/react/button"),l.Caret=e("src/react/caret"),l.Checkbox=e("src/react/checkbox"),l.Col=e("src/react/col"),l.Container=e("src/react/container"),l.Divider=e("src/react/divider"),l.Dropdown=e("src/react/dropdown"),l.DropdownItem=e("src/react/dropdown-item"),l.Form=e("src/react/form"),l.Input=e("src/react/input"),l.Option=e("src/react/option"),l.Panel=e("src/react/panel"),l.Radio=e("src/react/radio"),l.Row=e("src/react/row"),l.Select=e("src/react/select"),l.Tab=e("src/react/tab"),l.Tabs=e("src/react/tabs"),l.Textarea=e("src/react/textarea")}}(window)},{"src/react/appbar":11,"src/react/button":12,"src/react/caret":13,"src/react/checkbox":14,"src/react/col":15,"src/react/container":16,"src/react/divider":17,"src/react/dropdown":19,"src/react/dropdown-item":18,"src/react/form":20,"src/react/input":21,"src/react/option":22,"src/react/panel":23,"src/react/radio":24,"src/react/row":25,"src/react/select":26,"src/react/tab":27,"src/react/tabs":28,"src/react/textarea":29}],2:[function(e,t,r){"use strict";t.exports={debug:!0}},{}],3:[function(e,t,r){"use strict";function l(e,t,r){var l,i,u,c,p=document.documentElement.clientHeight,d=t*a+2*s,f=Math.min(d,p);i=s+a-(n+o),i-=r*a,u=-1*e.getBoundingClientRect().top,c=p-f+u,l=Math.min(Math.max(i,u),c);var b,h,v=0;return d>p&&(b=s+(r+1)*a-(-1*l+n+o),h=t*a+2*s-f,v=Math.min(b,h)),{height:f+"px",top:l+"px",scrollTop:v}}var n=15,o=32,a=42,s=8;t.exports={getMenuPositionalCSS:l}},{}],4:[function(e,t,r){"use strict";function l(e,t){if(t&&e.setAttribute){for(var r,l=h(e),n=t.split(" "),o=0;o<n.length;o++)r=n[o].trim(),l.indexOf(" "+r+" ")===-1&&(l+=r+" ");e.setAttribute("class",l.trim())}}function n(e,t,r){if(void 0===t)return getComputedStyle(e);var l=a(t);{if("object"!==l){"string"===l&&void 0!==r&&(e.style[v(t)]=r);var n=getComputedStyle(e),o="array"===a(t);if(!o)return m(e,t,n);for(var s,i={},u=0;u<t.length;u++)s=t[u],i[s]=m(e,s,n);return i}for(var s in t)e.style[v(s)]=t[s]}}function o(e,t){return!(!t||!e.getAttribute)&&h(e).indexOf(" "+t+" ")>-1}function a(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);if(0===t.indexOf("[object "))return t.slice(8,-1).toLowerCase();throw new Error("MUI: Could not understand type: "+t)}function s(e,t,r,l){l=void 0!==l&&l;var n=e._muiEventCache=e._muiEventCache||{};t.split(" ").map(function(t){e.addEventListener(t,r,l),n[t]=n[t]||[],n[t].push([r,l])})}function i(e,t,r,l){l=void 0!==l&&l;var n,o,a,s=e._muiEventCache=e._muiEventCache||{};t.split(" ").map(function(t){for(n=s[t]||[],a=n.length;a--;)o=n[a],(void 0===r||o[0]===r&&o[1]===l)&&(n.splice(a,1),e.removeEventListener(t,o[0],o[1]))})}function u(e,t,r,l){t.split(" ").map(function(t){s(e,t,function l(n){r&&r.apply(this,arguments),i(e,t,l)},l)})}function c(e,t){var r=window;if(void 0===t){if(e===r){var l=document.documentElement;return(r.pageXOffset||l.scrollLeft)-(l.clientLeft||0)}return e.scrollLeft}e===r?r.scrollTo(t,p(r)):e.scrollLeft=t}function p(e,t){var r=window;if(void 0===t){if(e===r){var l=document.documentElement;return(r.pageYOffset||l.scrollTop)-(l.clientTop||0)}return e.scrollTop}e===r?r.scrollTo(c(r),t):e.scrollTop=t}function d(e){var t=window,r=e.getBoundingClientRect(),l=p(t),n=c(t);return{top:r.top+l,left:r.left+n,height:r.height,width:r.width}}function f(e){var t=!1,r=!0,l=document,n=l.defaultView,o=l.documentElement,a=l.addEventListener?"addEventListener":"attachEvent",s=l.addEventListener?"removeEventListener":"detachEvent",i=l.addEventListener?"":"on",u=function r(o){"readystatechange"==o.type&&"complete"!=l.readyState||(("load"==o.type?n:l)[s](i+o.type,r,!1),!t&&(t=!0)&&e.call(n,o.type||o))},c=function e(){try{o.doScroll("left")}catch(t){return void setTimeout(e,50)}u("poll")};if("complete"==l.readyState)e.call(n,"lazy");else{if(l.createEventObject&&o.doScroll){try{r=!n.frameElement}catch(e){}r&&c()}l[a](i+"DOMContentLoaded",u,!1),l[a](i+"readystatechange",u,!1),n[a](i+"load",u,!1)}}function b(e,t){if(t&&e.setAttribute){for(var r,l=h(e),n=t.split(" "),o=0;o<n.length;o++)for(r=n[o].trim();l.indexOf(" "+r+" ")>=0;)l=l.replace(" "+r+" "," ");e.setAttribute("class",l.trim())}}function h(e){var t=(e.getAttribute("class")||"").replace(/[\n\t]/g,"");return" "+t+" "}function v(e){return e.replace(C,function(e,t,r,l){return l?r.toUpperCase():r}).replace(y,"Moz$1")}function m(e,t,r){var l;return l=r.getPropertyValue(t),""!==l||e.ownerDocument||(l=e.style[v(t)]),l}var C=/([\:\-\_]+(.))/g,y=/^moz([A-Z])/;t.exports={addClass:l,css:n,hasClass:o,off:i,offset:d,on:s,one:u,ready:f,removeClass:b,type:a,scrollLeft:c,scrollTop:p}},{}],5:[function(e,t,r){"use strict";function l(){var e=window;if(m.debug&&"undefined"!=typeof e.console)try{e.console.log.apply(e.console,arguments)}catch(r){var t=Array.prototype.slice.call(arguments);e.console.log(t.join("\n"))}}function n(e){var t,r=document;t=r.head||r.getElementsByTagName("head")[0]||r.documentElement;var l=r.createElement("style");return l.type="text/css",l.styleSheet?l.styleSheet.cssText=e:l.appendChild(r.createTextNode(e)),t.insertBefore(l,t.firstChild),l}function o(e,t){if(!t)throw new Error("MUI: "+e);"undefined"!=typeof console&&console.error("MUI Warning: "+e)}function a(e){if(y.push(e),void 0===y._initialized){var t=document,r="animationstart mozAnimationStart webkitAnimationStart";C.on(t,r,s),y._initialized=!0}}function s(e){if("mui-node-inserted"===e.animationName)for(var t=e.target,r=y.length-1;r>=0;r--)y[r](t)}function i(e){var t="";for(var r in e)t+=e[r]?r+" ":"";return t.trim()}function u(){if(void 0!==v)return v;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",v="auto"===e.style.pointerEvents}function c(e,t){return function(){e[t].apply(e,arguments)}}function p(e,t,r,l,n){var o,a=document.createEvent("HTMLEvents"),r=void 0===r||r,l=void 0===l||l;if(a.initEvent(t,r,l),n)for(o in n)a[o]=n[o];return e&&e.dispatchEvent(a),a}function d(){if(g+=1,1===g){var e=window,t=document;h={left:C.scrollLeft(e),top:C.scrollTop(e)},C.addClass(t.body,H),e.scrollTo(h.left,h.top)}}function f(e){if(0!==g&&(g-=1,0===g)){var t=window,r=document;C.removeClass(r.body,H),e&&t.scrollTo(h.left,h.top)}}function b(e){var t=window.requestAnimationFrame;t?t(e):setTimeout(e,0)}var h,v,m=e("../config"),C=e("./jqLite"),y=[],g=0,H="mui-body--scroll-lock";t.exports={callback:c,classNames:i,disableScrollLock:f,dispatchEvent:p,enableScrollLock:d,log:l,loadStyle:n,onNodeInserted:a,raiseError:o,requestAnimationFrame:b,supportsPointerEvents:u}},{"../config":2,"./jqLite":4}],6:[function(e,t,r){"use strict";var l="You provided a `value` prop to a form field without an `OnChange` handler. Please see React documentation on controlled components";t.exports={controlledMessage:l}},{}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/jqLite"),a=babelHelpers.interopRequireWildcard(o),s=e("../js/lib/util"),i=babelHelpers.interopRequireWildcard(s),u=n.default.PropTypes,c="mui-btn",p={color:1,variant:1,size:1},d=600,f=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.state={ripples:{}},r.rippleTimers=[];var l=i.callback;return r.onMouseDownCB=l(r,"onMouseDown"),r.onMouseUpCB=l(r,"onMouseUp"),r.onMouseLeaveCB=l(r,"onMouseLeave"),r.onTouchStartCB=l(r,"onTouchStart"),r.onTouchEndCB=l(r,"onTouchEnd"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){var e=this.refs.buttonEl;e._muiDropdown=!0,e._muiRipple=!0}},{key:"componentWillUnmount",value:function(){for(var e=this.rippleTimers,t=e.length;t--;)clearTimeout(e[t])}},{key:"onMouseDown",value:function(e){this.addRipple(e);var t=this.props.onMouseDown;t&&t(e)}},{key:"onMouseUp",value:function(e){this.removeRipples(e);var t=this.props.onMouseUp;t&&t(e)}},{key:"onMouseLeave",value:function(e){this.removeRipples(e);var t=this.props.onMouseLeave;t&&t(e)}},{key:"onTouchStart",value:function(e){this.addRipple(e);var t=this.props.onTouchStart;t&&t(e)}},{key:"onTouchEnd",value:function(e){this.removeRipples(e);var t=this.props.onTouchEnd;t&&t(e)}},{key:"addRipple",value:function(e){var t=this.refs.buttonEl;if(!("ontouchstart"in t&&"mousedown"===e.type)){var r=a.offset(this.refs.buttonEl),l=void 0;l="touchstart"===e.type&&e.touches?e.touches[0]:e;var n=2*Math.sqrt(r.width*r.width+r.height*r.height),o=this.state.ripples,s=Date.now();o[s]={xPos:l.pageX-r.left,yPos:l.pageY-r.top,diameter:n,animateOut:!1},this.setState({ripples:o})}}},{key:"removeRipples",value:function(e){var t=this,r=this.state.ripples,l=Object.keys(r),n=void 0;for(n in r)r[n].animateOut=!0;this.setState({ripples:r});var o=setTimeout(function(){for(var e=t.state.ripples,r=l.length;r--;)delete e[l[r]];t.setState({ripples:e})},d);this.rippleTimers.push(o)}},{key:"render",value:function(){var e=c,t=void 0,r=void 0,l=this.state.ripples,o=this.props,a=(o.color,o.size,o.variant,babelHelpers.objectWithoutProperties(o,["color","size","variant"]));for(t in p)r=this.props[t],"default"!==r&&(e+=" "+c+"--"+r);return n.default.createElement("button",babelHelpers.extends({},a,{ref:"buttonEl",className:e+" "+this.props.className,onMouseUp:this.onMouseUpCB,onMouseDown:this.onMouseDownCB,onMouseLeave:this.onMouseLeaveCB,onTouchStart:this.onTouchStartCB,onTouchEnd:this.onTouchEndCB}),this.props.children,Object.keys(l).map(function(e,t){var r=l[e];return n.default.createElement(b,{key:e,xPos:r.xPos,yPos:r.yPos,diameter:r.diameter,animateOut:r.animateOut})}))}}]),t}(n.default.Component);f.propTypes={color:u.oneOf(["default","primary","danger","dark","accent"]),size:u.oneOf(["default","small","large"]),variant:u.oneOf(["default","flat","raised","fab"])},f.defaultProps={className:"",color:"default",size:"default",variant:"default"};var b=function(e){function t(){var e,r,l,n;babelHelpers.classCallCheck(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=l=babelHelpers.possibleConstructorReturn(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),l.state={animateIn:!1},n=r,babelHelpers.possibleConstructorReturn(l,n)}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){var e=this;i.requestAnimationFrame(function(){e.setState({animateIn:!0})})}},{key:"render",value:function(){var e=this.props.diameter,t=e/2,r={height:e,width:e,top:this.props.yPos-t||0,left:this.props.xPos-t||0},l="mui-ripple-effect";return this.state.animateIn&&(l+=" mui--animate-in mui--active"),this.props.animateOut&&(l+=" mui--animate-out"),n.default.createElement("div",{className:l,style:r})}}]),t}(n.default.Component);b.propTypes={xPos:u.number,yPos:u.number,diameter:u.number,animateOut:u.bool},b.defaultProps={xPos:0,yPos:0,diameter:0,animateOut:!1},r.default=f,t.exports=r.default},{"../js/lib/jqLite":4,"../js/lib/util":5,react:"CwoHg3"}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,babelHelpers.objectWithoutProperties(e,["children"]));return n.default.createElement("span",babelHelpers.extends({},t,{className:"mui-caret "+this.props.className}))}}]),t}(n.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"CwoHg3"}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=n.default.PropTypes,a=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){return null}}]),t}(n.default.Component);a.propTypes={value:o.any,label:o.string,onActive:o.func},a.defaultProps={value:null,label:"",onActive:null},r.default=a,t.exports=r.default},{react:"CwoHg3"}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.TextField=void 0;var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/util"),a=babelHelpers.interopRequireWildcard(o),s=e("./_helpers"),i=n.default.PropTypes,u=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),l=e.value,n=l||e.defaultValue;r.state={innerValue:n,isDirty:Boolean(n)},void 0===l||e.onChange||a.raiseError(s.controlledMessage,!0);var o=a.callback;return r.onChangeCB=o(r,"onChange"),r.onFocusCB=o(r,"onFocus"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){this.refs.inputEl._muiTextfield=!0}},{key:"componentWillReceiveProps",value:function(e){"value"in e&&this.setState({innerValue:e.value})}},{key:"onChange",value:function(e){this.setState({innerValue:e.target.value});var t=this.props.onChange;t&&t(e)}},{key:"onFocus",value:function(e){this.setState({isDirty:!0});var t=this.props.onFocus;t&&t(e)}},{key:"triggerFocus",value:function(){this.refs.inputEl.focus()}},{key:"render",value:function(){var e={},t=Boolean(this.state.innerValue),r=void 0,l=this.props,o=l.hint,s=l.invalid,i=l.rows,u=l.type,c=babelHelpers.objectWithoutProperties(l,["hint","invalid","rows","type"]);return e["mui--is-empty"]=!t,e["mui--is-not-empty"]=t,e["mui--is-dirty"]=this.state.isDirty,e["mui--is-invalid"]=s,e=a.classNames(e),r="textarea"===u?n.default.createElement("textarea",babelHelpers.extends({},c,{ref:"inputEl",className:e,rows:i,placeholder:o,onChange:this.onChangeCB,onFocus:this.onFocusCB})):n.default.createElement("input",babelHelpers.extends({},c,{ref:"inputEl",className:e,type:u,placeholder:this.props.hint,onChange:this.onChangeCB,onFocus:this.onFocusCB}))}}]),t}(n.default.Component);u.propTypes={hint:i.string,invalid:i.bool,rows:i.number},u.defaultProps={hint:null,invalid:!1,rows:2};var c=function(e){function t(){var e,r,l,n;babelHelpers.classCallCheck(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=l=babelHelpers.possibleConstructorReturn(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),l.state={style:{}},n=r,babelHelpers.possibleConstructorReturn(l,n)}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){var e=this;this.styleTimer=setTimeout(function(){var t=".15s ease-out",r=void 0;r={transition:t,WebkitTransition:t,MozTransition:t,OTransition:t,msTransform:t},e.setState({style:r})},150)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.styleTimer)}},{key:"render",value:function(){return n.default.createElement("label",{style:this.state.style,onClick:this.props.onClick},this.props.text)}}]),t}(n.default.Component);c.defaultProps={text:"",onClick:null};var p=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.onClickCB=a.callback(r,"onClick"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"onClick",value:function(e){a.supportsPointerEvents()===!1&&(e.target.style.cursor="text",this.refs.inputEl.triggerFocus())}},{key:"render",value:function(){var e={},t=void 0,r=this.props,l=(r.children,r.className),o=r.style,s=r.label,i=r.floatingLabel,p=babelHelpers.objectWithoutProperties(r,["children","className","style","label","floatingLabel"]);return s.length&&(t=n.default.createElement(c,{text:s,onClick:this.onClickCB})),e["mui-textfield"]=!0,e["mui-textfield--float-label"]=i,e=a.classNames(e),n.default.createElement("div",{className:e+" "+l,style:o},n.default.createElement(u,babelHelpers.extends({ref:"inputEl"},p)),t)}}]),t}(n.default.Component);p.propTypes={label:i.string,floatingLabel:i.bool},p.defaultProps={className:"",label:"",floatingLabel:!1},r.TextField=p},{"../js/lib/util":5,"./_helpers":6,react:"CwoHg3"}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=babelHelpers.objectWithoutProperties(e,["children"]);return n.default.createElement("div",babelHelpers.extends({},r,{className:"mui-appbar "+this.props.className}),t)}}]),t}(n.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"CwoHg3"}],12:[function(e,t,r){t.exports=e(7)},{"../js/lib/jqLite":4,"../js/lib/util":5,react:"CwoHg3"}],13:[function(e,t,r){t.exports=e(8)},{react:"CwoHg3"}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/util"),a=(babelHelpers.interopRequireWildcard(o),e("./_helpers"),n.default.PropTypes),s=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,e.className),r=e.label,l=e.autoFocus,o=e.checked,a=e.defaultChecked,s=e.defaultValue,i=e.disabled,u=e.form,c=e.name,p=e.required,d=e.value,f=e.onChange,b=babelHelpers.objectWithoutProperties(e,["children","className","label","autoFocus","checked","defaultChecked","defaultValue","disabled","form","name","required","value","onChange"]);return n.default.createElement("div",babelHelpers.extends({},b,{className:"mui-checkbox "+t}),n.default.createElement("label",null,n.default.createElement("input",{ref:"inputEl",type:"checkbox",autoFocus:l,checked:o,defaultChecked:a,defaultValue:s,disabled:i,form:u,name:c,required:p,value:d,onChange:f}),r))}}]),t}(n.default.Component);s.propTypes={label:a.string},s.defaultProps={className:"",label:null},r.default=s,t.exports=r.default},{"../js/lib/util":5,"./_helpers":6,react:"CwoHg3"}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/util"),a=babelHelpers.interopRequireWildcard(o),s=["xs","sm","md","lg","xl"],i=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"defaultProps",value:function(){var e={className:""},t=void 0,r=void 0;for(t=s.length-1;t>-1;t--)r=s[t],e[r]=null,e[r+"-offset"]=null;return e}},{key:"render",value:function(){var e={},t=void 0,r=void 0,l=void 0,o=void 0,i=this.props,u=i.children,c=i.className,p=babelHelpers.objectWithoutProperties(i,["children","className"]);for(t=s.length-1;t>-1;t--)r=s[t],o="mui-col-"+r,l=this.props[r],l&&(e[o+"-"+l]=!0),l=this.props[r+"-offset"],l&&(e[o+"-offset-"+l]=!0),delete p[r],delete p[r+"-offset"];return e=a.classNames(e),n.default.createElement("div",babelHelpers.extends({},p,{className:e+" "+c}),u)}}]),t}(n.default.Component);r.default=i,t.exports=r.default},{"../js/lib/util":5,react:"CwoHg3"}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,l=e.fluid,o=babelHelpers.objectWithoutProperties(e,["children","className","fluid"]),a="mui-container";return l&&(a+="-fluid"),n.default.createElement("div",babelHelpers.extends({},o,{className:a+" "+r}),t)}}]),t}(n.default.Component);o.propTypes={fluid:n.default.PropTypes.bool},o.defaultProps={className:"",fluid:!1},r.default=o,t.exports=r.default},{react:"CwoHg3"}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,e.className),r=babelHelpers.objectWithoutProperties(e,["children","className"]);return n.default.createElement("div",babelHelpers.extends({},r,{className:"mui-divider "+t}))}}]),t}(n.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"CwoHg3"}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/util"),a=(babelHelpers.interopRequireWildcard(o),n.default.PropTypes),s=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.link,l=e.target,o=e.value,a=e.onClick,s=babelHelpers.objectWithoutProperties(e,["children","link","target","value","onClick"]);return n.default.createElement("li",s,n.default.createElement("a",{href:r,target:l,"data-mui-value":o,onClick:a},t))}}]),t}(n.default.Component);s.propTypes={link:a.string,target:a.string,onClick:a.func},r.default=s,t.exports=r.default},{"../js/lib/util":5,react:"CwoHg3"}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("./button"),a=babelHelpers.interopRequireDefault(o),s=e("./caret"),i=babelHelpers.interopRequireDefault(s),u=e("../js/lib/jqLite"),c=babelHelpers.interopRequireWildcard(u),p=e("../js/lib/util"),d=babelHelpers.interopRequireWildcard(p),f=n.default.PropTypes,b="mui-dropdown",h="mui-dropdown__menu",v="mui--is-open",m="mui-dropdown__menu--right",C=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.state={opened:!1,menuTop:0};var l=d.callback;return r.selectCB=l(r,"select"),r.onClickCB=l(r,"onClick"),r.onOutsideClickCB=l(r,"onOutsideClick"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.onOutsideClickCB)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.onOutsideClickCB)}},{key:"onClick",value:function(e){if(0===e.button&&!this.props.disabled&&!e.defaultPrevented){this.toggle();var t=this.props.onClick;t&&t(e)}}},{key:"toggle",value:function(){return this.props.children?void(this.state.opened?this.close():this.open()):d.raiseError("Dropdown menu element not found")}},{key:"open",value:function(){var e=this.refs.wrapperEl.getBoundingClientRect(),t=void 0;t=this.refs.button.refs.buttonEl.getBoundingClientRect(),this.setState({opened:!0,menuTop:t.top-e.top+t.height})}},{key:"close",value:function(){this.setState({opened:!1})}},{key:"select",value:function(e){this.props.onSelect&&"A"===e.target.tagName&&this.props.onSelect(e.target.getAttribute("data-mui-value")),e.defaultPrevented||this.close()}},{key:"onOutsideClick",value:function(e){var t=this.refs.wrapperEl.contains(e.target);t||this.close()}},{key:"render",value:function(){var e=void 0,t=void 0,r=void 0,l=this.props,o=l.children,s=l.className,u=l.color,p=l.variant,f=l.size,C=l.label,y=l.alignMenu,g=(l.onClick,l.onSelect,l.disabled),H=babelHelpers.objectWithoutProperties(l,["children","className","color","variant","size","label","alignMenu","onClick","onSelect","disabled"]);if(r="string"===c.type(C)?n.default.createElement("span",null,C," ",n.default.createElement(i.default,null)):C,e=n.default.createElement(a.default,{ref:"button",type:"button",onClick:this.onClickCB,color:u,variant:p,size:f,disabled:g},r),this.state.opened){var k={};k[h]=!0,k[v]=this.state.opened,k[m]="right"===y,k=d.classNames(k),t=n.default.createElement("ul",{ref:"menuEl",className:k,style:{top:this.state.menuTop},onClick:this.selectCB},o)}else t=n.default.createElement("div",null);return n.default.createElement("div",babelHelpers.extends({},H,{ref:"wrapperEl",className:b+" "+s}),e,t)}}]),t}(n.default.Component);C.propTypes={color:f.oneOf(["default","primary","danger","dark","accent"]),variant:f.oneOf(["default","flat","raised","fab"]),size:f.oneOf(["default","small","large"]),label:f.oneOfType([f.string,f.element]),alignMenu:f.oneOf(["left","right"]),onClick:f.func,onSelect:f.func,disabled:f.bool},C.defaultProps={className:"",color:"default",variant:"default",size:"default",label:"",alignMenu:"left",onClick:null,onSelect:null,disabled:!1},r.default=C,t.exports=r.default},{"../js/lib/jqLite":4,"../js/lib/util":5,"./button":7,"./caret":8,react:"CwoHg3"}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,l=e.inline,o=babelHelpers.objectWithoutProperties(e,["children","className","inline"]),a="";return l&&(a="mui-form--inline"),n.default.createElement("form",babelHelpers.extends({},o,{className:a+" "+r}),t)}}]),t}(n.default.Component);o.propTypes={inline:n.default.PropTypes.bool},o.defaultProps={className:"",inline:!1},r.default=o,t.exports=r.default},{react:"CwoHg3"}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("./text-field"),a=n.default.PropTypes,s=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){return n.default.createElement(o.TextField,this.props)}}]),t}(n.default.Component);s.propTypes={type:a.oneOf(["text","email","url","tel","password"])},s.defaultProps={type:"text"},r.default=s,t.exports=r.default},{"./text-field":10,react:"CwoHg3"}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/forms"),a=(babelHelpers.interopRequireWildcard(o),e("../js/lib/jqLite")),s=(babelHelpers.interopRequireWildcard(a),e("../js/lib/util")),i=(babelHelpers.interopRequireWildcard(s),e("./_helpers"),n.default.PropTypes),u=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,e.label),r=babelHelpers.objectWithoutProperties(e,["children","label"]);return n.default.createElement("option",r,t)}}]),t}(n.default.Component);u.propTypes={label:i.string},u.defaultProps={className:"",label:null},r.default=u,t.exports=r.default},{"../js/lib/forms":3,"../js/lib/jqLite":4,"../js/lib/util":5,"./_helpers":6,react:"CwoHg3"}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,l=babelHelpers.objectWithoutProperties(e,["children","className"]);return n.default.createElement("div",babelHelpers.extends({},l,{className:"mui-panel "+r}),t)}}]),t}(n.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"CwoHg3"}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=n.default.PropTypes,a=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,e.className),r=e.label,l=e.autoFocus,o=e.checked,a=e.defaultChecked,s=e.defaultValue,i=e.disabled,u=e.form,c=e.name,p=e.required,d=e.value,f=e.onChange,b=babelHelpers.objectWithoutProperties(e,["children","className","label","autoFocus","checked","defaultChecked","defaultValue","disabled","form","name","required","value","onChange"]);return n.default.createElement("div",babelHelpers.extends({},b,{className:"mui-radio "+t}),n.default.createElement("label",null,n.default.createElement("input",{ref:"inputEl",type:"radio",autoFocus:l,
checked:o,defaultChecked:a,defaultValue:s,disabled:i,form:u,name:c,required:p,value:d,onChange:f}),r))}}]),t}(n.default.Component);a.propTypes={label:o.string},a.defaultProps={className:"",label:null},r.default=a,t.exports=r.default},{react:"CwoHg3"}],25:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/util"),a=(babelHelpers.interopRequireWildcard(o),function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,l=babelHelpers.objectWithoutProperties(e,["children","className"]);return n.default.createElement("div",babelHelpers.extends({},l,{className:"mui-row "+r}),t)}}]),t}(n.default.Component));a.defaultProps={className:""},r.default=a,t.exports=r.default},{"../js/lib/util":5,react:"CwoHg3"}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("../js/lib/forms"),a=babelHelpers.interopRequireWildcard(o),s=e("../js/lib/jqLite"),i=babelHelpers.interopRequireWildcard(s),u=e("../js/lib/util"),c=babelHelpers.interopRequireWildcard(u),p=e("./_helpers"),d=n.default.PropTypes,f=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.state={showMenu:!1},e.readOnly===!1&&void 0!==e.value&&null===e.onChange&&c.raiseError(p.controlledMessage,!0),r.state.value=e.value;var l=c.callback;return r.hideMenuCB=l(r,"hideMenu"),r.onInnerChangeCB=l(r,"onInnerChange"),r.onInnerClickCB=l(r,"onInnerClick"),r.onInnerFocusCB=l(r,"onInnerFocus"),r.onInnerMouseDownCB=l(r,"onInnerMouseDown"),r.onKeydownCB=l(r,"onKeydown"),r.onMenuChangeCB=l(r,"onMenuChange"),r.onOuterFocusCB=l(r,"onOuterFocus"),r.onOuterBlurCB=l(r,"onOuterBlur"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){this.refs.selectEl._muiSelect=!0,this.refs.wrapperEl.tabIndex=-1,this.props.autoFocus&&this.refs.wrapperEl.focus()}},{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.value})}},{key:"onInnerMouseDown",value:function(e){if(0===e.button&&this.props.useDefault!==!0){e.preventDefault();var t=this.props.onMouseDown;t&&t(e)}}},{key:"onInnerChange",value:function(e){var t=e.target.value;this.setState({value:t});var r=this.props.onChange;r&&r(t)}},{key:"onInnerClick",value:function(e){if(0===e.button){this.showMenu();var t=this.props.onClick;t&&t(e)}}},{key:"onInnerFocus",value:function(e){var t=this;this.props.useDefault!==!0&&setTimeout(function(){t.refs.wrapperEl.focus()},0)}},{key:"onOuterFocus",value:function(e){if(e.target===this.refs.wrapperEl){var t=this.refs.selectEl;if(t._muiOrigIndex=t.tabIndex,t.tabIndex=-1,t.disabled)return this.refs.wrapperEl.blur();i.on(document,"keydown",this.onKeydownCB);var r=this.onFocus;r&&r(e)}}},{key:"onOuterBlur",value:function(e){if(e.target===this.refs.wrapperEl){var t=this.refs.selectEl;t.tabIndex=t._muiOrigIndex,i.off(document,"keydown",this.onKeydownCB);var r=this.onBlur;r&&r(e)}}},{key:"onKeydown",value:function(e){32!==e.keyCode&&38!==e.keyCode&&40!==e.keyCode||(e.preventDefault(),this.refs.selectEl.disabled!==!0&&this.showMenu())}},{key:"showMenu",value:function(){this.props.useDefault!==!0&&(c.enableScrollLock(),i.on(window,"resize",this.hideMenuCB),i.on(document,"click",this.hideMenuCB),this.setState({showMenu:!0}))}},{key:"hideMenu",value:function(){c.disableScrollLock(!0),i.off(window,"resize",this.hideMenuCB),i.off(document,"click",this.hideMenuCB),this.setState({showMenu:!1}),this.refs.selectEl.focus()}},{key:"onMenuChange",value:function(e){if(this.props.readOnly!==!0){this.setState({value:e});var t=this.props.onChange;t&&t(e)}}},{key:"render",value:function(){var e=void 0;this.state.showMenu&&(e=n.default.createElement(b,{optionEls:this.refs.selectEl.children,wrapperEl:this.refs.wrapperEl,onChange:this.onMenuChangeCB,onClose:this.hideMenuCB}));var t=this.props,r=t.children,l=t.className,o=t.style,a=t.label,s=t.defaultValue,i=(t.readOnly,t.useDefault,babelHelpers.objectWithoutProperties(t,["children","className","style","label","defaultValue","readOnly","useDefault"]));return n.default.createElement("div",{ref:"wrapperEl",style:o,className:"mui-select "+l,onFocus:this.onOuterFocusCB,onBlur:this.onOuterBlurCB},n.default.createElement("select",babelHelpers.extends({},i,{ref:"selectEl",value:this.state.value,defaultValue:s,readOnly:this.props.readOnly,onChange:this.onInnerChangeCB,onMouseDown:this.onInnerMouseDownCB,onClick:this.onInnerClickCB,onFocus:this.onInnerFocusCB}),r),n.default.createElement("label",null,a),e)}}]),t}(n.default.Component);f.propTypes={label:d.string,value:d.string,defaultValue:d.string,readOnly:d.bool,useDefault:d.bool,onChange:d.func},f.defaultProps={className:"",readOnly:!1,useDefault:"ontouchstart"in document.documentElement,onChange:null};var b=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={origIndex:null,currentIndex:null},r.onKeydownCB=c.callback(r,"onKeydown"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentWillMount",value:function(){var e=this.props.optionEls,t=e.length,r=0,l=void 0;for(l=t-1;l>-1;l--)e[l].selected&&(r=l);this.setState({origIndex:r,currentIndex:r})}},{key:"componentDidMount",value:function(){this.blurTimer=setTimeout(function(){var e=document.activeElement;"body"!==e.nodeName.toLowerCase()&&e.blur()},0);var e=a.getMenuPositionalCSS(this.props.wrapperEl,this.props.optionEls.length,this.state.currentIndex),t=this.refs.wrapperEl;i.css(t,e),i.scrollTop(t,e.scrollTop),i.on(document,"keydown",this.onKeydownCB)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.blurTimer),i.off(document,"keydown",this.onKeydownCB)}},{key:"onClick",value:function(e,t){t.stopPropagation(),this.selectAndDestroy(e)}},{key:"onKeydown",value:function(e){var t=e.keyCode;return 9===t?this.destroy():(27!==t&&40!==t&&38!==t&&13!==t||e.preventDefault(),void(27===t?this.destroy():40===t?this.increment():38===t?this.decrement():13===t&&this.selectAndDestroy()))}},{key:"increment",value:function(){this.state.currentIndex!==this.props.optionEls.length-1&&this.setState({currentIndex:this.state.currentIndex+1})}},{key:"decrement",value:function(){0!==this.state.currentIndex&&this.setState({currentIndex:this.state.currentIndex-1})}},{key:"selectAndDestroy",value:function(e){e=void 0===e?this.state.currentIndex:e,e!==this.state.origIndex&&this.props.onChange(this.props.optionEls[e].value),this.destroy()}},{key:"destroy",value:function(){this.props.onClose()}},{key:"render",value:function(){var e=[],t=this.props.optionEls,r=t.length,l=void 0,o=void 0;for(o=0;o<r;o++)l=o===this.state.currentIndex?"mui--is-selected ":"",l+=t[o].className,e.push(n.default.createElement("div",{key:o,className:l,onClick:this.onClick.bind(this,o)},t[o].textContent));return n.default.createElement("div",{ref:"wrapperEl",className:"mui-select__menu"},e)}}]),t}(n.default.Component);b.defaultProps={optionEls:[],wrapperEl:null,onChange:null,onClose:null},r.default=f,t.exports=r.default},{"../js/lib/forms":3,"../js/lib/jqLite":4,"../js/lib/util":5,"./_helpers":6,react:"CwoHg3"}],27:[function(e,t,r){t.exports=e(9)},{react:"CwoHg3"}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("./tab"),a=babelHelpers.interopRequireDefault(o),s=e("../js/lib/util"),i=babelHelpers.interopRequireWildcard(s),u=n.default.PropTypes,c="mui-tabs__bar",p="mui-tabs__bar--justified",d="mui-tabs__pane",f="mui--is-active",b=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={currentSelectedIndex:e.initialSelectedIndex},r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"onClick",value:function(e,t,r){e!==this.state.currentSelectedIndex&&(this.setState({currentSelectedIndex:e}),t.props.onActive&&t.props.onActive(t),this.props.onChange&&this.props.onChange(e,t.props.value,t,r))}},{key:"render",value:function(){var e=this.props,t=e.children,r=(e.initialSelectedIndex,e.justified),l=babelHelpers.objectWithoutProperties(e,["children","initialSelectedIndex","justified"]),o=[],s=[],u=t.length,b=this.state.currentSelectedIndex%u,h=void 0,v=void 0,m=void 0,C=void 0;for(C=0;C<u;C++)v=t[C],v.type!==a.default&&i.raiseError("Expecting MUITab React Element"),h=C===b,o.push(n.default.createElement("li",{key:C,className:h?f:""},n.default.createElement("a",{onClick:this.onClick.bind(this,C,v)},v.props.label))),m=d+" ",h&&(m+=f),s.push(n.default.createElement("div",{key:C,className:m},v.props.children));return m=c,r&&(m+=" "+p),n.default.createElement("div",l,n.default.createElement("ul",{className:m},o),s)}}]),t}(n.default.Component);b.propTypes={initialSelectedIndex:u.number,justified:u.bool,onChange:u.func},b.defaultProps={className:"",initialSelectedIndex:0,justified:!1,onChange:null},r.default=b,t.exports=r.default},{"../js/lib/util":5,"./tab":9,react:"CwoHg3"}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,n=babelHelpers.interopRequireDefault(l),o=e("./text-field"),a=(n.default.PropTypes,function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){return n.default.createElement(o.TextField,this.props)}}]),t}(n.default.Component));a.defaultProps={type:"textarea"},r.default=a,t.exports=r.default},{"./text-field":10,react:"CwoHg3"}]},{},[1]); |
ajax/libs/react-sortable-hoc/0.4.3/react-sortable-hoc.js | ahocevar/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["SortableHOC"] = factory(require("react"), require("react-dom"));
else
root["SortableHOC"] = factory(root["React"], root["ReactDOM"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_112__, __WEBPACK_EXTERNAL_MODULE_113__) {
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__) {
module.exports = __webpack_require__(1);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.arrayMove = exports.sortableHandle = exports.sortableElement = exports.sortableContainer = exports.SortableHandle = exports.SortableElement = exports.SortableContainer = undefined;
var _utils = __webpack_require__(2);
Object.defineProperty(exports, 'arrayMove', {
enumerable: true,
get: function get() {
return _utils.arrayMove;
}
});
var _SortableContainer2 = __webpack_require__(3);
var _SortableContainer3 = _interopRequireDefault(_SortableContainer2);
var _SortableElement2 = __webpack_require__(266);
var _SortableElement3 = _interopRequireDefault(_SortableElement2);
var _SortableHandle2 = __webpack_require__(268);
var _SortableHandle3 = _interopRequireDefault(_SortableHandle2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.SortableContainer = _SortableContainer3.default;
exports.SortableElement = _SortableElement3.default;
exports.SortableHandle = _SortableHandle3.default;
exports.sortableContainer = _SortableContainer3.default;
exports.sortableElement = _SortableElement3.default;
exports.sortableHandle = _SortableHandle3.default;
/***/ },
/* 2 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.arrayMove = arrayMove;
exports.closest = closest;
exports.limit = limit;
exports.getElementMargin = getElementMargin;
exports.provideDisplayName = provideDisplayName;
function arrayMove(arr, previousIndex, newIndex) {
var array = arr.slice(0);
if (newIndex >= array.length) {
var k = newIndex - array.length;
while (k-- + 1) {
array.push(undefined);
}
}
array.splice(newIndex, 0, array.splice(previousIndex, 1)[0]);
return array;
}
var events = exports.events = {
start: ['touchstart', 'mousedown'],
move: ['touchmove', 'mousemove'],
end: ['touchend', 'touchcancel', 'mouseup']
};
var vendorPrefix = exports.vendorPrefix = function () {
if (typeof window === 'undefined' || typeof document === 'undefined') return ''; // server environment
// fix for:
// https://bugzilla.mozilla.org/show_bug.cgi?id=548397
// window.getComputedStyle() returns null inside an iframe with display: none
// in this case return an array with a fake mozilla style in it.
var styles = window.getComputedStyle(document.documentElement, '') || ['-moz-hidden-iframe'];
var pre = (Array.prototype.slice.call(styles).join('').match(/-(moz|webkit|ms)-/) || styles.OLink === '' && ['', 'o'])[1];
switch (pre) {
case 'ms':
return 'ms';
default:
return pre && pre.length ? pre[0].toUpperCase() + pre.substr(1) : '';
}
}();
function closest(el, fn) {
while (el) {
if (fn(el)) return el;
el = el.parentNode;
}
}
function limit(min, max, value) {
if (value < min) {
return min;
}
if (value > max) {
return max;
}
return value;
}
function getCSSPixelValue(stringValue) {
if (stringValue.substr(-2) === 'px') {
return parseFloat(stringValue);
}
return 0;
}
function getElementMargin(element) {
var style = window.getComputedStyle(element);
return {
top: getCSSPixelValue(style.marginTop),
right: getCSSPixelValue(style.marginRight),
bottom: getCSSPixelValue(style.marginBottom),
left: getCSSPixelValue(style.marginLeft)
};
}
function provideDisplayName(prefix, Component) {
var componentName = Component.displayName || Component.name;
return componentName ? prefix + '(' + componentName + ')' : prefix;
}
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(4);
var _extends3 = _interopRequireDefault(_extends2);
var _slicedToArray2 = __webpack_require__(42);
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
var _toConsumableArray2 = __webpack_require__(68);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _getPrototypeOf = __webpack_require__(76);
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__(80);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(81);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(85);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(104);
var _inherits3 = _interopRequireDefault(_inherits2);
exports.default = sortableContainer;
var _react = __webpack_require__(112);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(113);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _omit = __webpack_require__(114);
var _omit2 = _interopRequireDefault(_omit);
var _invariant = __webpack_require__(196);
var _invariant2 = _interopRequireDefault(_invariant);
var _Manager = __webpack_require__(198);
var _Manager2 = _interopRequireDefault(_Manager);
var _utils = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Export Higher Order Sortable Container Component
function sortableContainer(WrappedComponent) {
var _class, _temp;
var config = arguments.length <= 1 || arguments[1] === undefined ? { withRef: false } : arguments[1];
return _temp = _class = function (_Component) {
(0, _inherits3.default)(_class, _Component);
function _class(props) {
(0, _classCallCheck3.default)(this, _class);
var _this = (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(_class).call(this, props));
_this.handleStart = function (e) {
var _this$props = _this.props;
var distance = _this$props.distance;
var shouldCancelStart = _this$props.shouldCancelStart;
if (e.button === 2 || shouldCancelStart(e)) {
return false;
}
_this._touched = true;
_this._pos = {
x: e.clientX,
y: e.clientY
};
var node = (0, _utils.closest)(e.target, function (el) {
return el.sortableInfo != null;
});
if (node && node.sortableInfo && !_this.state.sorting) {
var useDragHandle = _this.props.useDragHandle;
var _node$sortableInfo = node.sortableInfo;
var index = _node$sortableInfo.index;
var collection = _node$sortableInfo.collection;
if (useDragHandle && !(0, _utils.closest)(e.target, function (el) {
return el.sortableHandle != null;
})) return;
_this.manager.active = { index: index, collection: collection };
if (!distance) {
if (_this.props.pressDelay === 0) {
_this.handlePress(e);
} else {
_this.pressTimer = setTimeout(function () {
return _this.handlePress(e);
}, _this.props.pressDelay);
}
}
}
};
_this.handleMove = function (e) {
var distance = _this.props.distance;
if (!_this.state.sorting && _this._touched) {
_this._delta = {
x: _this._pos.x - e.clientX,
y: _this._pos.y - e.clientY
};
var delta = Math.abs(_this._delta.x) + Math.abs(_this._delta.y);
if (!distance) {
clearTimeout(_this.cancelTimer);
_this.cancelTimer = setTimeout(_this.cancel, 0);
} else if (delta >= distance) {
_this.handlePress(e);
}
}
};
_this.handleEnd = function () {
var distance = _this.props.distance;
_this._touched = false;
if (!distance) {
_this.cancel();
}
};
_this.cancel = function () {
if (!_this.state.sorting) {
clearTimeout(_this.pressTimer);
_this.manager.active = null;
}
};
_this.handlePress = function (e) {
var active = _this.manager.getActive();
if (active) {
var _this$props2 = _this.props;
var axis = _this$props2.axis;
var getHelperDimensions = _this$props2.getHelperDimensions;
var helperClass = _this$props2.helperClass;
var hideSortableGhost = _this$props2.hideSortableGhost;
var onSortStart = _this$props2.onSortStart;
var useWindowAsScrollContainer = _this$props2.useWindowAsScrollContainer;
var node = active.node;
var collection = active.collection;
var index = node.sortableInfo.index;
var margin = (0, _utils.getElementMargin)(node);
var containerBoundingRect = _this.container.getBoundingClientRect();
var dimensions = getHelperDimensions({ index: index, node: node, collection: collection });
_this.node = node;
_this.margin = margin;
_this.width = dimensions.width;
_this.height = dimensions.height;
_this.marginOffset = {
x: _this.margin.left + _this.margin.right,
y: Math.max(_this.margin.top, _this.margin.bottom)
};
_this.boundingClientRect = node.getBoundingClientRect();
_this.containerBoundingRect = containerBoundingRect;
_this.index = index;
_this.newIndex = index;
_this.axis = {
x: axis.indexOf('x') >= 0,
y: axis.indexOf('y') >= 0
};
_this.offsetEdge = _this.getEdgeOffset(node);
_this.initialOffset = _this.getOffset(e);
_this.initialScroll = {
top: _this.scrollContainer.scrollTop,
left: _this.scrollContainer.scrollLeft
};
_this.helper = _this.document.body.appendChild(node.cloneNode(true));
_this.helper.style.position = 'fixed';
_this.helper.style.top = _this.boundingClientRect.top - margin.top + 'px';
_this.helper.style.left = _this.boundingClientRect.left - margin.left + 'px';
_this.helper.style.width = _this.width + 'px';
_this.helper.style.boxSizing = 'border-box';
if (hideSortableGhost) {
_this.sortableGhost = node;
node.style.visibility = 'hidden';
}
_this.minTranslate = {};
_this.maxTranslate = {};
if (_this.axis.x) {
_this.minTranslate.x = (useWindowAsScrollContainer ? 0 : containerBoundingRect.left) - _this.boundingClientRect.left - _this.width / 2;
_this.maxTranslate.x = (useWindowAsScrollContainer ? _this.contentWindow.innerWidth : containerBoundingRect.left + containerBoundingRect.width) - _this.boundingClientRect.left - _this.width / 2;
}
if (_this.axis.y) {
_this.minTranslate.y = (useWindowAsScrollContainer ? 0 : containerBoundingRect.top) - _this.boundingClientRect.top - _this.height / 2;
_this.maxTranslate.y = (useWindowAsScrollContainer ? _this.contentWindow.innerHeight : containerBoundingRect.top + containerBoundingRect.height) - _this.boundingClientRect.top - _this.height / 2;
}
if (helperClass) {
var _this$helper$classLis;
(_this$helper$classLis = _this.helper.classList).add.apply(_this$helper$classLis, (0, _toConsumableArray3.default)(helperClass.split(' ')));
}
_this.listenerNode = e.touches ? node : _this.contentWindow;
_utils.events.move.forEach(function (eventName) {
return _this.listenerNode.addEventListener(eventName, _this.handleSortMove, false);
});
_utils.events.end.forEach(function (eventName) {
return _this.listenerNode.addEventListener(eventName, _this.handleSortEnd, false);
});
_this.setState({
sorting: true,
sortingIndex: index
});
if (onSortStart) onSortStart({ node: node, index: index, collection: collection }, e);
}
};
_this.handleSortMove = function (e) {
var onSortMove = _this.props.onSortMove;
e.preventDefault(); // Prevent scrolling on mobile
_this.updatePosition(e);
_this.animateNodes();
_this.autoscroll();
if (onSortMove) onSortMove(e);
};
_this.handleSortEnd = function (e) {
var _this$props3 = _this.props;
var hideSortableGhost = _this$props3.hideSortableGhost;
var onSortEnd = _this$props3.onSortEnd;
var collection = _this.manager.active.collection;
// Remove the event listeners if the node is still in the DOM
if (_this.listenerNode) {
_utils.events.move.forEach(function (eventName) {
return _this.listenerNode.removeEventListener(eventName, _this.handleSortMove);
});
_utils.events.end.forEach(function (eventName) {
return _this.listenerNode.removeEventListener(eventName, _this.handleSortEnd);
});
}
// Remove the helper from the DOM
_this.helper.parentNode.removeChild(_this.helper);
if (hideSortableGhost && _this.sortableGhost) {
_this.sortableGhost.style.visibility = '';
}
var nodes = _this.manager.refs[collection];
for (var i = 0, len = nodes.length; i < len; i++) {
var node = nodes[i];
var el = node.node;
// Clear the cached offsetTop / offsetLeft value
node.edgeOffset = null;
// Remove the transforms / transitions
el.style[_utils.vendorPrefix + 'Transform'] = '';
el.style[_utils.vendorPrefix + 'TransitionDuration'] = '';
}
if (typeof onSortEnd === 'function') {
onSortEnd({
oldIndex: _this.index,
newIndex: _this.newIndex,
collection: collection
}, e);
}
// Stop autoscroll
clearInterval(_this.autoscrollInterval);
_this.autoscrollInterval = null;
// Update state
_this.manager.active = null;
_this.setState({
sorting: false,
sortingIndex: null
});
_this._touched = false;
};
_this.autoscroll = function () {
var translate = _this.translate;
var direction = {
x: 0,
y: 0
};
var speed = {
x: 1,
y: 1
};
var acceleration = {
x: 10,
y: 10
};
if (translate.y >= _this.maxTranslate.y - _this.height / 2) {
direction.y = 1; // Scroll Down
speed.y = acceleration.y * Math.abs((_this.maxTranslate.y - _this.height / 2 - translate.y) / _this.height);
} else if (translate.x >= _this.maxTranslate.x - _this.width / 2) {
direction.x = 1; // Scroll Right
speed.x = acceleration.x * Math.abs((_this.maxTranslate.x - _this.width / 2 - translate.x) / _this.width);
} else if (translate.y <= _this.minTranslate.y + _this.height / 2) {
direction.y = -1; // Scroll Up
speed.y = acceleration.y * Math.abs((translate.y - _this.height / 2 - _this.minTranslate.y) / _this.height);
} else if (translate.x <= _this.minTranslate.x + _this.width / 2) {
direction.x = -1; // Scroll Left
speed.x = acceleration.x * Math.abs((translate.x - _this.width / 2 - _this.minTranslate.x) / _this.width);
}
if (_this.autoscrollInterval) {
clearInterval(_this.autoscrollInterval);
_this.autoscrollInterval = null;
_this.isAutoScrolling = false;
}
if (direction.x !== 0 || direction.y !== 0) {
_this.autoscrollInterval = setInterval(function () {
_this.isAutoScrolling = true;
var offset = {
left: 1 * speed.x * direction.x,
top: 1 * speed.y * direction.y
};
_this.scrollContainer.scrollTop += offset.top;
_this.scrollContainer.scrollLeft += offset.left;
_this.translate.x += offset.left;
_this.translate.y += offset.top;
_this.animateNodes();
}, 5);
}
};
_this.manager = new _Manager2.default();
_this.events = {
start: _this.handleStart,
move: _this.handleMove,
end: _this.handleEnd
};
(0, _invariant2.default)(!(props.distance && props.pressDelay), 'Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.');
_this.state = {};
return _this;
}
(0, _createClass3.default)(_class, [{
key: 'getChildContext',
value: function getChildContext() {
return {
manager: this.manager
};
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
var _props = this.props;
var contentWindow = _props.contentWindow;
var getContainer = _props.getContainer;
var useWindowAsScrollContainer = _props.useWindowAsScrollContainer;
this.container = typeof getContainer === 'function' ? getContainer(this.getWrappedInstance()) : _reactDom2.default.findDOMNode(this);
this.document = this.container.ownerDocument || document;
this.scrollContainer = useWindowAsScrollContainer ? this.document.body : this.container;
this.contentWindow = typeof contentWindow === 'function' ? contentWindow() : contentWindow;
var _loop = function _loop(key) {
_utils.events[key].forEach(function (eventName) {
return _this2.container.addEventListener(eventName, _this2.events[key], false);
});
};
for (var key in this.events) {
_loop(key);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
var _this3 = this;
var _loop2 = function _loop2(key) {
_utils.events[key].forEach(function (eventName) {
return _this3.container.removeEventListener(eventName, _this3.events[key]);
});
};
for (var key in this.events) {
_loop2(key);
}
}
}, {
key: 'getEdgeOffset',
value: function getEdgeOffset(node) {
var offset = arguments.length <= 1 || arguments[1] === undefined ? { top: 0, left: 0 } : arguments[1];
// Get the actual offsetTop / offsetLeft value, no matter how deep the node is nested
if (node) {
var nodeOffset = {
top: offset.top + node.offsetTop,
left: offset.left + node.offsetLeft
};
if (node.parentNode !== this.container) {
return this.getEdgeOffset(node.parentNode, nodeOffset);
} else {
return nodeOffset;
}
}
}
}, {
key: 'getOffset',
value: function getOffset(e) {
return {
x: e.touches ? e.touches[0].clientX : e.clientX,
y: e.touches ? e.touches[0].clientY : e.clientY
};
}
}, {
key: 'getLockPixelOffsets',
value: function getLockPixelOffsets() {
var lockOffset = this.props.lockOffset;
if (!Array.isArray(lockOffset)) {
lockOffset = [lockOffset, lockOffset];
}
(0, _invariant2.default)(lockOffset.length === 2, 'lockOffset prop of SortableContainer should be a single ' + 'value or an array of exactly two values. Given %s', lockOffset);
var _lockOffset = lockOffset;
var _lockOffset2 = (0, _slicedToArray3.default)(_lockOffset, 2);
var minLockOffset = _lockOffset2[0];
var maxLockOffset = _lockOffset2[1];
return [this.getLockPixelOffset(minLockOffset), this.getLockPixelOffset(maxLockOffset)];
}
}, {
key: 'getLockPixelOffset',
value: function getLockPixelOffset(lockOffset) {
var offsetX = lockOffset;
var offsetY = lockOffset;
var unit = 'px';
if (typeof lockOffset === 'string') {
var match = /^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(lockOffset);
(0, _invariant2.default)(match !== null, 'lockOffset value should be a number or a string of a ' + 'number followed by "px" or "%". Given %s', lockOffset);
offsetX = offsetY = parseFloat(lockOffset);
unit = match[1];
}
(0, _invariant2.default)(isFinite(offsetX) && isFinite(offsetY), 'lockOffset value should be a finite. Given %s', lockOffset);
if (unit === '%') {
offsetX = offsetX * this.width / 100;
offsetY = offsetY * this.height / 100;
}
return {
x: offsetX,
y: offsetY
};
}
}, {
key: 'updatePosition',
value: function updatePosition(e) {
var _props2 = this.props;
var lockAxis = _props2.lockAxis;
var lockToContainerEdges = _props2.lockToContainerEdges;
var offset = this.getOffset(e);
var translate = {
x: offset.x - this.initialOffset.x,
y: offset.y - this.initialOffset.y
};
this.translate = translate;
if (lockToContainerEdges) {
var _getLockPixelOffsets = this.getLockPixelOffsets();
var _getLockPixelOffsets2 = (0, _slicedToArray3.default)(_getLockPixelOffsets, 2);
var minLockOffset = _getLockPixelOffsets2[0];
var maxLockOffset = _getLockPixelOffsets2[1];
var minOffset = {
x: this.width / 2 - minLockOffset.x,
y: this.height / 2 - minLockOffset.y
};
var maxOffset = {
x: this.width / 2 - maxLockOffset.x,
y: this.height / 2 - maxLockOffset.y
};
translate.x = (0, _utils.limit)(this.minTranslate.x + minOffset.x, this.maxTranslate.x - maxOffset.x, translate.x);
translate.y = (0, _utils.limit)(this.minTranslate.y + minOffset.y, this.maxTranslate.y - maxOffset.y, translate.y);
}
switch (lockAxis) {
case 'x':
translate.y = 0;
break;
case 'y':
translate.x = 0;
break;
}
this.helper.style[_utils.vendorPrefix + 'Transform'] = 'translate3d(' + translate.x + 'px,' + translate.y + 'px, 0)';
}
}, {
key: 'animateNodes',
value: function animateNodes() {
var _props3 = this.props;
var transitionDuration = _props3.transitionDuration;
var hideSortableGhost = _props3.hideSortableGhost;
var nodes = this.manager.getOrderedRefs();
var deltaScroll = {
left: this.scrollContainer.scrollLeft - this.initialScroll.left,
top: this.scrollContainer.scrollTop - this.initialScroll.top
};
var sortingOffset = {
left: this.offsetEdge.left + this.translate.x + deltaScroll.left,
top: this.offsetEdge.top + this.translate.y + deltaScroll.top
};
this.newIndex = null;
for (var i = 0, len = nodes.length; i < len; i++) {
var _nodes$i = nodes[i];
var node = _nodes$i.node;
var edgeOffset = _nodes$i.edgeOffset;
var index = node.sortableInfo.index;
var width = node.offsetWidth;
var height = node.offsetHeight;
var offset = {
width: this.width > width ? width / 2 : this.width / 2,
height: this.height > height ? height / 2 : this.height / 2
};
var translate = {
x: 0,
y: 0
};
// If we haven't cached the node's offsetTop / offsetLeft value
if (!edgeOffset) {
nodes[i].edgeOffset = edgeOffset = this.getEdgeOffset(node);
}
// Get a reference to the next and previous node
var nextNode = i < nodes.length - 1 && nodes[i + 1];
var prevNode = i > 0 && nodes[i - 1];
// Also cache the next node's edge offset if needed.
// We need this for calculating the animation in a grid setup
if (nextNode && !nextNode.edgeOffset) {
nextNode.edgeOffset = this.getEdgeOffset(nextNode.node);
}
// If the node is the one we're currently animating, skip it
if (index === this.index) {
if (hideSortableGhost) {
/*
* With windowing libraries such as `react-virtualized`, the sortableGhost
* node may change while scrolling down and then back up (or vice-versa),
* so we need to update the reference to the new node just to be safe.
*/
this.sortableGhost = node;
node.style.visibility = 'hidden';
}
continue;
}
if (transitionDuration) {
node.style[_utils.vendorPrefix + 'TransitionDuration'] = transitionDuration + 'ms';
}
if (this.axis.x) {
if (this.axis.y) {
// Calculations for a grid setup
if (index < this.index && (sortingOffset.left - offset.width <= edgeOffset.left && sortingOffset.top <= edgeOffset.top + offset.height || sortingOffset.top + offset.height <= edgeOffset.top)) {
// If the current node is to the left on the same row, or above the node that's being dragged
// then move it to the right
translate.x = this.width + this.marginOffset.x;
if (edgeOffset.left + translate.x > this.containerBoundingRect.width - offset.width) {
// If it moves passed the right bounds, then animate it to the first position of the next row.
// We just use the offset of the next node to calculate where to move, because that node's original position
// is exactly where we want to go
translate.x = nextNode.edgeOffset.left - edgeOffset.left;
translate.y = nextNode.edgeOffset.top - edgeOffset.top;
}
if (this.newIndex === null) {
this.newIndex = index;
}
} else if (index > this.index && (sortingOffset.left + offset.width >= edgeOffset.left && sortingOffset.top + offset.height >= edgeOffset.top || sortingOffset.top + offset.height >= edgeOffset.top + height)) {
// If the current node is to the right on the same row, or below the node that's being dragged
// then move it to the left
translate.x = -(this.width + this.marginOffset.x);
if (edgeOffset.left + translate.x < this.containerBoundingRect.left + offset.width) {
// If it moves passed the left bounds, then animate it to the last position of the previous row.
// We just use the offset of the previous node to calculate where to move, because that node's original position
// is exactly where we want to go
translate.x = prevNode.edgeOffset.left - edgeOffset.left;
translate.y = prevNode.edgeOffset.top - edgeOffset.top;
}
this.newIndex = index;
}
} else {
if (index > this.index && sortingOffset.left + offset.width >= edgeOffset.left) {
translate.x = -(this.width + this.marginOffset.x);
this.newIndex = index;
} else if (index < this.index && sortingOffset.left <= edgeOffset.left + offset.width) {
translate.x = this.width + this.marginOffset.x;
if (this.newIndex == null) {
this.newIndex = index;
}
}
}
} else if (this.axis.y) {
if (index > this.index && sortingOffset.top + offset.height >= edgeOffset.top) {
translate.y = -(this.height + this.marginOffset.y);
this.newIndex = index;
} else if (index < this.index && sortingOffset.top <= edgeOffset.top + offset.height) {
translate.y = this.height + this.marginOffset.y;
if (this.newIndex == null) {
this.newIndex = index;
}
}
}
node.style[_utils.vendorPrefix + 'Transform'] = 'translate3d(' + translate.x + 'px,' + translate.y + 'px,0)';
}
if (this.newIndex == null) {
this.newIndex = this.index;
}
}
}, {
key: 'getWrappedInstance',
value: function getWrappedInstance() {
(0, _invariant2.default)(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call');
return this.refs.wrappedInstance;
}
}, {
key: 'render',
value: function render() {
var ref = config.withRef ? 'wrappedInstance' : null;
return _react2.default.createElement(WrappedComponent, (0, _extends3.default)({
ref: ref
}, (0, _omit2.default)(this.props, 'contentWindow', 'useWindowAsScrollContainer', 'distance', 'helperClass', 'hideSortableGhost', 'transitionDuration', 'useDragHandle', 'pressDelay', 'shouldCancelStart', 'onSortStart', 'onSortMove', 'onSortEnd', 'axis', 'lockAxis', 'lockOffset', 'lockToContainerEdges', 'getContainer')));
}
}]);
return _class;
}(_react.Component), _class.displayName = (0, _utils.provideDisplayName)('sortableList', WrappedComponent), _class.defaultProps = {
axis: 'y',
transitionDuration: 300,
pressDelay: 0,
distance: 0,
useWindowAsScrollContainer: false,
hideSortableGhost: true,
contentWindow: typeof window !== 'undefined' ? window : null,
shouldCancelStart: function shouldCancelStart(e) {
// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
if (['input', 'textarea', 'select', 'option'].indexOf(e.target.tagName.toLowerCase()) !== -1) {
return true; // Return true to cancel sorting
}
},
lockToContainerEdges: false,
lockOffset: '50%',
getHelperDimensions: function getHelperDimensions(_ref) {
var node = _ref.node;
return {
width: node.offsetWidth,
height: node.offsetHeight
};
}
}, _class.propTypes = {
axis: _react.PropTypes.oneOf(['x', 'y', 'xy']),
distance: _react.PropTypes.number,
lockAxis: _react.PropTypes.string,
helperClass: _react.PropTypes.string,
transitionDuration: _react.PropTypes.number,
contentWindow: _react.PropTypes.any,
onSortStart: _react.PropTypes.func,
onSortMove: _react.PropTypes.func,
onSortEnd: _react.PropTypes.func,
shouldCancelStart: _react.PropTypes.func,
pressDelay: _react.PropTypes.number,
useDragHandle: _react.PropTypes.bool,
useWindowAsScrollContainer: _react.PropTypes.bool,
hideSortableGhost: _react.PropTypes.bool,
lockToContainerEdges: _react.PropTypes.bool,
lockOffset: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string, _react.PropTypes.arrayOf(_react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]))]),
getContainer: _react.PropTypes.func,
getHelperDimensions: _react.PropTypes.func
}, _class.childContextTypes = {
manager: _react.PropTypes.object.isRequired
}, _temp;
}
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _assign = __webpack_require__(5);
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _assign2.default || 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;
};
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(6), __esModule: true };
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(7);
module.exports = __webpack_require__(10).Object.assign;
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(8);
$export($export.S + $export.F, 'Object', {assign: __webpack_require__(23)});
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(9)
, core = __webpack_require__(10)
, ctx = __webpack_require__(11)
, hide = __webpack_require__(13)
, PROTOTYPE = 'prototype';
var $export = function(type, name, source){
var IS_FORCED = type & $export.F
, IS_GLOBAL = type & $export.G
, IS_STATIC = type & $export.S
, IS_PROTO = type & $export.P
, IS_BIND = type & $export.B
, IS_WRAP = type & $export.W
, exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
, expProto = exports[PROTOTYPE]
, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
, key, own, out;
if(IS_GLOBAL)source = name;
for(key in source){
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if(own && key in exports)continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function(C){
var F = function(a, b, c){
if(this instanceof C){
switch(arguments.length){
case 0: return new C;
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if(IS_PROTO){
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ },
/* 9 */
/***/ function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
/***/ },
/* 10 */
/***/ function(module, exports) {
var core = module.exports = {version: '2.4.0'};
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(12);
module.exports = function(fn, that, length){
aFunction(fn);
if(that === undefined)return fn;
switch(length){
case 1: return function(a){
return fn.call(that, a);
};
case 2: return function(a, b){
return fn.call(that, a, b);
};
case 3: return function(a, b, c){
return fn.call(that, a, b, c);
};
}
return function(/* ...args */){
return fn.apply(that, arguments);
};
};
/***/ },
/* 12 */
/***/ function(module, exports) {
module.exports = function(it){
if(typeof it != 'function')throw TypeError(it + ' is not a function!');
return it;
};
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
var dP = __webpack_require__(14)
, createDesc = __webpack_require__(22);
module.exports = __webpack_require__(18) ? function(object, key, value){
return dP.f(object, key, createDesc(1, value));
} : function(object, key, value){
object[key] = value;
return object;
};
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(15)
, IE8_DOM_DEFINE = __webpack_require__(17)
, toPrimitive = __webpack_require__(21)
, dP = Object.defineProperty;
exports.f = __webpack_require__(18) ? Object.defineProperty : function defineProperty(O, P, Attributes){
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if(IE8_DOM_DEFINE)try {
return dP(O, P, Attributes);
} catch(e){ /* empty */ }
if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
if('value' in Attributes)O[P] = Attributes.value;
return O;
};
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(16);
module.exports = function(it){
if(!isObject(it))throw TypeError(it + ' is not an object!');
return it;
};
/***/ },
/* 16 */
/***/ function(module, exports) {
module.exports = function(it){
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(18) && !__webpack_require__(19)(function(){
return Object.defineProperty(__webpack_require__(20)('div'), 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(19)(function(){
return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ },
/* 19 */
/***/ function(module, exports) {
module.exports = function(exec){
try {
return !!exec();
} catch(e){
return true;
}
};
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(16)
, document = __webpack_require__(9).document
// in old IE typeof document.createElement is 'object'
, is = isObject(document) && isObject(document.createElement);
module.exports = function(it){
return is ? document.createElement(it) : {};
};
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(16);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function(it, S){
if(!isObject(it))return it;
var fn, val;
if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ },
/* 22 */
/***/ function(module, exports) {
module.exports = function(bitmap, value){
return {
enumerable : !(bitmap & 1),
configurable: !(bitmap & 2),
writable : !(bitmap & 4),
value : value
};
};
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__(24)
, gOPS = __webpack_require__(39)
, pIE = __webpack_require__(40)
, toObject = __webpack_require__(41)
, IObject = __webpack_require__(28)
, $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(19)(function(){
var A = {}
, B = {}
, S = Symbol()
, K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function(k){ B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source){ // eslint-disable-line no-unused-vars
var T = toObject(target)
, aLen = arguments.length
, index = 1
, getSymbols = gOPS.f
, isEnum = pIE.f;
while(aLen > index){
var S = IObject(arguments[index++])
, keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
, length = keys.length
, j = 0
, key;
while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
} return T;
} : $assign;
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(25)
, enumBugKeys = __webpack_require__(38);
module.exports = Object.keys || function keys(O){
return $keys(O, enumBugKeys);
};
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
var has = __webpack_require__(26)
, toIObject = __webpack_require__(27)
, arrayIndexOf = __webpack_require__(31)(false)
, IE_PROTO = __webpack_require__(35)('IE_PROTO');
module.exports = function(object, names){
var O = toIObject(object)
, i = 0
, result = []
, key;
for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while(names.length > i)if(has(O, key = names[i++])){
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ },
/* 26 */
/***/ function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function(it, key){
return hasOwnProperty.call(it, key);
};
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(28)
, defined = __webpack_require__(30);
module.exports = function(it){
return IObject(defined(it));
};
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(29);
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ },
/* 29 */
/***/ function(module, exports) {
var toString = {}.toString;
module.exports = function(it){
return toString.call(it).slice(8, -1);
};
/***/ },
/* 30 */
/***/ function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function(it){
if(it == undefined)throw TypeError("Can't call method on " + it);
return it;
};
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(27)
, toLength = __webpack_require__(32)
, toIndex = __webpack_require__(34);
module.exports = function(IS_INCLUDES){
return function($this, el, fromIndex){
var O = toIObject($this)
, length = toLength(O.length)
, index = toIndex(fromIndex, length)
, value;
// Array#includes uses SameValueZero equality algorithm
if(IS_INCLUDES && el != el)while(length > index){
value = O[index++];
if(value != value)return true;
// Array#toIndex ignores holes, Array#includes - not
} else for(;length > index; index++)if(IS_INCLUDES || index in O){
if(O[index] === el)return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(33)
, min = Math.min;
module.exports = function(it){
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ },
/* 33 */
/***/ function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil
, floor = Math.floor;
module.exports = function(it){
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(33)
, max = Math.max
, min = Math.min;
module.exports = function(index, length){
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
var shared = __webpack_require__(36)('keys')
, uid = __webpack_require__(37);
module.exports = function(key){
return shared[key] || (shared[key] = uid(key));
};
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(9)
, SHARED = '__core-js_shared__'
, store = global[SHARED] || (global[SHARED] = {});
module.exports = function(key){
return store[key] || (store[key] = {});
};
/***/ },
/* 37 */
/***/ function(module, exports) {
var id = 0
, px = Math.random();
module.exports = function(key){
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ },
/* 38 */
/***/ function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ },
/* 39 */
/***/ function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ },
/* 40 */
/***/ function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(30);
module.exports = function(it){
return Object(defined(it));
};
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _isIterable2 = __webpack_require__(43);
var _isIterable3 = _interopRequireDefault(_isIterable2);
var _getIterator2 = __webpack_require__(64);
var _getIterator3 = _interopRequireDefault(_getIterator2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if ((0, _isIterable3.default)(Object(arr))) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(44), __esModule: true };
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(45);
__webpack_require__(60);
module.exports = __webpack_require__(62);
/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(46);
var global = __webpack_require__(9)
, hide = __webpack_require__(13)
, Iterators = __webpack_require__(49)
, TO_STRING_TAG = __webpack_require__(58)('toStringTag');
for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
var NAME = collections[i]
, Collection = global[NAME]
, proto = Collection && Collection.prototype;
if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = Iterators.Array;
}
/***/ },
/* 46 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var addToUnscopables = __webpack_require__(47)
, step = __webpack_require__(48)
, Iterators = __webpack_require__(49)
, toIObject = __webpack_require__(27);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(50)(Array, 'Array', function(iterated, kind){
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function(){
var O = this._t
, kind = this._k
, index = this._i++;
if(!O || index >= O.length){
this._t = undefined;
return step(1);
}
if(kind == 'keys' )return step(0, index);
if(kind == 'values')return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ },
/* 47 */
/***/ function(module, exports) {
module.exports = function(){ /* empty */ };
/***/ },
/* 48 */
/***/ function(module, exports) {
module.exports = function(done, value){
return {value: value, done: !!done};
};
/***/ },
/* 49 */
/***/ function(module, exports) {
module.exports = {};
/***/ },
/* 50 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(51)
, $export = __webpack_require__(8)
, redefine = __webpack_require__(52)
, hide = __webpack_require__(13)
, has = __webpack_require__(26)
, Iterators = __webpack_require__(49)
, $iterCreate = __webpack_require__(53)
, setToStringTag = __webpack_require__(57)
, getPrototypeOf = __webpack_require__(59)
, ITERATOR = __webpack_require__(58)('iterator')
, BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
, FF_ITERATOR = '@@iterator'
, KEYS = 'keys'
, VALUES = 'values';
var returnThis = function(){ return this; };
module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
$iterCreate(Constructor, NAME, next);
var getMethod = function(kind){
if(!BUGGY && kind in proto)return proto[kind];
switch(kind){
case KEYS: return function keys(){ return new Constructor(this, kind); };
case VALUES: return function values(){ return new Constructor(this, kind); };
} return function entries(){ return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator'
, DEF_VALUES = DEFAULT == VALUES
, VALUES_BUG = false
, proto = Base.prototype
, $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
, $default = $native || getMethod(DEFAULT)
, $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
, $anyNative = NAME == 'Array' ? proto.entries || $native : $native
, methods, key, IteratorPrototype;
// Fix native
if($anyNative){
IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
if(IteratorPrototype !== Object.prototype){
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if(DEF_VALUES && $native && $native.name !== VALUES){
VALUES_BUG = true;
$default = function values(){ return $native.call(this); };
}
// Define iterator
if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if(DEFAULT){
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if(FORCED)for(key in methods){
if(!(key in proto))redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ },
/* 51 */
/***/ function(module, exports) {
module.exports = true;
/***/ },
/* 52 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(13);
/***/ },
/* 53 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var create = __webpack_require__(54)
, descriptor = __webpack_require__(22)
, setToStringTag = __webpack_require__(57)
, IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(13)(IteratorPrototype, __webpack_require__(58)('iterator'), function(){ return this; });
module.exports = function(Constructor, NAME, next){
Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(15)
, dPs = __webpack_require__(55)
, enumBugKeys = __webpack_require__(38)
, IE_PROTO = __webpack_require__(35)('IE_PROTO')
, Empty = function(){ /* empty */ }
, PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function(){
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(20)('iframe')
, i = enumBugKeys.length
, gt = '>'
, iframeDocument;
iframe.style.display = 'none';
__webpack_require__(56).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write('<script>document.F=Object</script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties){
var result;
if(O !== null){
Empty[PROTOTYPE] = anObject(O);
result = new Empty;
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ },
/* 55 */
/***/ function(module, exports, __webpack_require__) {
var dP = __webpack_require__(14)
, anObject = __webpack_require__(15)
, getKeys = __webpack_require__(24);
module.exports = __webpack_require__(18) ? Object.defineProperties : function defineProperties(O, Properties){
anObject(O);
var keys = getKeys(Properties)
, length = keys.length
, i = 0
, P;
while(length > i)dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ },
/* 56 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(9).document && document.documentElement;
/***/ },
/* 57 */
/***/ function(module, exports, __webpack_require__) {
var def = __webpack_require__(14).f
, has = __webpack_require__(26)
, TAG = __webpack_require__(58)('toStringTag');
module.exports = function(it, tag, stat){
if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
};
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
var store = __webpack_require__(36)('wks')
, uid = __webpack_require__(37)
, Symbol = __webpack_require__(9).Symbol
, USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function(name){
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ },
/* 59 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(26)
, toObject = __webpack_require__(41)
, IE_PROTO = __webpack_require__(35)('IE_PROTO')
, ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function(O){
O = toObject(O);
if(has(O, IE_PROTO))return O[IE_PROTO];
if(typeof O.constructor == 'function' && O instanceof O.constructor){
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ },
/* 60 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $at = __webpack_require__(61)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(50)(String, 'String', function(iterated){
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function(){
var O = this._t
, index = this._i
, point;
if(index >= O.length)return {value: undefined, done: true};
point = $at(O, index);
this._i += point.length;
return {value: point, done: false};
});
/***/ },
/* 61 */
/***/ function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(33)
, defined = __webpack_require__(30);
// true -> String#at
// false -> String#codePointAt
module.exports = function(TO_STRING){
return function(that, pos){
var s = String(defined(that))
, i = toInteger(pos)
, l = s.length
, a, b;
if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ },
/* 62 */
/***/ function(module, exports, __webpack_require__) {
var classof = __webpack_require__(63)
, ITERATOR = __webpack_require__(58)('iterator')
, Iterators = __webpack_require__(49);
module.exports = __webpack_require__(10).isIterable = function(it){
var O = Object(it);
return O[ITERATOR] !== undefined
|| '@@iterator' in O
|| Iterators.hasOwnProperty(classof(O));
};
/***/ },
/* 63 */
/***/ function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(29)
, TAG = __webpack_require__(58)('toStringTag')
// ES3 wrong here
, ARG = cof(function(){ return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function(it, key){
try {
return it[key];
} catch(e){ /* empty */ }
};
module.exports = function(it){
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(65), __esModule: true };
/***/ },
/* 65 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(45);
__webpack_require__(60);
module.exports = __webpack_require__(66);
/***/ },
/* 66 */
/***/ function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(15)
, get = __webpack_require__(67);
module.exports = __webpack_require__(10).getIterator = function(it){
var iterFn = get(it);
if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!');
return anObject(iterFn.call(it));
};
/***/ },
/* 67 */
/***/ function(module, exports, __webpack_require__) {
var classof = __webpack_require__(63)
, ITERATOR = __webpack_require__(58)('iterator')
, Iterators = __webpack_require__(49);
module.exports = __webpack_require__(10).getIteratorMethod = function(it){
if(it != undefined)return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ },
/* 68 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _from = __webpack_require__(69);
var _from2 = _interopRequireDefault(_from);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return (0, _from2.default)(arr);
}
};
/***/ },
/* 69 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(70), __esModule: true };
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(60);
__webpack_require__(71);
module.exports = __webpack_require__(10).Array.from;
/***/ },
/* 71 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var ctx = __webpack_require__(11)
, $export = __webpack_require__(8)
, toObject = __webpack_require__(41)
, call = __webpack_require__(72)
, isArrayIter = __webpack_require__(73)
, toLength = __webpack_require__(32)
, createProperty = __webpack_require__(74)
, getIterFn = __webpack_require__(67);
$export($export.S + $export.F * !__webpack_require__(75)(function(iter){ Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
var O = toObject(arrayLike)
, C = typeof this == 'function' ? this : Array
, aLen = arguments.length
, mapfn = aLen > 1 ? arguments[1] : undefined
, mapping = mapfn !== undefined
, index = 0
, iterFn = getIterFn(O)
, length, result, step, iterator;
if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for(result = new C(length); length > index; index++){
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ },
/* 72 */
/***/ function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(15);
module.exports = function(iterator, fn, value, entries){
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch(e){
var ret = iterator['return'];
if(ret !== undefined)anObject(ret.call(iterator));
throw e;
}
};
/***/ },
/* 73 */
/***/ function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(49)
, ITERATOR = __webpack_require__(58)('iterator')
, ArrayProto = Array.prototype;
module.exports = function(it){
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ },
/* 74 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $defineProperty = __webpack_require__(14)
, createDesc = __webpack_require__(22);
module.exports = function(object, index, value){
if(index in object)$defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ },
/* 75 */
/***/ function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(58)('iterator')
, SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function(){ SAFE_CLOSING = true; };
Array.from(riter, function(){ throw 2; });
} catch(e){ /* empty */ }
module.exports = function(exec, skipClosing){
if(!skipClosing && !SAFE_CLOSING)return false;
var safe = false;
try {
var arr = [7]
, iter = arr[ITERATOR]();
iter.next = function(){ return {done: safe = true}; };
arr[ITERATOR] = function(){ return iter; };
exec(arr);
} catch(e){ /* empty */ }
return safe;
};
/***/ },
/* 76 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(77), __esModule: true };
/***/ },
/* 77 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(78);
module.exports = __webpack_require__(10).Object.getPrototypeOf;
/***/ },
/* 78 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__(41)
, $getPrototypeOf = __webpack_require__(59);
__webpack_require__(79)('getPrototypeOf', function(){
return function getPrototypeOf(it){
return $getPrototypeOf(toObject(it));
};
});
/***/ },
/* 79 */
/***/ function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(8)
, core = __webpack_require__(10)
, fails = __webpack_require__(19);
module.exports = function(KEY, exec){
var fn = (core.Object || {})[KEY] || Object[KEY]
, exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
};
/***/ },
/* 80 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
/***/ },
/* 81 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _defineProperty = __webpack_require__(82);
var _defineProperty2 = _interopRequireDefault(_defineProperty);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = 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;
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
/***/ },
/* 82 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(83), __esModule: true };
/***/ },
/* 83 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(84);
var $Object = __webpack_require__(10).Object;
module.exports = function defineProperty(it, key, desc){
return $Object.defineProperty(it, key, desc);
};
/***/ },
/* 84 */
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(18), 'Object', {defineProperty: __webpack_require__(14).f});
/***/ },
/* 85 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof2 = __webpack_require__(86);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
};
/***/ },
/* 86 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _iterator = __webpack_require__(87);
var _iterator2 = _interopRequireDefault(_iterator);
var _symbol = __webpack_require__(90);
var _symbol2 = _interopRequireDefault(_symbol);
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof(obj);
} : function (obj) {
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
};
/***/ },
/* 87 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(88), __esModule: true };
/***/ },
/* 88 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(60);
__webpack_require__(45);
module.exports = __webpack_require__(89).f('iterator');
/***/ },
/* 89 */
/***/ function(module, exports, __webpack_require__) {
exports.f = __webpack_require__(58);
/***/ },
/* 90 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(91), __esModule: true };
/***/ },
/* 91 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(92);
__webpack_require__(101);
__webpack_require__(102);
__webpack_require__(103);
module.exports = __webpack_require__(10).Symbol;
/***/ },
/* 92 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
// ECMAScript 6 symbols shim
var global = __webpack_require__(9)
, has = __webpack_require__(26)
, DESCRIPTORS = __webpack_require__(18)
, $export = __webpack_require__(8)
, redefine = __webpack_require__(52)
, META = __webpack_require__(93).KEY
, $fails = __webpack_require__(19)
, shared = __webpack_require__(36)
, setToStringTag = __webpack_require__(57)
, uid = __webpack_require__(37)
, wks = __webpack_require__(58)
, wksExt = __webpack_require__(89)
, wksDefine = __webpack_require__(94)
, keyOf = __webpack_require__(95)
, enumKeys = __webpack_require__(96)
, isArray = __webpack_require__(97)
, anObject = __webpack_require__(15)
, toIObject = __webpack_require__(27)
, toPrimitive = __webpack_require__(21)
, createDesc = __webpack_require__(22)
, _create = __webpack_require__(54)
, gOPNExt = __webpack_require__(98)
, $GOPD = __webpack_require__(100)
, $DP = __webpack_require__(14)
, $keys = __webpack_require__(24)
, gOPD = $GOPD.f
, dP = $DP.f
, gOPN = gOPNExt.f
, $Symbol = global.Symbol
, $JSON = global.JSON
, _stringify = $JSON && $JSON.stringify
, PROTOTYPE = 'prototype'
, HIDDEN = wks('_hidden')
, TO_PRIMITIVE = wks('toPrimitive')
, isEnum = {}.propertyIsEnumerable
, SymbolRegistry = shared('symbol-registry')
, AllSymbols = shared('symbols')
, OPSymbols = shared('op-symbols')
, ObjectProto = Object[PROTOTYPE]
, USE_NATIVE = typeof $Symbol == 'function'
, QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function(){
return _create(dP({}, 'a', {
get: function(){ return dP(this, 'a', {value: 7}).a; }
})).a != 7;
}) ? function(it, key, D){
var protoDesc = gOPD(ObjectProto, key);
if(protoDesc)delete ObjectProto[key];
dP(it, key, D);
if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function(tag){
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
return typeof it == 'symbol';
} : function(it){
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D){
if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if(has(AllSymbols, key)){
if(!D.enumerable){
if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
D = _create(D, {enumerable: createDesc(0, false)});
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P){
anObject(it);
var keys = enumKeys(P = toIObject(P))
, i = 0
, l = keys.length
, key;
while(l > i)$defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P){
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key){
var E = isEnum.call(this, key = toPrimitive(key, true));
if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
it = toIObject(it);
key = toPrimitive(key, true);
if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
var D = gOPD(it, key);
if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it){
var names = gOPN(toIObject(it))
, result = []
, i = 0
, key;
while(names.length > i){
if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
var IS_OP = it === ObjectProto
, names = gOPN(IS_OP ? OPSymbols : toIObject(it))
, result = []
, i = 0
, key;
while(names.length > i){
if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if(!USE_NATIVE){
$Symbol = function Symbol(){
if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function(value){
if(this === ObjectProto)$set.call(OPSymbols, value);
if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString(){
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__(99).f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__(40).f = $propertyIsEnumerable;
__webpack_require__(39).f = $getOwnPropertySymbols;
if(DESCRIPTORS && !__webpack_require__(51)){
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function(name){
return wrap(wks(name));
}
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
for(var symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function(key){
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(key){
if(isSymbol(key))return keyOf(SymbolRegistry, key);
throw TypeError(key + ' is not a symbol!');
},
useSetter: function(){ setter = true; },
useSimple: function(){ setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it){
if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
var args = [it]
, i = 1
, replacer, $replacer;
while(arguments.length > i)args.push(arguments[i++]);
replacer = args[1];
if(typeof replacer == 'function')$replacer = replacer;
if($replacer || !isArray(replacer))replacer = function(key, value){
if($replacer)value = $replacer.call(this, key, value);
if(!isSymbol(value))return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(13)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ },
/* 93 */
/***/ function(module, exports, __webpack_require__) {
var META = __webpack_require__(37)('meta')
, isObject = __webpack_require__(16)
, has = __webpack_require__(26)
, setDesc = __webpack_require__(14).f
, id = 0;
var isExtensible = Object.isExtensible || function(){
return true;
};
var FREEZE = !__webpack_require__(19)(function(){
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function(it){
setDesc(it, META, {value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
}});
};
var fastKey = function(it, create){
// return primitive with prefix
if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if(!has(it, META)){
// can't set metadata to uncaught frozen object
if(!isExtensible(it))return 'F';
// not necessary to add metadata
if(!create)return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function(it, create){
if(!has(it, META)){
// can't set metadata to uncaught frozen object
if(!isExtensible(it))return true;
// not necessary to add metadata
if(!create)return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function(it){
if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ },
/* 94 */
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(9)
, core = __webpack_require__(10)
, LIBRARY = __webpack_require__(51)
, wksExt = __webpack_require__(89)
, defineProperty = __webpack_require__(14).f;
module.exports = function(name){
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
};
/***/ },
/* 95 */
/***/ function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(24)
, toIObject = __webpack_require__(27);
module.exports = function(object, el){
var O = toIObject(object)
, keys = getKeys(O)
, length = keys.length
, index = 0
, key;
while(length > index)if(O[key = keys[index++]] === el)return key;
};
/***/ },
/* 96 */
/***/ function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(24)
, gOPS = __webpack_require__(39)
, pIE = __webpack_require__(40);
module.exports = function(it){
var result = getKeys(it)
, getSymbols = gOPS.f;
if(getSymbols){
var symbols = getSymbols(it)
, isEnum = pIE.f
, i = 0
, key;
while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
} return result;
};
/***/ },
/* 97 */
/***/ function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(29);
module.exports = Array.isArray || function isArray(arg){
return cof(arg) == 'Array';
};
/***/ },
/* 98 */
/***/ function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(27)
, gOPN = __webpack_require__(99).f
, toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function(it){
try {
return gOPN(it);
} catch(e){
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it){
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ },
/* 99 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(25)
, hiddenKeys = __webpack_require__(38).concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
return $keys(O, hiddenKeys);
};
/***/ },
/* 100 */
/***/ function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(40)
, createDesc = __webpack_require__(22)
, toIObject = __webpack_require__(27)
, toPrimitive = __webpack_require__(21)
, has = __webpack_require__(26)
, IE8_DOM_DEFINE = __webpack_require__(17)
, gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(18) ? gOPD : function getOwnPropertyDescriptor(O, P){
O = toIObject(O);
P = toPrimitive(P, true);
if(IE8_DOM_DEFINE)try {
return gOPD(O, P);
} catch(e){ /* empty */ }
if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ },
/* 101 */
/***/ function(module, exports) {
/***/ },
/* 102 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(94)('asyncIterator');
/***/ },
/* 103 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(94)('observable');
/***/ },
/* 104 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _setPrototypeOf = __webpack_require__(105);
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
var _create = __webpack_require__(109);
var _create2 = _interopRequireDefault(_create);
var _typeof2 = __webpack_require__(86);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
}
subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
};
/***/ },
/* 105 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(106), __esModule: true };
/***/ },
/* 106 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(107);
module.exports = __webpack_require__(10).Object.setPrototypeOf;
/***/ },
/* 107 */
/***/ function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(8);
$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(108).set});
/***/ },
/* 108 */
/***/ function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(16)
, anObject = __webpack_require__(15);
var check = function(O, proto){
anObject(O);
if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function(test, buggy, set){
try {
set = __webpack_require__(11)(Function.call, __webpack_require__(100).f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch(e){ buggy = true; }
return function setPrototypeOf(O, proto){
check(O, proto);
if(buggy)O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ },
/* 109 */
/***/ function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(110), __esModule: true };
/***/ },
/* 110 */
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(111);
var $Object = __webpack_require__(10).Object;
module.exports = function create(P, D){
return $Object.create(P, D);
};
/***/ },
/* 111 */
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(8)
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', {create: __webpack_require__(54)});
/***/ },
/* 112 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_112__;
/***/ },
/* 113 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_113__;
/***/ },
/* 114 */
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(115),
baseDifference = __webpack_require__(116),
baseFlatten = __webpack_require__(162),
basePick = __webpack_require__(174),
baseRest = __webpack_require__(176),
getAllKeysIn = __webpack_require__(178),
toKey = __webpack_require__(194);
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable string keyed properties of `object` that are
* not omitted.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [props] The property identifiers 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 = baseRest(function(object, props) {
if (object == null) {
return {};
}
props = arrayMap(baseFlatten(props, 1), toKey);
return basePick(object, baseDifference(getAllKeysIn(object), props));
});
module.exports = omit;
/***/ },
/* 115 */
/***/ 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 ? array.length : 0,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ },
/* 116 */
/***/ function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(117),
arrayIncludes = __webpack_require__(155),
arrayIncludesWith = __webpack_require__(159),
arrayMap = __webpack_require__(115),
baseUnary = __webpack_require__(160),
cacheHas = __webpack_require__(161);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
module.exports = baseDifference;
/***/ },
/* 117 */
/***/ function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(118),
setCacheAdd = __webpack_require__(153),
setCacheHas = __webpack_require__(154);
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ },
/* 118 */
/***/ function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(119),
mapCacheDelete = __webpack_require__(147),
mapCacheGet = __webpack_require__(150),
mapCacheHas = __webpack_require__(151),
mapCacheSet = __webpack_require__(152);
/**
* 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 ? entries.length : 0;
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;
/***/ },
/* 119 */
/***/ function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(120),
ListCache = __webpack_require__(138),
Map = __webpack_require__(146);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ },
/* 120 */
/***/ function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(121),
hashDelete = __webpack_require__(134),
hashGet = __webpack_require__(135),
hashHas = __webpack_require__(136),
hashSet = __webpack_require__(137);
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
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;
/***/ },
/* 121 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(122);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
module.exports = hashClear;
/***/ },
/* 122 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(123);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ },
/* 123 */
/***/ function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(124),
getValue = __webpack_require__(133);
/**
* 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;
/***/ },
/* 124 */
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(125),
isHostObject = __webpack_require__(127),
isMasked = __webpack_require__(128),
isObject = __webpack_require__(126),
toSource = __webpack_require__(132);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.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) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ },
/* 125 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(126);
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* 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) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
module.exports = isFunction;
/***/ },
/* 126 */
/***/ function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.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 && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ },
/* 127 */
/***/ function(module, exports) {
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
module.exports = isHostObject;
/***/ },
/* 128 */
/***/ function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(129);
/** 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;
/***/ },
/* 129 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(130);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ },
/* 130 */
/***/ function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(131);
/** 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;
/***/ },
/* 131 */
/***/ 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; }())))
/***/ },
/* 132 */
/***/ function(module, exports) {
/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @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;
/***/ },
/* 133 */
/***/ 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;
/***/ },
/* 134 */
/***/ 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) {
return this.has(key) && delete this.__data__[key];
}
module.exports = hashDelete;
/***/ },
/* 135 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(122);
/** 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;
/***/ },
/* 136 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(122);
/** 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;
/***/ },
/* 137 */
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(122);
/** 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__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ },
/* 138 */
/***/ function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(139),
listCacheDelete = __webpack_require__(140),
listCacheGet = __webpack_require__(143),
listCacheHas = __webpack_require__(144),
listCacheSet = __webpack_require__(145);
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
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;
/***/ },
/* 139 */
/***/ function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
module.exports = listCacheClear;
/***/ },
/* 140 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(141);
/** 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);
}
return true;
}
module.exports = listCacheDelete;
/***/ },
/* 141 */
/***/ function(module, exports, __webpack_require__) {
var eq = __webpack_require__(142);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to search.
* @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;
/***/ },
/* 142 */
/***/ function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.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;
/***/ },
/* 143 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(141);
/**
* 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;
/***/ },
/* 144 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(141);
/**
* 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;
/***/ },
/* 145 */
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(141);
/**
* 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) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ },
/* 146 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(123),
root = __webpack_require__(130);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ },
/* 147 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(148);
/**
* 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) {
return getMapData(this, key)['delete'](key);
}
module.exports = mapCacheDelete;
/***/ },
/* 148 */
/***/ function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(149);
/**
* 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;
/***/ },
/* 149 */
/***/ 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;
/***/ },
/* 150 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(148);
/**
* 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;
/***/ },
/* 151 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(148);
/**
* 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;
/***/ },
/* 152 */
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(148);
/**
* 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) {
getMapData(this, key).set(key, value);
return this;
}
module.exports = mapCacheSet;
/***/ },
/* 153 */
/***/ function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
/***/ },
/* 154 */
/***/ function(module, exports) {
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
/***/ },
/* 155 */
/***/ function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(156);
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to search.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array ? array.length : 0;
return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;
/***/ },
/* 156 */
/***/ function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(157),
baseIsNaN = __webpack_require__(158);
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to search.
* @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) {
if (value !== value) {
return baseFindIndex(array, baseIsNaN, fromIndex);
}
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = baseIndexOf;
/***/ },
/* 157 */
/***/ function(module, exports) {
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to search.
* @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;
/***/ },
/* 158 */
/***/ 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;
/***/ },
/* 159 */
/***/ function(module, exports) {
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to search.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
module.exports = arrayIncludesWith;
/***/ },
/* 160 */
/***/ 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;
/***/ },
/* 161 */
/***/ function(module, exports) {
/**
* Checks if a cache value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ },
/* 162 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(163),
isFlattenable = __webpack_require__(164);
/**
* 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;
/***/ },
/* 163 */
/***/ 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;
/***/ },
/* 164 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(165),
isArguments = __webpack_require__(166),
isArray = __webpack_require__(173);
/** 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;
/***/ },
/* 165 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(130);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ },
/* 166 */
/***/ function(module, exports, __webpack_require__) {
var isArrayLikeObject = __webpack_require__(167);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/** 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/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** 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
*/
function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
module.exports = isArguments;
/***/ },
/* 167 */
/***/ function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(168),
isObjectLike = __webpack_require__(172);
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;
/***/ },
/* 168 */
/***/ function(module, exports, __webpack_require__) {
var getLength = __webpack_require__(169),
isFunction = __webpack_require__(125),
isLength = __webpack_require__(171);
/**
* 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(getLength(value)) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ },
/* 169 */
/***/ function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(170);
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
module.exports = getLength;
/***/ },
/* 170 */
/***/ function(module, exports) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ },
/* 171 */
/***/ 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 function is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.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;
/***/ },
/* 172 */
/***/ 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 && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 173 */
/***/ 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;
/***/ },
/* 174 */
/***/ function(module, exports, __webpack_require__) {
var basePickBy = __webpack_require__(175);
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} props The property identifiers to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, props) {
object = Object(object);
return basePickBy(object, props, function(value, key) {
return key in object;
});
}
module.exports = basePick;
/***/ },
/* 175 */
/***/ function(module, exports) {
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} props The property identifiers to pick from.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, props, predicate) {
var index = -1,
length = props.length,
result = {};
while (++index < length) {
var key = props[index],
value = object[key];
if (predicate(value, key)) {
result[key] = value;
}
}
return result;
}
module.exports = basePickBy;
/***/ },
/* 176 */
/***/ function(module, exports, __webpack_require__) {
var apply = __webpack_require__(177);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @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.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
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] = array;
return apply(func, this, otherArgs);
};
}
module.exports = baseRest;
/***/ },
/* 177 */
/***/ 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;
/***/ },
/* 178 */
/***/ function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(179),
getSymbolsIn = __webpack_require__(180),
keysIn = __webpack_require__(185);
/**
* 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;
/***/ },
/* 179 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(163),
isArray = __webpack_require__(173);
/**
* 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;
/***/ },
/* 180 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(163),
getPrototype = __webpack_require__(181),
getSymbols = __webpack_require__(183);
/* 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 symbol properties
* of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ },
/* 181 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(182);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetPrototype = Object.getPrototypeOf;
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
module.exports = getPrototype;
/***/ },
/* 182 */
/***/ function(module, exports) {
/**
* Creates a function that invokes `func` with its first 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;
/***/ },
/* 183 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(182),
stubArray = __webpack_require__(184);
/* 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 symbol properties 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;
/***/ },
/* 184 */
/***/ 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;
/***/ },
/* 185 */
/***/ function(module, exports, __webpack_require__) {
var baseKeysIn = __webpack_require__(186),
indexKeys = __webpack_require__(189),
isIndex = __webpack_require__(192),
isPrototype = __webpack_require__(193);
/** 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 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) {
var index = -1,
isProto = isPrototype(object),
props = baseKeysIn(object),
propsLength = props.length,
indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
while (++index < propsLength) {
var key = props[index];
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = keysIn;
/***/ },
/* 186 */
/***/ function(module, exports, __webpack_require__) {
var Reflect = __webpack_require__(187),
iteratorToArray = __webpack_require__(188);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var enumerate = Reflect ? Reflect.enumerate : undefined,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* The base implementation of `_.keysIn` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
object = object == null ? object : Object(object);
var result = [];
for (var key in object) {
result.push(key);
}
return result;
}
// Fallback for IE < 9 with es6-shim.
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
baseKeysIn = function(object) {
return iteratorToArray(enumerate(object));
};
}
module.exports = baseKeysIn;
/***/ },
/* 187 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(130);
/** Built-in value references. */
var Reflect = root.Reflect;
module.exports = Reflect;
/***/ },
/* 188 */
/***/ function(module, exports) {
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
module.exports = iteratorToArray;
/***/ },
/* 189 */
/***/ function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(190),
isArguments = __webpack_require__(166),
isArray = __webpack_require__(173),
isLength = __webpack_require__(171),
isString = __webpack_require__(191);
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
module.exports = indexKeys;
/***/ },
/* 190 */
/***/ 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;
/***/ },
/* 191 */
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(173),
isObjectLike = __webpack_require__(172);
/** `Object#toString` result references. */
var stringTag = '[object String]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* 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) && objectToString.call(value) == stringTag);
}
module.exports = isString;
/***/ },
/* 192 */
/***/ 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;
/***/ },
/* 193 */
/***/ 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;
/***/ },
/* 194 */
/***/ function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(195);
/** 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;
/***/ },
/* 195 */
/***/ function(module, exports, __webpack_require__) {
var isObjectLike = __webpack_require__(172);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* 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) && objectToString.call(value) == symbolTag);
}
module.exports = isSymbol;
/***/ },
/* 196 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-2015, 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.
*/
var invariant = function(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__(197)))
/***/ },
/* 197 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
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 = setTimeout(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;
clearTimeout(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) {
setTimeout(drainQueue, 0);
}
};
// 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; };
/***/ },
/* 198 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = __webpack_require__(80);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(81);
var _createClass3 = _interopRequireDefault(_createClass2);
var _find = __webpack_require__(199);
var _find2 = _interopRequireDefault(_find);
var _sortBy = __webpack_require__(254);
var _sortBy2 = _interopRequireDefault(_sortBy);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Manager = function () {
function Manager() {
(0, _classCallCheck3.default)(this, Manager);
this.refs = {};
}
(0, _createClass3.default)(Manager, [{
key: 'add',
value: function add(collection, ref) {
if (!this.refs[collection]) this.refs[collection] = [];
this.refs[collection].push(ref);
}
}, {
key: 'remove',
value: function remove(collection, ref) {
var index = this.getIndex(collection, ref);
if (index !== -1) {
this.refs[collection].splice(index, 1);
}
}
}, {
key: 'getActive',
value: function getActive() {
var _this = this;
return (0, _find2.default)(this.refs[this.active.collection], function (_ref) {
var node = _ref.node;
return node.sortableInfo.index == _this.active.index;
});
}
}, {
key: 'getIndex',
value: function getIndex(collection, ref) {
return this.refs[collection].indexOf(ref);
}
}, {
key: 'getOrderedRefs',
value: function getOrderedRefs() {
var collection = arguments.length <= 0 || arguments[0] === undefined ? this.active.collection : arguments[0];
return (0, _sortBy2.default)(this.refs[collection], function (_ref2) {
var node = _ref2.node;
return node.sortableInfo.index;
});
}
}]);
return Manager;
}();
exports.default = Manager;
/***/ },
/* 199 */
/***/ function(module, exports, __webpack_require__) {
var createFind = __webpack_require__(200),
findIndex = __webpack_require__(250);
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
module.exports = find;
/***/ },
/* 200 */
/***/ function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__(201),
isArrayLike = __webpack_require__(168),
keys = __webpack_require__(220);
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
module.exports = createFind;
/***/ },
/* 201 */
/***/ function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(202),
baseMatchesProperty = __webpack_require__(235),
identity = __webpack_require__(247),
isArray = __webpack_require__(173),
property = __webpack_require__(248);
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
module.exports = baseIteratee;
/***/ },
/* 202 */
/***/ function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(203),
getMatchData = __webpack_require__(232),
matchesStrictComparable = __webpack_require__(234);
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
module.exports = baseMatches;
/***/ },
/* 203 */
/***/ function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(204),
baseIsEqual = __webpack_require__(210);
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
: result
)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
/***/ },
/* 204 */
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(138),
stackClear = __webpack_require__(205),
stackDelete = __webpack_require__(206),
stackGet = __webpack_require__(207),
stackHas = __webpack_require__(208),
stackSet = __webpack_require__(209);
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
this.__data__ = new ListCache(entries);
}
// 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;
/***/ },
/* 205 */
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(138);
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
}
module.exports = stackClear;
/***/ },
/* 206 */
/***/ 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) {
return this.__data__['delete'](key);
}
module.exports = stackDelete;
/***/ },
/* 207 */
/***/ 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;
/***/ },
/* 208 */
/***/ 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;
/***/ },
/* 209 */
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(138),
Map = __webpack_require__(146),
MapCache = __webpack_require__(118);
/** 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 cache = this.__data__;
if (cache instanceof ListCache) {
var pairs = cache.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
return this;
}
cache = this.__data__ = new MapCache(pairs);
}
cache.set(key, value);
return this;
}
module.exports = stackSet;
/***/ },
/* 210 */
/***/ function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(211),
isObject = __webpack_require__(126),
isObjectLike = __webpack_require__(172);
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @param {boolean} [bitmask] The bitmask of comparison flags.
* The bitmask may be composed of the following flags:
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, customizer, bitmask, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
}
module.exports = baseIsEqual;
/***/ },
/* 211 */
/***/ function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(204),
equalArrays = __webpack_require__(212),
equalByTag = __webpack_require__(214),
equalObjects = __webpack_require__(218),
getTag = __webpack_require__(222),
isArray = __webpack_require__(173),
isHostObject = __webpack_require__(127),
isTypedArray = __webpack_require__(228);
/** Used to compose bitmasks for comparison styles. */
var PARTIAL_COMPARE_FLAG = 2;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = arrayTag,
othTag = arrayTag;
if (!objIsArr) {
objTag = getTag(object);
objTag = objTag == argsTag ? objectTag : objTag;
}
if (!othIsArr) {
othTag = getTag(other);
othTag = othTag == argsTag ? objectTag : othTag;
}
var objIsObj = objTag == objectTag && !isHostObject(object),
othIsObj = othTag == objectTag && !isHostObject(other),
isSameTag = objTag == othTag;
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
: equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
}
if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
}
module.exports = baseIsEqualDeep;
/***/ },
/* 212 */
/***/ function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(117),
arraySome = __webpack_require__(213);
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!seen.has(othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
return seen.add(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, customizer, bitmask, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
return result;
}
module.exports = equalArrays;
/***/ },
/* 213 */
/***/ function(module, exports) {
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
module.exports = arraySome;
/***/ },
/* 214 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(165),
Uint8Array = __webpack_require__(215),
eq = __webpack_require__(142),
equalArrays = __webpack_require__(212),
mapToArray = __webpack_require__(216),
setToArray = __webpack_require__(217);
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
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]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= UNORDERED_COMPARE_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
/***/ },
/* 215 */
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(130);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ },
/* 216 */
/***/ 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;
/***/ },
/* 217 */
/***/ 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;
/***/ },
/* 218 */
/***/ function(module, exports, __webpack_require__) {
var baseHas = __webpack_require__(219),
keys = __webpack_require__(220);
/** Used to compose bitmasks for comparison styles. */
var PARTIAL_COMPARE_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
objProps = keys(object),
objLength = objProps.length,
othProps = keys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
return result;
}
module.exports = equalObjects;
/***/ },
/* 219 */
/***/ function(module, exports, __webpack_require__) {
var getPrototype = __webpack_require__(181);
/** 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 `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
module.exports = baseHas;
/***/ },
/* 220 */
/***/ function(module, exports, __webpack_require__) {
var baseHas = __webpack_require__(219),
baseKeys = __webpack_require__(221),
indexKeys = __webpack_require__(189),
isArrayLike = __webpack_require__(168),
isIndex = __webpack_require__(192),
isPrototype = __webpack_require__(193);
/**
* 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/6.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) {
var isProto = isPrototype(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
}
module.exports = keys;
/***/ },
/* 221 */
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(182);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = Object.keys;
/**
* The base implementation of `_.keys` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
var baseKeys = overArg(nativeKeys, Object);
module.exports = baseKeys;
/***/ },
/* 222 */
/***/ function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(223),
Map = __webpack_require__(146),
Promise = __webpack_require__(224),
Set = __webpack_require__(225),
WeakMap = __webpack_require__(226),
baseGetTag = __webpack_require__(227),
toSource = __webpack_require__(132);
/** `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 for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** 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,
// for data views in Edge, and promises in Node.js.
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 = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : undefined;
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;
/***/ },
/* 223 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(123),
root = __webpack_require__(130);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ },
/* 224 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(123),
root = __webpack_require__(130);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ },
/* 225 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(123),
root = __webpack_require__(130);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ },
/* 226 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(123),
root = __webpack_require__(130);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ },
/* 227 */
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* The base implementation of `getTag`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
return objectToString.call(value);
}
module.exports = baseGetTag;
/***/ },
/* 228 */
/***/ function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(229),
baseUnary = __webpack_require__(160),
nodeUtil = __webpack_require__(230);
/* 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;
/***/ },
/* 229 */
/***/ function(module, exports, __webpack_require__) {
var isLength = __webpack_require__(171),
isObjectLike = __webpack_require__(172);
/** `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;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* 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[objectToString.call(value)];
}
module.exports = baseIsTypedArray;
/***/ },
/* 230 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(131);
/** Detect free variable `exports`. */
var freeExports = freeGlobal && typeof exports == 'object' && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && 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('util');
} catch (e) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(231)(module)))
/***/ },
/* 231 */
/***/ 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;
}
/***/ },
/* 232 */
/***/ function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(233),
keys = __webpack_require__(220);
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
module.exports = getMatchData;
/***/ },
/* 233 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(126);
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
/***/ },
/* 234 */
/***/ function(module, exports) {
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
module.exports = matchesStrictComparable;
/***/ },
/* 235 */
/***/ function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(210),
get = __webpack_require__(236),
hasIn = __webpack_require__(244),
isKey = __webpack_require__(243),
isStrictComparable = __webpack_require__(233),
matchesStrictComparable = __webpack_require__(234),
toKey = __webpack_require__(194);
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
};
}
module.exports = baseMatchesProperty;
/***/ },
/* 236 */
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(237);
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ },
/* 237 */
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(238),
isKey = __webpack_require__(243),
toKey = __webpack_require__(194);
/**
* 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 = isKey(path, object) ? [path] : castPath(path);
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;
/***/ },
/* 238 */
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(173),
stringToPath = __webpack_require__(239);
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
module.exports = castPath;
/***/ },
/* 239 */
/***/ function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(240),
toString = __webpack_require__(241);
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/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 = memoize(function(string) {
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ },
/* 240 */
/***/ function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(118);
/** Used as the `TypeError` message for "Functions" methods. */
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/6.0/#sec-properties-of-the-map-prototype-object)
* method interface of `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 && 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);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ },
/* 241 */
/***/ function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(242);
/**
* 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 process.
* @returns {string} Returns the 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;
/***/ },
/* 242 */
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(165),
isSymbol = __webpack_require__(195);
/** 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 (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
/***/ },
/* 243 */
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(173),
isSymbol = __webpack_require__(195);
/** 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;
/***/ },
/* 244 */
/***/ function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(245),
hasPath = __webpack_require__(246);
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;
/***/ },
/* 245 */
/***/ function(module, exports) {
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
module.exports = baseHasIn;
/***/ },
/* 246 */
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(238),
isArguments = __webpack_require__(166),
isArray = __webpack_require__(173),
isIndex = __webpack_require__(192),
isKey = __webpack_require__(243),
isLength = __webpack_require__(171),
isString = __webpack_require__(191),
toKey = __webpack_require__(194);
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = isKey(path, object) ? [path] : castPath(path);
var result,
index = -1,
length = path.length;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result) {
return result;
}
var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object));
}
module.exports = hasPath;
/***/ },
/* 247 */
/***/ 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;
/***/ },
/* 248 */
/***/ function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(170),
basePropertyDeep = __webpack_require__(249),
isKey = __webpack_require__(243),
toKey = __webpack_require__(194);
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
/***/ },
/* 249 */
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(237);
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
/***/ },
/* 250 */
/***/ function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(157),
baseIteratee = __webpack_require__(201),
toInteger = __webpack_require__(251);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to search.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
/***/ },
/* 251 */
/***/ function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(252);
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.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;
/***/ },
/* 252 */
/***/ function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(253);
/** 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;
/***/ },
/* 253 */
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(125),
isObject = __webpack_require__(126),
isSymbol = __webpack_require__(195);
/** 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 = isFunction(value.valueOf) ? 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;
/***/ },
/* 254 */
/***/ function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(162),
baseOrderBy = __webpack_require__(255),
baseRest = __webpack_require__(176),
isIterateeCall = __webpack_require__(265);
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, function(o) { return o.user; });
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*
* _.sortBy(users, 'user', function(o) {
* return Math.floor(o.age / 10);
* });
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
module.exports = sortBy;
/***/ },
/* 255 */
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(115),
baseIteratee = __webpack_require__(201),
baseMap = __webpack_require__(256),
baseSortBy = __webpack_require__(262),
baseUnary = __webpack_require__(160),
compareMultiple = __webpack_require__(263),
identity = __webpack_require__(247);
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
module.exports = baseOrderBy;
/***/ },
/* 256 */
/***/ function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(257),
isArrayLike = __webpack_require__(168);
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
module.exports = baseMap;
/***/ },
/* 257 */
/***/ function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(258),
createBaseEach = __webpack_require__(261);
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
module.exports = baseEach;
/***/ },
/* 258 */
/***/ function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(259),
keys = __webpack_require__(220);
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
module.exports = baseForOwn;
/***/ },
/* 259 */
/***/ function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(260);
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
module.exports = baseFor;
/***/ },
/* 260 */
/***/ function(module, exports) {
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
module.exports = createBaseFor;
/***/ },
/* 261 */
/***/ function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(168);
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
module.exports = createBaseEach;
/***/ },
/* 262 */
/***/ function(module, exports) {
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
module.exports = baseSortBy;
/***/ },
/* 263 */
/***/ function(module, exports, __webpack_require__) {
var compareAscending = __webpack_require__(264);
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
module.exports = compareMultiple;
/***/ },
/* 264 */
/***/ function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(195);
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
module.exports = compareAscending;
/***/ },
/* 265 */
/***/ function(module, exports, __webpack_require__) {
var eq = __webpack_require__(142),
isArrayLike = __webpack_require__(168),
isIndex = __webpack_require__(192),
isObject = __webpack_require__(126);
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ },
/* 266 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(4);
var _extends3 = _interopRequireDefault(_extends2);
var _getPrototypeOf = __webpack_require__(76);
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__(80);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(81);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(85);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(104);
var _inherits3 = _interopRequireDefault(_inherits2);
exports.default = sortableElement;
var _react = __webpack_require__(112);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(113);
var _lodash = __webpack_require__(267);
var _invariant = __webpack_require__(196);
var _invariant2 = _interopRequireDefault(_invariant);
var _utils = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Export Higher Order Sortable Element Component
function sortableElement(WrappedComponent) {
var _class, _temp;
var config = arguments.length <= 1 || arguments[1] === undefined ? { withRef: false } : arguments[1];
return _temp = _class = function (_Component) {
(0, _inherits3.default)(_class, _Component);
function _class() {
(0, _classCallCheck3.default)(this, _class);
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(_class).apply(this, arguments));
}
(0, _createClass3.default)(_class, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _props = this.props;
var collection = _props.collection;
var disabled = _props.disabled;
var index = _props.index;
if (!disabled) {
this.setDraggable(collection, index);
}
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (this.props.index !== nextProps.index && this.node) {
this.node.sortableInfo.index = nextProps.index;
}
if (this.props.disabled !== nextProps.disabled) {
var collection = nextProps.collection;
var disabled = nextProps.disabled;
var index = nextProps.index;
if (disabled) {
this.removeDraggable(collection);
} else {
this.setDraggable(collection, index);
}
} else if (this.props.collection !== nextProps.collection) {
this.removeDraggable(this.props.collection);
this.setDraggable(nextProps.collection, nextProps.index);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
var _props2 = this.props;
var collection = _props2.collection;
var disabled = _props2.disabled;
if (!disabled) this.removeDraggable(collection);
}
}, {
key: 'setDraggable',
value: function setDraggable(collection, index) {
var node = this.node = (0, _reactDom.findDOMNode)(this);
node.sortableInfo = { index: index, collection: collection };
this.ref = { node: node };
this.context.manager.add(collection, this.ref);
}
}, {
key: 'removeDraggable',
value: function removeDraggable(collection) {
this.context.manager.remove(collection, this.ref);
}
}, {
key: 'getWrappedInstance',
value: function getWrappedInstance() {
(0, _invariant2.default)(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call');
return this.refs.wrappedInstance;
}
}, {
key: 'render',
value: function render() {
var ref = config.withRef ? 'wrappedInstance' : null;
return _react2.default.createElement(WrappedComponent, (0, _extends3.default)({
ref: ref
}, (0, _lodash.omit)(this.props, 'collection', 'disabled', 'index')));
}
}]);
return _class;
}(_react.Component), _class.displayName = (0, _utils.provideDisplayName)('sortableElement', WrappedComponent), _class.contextTypes = {
manager: _react.PropTypes.object.isRequired
}, _class.propTypes = {
index: _react.PropTypes.number.isRequired,
collection: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]),
disabled: _react.PropTypes.bool
}, _class.defaultProps = {
collection: 0
}, _temp;
}
/***/ },
/* 267 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, module) {/**
* @license
* lodash <https://lodash.com/>
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
;(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Used as the semantic version number. */
var VERSION = '4.14.0';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for function metadata. */
var BIND_FLAG = 1,
BIND_KEY_FLAG = 2,
CURRY_BOUND_FLAG = 4,
CURRY_FLAG = 8,
CURRY_RIGHT_FLAG = 16,
PARTIAL_FLAG = 32,
PARTIAL_RIGHT_FLAG = 64,
ARY_FLAG = 128,
REARG_FLAG = 256,
FLIP_FLAG = 512;
/** Used to compose bitmasks for comparison styles. */
var UNORDERED_COMPARE_FLAG = 1,
PARTIAL_COMPARE_FLAG = 2;
/** Used as default options for `_.truncate`. */
var DEFAULT_TRUNC_LENGTH = 30,
DEFAULT_TRUNC_OMISSION = '...';
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 150,
HOT_SPAN = 16;
/** Used to indicate the type of lazy iteratees. */
var LAZY_FILTER_FLAG = 1,
LAZY_MAP_FLAG = 2,
LAZY_WHILE_FLAG = 3;
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_SAFE_INTEGER = 9007199254740991,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [
['ary', ARY_FLAG],
['bind', BIND_FLAG],
['bindKey', BIND_KEY_FLAG],
['curry', CURRY_FLAG],
['curryRight', CURRY_RIGHT_FLAG],
['flip', FLIP_FLAG],
['partial', PARTIAL_FLAG],
['partialRight', PARTIAL_RIGHT_FLAG],
['rearg', REARG_FLAG]
];
/** `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]',
promiseTag = '[object Promise]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]',
weakSetTag = '[object WeakSet]';
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 match empty string literals in compiled template source. */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/** Used to match HTML entities and HTML characters. */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
reUnescapedHtml = /[&<>"'`]/g,
reHasEscapedHtml = RegExp(reEscapedHtml.source),
reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
/** Used to match template delimiters. */
var reEscape = /<%-([\s\S]+?)%>/g,
reEvaluate = /<%([\s\S]+?)%>/g,
reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g,
reTrimStart = /^\s+/,
reTrimEnd = /\s+$/;
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/** Used to match non-compound words composed of alphanumeric characters. */
var reBasicWord = /[a-zA-Z0-9]+/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Used to match
* [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
*/
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/** Used to detect hexadecimal string values. */
var reHasHexPrefix = /^0x/i;
/** 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 host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
/** Used to ensure capturing order of template delimiters. */
var reNoMatch = /($^)/;
/** Used to match unescaped characters in compiled string literals. */
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
rsComboSymbolsRange = '\\u20d0-\\u20f0',
rsDingbatRange = '\\u2700-\\u27bf',
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsPunctuationRange = '\\u2000-\\u206f',
rsSpaceRange = ' \\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',
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = '\\ufe0e\\ufe0f',
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]",
rsAstral = '[' + rsAstralRange + ']',
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
var reComboMark = RegExp(rsCombo, 'g');
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/** Used to match complex or compound words. */
var reComplexWord = RegExp([
rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
rsUpper + '+' + rsOptUpperContr,
rsDigits,
rsEmoji
].join('|'), 'g');
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
/** Used to detect strings that need a more robust regexp to match words. */
var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/** Used to assign default `context` object properties. */
var contextProps = [
'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError',
'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
'_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
];
/** Used to make template sourceURLs easier to identify. */
var templateCounter = -1;
/** 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;
/** 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;
/** Used to map latin-1 supplementary letters to basic latin letters. */
var deburredLetters = {
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss'
};
/** Used to map characters to HTML entities. */
var htmlEscapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`'
};
/** Used to map HTML entities to characters. */
var htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'",
'`': '`'
};
/** Used to escape characters for inclusion in compiled string literals. */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/** Built-in method references without a dependency on `root`. */
var freeParseFloat = parseFloat,
freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** 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')();
/** Detect free variable `exports`. */
var freeExports = freeGlobal && typeof exports == 'object' && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && 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('util');
} catch (e) {}
}());
/* Node.js helper references. */
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
nodeIsDate = nodeUtil && nodeUtil.isDate,
nodeIsMap = nodeUtil && nodeUtil.isMap,
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
nodeIsSet = nodeUtil && nodeUtil.isSet,
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/*--------------------------------------------------------------------------*/
/**
* 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;
}
/**
* 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;
}
/**
* 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);
}
/**
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
/**
* 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 ? array.length : 0;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.forEachRight` 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 arrayEachRight(array, iteratee) {
var length = array ? array.length : 0;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array ? array.length : 0,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to search.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array ? array.length : 0;
return !!length && baseIndexOf(array, value, 0) > -1;
}
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to search.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
/**
* 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 ? array.length : 0,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
/**
* 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;
}
/**
* 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 ? array.length : 0;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
/**
* A specialized version of `_.reduceRight` 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 last element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array ? array.length : 0;
if (initAccum && length) {
accumulator = array[--length];
}
while (length--) {
accumulator = iteratee(accumulator, array[length], length, array);
}
return accumulator;
}
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array ? array.length : 0;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
/**
* The base implementation of methods like `_.findKey` and `_.findLastKey`,
* without support for iteratee shorthands, which iterates over `collection`
* using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to search.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the found element or its key, else `undefined`.
*/
function baseFindKey(collection, predicate, eachFunc) {
var result;
eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = key;
return false;
}
});
return result;
}
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to search.
* @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;
}
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to search.
* @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) {
if (value !== value) {
return baseFindIndex(array, baseIsNaN, fromIndex);
}
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* This function is like `baseIndexOf` except that it accepts a comparator.
*
* @private
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @param {Function} comparator The comparator invoked per element.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOfWith(array, value, fromIndex, comparator) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (comparator(array[index], value)) {
return index;
}
}
return -1;
}
/**
* 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;
}
/**
* The base implementation of `_.mean` and `_.meanBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the mean.
*/
function baseMean(array, iteratee) {
var length = array ? array.length : 0;
return length ? (baseSum(array, iteratee) / length) : NAN;
}
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
}
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initAccum
? (initAccum = false, value)
: iteratee(accumulator, value, index, collection);
});
return accumulator;
}
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
/**
* The base implementation of `_.sum` and `_.sumBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : (result + current);
}
}
return result;
}
/**
* 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;
}
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` 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 key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
/**
* 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);
};
}
/**
* 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];
});
}
/**
* Checks if a cache value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
/**
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the first unmatched string symbol.
*/
function charsStartIndex(strSymbols, chrSymbols) {
var index = -1,
length = strSymbols.length;
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
* that is not found in the character symbols.
*
* @private
* @param {Array} strSymbols The string symbols to inspect.
* @param {Array} chrSymbols The character symbols to find.
* @returns {number} Returns the index of the last unmatched string symbol.
*/
function charsEndIndex(strSymbols, chrSymbols) {
var index = strSymbols.length;
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
result++;
}
}
return result;
}
/**
* Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
/**
* Used by `_.escape` to convert characters to HTML entities.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
var escapeHtmlChar = basePropertyOf(htmlEscapes);
/**
* Used by `_.template` to escape characters for inclusion in compiled string literals.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
}
/**
* 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];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
/**
* 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;
}
/**
* Creates a function that invokes `func` with its first 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));
};
}
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
/**
* 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;
}
/**
* Converts `set` to its value-value pairs.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the value-value pairs.
*/
function setToPairs(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = [value, value];
});
return result;
}
/**
* Gets the number of symbols in `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the string size.
*/
function stringSize(string) {
if (!(string && reHasComplexSymbol.test(string))) {
return string.length;
}
var result = reComplexSymbol.lastIndex = 0;
while (reComplexSymbol.test(string)) {
result++;
}
return result;
}
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return string.match(reComplexSymbol);
}
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
* @private
* @param {string} chr The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
/*--------------------------------------------------------------------------*/
/**
* Create a new pristine `lodash` function using the `context` object.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Util
* @param {Object} [context=root] The context object.
* @returns {Function} Returns a new `lodash` function.
* @example
*
* _.mixin({ 'foo': _.constant('foo') });
*
* var lodash = _.runInContext();
* lodash.mixin({ 'bar': lodash.constant('bar') });
*
* _.isFunction(_.foo);
* // => true
* _.isFunction(_.bar);
* // => false
*
* lodash.isFunction(lodash.foo);
* // => false
* lodash.isFunction(lodash.bar);
* // => true
*
* // Use `context` to stub `Date#getTime` use in `_.now`.
* var stubbed = _.runInContext({
* 'Date': function() {
* return { 'getTime': stubGetTime };
* }
* });
*
* // Create a suped-up `defer` in Node.js.
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
*/
function runInContext(context) {
context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root;
/** Built-in constructor references. */
var Array = context.Array,
Date = context.Date,
Error = context.Error,
Math = context.Math,
RegExp = context.RegExp,
TypeError = context.TypeError;
/** Used for built-in method references. */
var arrayProto = context.Array.prototype,
objectProto = context.Object.prototype,
stringProto = context.String.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = context['__core-js_shared__'];
/** 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) : '';
}());
/** Used to resolve the decompiled source of functions. */
var funcToString = context.Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to generate unique IDs. */
var idCounter = 0;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to restore the original `_` reference in `_.noConflict`. */
var oldDash = root._;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Buffer = moduleExports ? context.Buffer : undefined,
Reflect = context.Reflect,
Symbol = context.Symbol,
Uint8Array = context.Uint8Array,
enumerate = Reflect ? Reflect.enumerate : undefined,
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
objectCreate = context.Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/** Built-in method references that are mockable. */
var clearTimeout = function(id) { return context.clearTimeout.call(root, id); },
setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); };
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
nativeFloor = Math.floor,
nativeGetPrototype = Object.getPrototypeOf,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeIsFinite = context.isFinite,
nativeJoin = arrayProto.join,
nativeKeys = Object.keys,
nativeMax = Math.max,
nativeMin = Math.min,
nativeParseInt = context.parseInt,
nativeRandom = Math.random,
nativeReplace = stringProto.replace,
nativeReverse = arrayProto.reverse,
nativeSplit = stringProto.split;
/* Built-in method references that are verified to be native. */
var DataView = getNative(context, 'DataView'),
Map = getNative(context, 'Map'),
Promise = getNative(context, 'Promise'),
Set = getNative(context, 'Set'),
WeakMap = getNative(context, 'WeakMap'),
nativeCreate = getNative(context.Object, 'create');
/* Used to set `toString` methods. */
var defineProperty = (function() {
var func = getNative(context.Object, 'defineProperty'),
name = getNative.name;
return (name && name.length > 2) ? func : undefined;
}());
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
/** Used to lookup unminified function names. */
var realNames = {};
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array of at least `200` elements
* and any iteratees accept only one argument. The heuristic for whether a
* section qualifies for shortcut fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {
// No operation performed.
}
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
/**
* By default, the template delimiters used by lodash are like those in
* embedded Ruby (ERB). Change the following template settings to use
* alternative delimiters.
*
* @static
* @memberOf _
* @type {Object}
*/
lodash.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'escape': reEscape,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'evaluate': reEvaluate,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type {RegExp}
*/
'interpolate': reInterpolate,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type {string}
*/
'variable': '',
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type {Object}
*/
'imports': {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type {Function}
*/
'_': lodash
}
};
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
/**
* Creates a clone of the lazy wrapper object.
*
* @private
* @name clone
* @memberOf LazyWrapper
* @returns {Object} Returns the cloned `LazyWrapper` object.
*/
function lazyClone() {
var result = new LazyWrapper(this.__wrapped__);
result.__actions__ = copyArray(this.__actions__);
result.__dir__ = this.__dir__;
result.__filtered__ = this.__filtered__;
result.__iteratees__ = copyArray(this.__iteratees__);
result.__takeCount__ = this.__takeCount__;
result.__views__ = copyArray(this.__views__);
return result;
}
/**
* Reverses the direction of lazy iteration.
*
* @private
* @name reverse
* @memberOf LazyWrapper
* @returns {Object} Returns the new reversed `LazyWrapper` object.
*/
function lazyReverse() {
if (this.__filtered__) {
var result = new LazyWrapper(this);
result.__dir__ = -1;
result.__filtered__ = true;
} else {
result = this.clone();
result.__dir__ *= -1;
}
return result;
}
/**
* Extracts the unwrapped value from its lazy wrapper.
*
* @private
* @name value
* @memberOf LazyWrapper
* @returns {*} Returns the unwrapped value.
*/
function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
arrLength = isArr ? array.length : 0,
view = getView(0, arrLength, this.__views__),
start = view.start,
end = view.end,
length = end - start,
index = isRight ? end : (start - 1),
iteratees = this.__iteratees__,
iterLength = iteratees.length,
resIndex = 0,
takeCount = nativeMin(length, this.__takeCount__);
if (!isArr || arrLength < LARGE_ARRAY_SIZE ||
(arrLength == length && takeCount == length)) {
return baseWrapperValue(array, this.__actions__);
}
var result = [];
outer:
while (length-- && resIndex < takeCount) {
index += dir;
var iterIndex = -1,
value = array[index];
while (++iterIndex < iterLength) {
var data = iteratees[iterIndex],
iteratee = data.iteratee,
type = data.type,
computed = iteratee(value);
if (type == LAZY_MAP_FLAG) {
value = computed;
} else if (!computed) {
if (type == LAZY_FILTER_FLAG) {
continue outer;
} else {
break outer;
}
}
}
result[resIndex++] = value;
}
return result;
}
// Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
/*------------------------------------------------------------------------*/
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* 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) {
return this.has(key) && delete this.__data__[key];
}
/**
* 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;
}
/**
* 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);
}
/**
* 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__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/*------------------------------------------------------------------------*/
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* 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);
}
return true;
}
/**
* 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];
}
/**
* 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;
}
/**
* 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) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/*------------------------------------------------------------------------*/
/**
* 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 ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* 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) {
return getMapData(this, key)['delete'](key);
}
/**
* 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);
}
/**
* 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);
}
/**
* 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) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/*------------------------------------------------------------------------*/
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/*------------------------------------------------------------------------*/
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
this.__data__ = new ListCache(entries);
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
}
/**
* 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) {
return this.__data__['delete'](key);
}
/**
* 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);
}
/**
* 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);
}
/**
* 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 cache = this.__data__;
if (cache instanceof ListCache) {
var pairs = cache.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
return this;
}
cache = this.__data__ = new MapCache(pairs);
}
cache.set(key, value);
return this;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/*------------------------------------------------------------------------*/
/**
* Used by `_.defaults` to customize its `_.assignIn` use.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function assignInDefaults(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @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 assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(typeof key == 'number' && value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.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))) {
object[key] = value;
}
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to search.
* @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;
}
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
/**
* 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);
}
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths of elements to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
isNil = object == null,
length = paths.length,
result = Array(length);
while (++index < length) {
result[index] = isNil ? undefined : get(object, paths[index]);
}
return result;
}
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @param {boolean} [isFull] Specify a clone including 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, isDeep, isFull, customizer, key, object, stack) {
var result;
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)) {
if (isHostObject(value)) {
return object ? value : {};
}
result = initCloneObject(isFunc ? {} : value);
if (!isDeep) {
return 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);
if (!isArr) {
var props = isFull ? getAllKeys(value) : keys(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, isDeep, isFull, customizer, key, value, stack));
});
if (!isFull) {
stack['delete'](value);
}
return result;
}
/**
* The base implementation of `_.conforms` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
*/
function baseConforms(source) {
var props = keys(source);
return function(object) {
return baseConformsTo(object, source, props);
};
}
/**
* The base implementation of `_.conformsTo` which accepts `props` to check.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
*/
function baseConformsTo(object, source, props) {
var length = props.length;
if (object == null) {
return !length;
}
var index = length;
while (index--) {
var key = props[index],
predicate = source[key],
value = object[key];
if ((value === undefined &&
!(key in Object(object))) || !predicate(value)) {
return false;
}
}
return true;
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} prototype The object to inherit from.
* @returns {Object} Returns the new object.
*/
function baseCreate(proto) {
return isObject(proto) ? objectCreate(proto) : {};
}
/**
* The base implementation of `_.delay` and `_.defer` which accepts `args`
* to provide to `func`.
*
* @private
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {Array} args The arguments to provide to `func`.
* @returns {number} Returns the timer id.
*/
function baseDelay(func, wait, args) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return setTimeout(function() { func.apply(undefined, args); }, wait);
}
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
/**
* The base implementation of `_.forEachRight` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEachRight = createBaseEach(baseForOwnRight, true);
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a
* `comparator` to determine the extremum value.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The iteratee invoked per iteration.
* @param {Function} comparator The comparator used to compare values.
* @returns {*} Returns the extremum value.
*/
function baseExtremum(array, iteratee, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index],
current = iteratee(value);
if (current != null && (computed === undefined
? (current === current && !isSymbol(current))
: comparator(current, computed)
)) {
var computed = current,
result = value;
}
}
return result;
}
/**
* The base implementation of `_.fill` without an iteratee call guard.
*
* @private
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
*/
function baseFill(array, value, start, end) {
var length = array.length;
start = toInteger(start);
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = (end === undefined || end > length) ? length : toInteger(end);
if (end < 0) {
end += length;
}
end = start > end ? 0 : toLength(end);
while (start < end) {
array[start++] = value;
}
return array;
}
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function baseFilter(collection, predicate) {
var result = [];
baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
});
return result;
}
/**
* 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;
}
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseForRight = createBaseFor(true);
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
/**
* The base implementation of `_.forOwnRight` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwnRight(object, iteratee) {
return object && baseForRight(object, iteratee, keys);
}
/**
* The base implementation of `_.functions` which creates an array of
* `object` function property names filtered from `props`.
*
* @private
* @param {Object} object The object to inspect.
* @param {Array} props The property names to filter.
* @returns {Array} Returns the function names.
*/
function baseFunctions(object, props) {
return arrayFilter(props, function(key) {
return isFunction(object[key]);
});
}
/**
* 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 = isKey(path, object) ? [path] : castPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/**
* 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));
}
/**
* The base implementation of `getTag`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
return objectToString.call(value);
}
/**
* The base implementation of `_.gt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
*/
function baseGt(value, other) {
return value > other;
}
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return object != null &&
(hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototype(object) === null));
}
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
/**
* The base implementation of `_.inRange` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to check.
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end);
}
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.invert` and `_.invertBy` which inverts
* `object` with values transformed by `iteratee` and set by `setter`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform values.
* @param {Object} accumulator The initial inverted object.
* @returns {Function} Returns `accumulator`.
*/
function baseInverter(object, setter, iteratee, accumulator) {
baseForOwn(object, function(value, key, object) {
setter(accumulator, iteratee(value), key, object);
});
return accumulator;
}
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
if (!isKey(path, object)) {
path = castPath(path);
object = parent(object, path);
path = last(path);
}
var func = object == null ? object : object[toKey(path)];
return func == null ? undefined : apply(func, object, args);
}
/**
* The base implementation of `_.isArrayBuffer` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
*/
function baseIsArrayBuffer(value) {
return isObjectLike(value) && objectToString.call(value) == arrayBufferTag;
}
/**
* The base implementation of `_.isDate` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
*/
function baseIsDate(value) {
return isObjectLike(value) && objectToString.call(value) == dateTag;
}
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @param {boolean} [bitmask] The bitmask of comparison flags.
* The bitmask may be composed of the following flags:
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, customizer, bitmask, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
}
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = arrayTag,
othTag = arrayTag;
if (!objIsArr) {
objTag = getTag(object);
objTag = objTag == argsTag ? objectTag : objTag;
}
if (!othIsArr) {
othTag = getTag(other);
othTag = othTag == argsTag ? objectTag : othTag;
}
var objIsObj = objTag == objectTag && !isHostObject(object),
othIsObj = othTag == objectTag && !isHostObject(other),
isSameTag = objTag == othTag;
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
: equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
}
if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
}
/**
* The base implementation of `_.isMap` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
*/
function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
}
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
: result
)) {
return false;
}
}
}
return true;
}
/**
* 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) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.isRegExp` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
*/
function baseIsRegExp(value) {
return isObject(value) && objectToString.call(value) == regexpTag;
}
/**
* The base implementation of `_.isSet` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
*/
function baseIsSet(value) {
return isObjectLike(value) && getTag(value) == setTag;
}
/**
* 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[objectToString.call(value)];
}
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
/**
* The base implementation of `_.keys` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
var baseKeys = overArg(nativeKeys, Object);
/**
* The base implementation of `_.keysIn` which doesn't skip the constructor
* property of prototypes or treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
object = object == null ? object : Object(object);
var result = [];
for (var key in object) {
result.push(key);
}
return result;
}
// Fallback for IE < 9 with es6-shim.
if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) {
baseKeysIn = function(object) {
return iteratorToArray(enumerate(object));
};
}
/**
* The base implementation of `_.lt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
*/
function baseLt(value, other) {
return value < other;
}
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
};
}
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
if (!(isArray(source) || isTypedArray(source))) {
var props = keysIn(source);
}
arrayEach(props || source, function(srcValue, key) {
if (props) {
key = srcValue;
srcValue = source[key];
}
if (isObject(srcValue)) {
stack || (stack = new Stack);
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
});
}
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
newValue = srcValue;
if (isArray(srcValue) || isTypedArray(srcValue)) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
else {
isCommon = false;
newValue = baseClone(srcValue, true);
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
isCommon = false;
newValue = baseClone(srcValue, true);
}
else {
newValue = objValue;
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
/**
* The base implementation of `_.nth` which doesn't coerce arguments.
*
* @private
* @param {Array} array The array to query.
* @param {number} n The index of the element to return.
* @returns {*} Returns the nth element of `array`.
*/
function baseNth(array, n) {
var length = array.length;
if (!length) {
return;
}
n += n < 0 ? length : 0;
return isIndex(n, length) ? array[n] : undefined;
}
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} props The property identifiers to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, props) {
object = Object(object);
return basePickBy(object, props, function(value, key) {
return key in object;
});
}
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} props The property identifiers to pick from.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, props, predicate) {
var index = -1,
length = props.length,
result = {};
while (++index < length) {
var key = props[index],
value = object[key];
if (predicate(value, key)) {
result[key] = value;
}
}
return result;
}
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
/**
* The base implementation of `_.pullAllBy` without support for iteratee
* shorthands.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
*/
function basePullAll(array, values, iteratee, comparator) {
var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
index = -1,
length = values.length,
seen = array;
if (array === values) {
values = copyArray(values);
}
if (iteratee) {
seen = arrayMap(array, baseUnary(iteratee));
}
while (++index < length) {
var fromIndex = 0,
value = values[index],
computed = iteratee ? iteratee(value) : value;
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
if (seen !== array) {
splice.call(seen, fromIndex, 1);
}
splice.call(array, fromIndex, 1);
}
}
return array;
}
/**
* The base implementation of `_.pullAt` without support for individual
* indexes or capturing the removed elements.
*
* @private
* @param {Array} array The array to modify.
* @param {number[]} indexes The indexes of elements to remove.
* @returns {Array} Returns `array`.
*/
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0,
lastIndex = length - 1;
while (length--) {
var index = indexes[length];
if (length == lastIndex || index !== previous) {
var previous = index;
if (isIndex(index)) {
splice.call(array, index, 1);
}
else if (!isKey(index, array)) {
var path = castPath(index),
object = parent(array, path);
if (object != null) {
delete object[toKey(last(path))];
}
}
else {
delete array[toKey(index)];
}
}
}
return array;
}
/**
* The base implementation of `_.random` without support for returning
* floating-point numbers.
*
* @private
* @param {number} lower The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the random number.
*/
function baseRandom(lower, upper) {
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
}
/**
* The base implementation of `_.range` and `_.rangeRight` which doesn't
* coerce arguments.
*
* @private
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @param {number} step The value to increment or decrement by.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the range of numbers.
*/
function baseRange(start, end, step, fromRight) {
var index = -1,
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
result = Array(length);
while (length--) {
result[fromRight ? length : ++index] = start;
start += step;
}
return result;
}
/**
* The base implementation of `_.repeat` which doesn't coerce arguments.
*
* @private
* @param {string} string The string to repeat.
* @param {number} n The number of times to repeat the string.
* @returns {string} Returns the repeated string.
*/
function baseRepeat(string, n) {
var result = '';
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
do {
if (n % 2) {
result += string;
}
n = nativeFloor(n / 2);
if (n) {
string += string;
}
} while (n);
return result;
}
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @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.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
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] = array;
return apply(func, this, otherArgs);
};
}
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
path = isKey(path, object) ? [path] : castPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]);
if (isObject(nested)) {
var newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = objValue == null
? (isIndex(path[index + 1]) ? [] : {})
: objValue;
}
}
assignValue(nested, key, newValue);
}
nested = nested[key];
}
return object;
}
/**
* The base implementation of `setData` without support for hot loop detection.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
/**
* 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;
}
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
/**
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
* performs a binary search of `array` to determine the index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndex(array, value, retHighest) {
var low = 0,
high = array ? array.length : low;
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
while (low < high) {
var mid = (low + high) >>> 1,
computed = array[mid];
if (computed !== null && !isSymbol(computed) &&
(retHighest ? (computed <= value) : (computed < value))) {
low = mid + 1;
} else {
high = mid;
}
}
return high;
}
return baseSortedIndexBy(array, value, identity, retHighest);
}
/**
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
* which invokes `iteratee` for `value` and each element of `array` to compute
* their sort ranking. The iteratee is invoked with one argument; (value).
*
* @private
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} iteratee The iteratee invoked per element.
* @param {boolean} [retHighest] Specify returning the highest qualified index.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
*/
function baseSortedIndexBy(array, value, iteratee, retHighest) {
value = iteratee(value);
var low = 0,
high = array ? array.length : 0,
valIsNaN = value !== value,
valIsNull = value === null,
valIsSymbol = isSymbol(value),
valIsUndefined = value === undefined;
while (low < high) {
var mid = nativeFloor((low + high) / 2),
computed = iteratee(array[mid]),
othIsDefined = computed !== undefined,
othIsNull = computed === null,
othIsReflexive = computed === computed,
othIsSymbol = isSymbol(computed);
if (valIsNaN) {
var setLow = retHighest || othIsReflexive;
} else if (valIsUndefined) {
setLow = othIsReflexive && (retHighest || othIsDefined);
} else if (valIsNull) {
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
} else if (valIsSymbol) {
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
} else if (othIsNull || othIsSymbol) {
setLow = false;
} else {
setLow = retHighest ? (computed <= value) : (computed < value);
}
if (setLow) {
low = mid + 1;
} else {
high = mid;
}
}
return nativeMin(high, MAX_ARRAY_INDEX);
}
/**
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseSortedUniq(array, iteratee) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
if (!index || !eq(computed, seen)) {
var seen = computed;
result[resIndex++] = value === 0 ? 0 : value;
}
}
return result;
}
/**
* The base implementation of `_.toNumber` which doesn't ensure correct
* conversions of binary, hexadecimal, or octal string values.
*
* @private
* @param {*} value The value to process.
* @returns {number} Returns the number.
*/
function baseToNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
return +value;
}
/**
* 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 (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = isKey(path, object) ? [path] : castPath(path);
object = parent(object, path);
var key = toKey(last(path));
return !(object != null && baseHas(object, key)) || delete object[key];
}
/**
* The base implementation of `_.update`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to update.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseUpdate(object, path, updater, customizer) {
return baseSet(object, path, updater(baseGet(object, path)), customizer);
}
/**
* The base implementation of methods like `_.dropWhile` and `_.takeWhile`
* without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to query.
* @param {Function} predicate The function invoked per iteration.
* @param {boolean} [isDrop] Specify dropping elements instead of taking them.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Array} Returns the slice of `array`.
*/
function baseWhile(array, predicate, isDrop, fromRight) {
var length = array.length,
index = fromRight ? length : -1;
while ((fromRight ? index-- : ++index < length) &&
predicate(array[index], index, array)) {}
return isDrop
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
: baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
}
/**
* The base implementation of `wrapperValue` which returns the result of
* performing a sequence of actions on the unwrapped `value`, where each
* successive action is supplied the return value of the previous.
*
* @private
* @param {*} value The unwrapped value.
* @param {Array} actions Actions to perform to resolve the unwrapped value.
* @returns {*} Returns the resolved value.
*/
function baseWrapperValue(value, actions) {
var result = value;
if (result instanceof LazyWrapper) {
result = result.value();
}
return arrayReduce(actions, function(result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
/**
* The base implementation of methods like `_.xor`, without support for
* iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of values.
*/
function baseXor(arrays, iteratee, comparator) {
var index = -1,
length = arrays.length;
while (++index < length) {
var result = result
? arrayPush(
baseDifference(result, arrays[index], iteratee, comparator),
baseDifference(arrays[index], result, iteratee, comparator)
)
: arrays[index];
}
return (result && result.length) ? baseUniq(result, iteratee, comparator) : [];
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return (!start && end >= length) ? array : baseSlice(array, start, end);
}
/**
* 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 result = new buffer.constructor(buffer.length);
buffer.copy(result);
return result;
}
/**
* 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;
}
/**
* 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);
}
/**
* 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), true) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
/**
* 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;
}
/**
* 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), true) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
/**
* 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)) : {};
}
/**
* 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);
}
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
/**
* 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;
}
/**
* 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) {
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;
assignValue(object, key, newValue === undefined ? source[key] : newValue);
}
return object;
}
/**
* Copies own symbol properties 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);
}
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
return func(collection, setter, getIteratee(iteratee, 2), accumulator);
};
}
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new case function.
*/
function createCaseFirst(methodName) {
return function(string) {
string = toString(string);
var strSymbols = reHasComplexSymbol.test(string)
? stringToArray(string)
: undefined;
var chr = strSymbols
? strSymbols[0]
: string.charAt(0);
var trailing = strSymbols
? castSlice(strSymbols, 1).join('')
: string.slice(1);
return chr[methodName]() + trailing;
};
}
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = getIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return baseRest(function(funcs) {
funcs = baseFlatten(funcs, 1);
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) &&
data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) &&
!data[4].length && data[9] == 1
) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = (func.length == 1 && isLaziable(func))
? wrapper[funcName]()
: wrapper.thru(func);
}
}
return function() {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 &&
isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & ARY_FLAG,
isBind = bitmask & BIND_FLAG,
isBindKey = bitmask & BIND_KEY_FLAG,
isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG),
isFlip = bitmask & FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length
);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
/**
* Creates a function like `_.invertBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} toIteratee The function to resolve iteratees.
* @returns {Function} Returns the new inverter function.
*/
function createInverter(setter, toIteratee) {
return function(object, iteratee) {
return baseInverter(object, setter, toIteratee(iteratee), {});
};
}
/**
* Creates a function that performs a mathematical operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @param {number} [defaultValue] The value used for `undefined` arguments.
* @returns {Function} Returns the new mathematical operation function.
*/
function createMathOperation(operator, defaultValue) {
return function(value, other) {
var result;
if (value === undefined && other === undefined) {
return defaultValue;
}
if (value !== undefined) {
result = value;
}
if (other !== undefined) {
if (result === undefined) {
return other;
}
if (typeof value == 'string' || typeof other == 'string') {
value = baseToString(value);
other = baseToString(other);
} else {
value = baseToNumber(value);
other = baseToNumber(other);
}
result = operator(value, other);
}
return result;
};
}
/**
* Creates a function like `_.over`.
*
* @private
* @param {Function} arrayFunc The function to iterate over iteratees.
* @returns {Function} Returns the new over function.
*/
function createOver(arrayFunc) {
return baseRest(function(iteratees) {
iteratees = (iteratees.length == 1 && isArray(iteratees[0]))
? arrayMap(iteratees[0], baseUnary(getIteratee()))
: arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee()));
return baseRest(function(args) {
var thisArg = this;
return arrayFunc(iteratees, function(iteratee) {
return apply(iteratee, thisArg, args);
});
});
});
}
/**
* Creates the padding for `string` based on `length`. The `chars` string
* is truncated if the number of characters exceeds `length`.
*
* @private
* @param {number} length The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padding for `string`.
*/
function createPadding(length, chars) {
chars = chars === undefined ? ' ' : baseToString(chars);
var charsLength = chars.length;
if (charsLength < 2) {
return charsLength ? baseRepeat(chars, length) : chars;
}
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
return reHasComplexSymbol.test(chars)
? castSlice(stringToArray(result), 0, length).join('')
: result.slice(0, length);
}
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function(start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toNumber(start);
start = start === start ? start : 0;
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
}
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
return baseRange(start, end, step, fromRight);
};
}
/**
* Creates a function that performs a relational operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @returns {Function} Returns the new relational operation function.
*/
function createRelationalOperation(operator) {
return function(value, other) {
if (!(typeof value == 'string' && typeof other == 'string')) {
value = toNumber(value);
other = toNumber(other);
}
return operator(value, other);
};
}
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
if (!(bitmask & CURRY_BOUND_FLAG)) {
bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
}
var newData = [
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
newHoldersRight, argPos, ary, arity
];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
/**
* Creates a function like `_.round`.
*
* @private
* @param {string} methodName The name of the `Math` method to use when rounding.
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
var func = Math[methodName];
return function(number, precision) {
number = toNumber(number);
precision = nativeMin(toInteger(precision), 292);
if (precision) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
var pair = (toString(number) + 'e').split('e'),
value = func(pair[0] + 'e' + (+pair[1] + precision));
pair = (toString(value) + 'e').split('e');
return +(pair[0] + 'e' + (+pair[1] - precision));
}
return func(number);
};
}
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
/**
* Creates a `_.toPairs` or `_.toPairsIn` function.
*
* @private
* @param {Function} keysFunc The function to get the keys of a given object.
* @returns {Function} Returns the new pairs function.
*/
function createToPairs(keysFunc) {
return function(object) {
var tag = getTag(object);
if (tag == mapTag) {
return mapToArray(object);
}
if (tag == setTag) {
return setToPairs(object);
}
return baseToPairs(object, keysFunc(object));
};
}
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* The bitmask may be composed of the following flags:
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [
func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
argPos, ary, arity
];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] == null
? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) {
bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!seen.has(othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
return seen.add(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, customizer, bitmask, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= UNORDERED_COMPARE_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} customizer The function to customize comparisons.
* @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
* for more details.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
objProps = keys(object),
objLength = objProps.length,
othProps = keys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : baseHas(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
return result;
}
/**
* 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);
}
/**
* 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);
}
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
return object.placeholder;
}
/**
* Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
* this function returns the custom method, otherwise it returns `baseIteratee`.
* If arguments are provided, the chosen function is invoked with them and
* its result is returned.
*
* @private
* @param {*} [value] The value to convert to an iteratee.
* @param {number} [arity] The arity of the created iteratee.
* @returns {Function} Returns the chosen function or its result.
*/
function getIteratee() {
var result = lodash.iteratee || iteratee;
result = result === iteratee ? baseIteratee : result;
return arguments.length ? result(arguments[0], arguments[1]) : result;
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* 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;
}
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
/**
* 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;
}
/**
* Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
var getPrototype = overArg(nativeGetPrototype, Object);
/**
* Creates an array of the own enumerable symbol properties of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
/**
* Creates an array of the own and inherited enumerable symbol properties
* of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? getSymbols : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
/**
* 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,
// for data views in Edge, and promises in Node.js.
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 = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : undefined;
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;
};
}
/**
* Gets the view, applying any `transforms` to the `start` and `end` positions.
*
* @private
* @param {number} start The start of the view.
* @param {number} end The end of the view.
* @param {Array} transforms The transformations to apply to the view.
* @returns {Object} Returns an object containing the `start` and `end`
* positions of the view.
*/
function getView(start, end, transforms) {
var index = -1,
length = transforms.length;
while (++index < length) {
var data = transforms[index],
size = data.size;
switch (data.type) {
case 'drop': start += size; break;
case 'dropRight': end -= size; break;
case 'take': end = nativeMin(end, start + size); break;
case 'takeRight': start = nativeMax(start, end - size); break;
}
}
return { 'start': start, 'end': end };
}
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = isKey(path, object) ? [path] : castPath(path);
var result,
index = -1,
length = path.length;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result) {
return result;
}
var length = object ? object.length : 0;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isString(object) || isArguments(object));
}
/**
* 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;
}
/**
* 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))
: {};
}
/**
* 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);
}
}
/**
* Creates an array of index keys for `object` values of arrays,
* `arguments` objects, and strings, otherwise `null` is returned.
*
* @private
* @param {Object} object The object to query.
* @returns {Array|null} Returns index keys, else `null`.
*/
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
}
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length,
lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
/**
* 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])
}
/**
* 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);
}
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
/**
* 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));
}
/**
* 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);
}
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
/**
* 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);
}
/**
* Checks if `func` is capable of being masked.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `func` is maskable, else `false`.
*/
var isMaskable = coreJsData ? isFunction : stubFalse;
/**
* 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;
}
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG);
var isCombo =
((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) ||
((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
}
// Use source `ary` if it's smaller.
if (srcBitmask & ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
/**
* Used by `_.defaultsDeep` to customize its `_.merge` use.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to merge.
* @param {Object} object The parent object of `objValue`.
* @param {Object} source The parent object of `srcValue`.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
* @returns {*} Returns the value to assign.
*/
function mergeDefaults(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue) && isObject(srcValue)) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, objValue);
baseMerge(objValue, srcValue, undefined, mergeDefaults, stack);
stack['delete'](srcValue);
}
return objValue;
}
/**
* 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 == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
}
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = (function() {
var count = 0,
lastCalled = 0;
return function(key, value) {
var stamp = now(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return key;
}
} else {
count = 0;
}
return baseSetData(key, value);
};
}());
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) {
var source = (reference + '');
return defineProperty(wrapper, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)))
});
};
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
/**
* 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;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @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 '';
}
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function(pair) {
var value = '_.' + pair[0];
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
/*------------------------------------------------------------------------*/
/**
* Creates an array of elements split into groups the length of `size`.
* If `array` can't be split evenly, the final chunk will be the remaining
* elements.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to process.
* @param {number} [size=1] The length of each chunk
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the new array of chunks.
* @example
*
* _.chunk(['a', 'b', 'c', 'd'], 2);
* // => [['a', 'b'], ['c', 'd']]
*
* _.chunk(['a', 'b', 'c', 'd'], 3);
* // => [['a', 'b', 'c'], ['d']]
*/
function chunk(array, size, guard) {
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
size = 1;
} else {
size = nativeMax(toInteger(size), 0);
}
var length = array ? array.length : 0;
if (!length || size < 1) {
return [];
}
var index = 0,
resIndex = 0,
result = Array(nativeCeil(length / size));
while (index < length) {
result[resIndex++] = baseSlice(array, index, (index += size));
}
return result;
}
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array ? array.length : 0,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
/**
* Creates a new array concatenating `array` with any additional arrays
* and/or values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to concatenate.
* @param {...*} [values] The values to concatenate.
* @returns {Array} Returns the new concatenated array.
* @example
*
* var array = [1];
* var other = _.concat(array, 2, [3], [[4]]);
*
* console.log(other);
* // => [1, 2, 3, [4]]
*
* console.log(array);
* // => [1]
*/
function concat() {
var length = arguments.length,
args = Array(length ? length - 1 : 0),
array = arguments[0],
index = length;
while (index--) {
args[index - 1] = arguments[index];
}
return length
? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1))
: [];
}
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. The order of result values is determined by the
* order they occur in the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
/**
* This method is like `_.difference` except that it accepts `iteratee` which
* is invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. Result values are chosen from the first array.
* The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.pullAllBy`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2]
*
* // The `_.property` iteratee shorthand.
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var differenceBy = baseRest(function(array, values) {
var iteratee = last(values);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
: [];
});
/**
* This method is like `_.difference` except that it accepts `comparator`
* which is invoked to compare elements of `array` to `values`. Result values
* are chosen from the first array. The comparator is invoked with two arguments:
* (arrVal, othVal).
*
* **Note:** Unlike `_.pullAllWith`, this method returns a new array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
*
* _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
* // => [{ 'x': 2, 'y': 1 }]
*/
var differenceWith = baseRest(function(array, values) {
var comparator = last(values);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
: [];
});
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` excluding elements dropped from the end.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.dropRightWhile(users, function(o) { return !o.active; });
* // => objects for ['barney']
*
* // The `_.matches` iteratee shorthand.
* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['barney', 'fred']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropRightWhile(users, ['active', false]);
* // => objects for ['barney']
*
* // The `_.property` iteratee shorthand.
* _.dropRightWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true, true)
: [];
}
/**
* Creates a slice of `array` excluding elements dropped from the beginning.
* Elements are dropped until `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.dropWhile(users, function(o) { return !o.active; });
* // => objects for ['pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.dropWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.dropWhile(users, ['active', false]);
* // => objects for ['pebbles']
*
* // The `_.property` iteratee shorthand.
* _.dropWhile(users, 'active');
* // => objects for ['barney', 'fred', 'pebbles']
*/
function dropWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), true)
: [];
}
/**
* Fills elements of `array` with `value` from `start` up to, but not
* including, `end`.
*
* **Note:** This method mutates `array`.
*
* @static
* @memberOf _
* @since 3.2.0
* @category Array
* @param {Array} array The array to fill.
* @param {*} value The value to fill `array` with.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.fill(array, 'a');
* console.log(array);
* // => ['a', 'a', 'a']
*
* _.fill(Array(3), 2);
* // => [2, 2, 2]
*
* _.fill([4, 6, 8, 10], '*', 1, 3);
* // => [4, '*', '*', 10]
*/
function fill(array, value, start, end) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
start = 0;
end = length;
}
return baseFill(array, value, start, end);
}
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to search.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, getIteratee(predicate, 3), index);
}
/**
* This method is like `_.findIndex` except that it iterates over elements
* of `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to search.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
* // => 2
*
* // The `_.matches` iteratee shorthand.
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
* // => 0
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastIndex(users, ['active', false]);
* // => 2
*
* // The `_.property` iteratee shorthand.
* _.findLastIndex(users, 'active');
* // => 0
*/
function findLastIndex(array, predicate, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length - 1;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = fromIndex < 0
? nativeMax(length + index, 0)
: nativeMin(index, length - 1);
}
return baseFindIndex(array, getIteratee(predicate, 3), index, true);
}
/**
* 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 ? array.length : 0;
return length ? baseFlatten(array, 1) : [];
}
/**
* Recursively flattens `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flattenDeep([1, [2, [3, [4]], 5]]);
* // => [1, 2, 3, 4, 5]
*/
function flattenDeep(array) {
var length = array ? array.length : 0;
return length ? baseFlatten(array, INFINITY) : [];
}
/**
* Recursively flatten `array` up to `depth` times.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Array
* @param {Array} array The array to flatten.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* var array = [1, [2, [3, [4]], 5]];
*
* _.flattenDepth(array, 1);
* // => [1, 2, [3, [4]], 5]
*
* _.flattenDepth(array, 2);
* // => [1, 2, 3, [4], 5]
*/
function flattenDepth(array, depth) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(array, depth);
}
/**
* The inverse of `_.toPairs`; this method returns an object composed
* from key-value `pairs`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} pairs The key-value pairs.
* @returns {Object} Returns the new object.
* @example
*
* _.fromPairs([['a', 1], ['b', 2]]);
* // => { 'a': 1, 'b': 2 }
*/
function fromPairs(pairs) {
var index = -1,
length = pairs ? pairs.length : 0,
result = {};
while (++index < length) {
var pair = pairs[index];
result[pair[0]] = pair[1];
}
return result;
}
/**
* Gets the first element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias first
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the first element of `array`.
* @example
*
* _.head([1, 2, 3]);
* // => 1
*
* _.head([]);
* // => undefined
*/
function head(array) {
return (array && array.length) ? array[0] : undefined;
}
/**
* Gets the index at which the first occurrence of `value` is found in `array`
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. If `fromIndex` is negative, it's used as the
* offset from the end of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.indexOf([1, 2, 1, 2], 2);
* // => 1
*
* // Search from the `fromIndex`.
* _.indexOf([1, 2, 1, 2], 2, 2);
* // => 3
*/
function indexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseIndexOf(array, value, index);
}
/**
* Gets all but the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*/
function initial(array) {
return dropRight(array, 1);
}
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons. The order of result values is determined by the
* order they occur in the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
/**
* This method is like `_.intersection` except that it accepts `iteratee`
* which is invoked for each element of each `arrays` to generate the criterion
* by which they're compared. Result values are chosen from the first array.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [2.1]
*
* // The `_.property` iteratee shorthand.
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }]
*/
var intersectionBy = baseRest(function(arrays) {
var iteratee = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
if (iteratee === last(mapped)) {
iteratee = undefined;
} else {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, getIteratee(iteratee, 2))
: [];
});
/**
* This method is like `_.intersection` except that it accepts `comparator`
* which is invoked to compare elements of `arrays`. Result values are chosen
* from the first array. The comparator is invoked with two arguments:
* (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.intersectionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }]
*/
var intersectionWith = baseRest(function(arrays) {
var comparator = last(arrays),
mapped = arrayMap(arrays, castArrayLikeObject);
if (comparator === last(mapped)) {
comparator = undefined;
} else {
mapped.pop();
}
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped, undefined, comparator)
: [];
});
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* _.join(['a', 'b', 'c'], '~');
* // => 'a~b~c'
*/
function join(array, separator) {
return array ? nativeJoin.call(array, separator) : '';
}
/**
* 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 ? array.length : 0;
return length ? array[length - 1] : undefined;
}
/**
* This method is like `_.indexOf` except that it iterates over elements of
* `array` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.lastIndexOf([1, 2, 1, 2], 2);
* // => 3
*
* // Search from the `fromIndex`.
* _.lastIndexOf([1, 2, 1, 2], 2, 2);
* // => 1
*/
function lastIndexOf(array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = (
index < 0
? nativeMax(length + index, 0)
: nativeMin(index, length - 1)
) + 1;
}
if (value !== value) {
return baseFindIndex(array, baseIsNaN, index - 1, true);
}
while (index--) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* Gets the element at index `n` of `array`. If `n` is negative, the nth
* element from the end is returned.
*
* @static
* @memberOf _
* @since 4.11.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=0] The index of the element to return.
* @returns {*} Returns the nth element of `array`.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
*
* _.nth(array, 1);
* // => 'b'
*
* _.nth(array, -2);
* // => 'c';
*/
function nth(array, n) {
return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
}
/**
* Removes all given values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
* to remove elements from an array by predicate.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...*} [values] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pull(array, 'a', 'c');
* console.log(array);
* // => ['b', 'b']
*/
var pull = baseRest(pullAll);
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `iteratee` which is
* invoked for each element of `array` and `values` to generate the criterion
* by which they're compared. The iteratee is invoked with one argument: (value).
*
* **Note:** Unlike `_.differenceBy`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [iteratee=_.identity]
* The iteratee invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
*
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
* console.log(array);
* // => [{ 'x': 2 }]
*/
function pullAllBy(array, values, iteratee) {
return (array && array.length && values && values.length)
? basePullAll(array, values, getIteratee(iteratee, 2))
: array;
}
/**
* This method is like `_.pullAll` except that it accepts `comparator` which
* is invoked to compare elements of `array` to `values`. The comparator is
* invoked with two arguments: (arrVal, othVal).
*
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns `array`.
* @example
*
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
*
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
* console.log(array);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
*/
function pullAllWith(array, values, comparator) {
return (array && array.length && values && values.length)
? basePullAll(array, values, undefined, comparator)
: array;
}
/**
* Removes elements from `array` corresponding to `indexes` and returns an
* array of removed elements.
*
* **Note:** Unlike `_.at`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {...(number|number[])} [indexes] The indexes of elements to remove.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = ['a', 'b', 'c', 'd'];
* var pulled = _.pullAt(array, [1, 3]);
*
* console.log(array);
* // => ['a', 'c']
*
* console.log(pulled);
* // => ['b', 'd']
*/
var pullAt = baseRest(function(array, indexes) {
indexes = baseFlatten(indexes, 1);
var length = array ? array.length : 0,
result = baseAt(array, indexes);
basePullAt(array, arrayMap(indexes, function(index) {
return isIndex(index, length) ? +index : index;
}).sort(compareAscending));
return result;
});
/**
* Removes all elements from `array` that `predicate` returns truthy for
* and returns an array of the removed elements. The predicate is invoked
* with three arguments: (value, index, array).
*
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
* to pull elements from an array by value.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4];
* var evens = _.remove(array, function(n) {
* return n % 2 == 0;
* });
*
* console.log(array);
* // => [1, 3]
*
* console.log(evens);
* // => [2, 4]
*/
function remove(array, predicate) {
var result = [];
if (!(array && array.length)) {
return result;
}
var index = -1,
indexes = [],
length = array.length;
predicate = getIteratee(predicate, 3);
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result.push(value);
indexes.push(index);
}
}
basePullAt(array, indexes);
return result;
}
/**
* Reverses `array` so that the first element becomes the last, the second
* element becomes the second to last, and so on.
*
* **Note:** This method mutates `array` and is based on
* [`Array#reverse`](https://mdn.io/Array/reverse).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3];
*
* _.reverse(array);
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function reverse(array) {
return array ? nativeReverse.call(array) : array;
}
/**
* Creates a slice of `array` from `start` up to, but not including, `end`.
*
* **Note:** This method is used instead of
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
* returned.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @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 slice(array, start, end) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
}
else {
start = start == null ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
}
return baseSlice(array, start, end);
}
/**
* Uses a binary search to determine the lowest index at which `value`
* should be inserted into `array` in order to maintain its sort order.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([30, 50], 40);
* // => 1
*/
function sortedIndex(array, value) {
return baseSortedIndex(array, value);
}
/**
* This method is like `_.sortedIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity]
* The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.sortedIndexBy(objects, { 'x': 4 }, 'x');
* // => 0
*/
function sortedIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
}
/**
* This method is like `_.indexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
* // => 1
*/
function sortedIndexOf(array, value) {
var length = array ? array.length : 0;
if (length) {
var index = baseSortedIndex(array, value);
if (index < length && eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.sortedIndex` except that it returns the highest
* index at which `value` should be inserted into `array` in order to
* maintain its sort order.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedLastIndex([4, 5, 5, 5, 6], 5);
* // => 4
*/
function sortedLastIndex(array, value) {
return baseSortedIndex(array, value, true);
}
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity]
* The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 1
*
* // The `_.property` iteratee shorthand.
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
}
/**
* This method is like `_.lastIndexOf` except that it performs a binary
* search on a sorted `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
* // => 3
*/
function sortedLastIndexOf(array, value) {
var length = array ? array.length : 0;
if (length) {
var index = baseSortedIndex(array, value, true) - 1;
if (eq(array[index], value)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return (array && array.length)
? baseSortedUniq(array)
: [];
}
/**
* This method is like `_.uniqBy` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
* // => [1.1, 2.3]
*/
function sortedUniqBy(array, iteratee) {
return (array && array.length)
? baseSortedUniq(array, getIteratee(iteratee, 2))
: [];
}
/**
* Gets all but the first element of `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to query.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.tail([1, 2, 3]);
* // => [2, 3]
*/
function tail(array) {
return drop(array, 1);
}
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
/**
* Creates a slice of `array` with `n` elements taken from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.takeRight([1, 2, 3]);
* // => [3]
*
* _.takeRight([1, 2, 3], 2);
* // => [2, 3]
*
* _.takeRight([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.takeRight([1, 2, 3], 0);
* // => []
*/
function takeRight(array, n, guard) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, n < 0 ? 0 : n, length);
}
/**
* Creates a slice of `array` with elements taken from the end. Elements are
* taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': false }
* ];
*
* _.takeRightWhile(users, function(o) { return !o.active; });
* // => objects for ['fred', 'pebbles']
*
* // The `_.matches` iteratee shorthand.
* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
* // => objects for ['pebbles']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeRightWhile(users, ['active', false]);
* // => objects for ['fred', 'pebbles']
*
* // The `_.property` iteratee shorthand.
* _.takeRightWhile(users, 'active');
* // => []
*/
function takeRightWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3), false, true)
: [];
}
/**
* Creates a slice of `array` with elements taken from the beginning. Elements
* are taken until `predicate` returns falsey. The predicate is invoked with
* three arguments: (value, index, array).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the slice of `array`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false},
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.takeWhile(users, function(o) { return !o.active; });
* // => objects for ['barney', 'fred']
*
* // The `_.matches` iteratee shorthand.
* _.takeWhile(users, { 'user': 'barney', 'active': false });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.takeWhile(users, ['active', false]);
* // => objects for ['barney', 'fred']
*
* // The `_.property` iteratee shorthand.
* _.takeWhile(users, 'active');
* // => []
*/
function takeWhile(array, predicate) {
return (array && array.length)
? baseWhile(array, getIteratee(predicate, 3))
: [];
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* This method is like `_.union` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which uniqueness is computed. Result values are chosen from the first
* array in which the value occurs. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity]
* The iteratee invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.unionBy([2.1], [1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
var unionBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
});
/**
* This method is like `_.union` except that it accepts `comparator` which
* is invoked to compare elements of `arrays`. Result values are chosen from
* the first array in which the value occurs. The comparator is invoked
* with two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of combined values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.unionWith(objects, others, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var unionWith = baseRest(function(arrays) {
var comparator = last(arrays);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons, in which only the first occurrence of each
* element is kept.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniq([2, 1, 2]);
* // => [2, 1]
*/
function uniq(array) {
return (array && array.length)
? baseUniq(array)
: [];
}
/**
* This method is like `_.uniq` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* uniqueness is computed. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [iteratee=_.identity]
* The iteratee invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.uniqBy([2.1, 1.2, 2.3], Math.floor);
* // => [2.1, 1.2]
*
* // The `_.property` iteratee shorthand.
* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniqBy(array, iteratee) {
return (array && array.length)
? baseUniq(array, getIteratee(iteratee, 2))
: [];
}
/**
* This method is like `_.uniq` except that it accepts `comparator` which
* is invoked to compare elements of `array`. The comparator is invoked with
* two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.uniqWith(objects, _.isEqual);
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
*/
function uniqWith(array, comparator) {
return (array && array.length)
? baseUniq(array, undefined, comparator)
: [];
}
/**
* This method is like `_.zip` except that it accepts an array of grouped
* elements and creates an array regrouping the elements to their pre-zip
* configuration.
*
* @static
* @memberOf _
* @since 1.2.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*
* _.unzip(zipped);
* // => [['a', 'b'], [1, 2], [true, false]]
*/
function unzip(array) {
if (!(array && array.length)) {
return [];
}
var length = 0;
array = arrayFilter(array, function(group) {
if (isArrayLikeObject(group)) {
length = nativeMax(group.length, length);
return true;
}
});
return baseTimes(length, function(index) {
return arrayMap(array, baseProperty(index));
});
}
/**
* This method is like `_.unzip` except that it accepts `iteratee` to specify
* how regrouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {Array} array The array of grouped elements to process.
* @param {Function} [iteratee=_.identity] The function to combine
* regrouped values.
* @returns {Array} Returns the new array of regrouped elements.
* @example
*
* var zipped = _.zip([1, 2], [10, 20], [100, 200]);
* // => [[1, 10, 100], [2, 20, 200]]
*
* _.unzipWith(zipped, _.add);
* // => [3, 30, 300]
*/
function unzipWith(array, iteratee) {
if (!(array && array.length)) {
return [];
}
var result = unzip(array);
if (iteratee == null) {
return result;
}
return arrayMap(result, function(group) {
return apply(iteratee, undefined, group);
});
}
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
/**
* Creates an array of unique values that is the
* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the given arrays. The order of result values is determined by the order
* they occur in the arrays.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.without
* @example
*
* _.xor([2, 1], [2, 3]);
* // => [1, 3]
*/
var xor = baseRest(function(arrays) {
return baseXor(arrayFilter(arrays, isArrayLikeObject));
});
/**
* This method is like `_.xor` except that it accepts `iteratee` which is
* invoked for each element of each `arrays` to generate the criterion by
* which by which they're compared. The iteratee is invoked with one argument:
* (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee=_.identity]
* The iteratee invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
* // => [1.2, 3.4]
*
* // The `_.property` iteratee shorthand.
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 2 }]
*/
var xorBy = baseRest(function(arrays) {
var iteratee = last(arrays);
if (isArrayLikeObject(iteratee)) {
iteratee = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
});
/**
* This method is like `_.xor` except that it accepts `comparator` which is
* invoked to compare elements of `arrays`. The comparator is invoked with
* two arguments: (arrVal, othVal).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
*
* _.xorWith(objects, others, _.isEqual);
* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
*/
var xorWith = baseRest(function(arrays) {
var comparator = last(arrays);
if (isArrayLikeObject(comparator)) {
comparator = undefined;
}
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
});
/**
* Creates an array of grouped elements, the first of which contains the
* first elements of the given arrays, the second of which contains the
* second elements of the given arrays, and so on.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zip(['a', 'b'], [1, 2], [true, false]);
* // => [['a', 1, true], ['b', 2, false]]
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/**
* This method is like `_.zipObject` except that it supports property paths.
*
* @static
* @memberOf _
* @since 4.1.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
*/
function zipObjectDeep(props, values) {
return baseZipObject(props || [], values || [], baseSet);
}
/**
* This method is like `_.zip` except that it accepts `iteratee` to specify
* how grouped values should be combined. The iteratee is invoked with the
* elements of each group: (...group).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Array
* @param {...Array} [arrays] The arrays to process.
* @param {Function} [iteratee=_.identity] The function to combine grouped values.
* @returns {Array} Returns the new array of grouped elements.
* @example
*
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
* return a + b + c;
* });
* // => [111, 222]
*/
var zipWith = baseRest(function(arrays) {
var length = arrays.length,
iteratee = length > 1 ? arrays[length - 1] : undefined;
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
return unzipWith(arrays, iteratee);
});
/*------------------------------------------------------------------------*/
/**
* Creates a `lodash` wrapper instance that wraps `value` with explicit method
* chain sequences enabled. The result of such sequences must be unwrapped
* with `_#value`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Seq
* @param {*} value The value to wrap.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'pebbles', 'age': 1 }
* ];
*
* var youngest = _
* .chain(users)
* .sortBy('age')
* .map(function(o) {
* return o.user + ' is ' + o.age;
* })
* .head()
* .value();
* // => 'pebbles is 1'
*/
function chain(value) {
var result = lodash(value);
result.__chain__ = true;
return result;
}
/**
* This method invokes `interceptor` and returns `value`. The interceptor
* is invoked with one argument; (value). The purpose of this method is to
* "tap into" a method chain sequence in order to modify intermediate results.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns `value`.
* @example
*
* _([1, 2, 3])
* .tap(function(array) {
* // Mutate input array.
* array.pop();
* })
* .reverse()
* .value();
* // => [2, 1]
*/
function tap(value, interceptor) {
interceptor(value);
return value;
}
/**
* This method is like `_.tap` except that it returns the result of `interceptor`.
* The purpose of this method is to "pass thru" values replacing intermediate
* results in a method chain sequence.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns the result of `interceptor`.
* @example
*
* _(' abc ')
* .chain()
* .trim()
* .thru(function(value) {
* return [value];
* })
* .value();
* // => ['abc']
*/
function thru(value, interceptor) {
return interceptor(value);
}
/**
* This method is the wrapper version of `_.at`.
*
* @name at
* @memberOf _
* @since 1.0.0
* @category Seq
* @param {...(string|string[])} [paths] The property paths of elements to pick.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _(object).at(['a[0].b.c', 'a[1]']).value();
* // => [3, 4]
*/
var wrapperAt = baseRest(function(paths) {
paths = baseFlatten(paths, 1);
var length = paths.length,
start = length ? paths[0] : 0,
value = this.__wrapped__,
interceptor = function(object) { return baseAt(object, paths); };
if (length > 1 || this.__actions__.length ||
!(value instanceof LazyWrapper) || !isIndex(start)) {
return this.thru(interceptor);
}
value = value.slice(start, +start + (length ? 1 : 0));
value.__actions__.push({
'func': thru,
'args': [interceptor],
'thisArg': undefined
});
return new LodashWrapper(value, this.__chain__).thru(function(array) {
if (length && !array.length) {
array.push(undefined);
}
return array;
});
});
/**
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
*
* @name chain
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // A sequence without explicit chaining.
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // A sequence with explicit chaining.
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
/**
* Executes the chain sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @since 3.2.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
/**
* Gets the next value on a wrapped object following the
* [iterator protocol](https://mdn.io/iteration_protocols#iterator).
*
* @name next
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the next iterator value.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped.next();
* // => { 'done': false, 'value': 1 }
*
* wrapped.next();
* // => { 'done': false, 'value': 2 }
*
* wrapped.next();
* // => { 'done': true, 'value': undefined }
*/
function wrapperNext() {
if (this.__values__ === undefined) {
this.__values__ = toArray(this.value());
}
var done = this.__index__ >= this.__values__.length,
value = done ? undefined : this.__values__[this.__index__++];
return { 'done': done, 'value': value };
}
/**
* Enables the wrapper to be iterable.
*
* @name Symbol.iterator
* @memberOf _
* @since 4.0.0
* @category Seq
* @returns {Object} Returns the wrapper object.
* @example
*
* var wrapped = _([1, 2]);
*
* wrapped[Symbol.iterator]() === wrapped;
* // => true
*
* Array.from(wrapped);
* // => [1, 2]
*/
function wrapperToIterator() {
return this;
}
/**
* Creates a clone of the chain sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @since 3.2.0
* @category Seq
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
/**
* This method is the wrapper version of `_.reverse`.
*
* **Note:** This method mutates the wrapped array.
*
* @name reverse
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2, 3];
*
* _(array).reverse().value()
* // => [3, 2, 1]
*
* console.log(array);
* // => [3, 2, 1]
*/
function wrapperReverse() {
var value = this.__wrapped__;
if (value instanceof LazyWrapper) {
var wrapped = value;
if (this.__actions__.length) {
wrapped = new LazyWrapper(this);
}
wrapped = wrapped.reverse();
wrapped.__actions__.push({
'func': thru,
'args': [reverse],
'thisArg': undefined
});
return new LodashWrapper(wrapped, this.__chain__);
}
return this.thru(reverse);
}
/**
* Executes the chain sequence to resolve the unwrapped value.
*
* @name value
* @memberOf _
* @since 0.1.0
* @alias toJSON, valueOf
* @category Seq
* @returns {*} Returns the resolved unwrapped value.
* @example
*
* _([1, 2, 3]).value();
* // => [1, 2, 3]
*/
function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
/*------------------------------------------------------------------------*/
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the number of times the key was returned by `iteratee`. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.5.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': 1, '6': 2 }
*
* // The `_.property` iteratee shorthand.
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function(result, value, key) {
hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
});
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning an array of all elements
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* **Note:** Unlike `_.remove`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.reject
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* _.filter(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, { 'age': 36, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.filter(users, 'active');
* // => objects for ['barney']
*/
function filter(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, getIteratee(predicate, 3));
}
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to search.
* @param {Function} [predicate=_.identity]
* The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(n) {
* return n % 2 == 1;
* });
* // => 3
*/
var findLast = createFind(findLastIndex);
/**
* Creates a flattened array of values by running each element in `collection`
* thru `iteratee` and flattening the mapped results. The iteratee is invoked
* with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [n, n];
* }
*
* _.flatMap([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMap(collection, iteratee) {
return baseFlatten(map(collection, iteratee), 1);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The function invoked per iteration.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDeep([1, 2], duplicate);
* // => [1, 1, 2, 2]
*/
function flatMapDeep(collection, iteratee) {
return baseFlatten(map(collection, iteratee), INFINITY);
}
/**
* This method is like `_.flatMap` except that it recursively flattens the
* mapped results up to `depth` times.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The function invoked per iteration.
* @param {number} [depth=1] The maximum recursion depth.
* @returns {Array} Returns the new flattened array.
* @example
*
* function duplicate(n) {
* return [[[n, n]]];
* }
*
* _.flatMapDepth([1, 2], duplicate, 2);
* // => [[1, 1], [2, 2]]
*/
function flatMapDepth(collection, iteratee, depth) {
depth = depth === undefined ? 1 : toInteger(depth);
return baseFlatten(map(collection, iteratee), depth);
}
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _([1, 2]).forEach(function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forEach` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @alias eachRight
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEach
* @example
*
* _.forEachRight([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `2` then `1`.
*/
function forEachRight(collection, iteratee) {
var func = isArray(collection) ? arrayEachRight : baseEachRight;
return func(collection, getIteratee(iteratee, 3));
}
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The order of grouped values
* is determined by the order they occur in `collection`. The corresponding
* value of each key is an array of elements responsible for generating the
* key. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.groupBy([6.1, 4.2, 6.3], Math.floor);
* // => { '4': [4.2], '6': [6.1, 6.3] }
*
* // The `_.property` iteratee shorthand.
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
var groupBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
result[key].push(value);
} else {
result[key] = [value];
}
});
/**
* 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/6.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 search.
* @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);
}
/**
* Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `path` is a function, it's invoked
* for, and `this` bound to, each element in `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array|Function|string} path The path of the method to invoke or
* the function invoked per iteration.
* @param {...*} [args] The arguments to invoke each method with.
* @returns {Array} Returns the array of results.
* @example
*
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
* // => [[1, 5, 7], [1, 2, 3]]
*
* _.invokeMap([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
var invokeMap = baseRest(function(collection, path, args) {
var index = -1,
isFunc = typeof path == 'function',
isProp = isKey(path),
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args);
});
return result;
});
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` thru `iteratee`. The corresponding value of
* each key is the last element responsible for generating the key. The
* iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity]
* The iteratee to transform keys.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var array = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.keyBy(array, function(o) {
* return String.fromCharCode(o.code);
* });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.keyBy(array, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*/
var keyBy = createAggregator(function(result, value, key) {
result[key] = value;
});
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, getIteratee(iteratee, 3));
}
/**
* This method is like `_.sortBy` except that it allows specifying the sort
* orders of the iteratees to sort by. If `orders` is unspecified, all values
* are sorted in ascending order. Otherwise, specify an order of "desc" for
* descending or "asc" for ascending sort order of corresponding values.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
* The iteratees to sort by.
* @param {string[]} [orders] The sort orders of `iteratees`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 34 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 36 }
* ];
*
* // Sort by `user` in ascending order and by `age` in descending order.
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
function orderBy(collection, iteratees, orders, guard) {
if (collection == null) {
return [];
}
if (!isArray(iteratees)) {
iteratees = iteratees == null ? [] : [iteratees];
}
orders = guard ? undefined : orders;
if (!isArray(orders)) {
orders = orders == null ? [] : [orders];
}
return baseOrderBy(collection, iteratees, orders);
}
/**
* Creates an array of elements split into two groups, the first of which
* contains elements `predicate` returns truthy for, the second of which
* contains elements `predicate` returns falsey for. The predicate is
* invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of grouped elements.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true },
* { 'user': 'pebbles', 'age': 1, 'active': false }
* ];
*
* _.partition(users, function(o) { return o.active; });
* // => objects for [['fred'], ['barney', 'pebbles']]
*
* // The `_.matches` iteratee shorthand.
* _.partition(users, { 'age': 1, 'active': false });
* // => objects for [['pebbles'], ['barney', 'fred']]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.partition(users, ['active', false]);
* // => objects for [['barney', 'pebbles'], ['fred']]
*
* // The `_.property` iteratee shorthand.
* _.partition(users, 'active');
* // => objects for [['fred'], ['barney', 'pebbles']]
*/
var partition = createAggregator(function(result, value, key) {
result[key ? 0 : 1].push(value);
}, function() { return [[], []]; });
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
/**
* This method is like `_.reduce` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduce
* @example
*
* var array = [[0, 1], [2, 3], [4, 5]];
*
* _.reduceRight(array, function(flattened, other) {
* return flattened.concat(other);
* }, []);
* // => [4, 5, 2, 3, 0, 1]
*/
function reduceRight(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduceRight : baseReduce,
initAccum = arguments.length < 3;
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
}
/**
* The opposite of `_.filter`; this method returns the elements of `collection`
* that `predicate` does **not** return truthy for.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.filter
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true }
* ];
*
* _.reject(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.reject(users, { 'age': 40, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.reject(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.reject(users, 'active');
* // => objects for ['barney']
*/
function reject(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, negate(getIteratee(predicate, 3)));
}
/**
* Gets a random element from `collection`.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*/
function sample(collection) {
var array = isArrayLike(collection) ? collection : values(collection),
length = array.length;
return length > 0 ? array[baseRandom(0, length - 1)] : undefined;
}
/**
* Gets `n` random elements at unique keys from `collection` up to the
* size of `collection`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @param {number} [n=1] The number of elements to sample.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the random elements.
* @example
*
* _.sampleSize([1, 2, 3], 2);
* // => [3, 1]
*
* _.sampleSize([1, 2, 3], 4);
* // => [2, 3, 1]
*/
function sampleSize(collection, n, guard) {
var index = -1,
result = toArray(collection),
length = result.length,
lastIndex = length - 1;
if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
n = 1;
} else {
n = baseClamp(toInteger(n), 0, length);
}
while (++index < n) {
var rand = baseRandom(index, lastIndex),
value = result[rand];
result[rand] = result[index];
result[index] = value;
}
result.length = n;
return result;
}
/**
* Creates an array of shuffled values, using a version of the
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to shuffle.
* @returns {Array} Returns the new shuffled array.
* @example
*
* _.shuffle([1, 2, 3, 4]);
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
return sampleSize(collection, MAX_ARRAY_LENGTH);
}
/**
* Gets the size of `collection` by returning its length for array-like
* values or the number of own enumerable string keyed properties for objects.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @returns {number} Returns the collection size.
* @example
*
* _.size([1, 2, 3]);
* // => 3
*
* _.size({ 'a': 1, 'b': 2 });
* // => 2
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
var result = collection.length;
return (result && isString(collection)) ? stringSize(collection) : result;
}
if (isObjectLike(collection)) {
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
}
return keys(collection).length;
}
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, getIteratee(predicate, 3));
}
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, function(o) { return o.user; });
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*
* _.sortBy(users, 'user', function(o) {
* return Math.floor(o.age / 10);
* });
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
/*------------------------------------------------------------------------*/
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
function now() {
return Date.now();
}
/*------------------------------------------------------------------------*/
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it's called `n` or more times.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {number} n The number of calls before `func` is invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var saves = ['profile', 'settings'];
*
* var done = _.after(saves.length, function() {
* console.log('done saving!');
* });
*
* _.forEach(saves, function(type) {
* asyncSave({ 'type': type, 'complete': done });
* });
* // => Logs 'done saving!' after the two async saves have completed.
*/
function after(n, func) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
};
}
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = (func && n == null) ? func.length : n;
return createWrap(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it's called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery(element).on('click', _.before(5, addContactToList));
* // => Allows adding up to 4 contacts to the list.
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
/**
* Creates a function that invokes `func` with the `this` binding of `thisArg`
* and `partials` prepended to the arguments it receives.
*
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for partially applied arguments.
*
* **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
* property of bound functions.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* function greet(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
*
* var object = { 'user': 'fred' };
*
* var bound = _.bind(greet, object, 'hi');
* bound('!');
* // => 'hi fred!'
*
* // Bound with placeholders.
* var bound = _.bind(greet, object, _, '!');
* bound('hi');
* // => 'hi fred!'
*/
var bind = baseRest(function(func, thisArg, partials) {
var bitmask = BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bind));
bitmask |= PARTIAL_FLAG;
}
return createWrap(func, bitmask, thisArg, partials, holders);
});
/**
* Creates a function that invokes the method at `object[key]` with `partials`
* prepended to the arguments it receives.
*
* This method differs from `_.bind` by allowing bound functions to reference
* methods that may be redefined or don't yet exist. See
* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
* for more details.
*
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* @static
* @memberOf _
* @since 0.10.0
* @category Function
* @param {Object} object The object to invoke the method on.
* @param {string} key The key of the method.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'user': 'fred',
* 'greet': function(greeting, punctuation) {
* return greeting + ' ' + this.user + punctuation;
* }
* };
*
* var bound = _.bindKey(object, 'greet', 'hi');
* bound('!');
* // => 'hi fred!'
*
* object.greet = function(greeting, punctuation) {
* return greeting + 'ya ' + this.user + punctuation;
* };
*
* bound('!');
* // => 'hiya fred!'
*
* // Bound with placeholders.
* var bound = _.bindKey(object, 'greet', _, '!');
* bound('hi');
* // => 'hiya fred!'
*/
var bindKey = baseRest(function(object, key, partials) {
var bitmask = BIND_FLAG | BIND_KEY_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bindKey));
bitmask |= PARTIAL_FLAG;
}
return createWrap(key, bitmask, object, partials, holders);
});
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
/**
* This method is like `_.curry` except that arguments are applied to `func`
* in the manner of `_.partialRight` instead of `_.partial`.
*
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curryRight(abc);
*
* curried(3)(2)(1);
* // => [1, 2, 3]
*
* curried(2, 3)(1);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(3)(1, _)(2);
* // => [1, 2, 3]
*/
function curryRight(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curryRight.placeholder;
return result;
}
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide an options object to indicate whether `func` should be invoked on
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent calls
* to the debounced function return the result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
/**
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to defer.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) {
* console.log(text);
* }, 'deferred');
* // => Logs 'deferred' after one or more milliseconds.
*/
var defer = baseRest(function(func, args) {
return baseDelay(func, 1, args);
});
/**
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) {
* console.log(text);
* }, 1000, 'later');
* // => Logs 'later' after one second.
*/
var delay = baseRest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new flipped function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrap(func, FLIP_FLAG);
}
/**
* 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/6.0/#sec-properties-of-the-map-prototype-object)
* method interface of `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 && 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);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} predicate The predicate to negate.
* @returns {Function} Returns the new negated function.
* @example
*
* function isEven(n) {
* return n % 2 == 0;
* }
*
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
* // => [1, 3, 5]
*/
function negate(predicate) {
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var args = arguments;
switch (args.length) {
case 0: return !predicate.call(this);
case 1: return !predicate.call(this, args[0]);
case 2: return !predicate.call(this, args[0], args[1]);
case 3: return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first invocation. The `func` is
* invoked with the `this` binding and arguments of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // => `createApplication` is invoked once
*/
function once(func) {
return before(2, func);
}
/**
* Creates a function that invokes `func` with its arguments transformed.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Function
* @param {Function} func The function to wrap.
* @param {...(Function|Function[])} [transforms=[_.identity]]
* The argument transforms.
* @returns {Function} Returns the new function.
* @example
*
* function doubled(n) {
* return n * 2;
* }
*
* function square(n) {
* return n * n;
* }
*
* var func = _.overArgs(function(x, y) {
* return [x, y];
* }, [square, doubled]);
*
* func(9, 3);
* // => [81, 6]
*
* func(10, 5);
* // => [100, 10]
*/
var overArgs = baseRest(function(func, transforms) {
transforms = (transforms.length == 1 && isArray(transforms[0]))
? arrayMap(transforms[0], baseUnary(getIteratee()))
: arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
var funcsLength = transforms.length;
return baseRest(function(args) {
var index = -1,
length = nativeMin(args.length, funcsLength);
while (++index < length) {
args[index] = transforms[index].call(this, args[index]);
}
return apply(func, this, args);
});
});
/**
* Creates a function that invokes `func` with `partials` prepended to the
* arguments it receives. This method is like `_.bind` except it does **not**
* alter the `this` binding.
*
* The `_.partial.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 0.2.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var sayHelloTo = _.partial(greet, 'hello');
* sayHelloTo('fred');
* // => 'hello fred'
*
* // Partially applied with placeholders.
* var greetFred = _.partial(greet, _, 'fred');
* greetFred('hi');
* // => 'hi fred'
*/
var partial = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partial));
return createWrap(func, PARTIAL_FLAG, undefined, partials, holders);
});
/**
* This method is like `_.partial` except that partially applied arguments
* are appended to the arguments it receives.
*
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var greetFred = _.partialRight(greet, 'fred');
* greetFred('hi');
* // => 'hi fred'
*
* // Partially applied with placeholders.
* var sayHelloTo = _.partialRight(greet, 'hello', _);
* sayHelloTo('fred');
* // => 'hello fred'
*/
var partialRight = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partialRight));
return createWrap(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = baseRest(function(func, indexes) {
return createWrap(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1));
});
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as
* an array.
*
* **Note:** This method is based on the
* [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start === undefined ? start : toInteger(start);
return baseRest(func, start);
}
/**
* Creates a function that invokes `func` with the `this` binding of the
* create function and an array of arguments much like
* [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply).
*
* **Note:** This method is based on the
* [spread operator](https://mdn.io/spread_operator).
*
* @static
* @memberOf _
* @since 3.2.0
* @category Function
* @param {Function} func The function to spread arguments over.
* @param {number} [start=0] The start position of the spread.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.spread(function(who, what) {
* return who + ' says ' + what;
* });
*
* say(['fred', 'hello']);
* // => 'fred says hello'
*
* var numbers = Promise.all([
* Promise.resolve(40),
* Promise.resolve(36)
* ]);
*
* numbers.then(_.spread(function(x, y) {
* return x + y;
* }));
* // => a Promise of 76
*/
function spread(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start === undefined ? 0 : nativeMax(toInteger(start), 0);
return baseRest(function(args) {
var array = args[start],
otherArgs = castSlice(args, 0, start);
if (array) {
arrayPush(otherArgs, array);
}
return apply(func, this, otherArgs);
});
}
/**
* Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide an options object to indicate whether
* `func` should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to throttle.
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=true]
* Specify invoking on the leading edge of the timeout.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // Avoid excessively updating the position while scrolling.
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* jQuery(element).on('click', throttled);
*
* // Cancel the trailing throttled invocation.
* jQuery(window).on('popstate', throttled.cancel);
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
return debounce(func, wait, {
'leading': leading,
'maxWait': wait,
'trailing': trailing
});
}
/**
* Creates a function that accepts up to one argument, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.unary(parseInt));
* // => [6, 8, 10]
*/
function unary(func) {
return ary(func, 1);
}
/**
* Creates a function that provides `value` to `wrapper` as its first
* argument. Any additional arguments provided to the function are appended
* to those provided to the `wrapper`. The wrapper is invoked with the `this`
* binding of the created function.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {*} value The value to wrap.
* @param {Function} [wrapper=identity] The wrapper function.
* @returns {Function} Returns the new function.
* @example
*
* var p = _.wrap(_.escape, function(func, text) {
* return '<p>' + func(text) + '</p>';
* });
*
* p('fred, barney, & pebbles');
* // => '<p>fred, barney, & pebbles</p>'
*/
function wrap(value, wrapper) {
wrapper = wrapper == null ? identity : wrapper;
return partial(wrapper, value);
}
/*------------------------------------------------------------------------*/
/**
* Casts `value` as an array if it's not one.
*
* @static
* @memberOf _
* @since 4.4.0
* @category Lang
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast array.
* @example
*
* _.castArray(1);
* // => [1]
*
* _.castArray({ 'a': 1 });
* // => [{ 'a': 1 }]
*
* _.castArray('abc');
* // => ['abc']
*
* _.castArray(null);
* // => [null]
*
* _.castArray(undefined);
* // => [undefined]
*
* _.castArray();
* // => []
*
* var array = [1, 2, 3];
* console.log(_.castArray(array) === array);
* // => true
*/
function castArray() {
if (!arguments.length) {
return [];
}
var value = arguments[0];
return isArray(value) ? value : [value];
}
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, false, true);
}
/**
* This method is like `_.clone` except that it accepts `customizer` which
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
* cloning is handled by the method instead. The `customizer` is invoked with
* up to four arguments; (value [, index|key, object, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the cloned value.
* @see _.cloneDeepWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(false);
* }
* }
*
* var el = _.cloneWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 0
*/
function cloneWith(value, customizer) {
return baseClone(value, false, true, customizer);
}
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, true, true);
}
/**
* This method is like `_.cloneWith` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @param {Function} [customizer] The function to customize cloning.
* @returns {*} Returns the deep cloned value.
* @see _.cloneWith
* @example
*
* function customizer(value) {
* if (_.isElement(value)) {
* return value.cloneNode(true);
* }
* }
*
* var el = _.cloneDeepWith(document.body, customizer);
*
* console.log(el === document.body);
* // => false
* console.log(el.nodeName);
* // => 'BODY'
* console.log(el.childNodes.length);
* // => 20
*/
function cloneDeepWith(value, customizer) {
return baseClone(value, true, true, customizer);
}
/**
* Checks if `object` conforms to `source` by invoking the predicate properties
* of `source` with the corresponding property values of `object`. This method
* is equivalent to a `_.conforms` function when `source` is partially applied.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property predicates to conform to.
* @returns {boolean} Returns `true` if `object` conforms, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.conformsTo(object, { 'b': function(n) { return n > 1; } });
* // => true
*
* _.conformsTo(object, { 'b': function(n) { return n > 2; } });
* // => false
*/
function conformsTo(object, source) {
return source == null || baseConformsTo(object, source, keys(source));
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.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);
}
/**
* Checks if `value` is greater than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than `other`,
* else `false`.
* @see _.lt
* @example
*
* _.gt(3, 1);
* // => true
*
* _.gt(3, 3);
* // => false
*
* _.gt(1, 3);
* // => false
*/
var gt = createRelationalOperation(baseGt);
/**
* Checks if `value` is greater than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is greater than or equal to
* `other`, else `false`.
* @see _.lte
* @example
*
* _.gte(3, 1);
* // => true
*
* _.gte(3, 3);
* // => true
*
* _.gte(1, 3);
* // => false
*/
var gte = createRelationalOperation(function(value, other) {
return value >= other;
});
/**
* 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
*/
function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* 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;
/**
* Checks if `value` is classified as an `ArrayBuffer` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
* @example
*
* _.isArrayBuffer(new ArrayBuffer(2));
* // => true
*
* _.isArrayBuffer(new Array(2));
* // => false
*/
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
/**
* 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(getLength(value)) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a boolean primitive or object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
* @example
*
* _.isBoolean(false);
* // => true
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
(isObjectLike(value) && objectToString.call(value) == boolTag);
}
/**
* 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;
/**
* Checks if `value` is classified as a `Date` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
* @example
*
* _.isDate(new Date);
* // => true
*
* _.isDate('Mon April 23 2012');
* // => false
*/
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
/**
* Checks if `value` is likely a DOM element.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a DOM element,
* else `false`.
* @example
*
* _.isElement(document.body);
* // => true
*
* _.isElement('<body>');
* // => false
*/
function isElement(value) {
return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
}
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (isArrayLike(value) &&
(isArray(value) || isString(value) || isFunction(value.splice) ||
isArguments(value) || isBuffer(value))) {
return !value.length;
}
if (isObjectLike(value)) {
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return !(nonEnumShadows && keys(value).length);
}
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are **not** supported.
*
* @static
* @memberOf _
* @since 0.1.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 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
/**
* This method is like `_.isEqual` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with up to
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if the values are equivalent,
* else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, othValue) {
* if (isGreeting(objValue) && isGreeting(othValue)) {
* return true;
* }
* }
*
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqualWith(array, other, customizer);
* // => true
*/
function isEqualWith(value, other, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
}
/**
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
* `SyntaxError`, `TypeError`, or `URIError` object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an error object,
* else `false`.
* @example
*
* _.isError(new Error);
* // => true
*
* _.isError(Error);
* // => false
*/
function isError(value) {
if (!isObjectLike(value)) {
return false;
}
return (objectToString.call(value) == errorTag) ||
(typeof value.message == 'string' && typeof value.name == 'string');
}
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on
* [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number,
* else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MIN_VALUE);
* // => true
*
* _.isFinite(Infinity);
* // => false
*
* _.isFinite('3');
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
/**
* 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) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is an integer.
*
* **Note:** This method is based on
* [`Number.isInteger`](https://mdn.io/Number/isInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
* @example
*
* _.isInteger(3);
* // => true
*
* _.isInteger(Number.MIN_VALUE);
* // => false
*
* _.isInteger(Infinity);
* // => false
*
* _.isInteger('3');
* // => false
*/
function isInteger(value) {
return typeof value == 'number' && value == toInteger(value);
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.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;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/6.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 && (type == 'object' || type == 'function');
}
/**
* 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 && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Map` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
* @example
*
* _.isMap(new Map);
* // => true
*
* _.isMap(new WeakMap);
* // => false
*/
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
/**
* Performs a partial deep comparison between `object` and `source` to
* determine if `object` contains equivalent property values. This method is
* equivalent to a `_.matches` function when `source` is partially applied.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* var object = { 'a': 1, 'b': 2 };
*
* _.isMatch(object, { 'b': 2 });
* // => true
*
* _.isMatch(object, { 'b': 1 });
* // => false
*/
function isMatch(object, source) {
return object === source || baseIsMatch(object, source, getMatchData(source));
}
/**
* This method is like `_.isMatch` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with five
* arguments: (objValue, srcValue, index|key, object, source).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, srcValue) {
* if (isGreeting(objValue) && isGreeting(srcValue)) {
* return true;
* }
* }
*
* var object = { 'greeting': 'hello' };
* var source = { 'greeting': 'hi' };
*
* _.isMatchWith(object, source, customizer);
* // => true
*/
function isMatchWith(object, source, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return baseIsMatch(object, source, getMatchData(source), customizer);
}
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
/**
* Checks if `value` is a pristine native function.
*
* **Note:** This method can't reliably detect native functions in the presence
* of the core-js package because core-js circumvents this kind of detection.
* Despite multiple requests, the core-js maintainer has made it clear: any
* attempt to fix the detection will be obstructed. As a result, we're left
* with little choice but to throw an error. Unfortunately, this also affects
* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
* which rely on core-js.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (isMaskable(value)) {
throw new Error('This method is not supported with core-js. Try https://github.com/es-shims.');
}
return baseIsNative(value);
}
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(void 0);
* // => false
*/
function isNull(value) {
return value === null;
}
/**
* Checks if `value` is `null` or `undefined`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
* @example
*
* _.isNil(null);
* // => true
*
* _.isNil(void 0);
* // => true
*
* _.isNil(NaN);
* // => false
*/
function isNil(value) {
return value == null;
}
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' ||
(isObjectLike(value) && objectToString.call(value) == numberTag);
}
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object,
* else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) ||
objectToString.call(value) != objectTag || isHostObject(value)) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return (typeof Ctor == 'function' &&
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
}
/**
* Checks if `value` is classified as a `RegExp` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
* @example
*
* _.isRegExp(/abc/);
* // => true
*
* _.isRegExp('/abc/');
* // => false
*/
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
/**
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
* double precision number which isn't the result of a rounded unsafe integer.
*
* **Note:** This method is based on
* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a safe integer,
* else `false`.
* @example
*
* _.isSafeInteger(3);
* // => true
*
* _.isSafeInteger(Number.MIN_VALUE);
* // => false
*
* _.isSafeInteger(Infinity);
* // => false
*
* _.isSafeInteger('3');
* // => false
*/
function isSafeInteger(value) {
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as a `Set` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
* @example
*
* _.isSet(new Set);
* // => true
*
* _.isSet(new WeakSet);
* // => false
*/
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
/**
* 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) && objectToString.call(value) == stringTag);
}
/**
* 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) && objectToString.call(value) == symbolTag);
}
/**
* 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;
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
/**
* Checks if `value` is classified as a `WeakMap` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
* @example
*
* _.isWeakMap(new WeakMap);
* // => true
*
* _.isWeakMap(new Map);
* // => false
*/
function isWeakMap(value) {
return isObjectLike(value) && getTag(value) == weakMapTag;
}
/**
* Checks if `value` is classified as a `WeakSet` object.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
* @example
*
* _.isWeakSet(new WeakSet);
* // => true
*
* _.isWeakSet(new Set);
* // => false
*/
function isWeakSet(value) {
return isObjectLike(value) && objectToString.call(value) == weakSetTag;
}
/**
* Checks if `value` is less than `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
* @see _.gt
* @example
*
* _.lt(1, 3);
* // => true
*
* _.lt(3, 3);
* // => false
*
* _.lt(3, 1);
* // => false
*/
var lt = createRelationalOperation(baseLt);
/**
* Checks if `value` is less than or equal to `other`.
*
* @static
* @memberOf _
* @since 3.9.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than or equal to
* `other`, else `false`.
* @see _.gte
* @example
*
* _.lte(1, 3);
* // => true
*
* _.lte(3, 3);
* // => true
*
* _.lte(3, 1);
* // => false
*/
var lte = createRelationalOperation(function(value, other) {
return value <= other;
});
/**
* Converts `value` to an array.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to convert.
* @returns {Array} Returns the converted array.
* @example
*
* _.toArray({ 'a': 1, 'b': 2 });
* // => [1, 2]
*
* _.toArray('abc');
* // => ['a', 'b', 'c']
*
* _.toArray(1);
* // => []
*
* _.toArray(null);
* // => []
*/
function toArray(value) {
if (!value) {
return [];
}
if (isArrayLike(value)) {
return isString(value) ? stringToArray(value) : copyArray(value);
}
if (iteratorSymbol && value[iteratorSymbol]) {
return iteratorToArray(value[iteratorSymbol]());
}
var tag = getTag(value),
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
return func(value);
}
/**
* 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;
}
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.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;
}
/**
* Converts `value` to an integer suitable for use as the length of an
* array-like object.
*
* **Note:** This method is based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toLength(3.2);
* // => 3
*
* _.toLength(Number.MIN_VALUE);
* // => 0
*
* _.toLength(Infinity);
* // => 4294967295
*
* _.toLength('3.2');
* // => 3
*/
function toLength(value) {
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
}
/**
* 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 = isFunction(value.valueOf) ? 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);
}
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
/**
* Converts `value` to a safe integer. A safe integer can be compared and
* represented correctly.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toSafeInteger(3.2);
* // => 3
*
* _.toSafeInteger(Number.MIN_VALUE);
* // => 0
*
* _.toSafeInteger(Infinity);
* // => 9007199254740991
*
* _.toSafeInteger('3.2');
* // => 3
*/
function toSafeInteger(value) {
return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
}
/**
* 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 process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/*------------------------------------------------------------------------*/
/**
* Assigns own enumerable string keyed properties of source objects to the
* destination object. Source objects are applied from left to right.
* Subsequent sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @static
* @memberOf _
* @since 0.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assignIn
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3 }
*/
var assign = createAssigner(function(object, source) {
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
/**
* This method is like `_.assign` except that it iterates over own and
* inherited source properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assign
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
var assignIn = createAssigner(function(object, source) {
if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
copyObject(source, keysIn(source), object);
return;
}
for (var key in source) {
assignValue(object, key, source[key]);
}
});
/**
* This method is like `_.assignIn` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keysIn(source), object, customizer);
});
/**
* This method is like `_.assign` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignInWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keys(source), object, customizer);
});
/**
* Creates an array of values corresponding to `paths` of `object`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {...(string|string[])} [paths] The property paths of elements to pick.
* @returns {Array} Returns the picked values.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
*
* _.at(object, ['a[0].b.c', 'a[1]']);
* // => [3, 4]
*/
var at = baseRest(function(object, paths) {
return baseAt(object, baseFlatten(paths, 1));
});
/**
* Creates an object that inherits from the `prototype` object. If a
* `properties` object is given, its own enumerable string keyed properties
* are assigned to the created object.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Object
* @param {Object} prototype The object to inherit from.
* @param {Object} [properties] The properties to assign to the object.
* @returns {Object} Returns the new object.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* function Circle() {
* Shape.call(this);
* }
*
* Circle.prototype = _.create(Shape.prototype, {
* 'constructor': Circle
* });
*
* var circle = new Circle;
* circle instanceof Circle;
* // => true
*
* circle instanceof Shape;
* // => true
*/
function create(prototype, properties) {
var result = baseCreate(prototype);
return properties ? baseAssign(result, properties) : result;
}
/**
* Assigns own and inherited enumerable string keyed properties of source
* objects to the destination object for all destination properties that
* resolve to `undefined`. Source objects are applied from left to right.
* Once a property is set, additional values of the same property are ignored.
*
* **Note:** This method mutates `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaultsDeep
* @example
*
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var defaults = baseRest(function(args) {
args.push(undefined, assignInDefaults);
return apply(assignInWith, undefined, args);
});
/**
* This method is like `_.defaults` except that it recursively assigns
* default properties.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaults
* @example
*
* _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
* // => { 'a': { 'b': 2, 'c': 3 } }
*/
var defaultsDeep = baseRest(function(args) {
args.push(undefined, mergeDefaults);
return apply(mergeWith, undefined, args);
});
/**
* This method is like `_.find` except that it returns the key of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Object
* @param {Object} object The object to search.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findKey(users, function(o) { return o.age < 40; });
* // => 'barney' (iteration order is not guaranteed)
*
* // The `_.matches` iteratee shorthand.
* _.findKey(users, { 'age': 1, 'active': true });
* // => 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findKey(users, 'active');
* // => 'barney'
*/
function findKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
}
/**
* This method is like `_.findKey` except that it iterates over elements of
* a collection in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to search.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findLastKey(users, function(o) { return o.age < 40; });
* // => returns 'pebbles' assuming `_.findKey` returns 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.findLastKey(users, { 'age': 36, 'active': true });
* // => 'barney'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate) {
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
}
/**
* Iterates over own and inherited enumerable string keyed properties of an
* object and invokes `iteratee` for each property. The iteratee is invoked
* with three arguments: (value, key, object). Iteratee functions may exit
* iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forInRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forIn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
*/
function forIn(object, iteratee) {
return object == null
? object
: baseFor(object, getIteratee(iteratee, 3), keysIn);
}
/**
* This method is like `_.forIn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forIn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forInRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
*/
function forInRight(object, iteratee) {
return object == null
? object
: baseForRight(object, getIteratee(iteratee, 3), keysIn);
}
/**
* Iterates over own enumerable string keyed properties of an object and
* invokes `iteratee` for each property. The iteratee is invoked with three
* arguments: (value, key, object). Iteratee functions may exit iteration
* early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 0.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwnRight
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwn(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
return object && baseForOwn(object, getIteratee(iteratee, 3));
}
/**
* This method is like `_.forOwn` except that it iterates over properties of
* `object` in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns `object`.
* @see _.forOwn
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.forOwnRight(new Foo, function(value, key) {
* console.log(key);
* });
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
*/
function forOwnRight(object, iteratee) {
return object && baseForOwnRight(object, getIteratee(iteratee, 3));
}
/**
* Creates an array of function property names from own enumerable properties
* of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functionsIn
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functions(new Foo);
* // => ['a', 'b']
*/
function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
}
/**
* Creates an array of function property names from own and inherited
* enumerable properties of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functions
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functionsIn(new Foo);
* // => ['a', 'b', 'c']
*/
function functionsIn(object) {
return object == null ? [] : baseFunctions(object, keysIn(object));
}
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function(result, value, key) {
result[value] = key;
}, constant(identity));
/**
* This method is like `_.invert` except that the inverted object is generated
* from the results of running each element of `object` thru `iteratee`. The
* corresponding inverted value of each inverted key is an array of keys
* responsible for generating the inverted value. The iteratee is invoked
* with one argument: (value).
*
* @static
* @memberOf _
* @since 4.1.0
* @category Object
* @param {Object} object The object to invert.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invertBy(object);
* // => { '1': ['a', 'c'], '2': ['b'] }
*
* _.invertBy(object, function(value) {
* return 'group' + value;
* });
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
var invertBy = createInverter(function(result, value, key) {
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}, getIteratee);
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
/**
* 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/6.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) {
var isProto = isPrototype(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(object, key) &&
!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(isProto && key == 'constructor')) {
result.push(key);
}
}
return result;
}
/**
* 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) {
var index = -1,
isProto = isPrototype(object),
props = baseKeysIn(object),
propsLength = props.length,
indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
while (++index < propsLength) {
var key = props[index];
if (!(skipIndexes && (key == 'length' || isIndex(key, length))) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* The opposite of `_.mapValues`; this method creates an object with the
* same values as `object` and keys generated by running each own enumerable
* string keyed property of `object` thru `iteratee`. The iteratee is invoked
* with three arguments: (value, key, object).
*
* @static
* @memberOf _
* @since 3.8.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapValues
* @example
*
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
* return key + value;
* });
* // => { 'a1': 1, 'b2': 2 }
*/
function mapKeys(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
result[iteratee(value, key, object)] = value;
});
return result;
}
/**
* Creates an object with the same keys as `object` and values generated
* by running each own enumerable string keyed property of `object` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, key, object).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = getIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
result[key] = iteratee(value, key, object);
});
return result;
}
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
/**
* This method is like `_.merge` except that it accepts `customizer` which
* is invoked to produce the merged values of the destination and source
* properties. If `customizer` returns `undefined`, merging is handled by the
* method instead. The `customizer` is invoked with seven arguments:
* (objValue, srcValue, key, object, source, stack).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} customizer The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* function customizer(objValue, srcValue) {
* if (_.isArray(objValue)) {
* return objValue.concat(srcValue);
* }
* }
*
* var object = { 'a': [1], 'b': [2] };
* var other = { 'a': [3], 'b': [4] };
*
* _.mergeWith(object, other, customizer);
* // => { 'a': [1, 3], 'b': [2, 4] }
*/
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
baseMerge(object, source, srcIndex, customizer);
});
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable string keyed properties of `object` that are
* not omitted.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [props] The property identifiers 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 = baseRest(function(object, props) {
if (object == null) {
return {};
}
props = arrayMap(baseFlatten(props, 1), toKey);
return basePick(object, baseDifference(getAllKeysIn(object), props));
});
/**
* The opposite of `_.pickBy`; this method creates an object composed of
* the own and inherited enumerable string keyed properties of `object` that
* `predicate` doesn't return truthy for. The predicate is invoked with two
* arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omitBy(object, _.isNumber);
* // => { 'b': '2' }
*/
function omitBy(object, predicate) {
return pickBy(object, negate(getIteratee(predicate)));
}
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [props] The property identifiers to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = baseRest(function(object, props) {
return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));
});
/**
* Creates an object composed of the `object` properties `predicate` returns
* truthy for. The predicate is invoked with two arguments: (value, key).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The source object.
* @param {Function} [predicate=_.identity] The function invoked per property.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pickBy(object, _.isNumber);
* // => { 'a': 1, 'c': 3 }
*/
function pickBy(object, predicate) {
return object == null ? {} : basePickBy(object, getAllKeysIn(object), getIteratee(predicate));
}
/**
* This method is like `_.get` except that if the resolved value is a
* function it's invoked with the `this` binding of its parent object and
* its result is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to resolve.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
*
* _.result(object, 'a[0].b.c1');
* // => 3
*
* _.result(object, 'a[0].b.c2');
* // => 4
*
* _.result(object, 'a[0].b.c3', 'default');
* // => 'default'
*
* _.result(object, 'a[0].b.c3', _.constant('default'));
* // => 'default'
*/
function result(object, path, defaultValue) {
path = isKey(path, object) ? [path] : castPath(path);
var index = -1,
length = path.length;
// Ensure the loop is entered when path is empty.
if (!length) {
object = undefined;
length = 1;
}
while (++index < length) {
var value = object == null ? undefined : object[toKey(path[index])];
if (value === undefined) {
index = length;
value = defaultValue;
}
object = isFunction(value) ? value.call(object) : value;
}
return object;
}
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
/**
* This method is like `_.set` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.setWith(object, '[0][1]', 'a', Object);
* // => { '0': { '1': 'a' } }
*/
function setWith(object, path, value, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseSet(object, path, value, customizer);
}
/**
* Creates an array of own enumerable string keyed-value pairs for `object`
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
* entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entries
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairs(new Foo);
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
*/
var toPairs = createToPairs(keys);
/**
* Creates an array of own and inherited enumerable string keyed-value pairs
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map
* or set, its entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entriesIn
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairsIn(new Foo);
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
*/
var toPairsIn = createToPairs(keysIn);
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable string keyed properties thru `iteratee`, with each invocation
* potentially mutating the `accumulator` object. If `accumulator` is not
* provided, a new object with the same `[[Prototype]]` will be used. The
* iteratee is invoked with four arguments: (accumulator, value, key, object).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
* }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
var isArr = isArray(object) || isTypedArray(object);
iteratee = getIteratee(iteratee, 4);
if (accumulator == null) {
if (isArr || isObject(object)) {
var Ctor = object.constructor;
if (isArr) {
accumulator = isArray(object) ? new Ctor : [];
} else {
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
}
} else {
accumulator = {};
}
}
(isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
return iteratee(accumulator, value, index, object);
});
return accumulator;
}
/**
* Removes the property at `path` of `object`.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 7 } }] };
* _.unset(object, 'a[0].b.c');
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*
* _.unset(object, ['a', '0', 'b', 'c']);
* // => true
*
* console.log(object);
* // => { 'a': [{ 'b': {} }] };
*/
function unset(object, path) {
return object == null ? true : baseUnset(object, path);
}
/**
* This method is like `_.set` except that accepts `updater` to produce the
* value to set. Use `_.updateWith` to customize `path` creation. The `updater`
* is invoked with one argument: (value).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.update(object, 'a[0].b.c', function(n) { return n * n; });
* console.log(object.a[0].b.c);
* // => 9
*
* _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
* console.log(object.x[0].y.z);
* // => 0
*/
function update(object, path, updater) {
return object == null ? object : baseUpdate(object, path, castFunction(updater));
}
/**
* This method is like `_.update` except that it accepts `customizer` which is
* invoked to produce the objects of `path`. If `customizer` returns `undefined`
* path creation is handled by the method instead. The `customizer` is invoked
* with three arguments: (nsValue, key, nsObject).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.6.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} updater The function to produce the updated value.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @example
*
* var object = {};
*
* _.updateWith(object, '[0][1]', _.constant('a'), Object);
* // => { '0': { '1': 'a' } }
*/
function updateWith(object, path, updater, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
}
/**
* 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 ? baseValues(object, keys(object)) : [];
}
/**
* Creates an array of the own and inherited enumerable string keyed property
* values 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 values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.valuesIn(new Foo);
* // => [1, 2, 3] (iteration order is not guaranteed)
*/
function valuesIn(object) {
return object == null ? [] : baseValues(object, keysIn(object));
}
/*------------------------------------------------------------------------*/
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Number
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
*/
function clamp(number, lower, upper) {
if (upper === undefined) {
upper = lower;
lower = undefined;
}
if (upper !== undefined) {
upper = toNumber(upper);
upper = upper === upper ? upper : 0;
}
if (lower !== undefined) {
lower = toNumber(lower);
lower = lower === lower ? lower : 0;
}
return baseClamp(toNumber(number), lower, upper);
}
/**
* Checks if `n` is between `start` and up to, but not including, `end`. If
* `end` is not specified, it's set to `start` with `start` then set to `0`.
* If `start` is greater than `end` the params are swapped to support
* negative ranges.
*
* @static
* @memberOf _
* @since 3.3.0
* @category Number
* @param {number} number The number to check.
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
* @see _.range, _.rangeRight
* @example
*
* _.inRange(3, 2, 4);
* // => true
*
* _.inRange(4, 8);
* // => true
*
* _.inRange(4, 2);
* // => false
*
* _.inRange(2, 2);
* // => false
*
* _.inRange(1.2, 2);
* // => true
*
* _.inRange(5.2, 4);
* // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/
function inRange(number, start, end) {
start = toNumber(start) || 0;
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
}
number = toNumber(number);
return baseInRange(number, start, end);
}
/**
* Produces a random number between the inclusive `lower` and `upper` bounds.
* If only one argument is provided a number between `0` and the given number
* is returned. If `floating` is `true`, or either `lower` or `upper` are
* floats, a floating-point number is returned instead of an integer.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Number
* @param {number} [lower=0] The lower bound.
* @param {number} [upper=1] The upper bound.
* @param {boolean} [floating] Specify returning a floating-point number.
* @returns {number} Returns the random number.
* @example
*
* _.random(0, 5);
* // => an integer between 0 and 5
*
* _.random(5);
* // => also an integer between 0 and 5
*
* _.random(5, true);
* // => a floating-point number between 0 and 5
*
* _.random(1.2, 5.2);
* // => a floating-point number between 1.2 and 5.2
*/
function random(lower, upper, floating) {
if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
upper = floating = undefined;
}
if (floating === undefined) {
if (typeof upper == 'boolean') {
floating = upper;
upper = undefined;
}
else if (typeof lower == 'boolean') {
floating = lower;
lower = undefined;
}
}
if (lower === undefined && upper === undefined) {
lower = 0;
upper = 1;
}
else {
lower = toNumber(lower) || 0;
if (upper === undefined) {
upper = lower;
lower = 0;
} else {
upper = toNumber(upper) || 0;
}
}
if (lower > upper) {
var temp = lower;
lower = upper;
upper = temp;
}
if (floating || lower % 1 || upper % 1) {
var rand = nativeRandom();
return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
}
return baseRandom(lower, upper);
}
/*------------------------------------------------------------------------*/
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the camel cased string.
* @example
*
* _.camelCase('Foo Bar');
* // => 'fooBar'
*
* _.camelCase('--foo-bar--');
* // => 'fooBar'
*
* _.camelCase('__FOO_BAR__');
* // => 'fooBar'
*/
var camelCase = createCompounder(function(result, word, index) {
word = word.toLowerCase();
return result + (index ? capitalize(word) : word);
});
/**
* Converts the first character of `string` to upper case and the remaining
* to lower case.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to capitalize.
* @returns {string} Returns the capitalized string.
* @example
*
* _.capitalize('FRED');
* // => 'Fred'
*/
function capitalize(string) {
return upperFirst(toString(string).toLowerCase());
}
/**
* Deburrs `string` by converting
* [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* to basic latin letters and removing
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
}
/**
* Checks if `string` ends with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to search.
* @param {string} [target] The string to search for.
* @param {number} [position=string.length] The position to search up to.
* @returns {boolean} Returns `true` if `string` ends with `target`,
* else `false`.
* @example
*
* _.endsWith('abc', 'c');
* // => true
*
* _.endsWith('abc', 'b');
* // => false
*
* _.endsWith('abc', 'b', 2);
* // => true
*/
function endsWith(string, target, position) {
string = toString(string);
target = baseToString(target);
var length = string.length;
position = position === undefined
? length
: baseClamp(toInteger(position), 0, length);
var end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
}
/**
* Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
* their corresponding HTML entities.
*
* **Note:** No other characters are escaped. To escape additional
* characters use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
* ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value. See
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* Backticks are escaped because in IE < 9, they can break out of
* attribute values or HTML comments. See [#59](https://html5sec.org/#59),
* [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
* [#133](https://html5sec.org/#133) of the
* [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
*
* When working with HTML you should always
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce
* XSS vectors.
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function escape(string) {
string = toString(string);
return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar)
: string;
}
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: string;
}
/**
* Converts `string` to
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the kebab cased string.
* @example
*
* _.kebabCase('Foo Bar');
* // => 'foo-bar'
*
* _.kebabCase('fooBar');
* // => 'foo-bar'
*
* _.kebabCase('__FOO_BAR__');
* // => 'foo-bar'
*/
var kebabCase = createCompounder(function(result, word, index) {
return result + (index ? '-' : '') + word.toLowerCase();
});
/**
* Converts `string`, as space separated words, to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.lowerCase('--Foo-Bar--');
* // => 'foo bar'
*
* _.lowerCase('fooBar');
* // => 'foo bar'
*
* _.lowerCase('__FOO_BAR__');
* // => 'foo bar'
*/
var lowerCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toLowerCase();
});
/**
* Converts the first character of `string` to lower case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.lowerFirst('Fred');
* // => 'fred'
*
* _.lowerFirst('FRED');
* // => 'fRED'
*/
var lowerFirst = createCaseFirst('toLowerCase');
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.pad('abc', 8);
* // => ' abc '
*
* _.pad('abc', 8, '_-');
* // => '_-abc_-_'
*
* _.pad('abc', 3);
* // => 'abc'
*/
function pad(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2;
return (
createPadding(nativeFloor(mid), chars) +
string +
createPadding(nativeCeil(mid), chars)
);
}
/**
* Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padEnd('abc', 6);
* // => 'abc '
*
* _.padEnd('abc', 6, '_-');
* // => 'abc_-_'
*
* _.padEnd('abc', 3);
* // => 'abc'
*/
function padEnd(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (string + createPadding(length - strLength, chars))
: string;
}
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padStart('abc', 6);
* // => ' abc'
*
* _.padStart('abc', 6, '_-');
* // => '_-_abc'
*
* _.padStart('abc', 3);
* // => 'abc'
*/
function padStart(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (createPadding(length - strLength, chars) + string)
: string;
}
/**
* Converts `string` to an integer of the specified radix. If `radix` is
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a
* hexadecimal, in which case a `radix` of `16` is used.
*
* **Note:** This method aligns with the
* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
*
* @static
* @memberOf _
* @since 1.1.0
* @category String
* @param {string} string The string to convert.
* @param {number} [radix=10] The radix to interpret `value` by.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {number} Returns the converted integer.
* @example
*
* _.parseInt('08');
* // => 8
*
* _.map(['6', '08', '10'], _.parseInt);
* // => [6, 8, 10]
*/
function parseInt(string, radix, guard) {
// Chrome fails to trim leading <BOM> whitespace characters.
// See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details.
if (guard || radix == null) {
radix = 0;
} else if (radix) {
radix = +radix;
}
string = toString(string).replace(reTrim, '');
return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
}
/**
* Repeats the given string `n` times.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to repeat.
* @param {number} [n=1] The number of times to repeat the string.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the repeated string.
* @example
*
* _.repeat('*', 3);
* // => '***'
*
* _.repeat('abc', 2);
* // => 'abcabc'
*
* _.repeat('abc', 0);
* // => ''
*/
function repeat(string, n, guard) {
if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
n = 1;
} else {
n = toInteger(n);
}
return baseRepeat(toString(string), n);
}
/**
* Replaces matches for `pattern` in `string` with `replacement`.
*
* **Note:** This method is based on
* [`String#replace`](https://mdn.io/String/replace).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to modify.
* @param {RegExp|string} pattern The pattern to replace.
* @param {Function|string} replacement The match replacement.
* @returns {string} Returns the modified string.
* @example
*
* _.replace('Hi Fred', 'Fred', 'Barney');
* // => 'Hi Barney'
*/
function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]);
}
/**
* Converts `string` to
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--FOO-BAR--');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
/**
* Splits `string` by `separator`.
*
* **Note:** This method is based on
* [`String#split`](https://mdn.io/String/split).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to split.
* @param {RegExp|string} separator The separator pattern to split by.
* @param {number} [limit] The length to truncate results to.
* @returns {Array} Returns the string segments.
* @example
*
* _.split('a-b-c', '-', 2);
* // => ['a', 'b']
*/
function split(string, separator, limit) {
if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
separator = limit = undefined;
}
limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
if (!limit) {
return [];
}
string = toString(string);
if (string && (
typeof separator == 'string' ||
(separator != null && !isRegExp(separator))
)) {
separator = baseToString(separator);
if (separator == '' && reHasComplexSymbol.test(string)) {
return castSlice(stringToArray(string), 0, limit);
}
}
return nativeSplit.call(string, separator, limit);
}
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to search.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`,
* else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + target.length) == target;
}
/**
* Creates a compiled template function that can interpolate data properties
* in "interpolate" delimiters, HTML-escape interpolated data properties in
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
* properties may be accessed as free variables in the template. If a setting
* object is given, it takes precedence over `_.templateSettings` values.
*
* **Note:** In the development build `_.template` utilizes
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* for easier debugging.
*
* For more information on precompiling templates see
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
*
* For more information on Chrome extension sandboxes see
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
*
* @static
* @since 0.1.0
* @memberOf _
* @category String
* @param {string} [string=''] The template string.
* @param {Object} [options={}] The options object.
* @param {RegExp} [options.escape=_.templateSettings.escape]
* The HTML "escape" delimiter.
* @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
* The "evaluate" delimiter.
* @param {Object} [options.imports=_.templateSettings.imports]
* An object to import into the template as free variables.
* @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
* The "interpolate" delimiter.
* @param {string} [options.sourceURL='lodash.templateSources[n]']
* The sourceURL of the compiled template.
* @param {string} [options.variable='obj']
* The data object variable name.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the compiled template function.
* @example
*
* // Use the "interpolate" delimiter to create a compiled template.
* var compiled = _.template('hello <%= user %>!');
* compiled({ 'user': 'fred' });
* // => 'hello fred!'
*
* // Use the HTML "escape" delimiter to escape data property values.
* var compiled = _.template('<b><%- value %></b>');
* compiled({ 'value': '<script>' });
* // => '<b><script></b>'
*
* // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // Use the internal `print` function in "evaluate" delimiters.
* var compiled = _.template('<% print("hello " + user); %>!');
* compiled({ 'user': 'barney' });
* // => 'hello barney!'
*
* // Use the ES delimiter as an alternative to the default "interpolate" delimiter.
* var compiled = _.template('hello ${ user }!');
* compiled({ 'user': 'pebbles' });
* // => 'hello pebbles!'
*
* // Use backslashes to treat delimiters as plain text.
* var compiled = _.template('<%= "\\<%- value %\\>" %>');
* compiled({ 'value': 'ignored' });
* // => '<%- value %>'
*
* // Use the `imports` option to import `jQuery` as `jq`.
* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
* compiled({ 'users': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // Use the `sourceURL` option to specify a custom sourceURL for the template.
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
* // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
*
* // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* // var __t, __p = '';
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
* // return __p;
* // }
*
* // Use custom template delimiters.
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
* var compiled = _.template('hello {{ user }}!');
* compiled({ 'user': 'mustache' });
* // => 'hello mustache!'
*
* // Use the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and stack traces.
* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(string, options, guard) {
// Based on John Resig's `tmpl` implementation
// (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
var settings = lodash.templateSettings;
if (guard && isIterateeCall(string, options, guard)) {
options = undefined;
}
string = toString(string);
options = assignInWith({}, options, settings, assignInDefaults);
var imports = assignInWith({}, options.imports, settings.imports, assignInDefaults),
importsKeys = keys(imports),
importsValues = baseValues(imports, importsKeys);
var isEscaping,
isEvaluating,
index = 0,
interpolate = options.interpolate || reNoMatch,
source = "__p += '";
// Compile the regexp to match each delimiter.
var reDelimiters = RegExp(
(options.escape || reNoMatch).source + '|' +
interpolate.source + '|' +
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
(options.evaluate || reNoMatch).source + '|$'
, 'g');
// Use a sourceURL for easier debugging.
var sourceURL = '//# sourceURL=' +
('sourceURL' in options
? options.sourceURL
: ('lodash.templateSources[' + (++templateCounter) + ']')
) + '\n';
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
interpolateValue || (interpolateValue = esTemplateValue);
// Escape characters that can't be included in string literals.
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
// Replace delimiters with snippets.
if (escapeValue) {
isEscaping = true;
source += "' +\n__e(" + escapeValue + ") +\n'";
}
if (evaluateValue) {
isEvaluating = true;
source += "';\n" + evaluateValue + ";\n__p += '";
}
if (interpolateValue) {
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
}
index = offset + match.length;
// The JS engine embedded in Adobe products needs `match` returned in
// order to produce the correct `offset` value.
return match;
});
source += "';\n";
// If `variable` is not specified wrap a with-statement around the generated
// code to add the data object to the top of the scope chain.
var variable = options.variable;
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
}
// Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
.replace(reEmptyStringTrailing, '$1;');
// Frame code as the function body.
source = 'function(' + (variable || 'obj') + ') {\n' +
(variable
? ''
: 'obj || (obj = {});\n'
) +
"var __t, __p = ''" +
(isEscaping
? ', __e = _.escape'
: ''
) +
(isEvaluating
? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n"
: ';\n'
) +
source +
'return __p\n}';
var result = attempt(function() {
return Function(importsKeys, sourceURL + 'return ' + source)
.apply(undefined, importsValues);
});
// Provide the compiled function's source by its `toString` method or
// the `source` property as a convenience for inlining compiled templates.
result.source = source;
if (isError(result)) {
throw result;
}
return result;
}
/**
* Converts `string`, as a whole, to lower case just like
* [String#toLowerCase](https://mdn.io/toLowerCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.toLower('--Foo-Bar--');
* // => '--foo-bar--'
*
* _.toLower('fooBar');
* // => 'foobar'
*
* _.toLower('__FOO_BAR__');
* // => '__foo_bar__'
*/
function toLower(value) {
return toString(value).toLowerCase();
}
/**
* Converts `string`, as a whole, to upper case just like
* [String#toUpperCase](https://mdn.io/toUpperCase).
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.toUpper('--foo-bar--');
* // => '--FOO-BAR--'
*
* _.toUpper('fooBar');
* // => 'FOOBAR'
*
* _.toUpper('__foo_bar__');
* // => '__FOO_BAR__'
*/
function toUpper(value) {
return toString(value).toUpperCase();
}
/**
* Removes leading and trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trim(' abc ');
* // => 'abc'
*
* _.trim('-_-abc-_-', '_-');
* // => 'abc'
*
* _.map([' foo ', ' bar '], _.trim);
* // => ['foo', 'bar']
*/
function trim(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrim, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
chrSymbols = stringToArray(chars),
start = charsStartIndex(strSymbols, chrSymbols),
end = charsEndIndex(strSymbols, chrSymbols) + 1;
return castSlice(strSymbols, start, end).join('');
}
/**
* Removes trailing whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimEnd(' abc ');
* // => ' abc'
*
* _.trimEnd('-_-abc-_-', '_-');
* // => '-_-abc'
*/
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimEnd, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
return castSlice(strSymbols, 0, end).join('');
}
/**
* Removes leading whitespace or specified characters from `string`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to trim.
* @param {string} [chars=whitespace] The characters to trim.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {string} Returns the trimmed string.
* @example
*
* _.trimStart(' abc ');
* // => 'abc '
*
* _.trimStart('-_-abc-_-', '_-');
* // => 'abc-_-'
*/
function trimStart(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimStart, '');
}
if (!string || !(chars = baseToString(chars))) {
return string;
}
var strSymbols = stringToArray(string),
start = charsStartIndex(strSymbols, stringToArray(chars));
return castSlice(strSymbols, start).join('');
}
/**
* Truncates `string` if it's longer than the given maximum string length.
* The last characters of the truncated string are replaced with the omission
* string which defaults to "...".
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to truncate.
* @param {Object} [options={}] The options object.
* @param {number} [options.length=30] The maximum string length.
* @param {string} [options.omission='...'] The string to indicate text is omitted.
* @param {RegExp|string} [options.separator] The separator pattern to truncate to.
* @returns {string} Returns the truncated string.
* @example
*
* _.truncate('hi-diddly-ho there, neighborino');
* // => 'hi-diddly-ho there, neighbo...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': ' '
* });
* // => 'hi-diddly-ho there,...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'length': 24,
* 'separator': /,? +/
* });
* // => 'hi-diddly-ho there...'
*
* _.truncate('hi-diddly-ho there, neighborino', {
* 'omission': ' [...]'
* });
* // => 'hi-diddly-ho there, neig [...]'
*/
function truncate(string, options) {
var length = DEFAULT_TRUNC_LENGTH,
omission = DEFAULT_TRUNC_OMISSION;
if (isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? toInteger(options.length) : length;
omission = 'omission' in options ? baseToString(options.omission) : omission;
}
string = toString(string);
var strLength = string.length;
if (reHasComplexSymbol.test(string)) {
var strSymbols = stringToArray(string);
strLength = strSymbols.length;
}
if (length >= strLength) {
return string;
}
var end = length - stringSize(omission);
if (end < 1) {
return omission;
}
var result = strSymbols
? castSlice(strSymbols, 0, end).join('')
: string.slice(0, end);
if (separator === undefined) {
return result + omission;
}
if (strSymbols) {
end += (result.length - end);
}
if (isRegExp(separator)) {
if (string.slice(end).search(separator)) {
var match,
substring = result;
if (!separator.global) {
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
}
separator.lastIndex = 0;
while ((match = separator.exec(substring))) {
var newEnd = match.index;
}
result = result.slice(0, newEnd === undefined ? end : newEnd);
}
} else if (string.indexOf(baseToString(separator), end) != end) {
var index = result.lastIndexOf(separator);
if (index > -1) {
result = result.slice(0, index);
}
}
return result + omission;
}
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&`, `<`, `>`, `"`, `'`, and ``` in `string` to
* their corresponding characters.
*
* **Note:** No other HTML entities are unescaped. To unescape additional
* HTML entities use a third-party library like [_he_](https://mths.be/he).
*
* @static
* @memberOf _
* @since 0.6.0
* @category String
* @param {string} [string=''] The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('fred, barney, & pebbles');
* // => 'fred, barney, & pebbles'
*/
function unescape(string) {
string = toString(string);
return (string && reHasEscapedHtml.test(string))
? string.replace(reEscapedHtml, unescapeHtmlChar)
: string;
}
/**
* Converts `string`, as space separated words, to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('--foo-bar');
* // => 'FOO BAR'
*
* _.upperCase('fooBar');
* // => 'FOO BAR'
*
* _.upperCase('__foo_bar__');
* // => 'FOO BAR'
*/
var upperCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord;
}
return string.match(pattern) || [];
}
/*------------------------------------------------------------------------*/
/**
* Attempts to invoke `func`, returning either the result or the caught error
* object. Any additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Function} func The function to attempt.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {*} Returns the `func` result or error object.
* @example
*
* // Avoid throwing errors for invalid selectors.
* var elements = _.attempt(function(selector) {
* return document.querySelectorAll(selector);
* }, '>_>');
*
* if (_.isError(elements)) {
* elements = [];
* }
*/
var attempt = baseRest(function(func, args) {
try {
return apply(func, undefined, args);
} catch (e) {
return isError(e) ? e : new Error(e);
}
});
/**
* Binds methods of an object to the object itself, overwriting the existing
* method.
*
* **Note:** This method doesn't set the "length" property of bound functions.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Object} object The object to bind and assign the bound methods to.
* @param {...(string|string[])} methodNames The object method names to bind.
* @returns {Object} Returns `object`.
* @example
*
* var view = {
* 'label': 'docs',
* 'click': function() {
* console.log('clicked ' + this.label);
* }
* };
*
* _.bindAll(view, ['click']);
* jQuery(element).on('click', view.click);
* // => Logs 'clicked docs' when clicked.
*/
var bindAll = baseRest(function(object, methodNames) {
arrayEach(baseFlatten(methodNames, 1), function(key) {
key = toKey(key);
object[key] = bind(object[key], object);
});
return object;
});
/**
* Creates a function that iterates over `pairs` and invokes the corresponding
* function of the first predicate to return truthy. The predicate-function
* pairs are invoked with the `this` binding and arguments of the created
* function.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Array} pairs The predicate-function pairs.
* @returns {Function} Returns the new composite function.
* @example
*
* var func = _.cond([
* [_.matches({ 'a': 1 }), _.constant('matches A')],
* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
* [_.stubTrue, _.constant('no match')]
* ]);
*
* func({ 'a': 1, 'b': 2 });
* // => 'matches A'
*
* func({ 'a': 0, 'b': 1 });
* // => 'matches B'
*
* func({ 'a': '1', 'b': '2' });
* // => 'no match'
*/
function cond(pairs) {
var length = pairs ? pairs.length : 0,
toIteratee = getIteratee();
pairs = !length ? [] : arrayMap(pairs, function(pair) {
if (typeof pair[1] != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
return [toIteratee(pair[0]), pair[1]];
});
return baseRest(function(args) {
var index = -1;
while (++index < length) {
var pair = pairs[index];
if (apply(pair[0], this, args)) {
return apply(pair[1], this, args);
}
}
});
}
/**
* Creates a function that invokes the predicate properties of `source` with
* the corresponding property values of a given object, returning `true` if
* all predicates return truthy, else `false`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {Object} source The object of property predicates to conform to.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 2, 'b': 1 },
* { 'a': 1, 'b': 2 }
* ];
*
* _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
* // => [{ 'a': 1, 'b': 2 }]
*/
function conforms(source) {
return baseConforms(baseClone(source, true));
}
/**
* 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;
};
}
/**
* Checks `value` to determine whether a default value should be returned in
* its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
* or `undefined`.
*
* @static
* @memberOf _
* @since 4.14.0
* @category Util
* @param {*} value The value to check.
* @param {*} defaultValue The default value.
* @returns {*} Returns the resolved value.
* @example
*
* _.defaultTo(1, 10);
* // => 1
*
* _.defaultTo(undefined, 10);
* // => 10
*/
function defaultTo(value, defaultValue) {
return (value == null || value !== value) ? defaultValue : value;
}
/**
* Creates a function that returns the result of invoking the given functions
* with the `this` binding of the created function, where each successive
* invocation is supplied the return value of the previous.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flowRight
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flow([_.add, square]);
* addSquare(1, 2);
* // => 9
*/
var flow = createFlow();
/**
* This method is like `_.flow` except that it creates a function that
* invokes the given functions from right to left.
*
* @static
* @since 3.0.0
* @memberOf _
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flow
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight([square, _.add]);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
/**
* 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;
}
/**
* Creates a function that invokes `func` with the arguments of the created
* function. If `func` is a property name, the created function returns the
* property value for a given element. If `func` is an array or object, the
* created function returns `true` for elements that contain the equivalent
* source properties, otherwise it returns `false`.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Util
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
* // => [{ 'user': 'barney', 'age': 36, 'active': true }]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, _.iteratee(['user', 'fred']));
* // => [{ 'user': 'fred', 'age': 40 }]
*
* // The `_.property` iteratee shorthand.
* _.map(users, _.iteratee('user'));
* // => ['barney', 'fred']
*
* // Create custom iteratee shorthands.
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
* return !_.isRegExp(func) ? iteratee(func) : function(string) {
* return func.test(string);
* };
* });
*
* _.filter(['abc', 'def'], /ef/);
* // => ['def']
*/
function iteratee(func) {
return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));
}
/**
* Creates a function that performs a partial deep comparison between a given
* object and `source`, returning `true` if the given object has equivalent
* property values, else `false`. The created function is equivalent to
* `_.isMatch` with a `source` partially applied.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 1, 'b': 2, 'c': 3 },
* { 'a': 4, 'b': 5, 'c': 6 }
* ];
*
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
* // => [{ 'a': 4, 'b': 5, 'c': 6 }]
*/
function matches(source) {
return baseMatches(baseClone(source, true));
}
/**
* Creates a function that performs a partial deep comparison between the
* value at `path` of a given object to `srcValue`, returning `true` if the
* object value is equivalent, else `false`.
*
* **Note:** This method supports comparing the same values as `_.isEqual`.
*
* @static
* @memberOf _
* @since 3.2.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
* @example
*
* var objects = [
* { 'a': 1, 'b': 2, 'c': 3 },
* { 'a': 4, 'b': 5, 'c': 6 }
* ];
*
* _.find(objects, _.matchesProperty('a', 4));
* // => { 'a': 4, 'b': 5, 'c': 6 }
*/
function matchesProperty(path, srcValue) {
return baseMatchesProperty(path, baseClone(srcValue, true));
}
/**
* Creates a function that invokes the method at `path` of a given object.
* Any additional arguments are provided to the invoked method.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Util
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new invoker function.
* @example
*
* var objects = [
* { 'a': { 'b': _.constant(2) } },
* { 'a': { 'b': _.constant(1) } }
* ];
*
* _.map(objects, _.method('a.b'));
* // => [2, 1]
*
* _.map(objects, _.method(['a', 'b']));
* // => [2, 1]
*/
var method = baseRest(function(path, args) {
return function(object) {
return baseInvoke(object, path, args);
};
});
/**
* The opposite of `_.method`; this method creates a function that invokes
* the method at a given path of `object`. Any additional arguments are
* provided to the invoked method.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Util
* @param {Object} object The object to query.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new invoker function.
* @example
*
* var array = _.times(3, _.constant),
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.methodOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.methodOf(object));
* // => [2, 0]
*/
var methodOf = baseRest(function(object, args) {
return function(path) {
return baseInvoke(object, path, args);
};
});
/**
* Adds all own enumerable string keyed function properties of a source
* object to the destination object. If `object` is a function, then methods
* are added to its prototype as well.
*
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to
* avoid conflicts caused by modifying the original.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {Function|Object} [object=lodash] The destination object.
* @param {Object} source The object of functions to add.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.chain=true] Specify whether mixins are chainable.
* @returns {Function|Object} Returns `object`.
* @example
*
* function vowels(string) {
* return _.filter(string, function(v) {
* return /[aeiou]/i.test(v);
* });
* }
*
* _.mixin({ 'vowels': vowels });
* _.vowels('fred');
* // => ['e']
*
* _('fred').vowels().value();
* // => ['e']
*
* _.mixin({ 'vowels': vowels }, { 'chain': false });
* _('fred').vowels();
* // => ['e']
*/
function mixin(object, source, options) {
var props = keys(source),
methodNames = baseFunctions(source, props);
if (options == null &&
!(isObject(source) && (methodNames.length || !props.length))) {
options = source;
source = object;
object = this;
methodNames = baseFunctions(source, keys(source));
}
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
isFunc = isFunction(object);
arrayEach(methodNames, function(methodName) {
var func = source[methodName];
object[methodName] = func;
if (isFunc) {
object.prototype[methodName] = function() {
var chainAll = this.__chain__;
if (chain || chainAll) {
var result = object(this.__wrapped__),
actions = result.__actions__ = copyArray(this.__actions__);
actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
result.__chain__ = chainAll;
return result;
}
return func.apply(object, arrayPush([this.value()], arguments));
};
}
});
return object;
}
/**
* Reverts the `_` variable to its previous value and returns a reference to
* the `lodash` function.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @returns {Function} Returns the `lodash` function.
* @example
*
* var lodash = _.noConflict();
*/
function noConflict() {
if (root._ === this) {
root._ = oldDash;
}
return this;
}
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
/**
* Creates a function that gets the argument at index `n`. If `n` is negative,
* the nth argument from the end is returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {number} [n=0] The index of the argument to return.
* @returns {Function} Returns the new pass-thru function.
* @example
*
* var func = _.nthArg(1);
* func('a', 'b', 'c', 'd');
* // => 'b'
*
* var func = _.nthArg(-2);
* func('a', 'b', 'c', 'd');
* // => 'c'
*/
function nthArg(n) {
n = toInteger(n);
return baseRest(function(args) {
return baseNth(args, n);
});
}
/**
* Creates a function that invokes `iteratees` with the arguments it receives
* and returns their results.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to invoke.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.over([Math.max, Math.min]);
*
* func(1, 2, 3, 4);
* // => [4, 1]
*/
var over = createOver(arrayMap);
/**
* Creates a function that checks if **all** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overEvery([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => false
*
* func(NaN);
* // => false
*/
var overEvery = createOver(arrayEvery);
/**
* Creates a function that checks if **any** of the `predicates` return
* truthy when invoked with the arguments it receives.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {...(Function|Function[])} [predicates=[_.identity]]
* The predicates to check.
* @returns {Function} Returns the new function.
* @example
*
* var func = _.overSome([Boolean, isFinite]);
*
* func('1');
* // => true
*
* func(null);
* // => true
*
* func(NaN);
* // => false
*/
var overSome = createOver(arraySome);
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
/**
* The opposite of `_.property`; this method creates a function that returns
* the value at a given path of `object`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
* @example
*
* var array = [0, 1, 2],
* object = { 'a': array, 'b': array, 'c': array };
*
* _.map(['a[2]', 'c[0]'], _.propertyOf(object));
* // => [2, 0]
*
* _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
* // => [2, 0]
*/
function propertyOf(object) {
return function(path) {
return object == null ? undefined : baseGet(object, path);
};
}
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
* `start` is specified without an `end` or `step`. If `end` is not specified,
* it's set to `start` with `start` then set to `0`.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.rangeRight
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(-4);
* // => [0, -1, -2, -3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
var range = createRange();
/**
* This method is like `_.range` except that it populates values in
* descending order.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.range
* @example
*
* _.rangeRight(4);
* // => [3, 2, 1, 0]
*
* _.rangeRight(-4);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 5);
* // => [4, 3, 2, 1]
*
* _.rangeRight(0, 20, 5);
* // => [15, 10, 5, 0]
*
* _.rangeRight(0, -4, -1);
* // => [-3, -2, -1, 0]
*
* _.rangeRight(1, 4, 0);
* // => [1, 1, 1]
*
* _.rangeRight(0);
* // => []
*/
var rangeRight = createRange(true);
/**
* 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 [];
}
/**
* 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;
}
/**
* This method returns a new empty object.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Object} Returns the new empty object.
* @example
*
* var objects = _.times(2, _.stubObject);
*
* console.log(objects);
* // => [{}, {}]
*
* console.log(objects[0] === objects[1]);
* // => false
*/
function stubObject() {
return {};
}
/**
* This method returns an empty string.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {string} Returns the empty string.
* @example
*
* _.times(2, _.stubString);
* // => ['', '']
*/
function stubString() {
return '';
}
/**
* This method returns `true`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `true`.
* @example
*
* _.times(2, _.stubTrue);
* // => [true, true]
*/
function stubTrue() {
return true;
}
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = getIteratee(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(value));
}
/**
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {string} [prefix=''] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return toString(prefix) + id;
}
/*------------------------------------------------------------------------*/
/**
* Adds two numbers.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {number} augend The first number in an addition.
* @param {number} addend The second number in an addition.
* @returns {number} Returns the total.
* @example
*
* _.add(6, 4);
* // => 10
*/
var add = createMathOperation(function(augend, addend) {
return augend + addend;
}, 0);
/**
* Computes `number` rounded up to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round up.
* @param {number} [precision=0] The precision to round up to.
* @returns {number} Returns the rounded up number.
* @example
*
* _.ceil(4.006);
* // => 5
*
* _.ceil(6.004, 2);
* // => 6.01
*
* _.ceil(6040, -2);
* // => 6100
*/
var ceil = createRound('ceil');
/**
* Divide two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} dividend The first number in a division.
* @param {number} divisor The second number in a division.
* @returns {number} Returns the quotient.
* @example
*
* _.divide(6, 4);
* // => 1.5
*/
var divide = createMathOperation(function(dividend, divisor) {
return dividend / divisor;
}, 1);
/**
* Computes `number` rounded down to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round down.
* @param {number} [precision=0] The precision to round down to.
* @returns {number} Returns the rounded down number.
* @example
*
* _.floor(4.006);
* // => 4
*
* _.floor(0.046, 2);
* // => 0.04
*
* _.floor(4060, -2);
* // => 4000
*/
var floor = createRound('floor');
/**
* Computes the maximum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the maximum value.
* @example
*
* _.max([4, 2, 8, 6]);
* // => 8
*
* _.max([]);
* // => undefined
*/
function max(array) {
return (array && array.length)
? baseExtremum(array, identity, baseGt)
: undefined;
}
/**
* This method is like `_.max` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the maximum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* _.maxBy(objects, function(o) { return o.n; });
* // => { 'n': 2 }
*
* // The `_.property` iteratee shorthand.
* _.maxBy(objects, 'n');
* // => { 'n': 2 }
*/
function maxBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
: undefined;
}
/**
* Computes the mean of the values in `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the mean.
* @example
*
* _.mean([4, 2, 8, 6]);
* // => 5
*/
function mean(array) {
return baseMean(array, identity);
}
/**
* This method is like `_.mean` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be averaged.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the mean.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.meanBy(objects, function(o) { return o.n; });
* // => 5
*
* // The `_.property` iteratee shorthand.
* _.meanBy(objects, 'n');
* // => 5
*/
function meanBy(array, iteratee) {
return baseMean(array, getIteratee(iteratee, 2));
}
/**
* Computes the minimum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the minimum value.
* @example
*
* _.min([4, 2, 8, 6]);
* // => 2
*
* _.min([]);
* // => undefined
*/
function min(array) {
return (array && array.length)
? baseExtremum(array, identity, baseLt)
: undefined;
}
/**
* This method is like `_.min` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the criterion by which
* the value is ranked. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {*} Returns the minimum value.
* @example
*
* var objects = [{ 'n': 1 }, { 'n': 2 }];
*
* _.minBy(objects, function(o) { return o.n; });
* // => { 'n': 1 }
*
* // The `_.property` iteratee shorthand.
* _.minBy(objects, 'n');
* // => { 'n': 1 }
*/
function minBy(array, iteratee) {
return (array && array.length)
? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
: undefined;
}
/**
* Multiply two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} multiplier The first number in a multiplication.
* @param {number} multiplicand The second number in a multiplication.
* @returns {number} Returns the product.
* @example
*
* _.multiply(6, 4);
* // => 24
*/
var multiply = createMathOperation(function(multiplier, multiplicand) {
return multiplier * multiplicand;
}, 1);
/**
* Computes `number` rounded to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round.
* @param {number} [precision=0] The precision to round to.
* @returns {number} Returns the rounded number.
* @example
*
* _.round(4.006);
* // => 4
*
* _.round(4.006, 2);
* // => 4.01
*
* _.round(4060, -2);
* // => 4100
*/
var round = createRound('round');
/**
* Subtract two numbers.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {number} minuend The first number in a subtraction.
* @param {number} subtrahend The second number in a subtraction.
* @returns {number} Returns the difference.
* @example
*
* _.subtract(6, 4);
* // => 2
*/
var subtract = createMathOperation(function(minuend, subtrahend) {
return minuend - subtrahend;
}, 0);
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: 0;
}
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be summed.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the sum.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.sumBy(objects, function(o) { return o.n; });
* // => 20
*
* // The `_.property` iteratee shorthand.
* _.sumBy(objects, 'n');
* // => 20
*/
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, getIteratee(iteratee, 2))
: 0;
}
/*------------------------------------------------------------------------*/
// Add methods that return wrapped values in chain sequences.
lodash.after = after;
lodash.ary = ary;
lodash.assign = assign;
lodash.assignIn = assignIn;
lodash.assignInWith = assignInWith;
lodash.assignWith = assignWith;
lodash.at = at;
lodash.before = before;
lodash.bind = bind;
lodash.bindAll = bindAll;
lodash.bindKey = bindKey;
lodash.castArray = castArray;
lodash.chain = chain;
lodash.chunk = chunk;
lodash.compact = compact;
lodash.concat = concat;
lodash.cond = cond;
lodash.conforms = conforms;
lodash.constant = constant;
lodash.countBy = countBy;
lodash.create = create;
lodash.curry = curry;
lodash.curryRight = curryRight;
lodash.debounce = debounce;
lodash.defaults = defaults;
lodash.defaultsDeep = defaultsDeep;
lodash.defer = defer;
lodash.delay = delay;
lodash.difference = difference;
lodash.differenceBy = differenceBy;
lodash.differenceWith = differenceWith;
lodash.drop = drop;
lodash.dropRight = dropRight;
lodash.dropRightWhile = dropRightWhile;
lodash.dropWhile = dropWhile;
lodash.fill = fill;
lodash.filter = filter;
lodash.flatMap = flatMap;
lodash.flatMapDeep = flatMapDeep;
lodash.flatMapDepth = flatMapDepth;
lodash.flatten = flatten;
lodash.flattenDeep = flattenDeep;
lodash.flattenDepth = flattenDepth;
lodash.flip = flip;
lodash.flow = flow;
lodash.flowRight = flowRight;
lodash.fromPairs = fromPairs;
lodash.functions = functions;
lodash.functionsIn = functionsIn;
lodash.groupBy = groupBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.intersectionBy = intersectionBy;
lodash.intersectionWith = intersectionWith;
lodash.invert = invert;
lodash.invertBy = invertBy;
lodash.invokeMap = invokeMap;
lodash.iteratee = iteratee;
lodash.keyBy = keyBy;
lodash.keys = keys;
lodash.keysIn = keysIn;
lodash.map = map;
lodash.mapKeys = mapKeys;
lodash.mapValues = mapValues;
lodash.matches = matches;
lodash.matchesProperty = matchesProperty;
lodash.memoize = memoize;
lodash.merge = merge;
lodash.mergeWith = mergeWith;
lodash.method = method;
lodash.methodOf = methodOf;
lodash.mixin = mixin;
lodash.negate = negate;
lodash.nthArg = nthArg;
lodash.omit = omit;
lodash.omitBy = omitBy;
lodash.once = once;
lodash.orderBy = orderBy;
lodash.over = over;
lodash.overArgs = overArgs;
lodash.overEvery = overEvery;
lodash.overSome = overSome;
lodash.partial = partial;
lodash.partialRight = partialRight;
lodash.partition = partition;
lodash.pick = pick;
lodash.pickBy = pickBy;
lodash.property = property;
lodash.propertyOf = propertyOf;
lodash.pull = pull;
lodash.pullAll = pullAll;
lodash.pullAllBy = pullAllBy;
lodash.pullAllWith = pullAllWith;
lodash.pullAt = pullAt;
lodash.range = range;
lodash.rangeRight = rangeRight;
lodash.rearg = rearg;
lodash.reject = reject;
lodash.remove = remove;
lodash.rest = rest;
lodash.reverse = reverse;
lodash.sampleSize = sampleSize;
lodash.set = set;
lodash.setWith = setWith;
lodash.shuffle = shuffle;
lodash.slice = slice;
lodash.sortBy = sortBy;
lodash.sortedUniq = sortedUniq;
lodash.sortedUniqBy = sortedUniqBy;
lodash.split = split;
lodash.spread = spread;
lodash.tail = tail;
lodash.take = take;
lodash.takeRight = takeRight;
lodash.takeRightWhile = takeRightWhile;
lodash.takeWhile = takeWhile;
lodash.tap = tap;
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.toPairs = toPairs;
lodash.toPairsIn = toPairsIn;
lodash.toPath = toPath;
lodash.toPlainObject = toPlainObject;
lodash.transform = transform;
lodash.unary = unary;
lodash.union = union;
lodash.unionBy = unionBy;
lodash.unionWith = unionWith;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.uniqWith = uniqWith;
lodash.unset = unset;
lodash.unzip = unzip;
lodash.unzipWith = unzipWith;
lodash.update = update;
lodash.updateWith = updateWith;
lodash.values = values;
lodash.valuesIn = valuesIn;
lodash.without = without;
lodash.words = words;
lodash.wrap = wrap;
lodash.xor = xor;
lodash.xorBy = xorBy;
lodash.xorWith = xorWith;
lodash.zip = zip;
lodash.zipObject = zipObject;
lodash.zipObjectDeep = zipObjectDeep;
lodash.zipWith = zipWith;
// Add aliases.
lodash.entries = toPairs;
lodash.entriesIn = toPairsIn;
lodash.extend = assignIn;
lodash.extendWith = assignInWith;
// Add methods to `lodash.prototype`.
mixin(lodash, lodash);
/*------------------------------------------------------------------------*/
// Add methods that return unwrapped values in chain sequences.
lodash.add = add;
lodash.attempt = attempt;
lodash.camelCase = camelCase;
lodash.capitalize = capitalize;
lodash.ceil = ceil;
lodash.clamp = clamp;
lodash.clone = clone;
lodash.cloneDeep = cloneDeep;
lodash.cloneDeepWith = cloneDeepWith;
lodash.cloneWith = cloneWith;
lodash.conformsTo = conformsTo;
lodash.deburr = deburr;
lodash.defaultTo = defaultTo;
lodash.divide = divide;
lodash.endsWith = endsWith;
lodash.eq = eq;
lodash.escape = escape;
lodash.escapeRegExp = escapeRegExp;
lodash.every = every;
lodash.find = find;
lodash.findIndex = findIndex;
lodash.findKey = findKey;
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.floor = floor;
lodash.forEach = forEach;
lodash.forEachRight = forEachRight;
lodash.forIn = forIn;
lodash.forInRight = forInRight;
lodash.forOwn = forOwn;
lodash.forOwnRight = forOwnRight;
lodash.get = get;
lodash.gt = gt;
lodash.gte = gte;
lodash.has = has;
lodash.hasIn = hasIn;
lodash.head = head;
lodash.identity = identity;
lodash.includes = includes;
lodash.indexOf = indexOf;
lodash.inRange = inRange;
lodash.invoke = invoke;
lodash.isArguments = isArguments;
lodash.isArray = isArray;
lodash.isArrayBuffer = isArrayBuffer;
lodash.isArrayLike = isArrayLike;
lodash.isArrayLikeObject = isArrayLikeObject;
lodash.isBoolean = isBoolean;
lodash.isBuffer = isBuffer;
lodash.isDate = isDate;
lodash.isElement = isElement;
lodash.isEmpty = isEmpty;
lodash.isEqual = isEqual;
lodash.isEqualWith = isEqualWith;
lodash.isError = isError;
lodash.isFinite = isFinite;
lodash.isFunction = isFunction;
lodash.isInteger = isInteger;
lodash.isLength = isLength;
lodash.isMap = isMap;
lodash.isMatch = isMatch;
lodash.isMatchWith = isMatchWith;
lodash.isNaN = isNaN;
lodash.isNative = isNative;
lodash.isNil = isNil;
lodash.isNull = isNull;
lodash.isNumber = isNumber;
lodash.isObject = isObject;
lodash.isObjectLike = isObjectLike;
lodash.isPlainObject = isPlainObject;
lodash.isRegExp = isRegExp;
lodash.isSafeInteger = isSafeInteger;
lodash.isSet = isSet;
lodash.isString = isString;
lodash.isSymbol = isSymbol;
lodash.isTypedArray = isTypedArray;
lodash.isUndefined = isUndefined;
lodash.isWeakMap = isWeakMap;
lodash.isWeakSet = isWeakSet;
lodash.join = join;
lodash.kebabCase = kebabCase;
lodash.last = last;
lodash.lastIndexOf = lastIndexOf;
lodash.lowerCase = lowerCase;
lodash.lowerFirst = lowerFirst;
lodash.lt = lt;
lodash.lte = lte;
lodash.max = max;
lodash.maxBy = maxBy;
lodash.mean = mean;
lodash.meanBy = meanBy;
lodash.min = min;
lodash.minBy = minBy;
lodash.stubArray = stubArray;
lodash.stubFalse = stubFalse;
lodash.stubObject = stubObject;
lodash.stubString = stubString;
lodash.stubTrue = stubTrue;
lodash.multiply = multiply;
lodash.nth = nth;
lodash.noConflict = noConflict;
lodash.noop = noop;
lodash.now = now;
lodash.pad = pad;
lodash.padEnd = padEnd;
lodash.padStart = padStart;
lodash.parseInt = parseInt;
lodash.random = random;
lodash.reduce = reduce;
lodash.reduceRight = reduceRight;
lodash.repeat = repeat;
lodash.replace = replace;
lodash.result = result;
lodash.round = round;
lodash.runInContext = runInContext;
lodash.sample = sample;
lodash.size = size;
lodash.snakeCase = snakeCase;
lodash.some = some;
lodash.sortedIndex = sortedIndex;
lodash.sortedIndexBy = sortedIndexBy;
lodash.sortedIndexOf = sortedIndexOf;
lodash.sortedLastIndex = sortedLastIndex;
lodash.sortedLastIndexBy = sortedLastIndexBy;
lodash.sortedLastIndexOf = sortedLastIndexOf;
lodash.startCase = startCase;
lodash.startsWith = startsWith;
lodash.subtract = subtract;
lodash.sum = sum;
lodash.sumBy = sumBy;
lodash.template = template;
lodash.times = times;
lodash.toFinite = toFinite;
lodash.toInteger = toInteger;
lodash.toLength = toLength;
lodash.toLower = toLower;
lodash.toNumber = toNumber;
lodash.toSafeInteger = toSafeInteger;
lodash.toString = toString;
lodash.toUpper = toUpper;
lodash.trim = trim;
lodash.trimEnd = trimEnd;
lodash.trimStart = trimStart;
lodash.truncate = truncate;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;
lodash.upperCase = upperCase;
lodash.upperFirst = upperFirst;
// Add aliases.
lodash.each = forEach;
lodash.eachRight = forEachRight;
lodash.first = head;
mixin(lodash, (function() {
var source = {};
baseForOwn(lodash, function(func, methodName) {
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
source[methodName] = func;
}
});
return source;
}()), { 'chain': false });
/*------------------------------------------------------------------------*/
/**
* The semantic version number.
*
* @static
* @memberOf _
* @type {string}
*/
lodash.VERSION = VERSION;
// Assign default placeholders.
arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
lodash[methodName].placeholder = lodash;
});
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
arrayEach(['drop', 'take'], function(methodName, index) {
LazyWrapper.prototype[methodName] = function(n) {
var filtered = this.__filtered__;
if (filtered && !index) {
return new LazyWrapper(this);
}
n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = this.clone();
if (filtered) {
result.__takeCount__ = nativeMin(n, result.__takeCount__);
} else {
result.__views__.push({
'size': nativeMin(n, MAX_ARRAY_LENGTH),
'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
});
}
return result;
};
LazyWrapper.prototype[methodName + 'Right'] = function(n) {
return this.reverse()[methodName](n).reverse();
};
});
// Add `LazyWrapper` methods that accept an `iteratee` value.
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
var type = index + 1,
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
LazyWrapper.prototype[methodName] = function(iteratee) {
var result = this.clone();
result.__iteratees__.push({
'iteratee': getIteratee(iteratee, 3),
'type': type
});
result.__filtered__ = result.__filtered__ || isFilter;
return result;
};
});
// Add `LazyWrapper` methods for `_.head` and `_.last`.
arrayEach(['head', 'last'], function(methodName, index) {
var takeName = 'take' + (index ? 'Right' : '');
LazyWrapper.prototype[methodName] = function() {
return this[takeName](1).value()[0];
};
});
// Add `LazyWrapper` methods for `_.initial` and `_.tail`.
arrayEach(['initial', 'tail'], function(methodName, index) {
var dropName = 'drop' + (index ? '' : 'Right');
LazyWrapper.prototype[methodName] = function() {
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
};
});
LazyWrapper.prototype.compact = function() {
return this.filter(identity);
};
LazyWrapper.prototype.find = function(predicate) {
return this.filter(predicate).head();
};
LazyWrapper.prototype.findLast = function(predicate) {
return this.reverse().find(predicate);
};
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
if (typeof path == 'function') {
return new LazyWrapper(this);
}
return this.map(function(value) {
return baseInvoke(value, path, args);
});
});
LazyWrapper.prototype.reject = function(predicate) {
return this.filter(negate(getIteratee(predicate)));
};
LazyWrapper.prototype.slice = function(start, end) {
start = toInteger(start);
var result = this;
if (result.__filtered__ && (start > 0 || end < 0)) {
return new LazyWrapper(result);
}
if (start < 0) {
result = result.takeRight(-start);
} else if (start) {
result = result.drop(start);
}
if (end !== undefined) {
end = toInteger(end);
result = end < 0 ? result.dropRight(-end) : result.take(end - start);
}
return result;
};
LazyWrapper.prototype.takeRightWhile = function(predicate) {
return this.reverse().takeWhile(predicate).reverse();
};
LazyWrapper.prototype.toArray = function() {
return this.take(MAX_ARRAY_LENGTH);
};
// Add `LazyWrapper` methods to `lodash.prototype`.
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
isTaker = /^(?:head|last)$/.test(methodName),
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
retUnwrapped = isTaker || /^find/.test(methodName);
if (!lodashFunc) {
return;
}
lodash.prototype[methodName] = function() {
var value = this.__wrapped__,
args = isTaker ? [1] : arguments,
isLazy = value instanceof LazyWrapper,
iteratee = args[0],
useLazy = isLazy || isArray(value);
var interceptor = function(value) {
var result = lodashFunc.apply(lodash, arrayPush([value], args));
return (isTaker && chainAll) ? result[0] : result;
};
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
// Avoid lazy use if the iteratee has a "length" value other than `1`.
isLazy = useLazy = false;
}
var chainAll = this.__chain__,
isHybrid = !!this.__actions__.length,
isUnwrapped = retUnwrapped && !chainAll,
onlyLazy = isLazy && !isHybrid;
if (!retUnwrapped && useLazy) {
value = onlyLazy ? value : new LazyWrapper(this);
var result = func.apply(value, args);
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
return new LodashWrapper(result, chainAll);
}
if (isUnwrapped && onlyLazy) {
return func.apply(this, args);
}
result = this.thru(interceptor);
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
};
});
// Add `Array` methods to `lodash.prototype`.
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayProto[methodName],
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
lodash.prototype[methodName] = function() {
var args = arguments;
if (retUnwrapped && !this.__chain__) {
var value = this.value();
return func.apply(isArray(value) ? value : [], args);
}
return this[chainName](function(value) {
return func.apply(isArray(value) ? value : [], args);
});
};
});
// Map minified method names to their real names.
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var lodashFunc = lodash[methodName];
if (lodashFunc) {
var key = (lodashFunc.name + ''),
names = realNames[key] || (realNames[key] = []);
names.push({ 'name': methodName, 'func': lodashFunc });
}
});
realNames[createHybrid(undefined, BIND_KEY_FLAG).name] = [{
'name': 'wrapper',
'func': undefined
}];
// Add methods to `LazyWrapper`.
LazyWrapper.prototype.clone = lazyClone;
LazyWrapper.prototype.reverse = lazyReverse;
LazyWrapper.prototype.value = lazyValue;
// Add chain sequence methods to the `lodash` wrapper.
lodash.prototype.at = wrapperAt;
lodash.prototype.chain = wrapperChain;
lodash.prototype.commit = wrapperCommit;
lodash.prototype.next = wrapperNext;
lodash.prototype.plant = wrapperPlant;
lodash.prototype.reverse = wrapperReverse;
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
// Add lazy aliases.
lodash.prototype.first = lodash.prototype.head;
if (iteratorSymbol) {
lodash.prototype[iteratorSymbol] = wrapperToIterator;
}
return lodash;
}
/*--------------------------------------------------------------------------*/
// Export lodash.
var _ = runInContext();
// Some AMD build optimizers, like r.js, check for condition patterns like:
if (true) {
// Expose Lodash on the global object to prevent errors when Lodash is
// loaded by a script tag in the presence of an AMD loader.
// See http://requirejs.org/docs/errors.html#mismatch for more details.
// Use `_.noConflict` to remove Lodash from the global object.
root._ = _;
// Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module.
!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return _;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
// Check for `exports` after `define` in case a build optimizer adds it.
else if (freeModule) {
// Export for Node.js.
(freeModule.exports = _)._ = _;
// Export for CommonJS support.
freeExports._ = _;
}
else {
// Export to the global object.
root._ = _;
}
}.call(this));
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(231)(module)))
/***/ },
/* 268 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(4);
var _extends3 = _interopRequireDefault(_extends2);
var _getPrototypeOf = __webpack_require__(76);
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__(80);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(81);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(85);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(104);
var _inherits3 = _interopRequireDefault(_inherits2);
exports.default = sortableHandle;
var _react = __webpack_require__(112);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(113);
var _invariant = __webpack_require__(196);
var _invariant2 = _interopRequireDefault(_invariant);
var _utils = __webpack_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Export Higher Order Sortable Element Component
function sortableHandle(WrappedComponent) {
var _class, _temp;
var config = arguments.length <= 1 || arguments[1] === undefined ? { withRef: false } : arguments[1];
return _temp = _class = function (_Component) {
(0, _inherits3.default)(_class, _Component);
function _class() {
(0, _classCallCheck3.default)(this, _class);
return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(_class).apply(this, arguments));
}
(0, _createClass3.default)(_class, [{
key: 'componentDidMount',
value: function componentDidMount() {
var node = (0, _reactDom.findDOMNode)(this);
node.sortableHandle = true;
}
}, {
key: 'getWrappedInstance',
value: function getWrappedInstance() {
(0, _invariant2.default)(config.withRef, 'To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call');
return this.refs.wrappedInstance;
}
}, {
key: 'render',
value: function render() {
var ref = config.withRef ? 'wrappedInstance' : null;
return _react2.default.createElement(WrappedComponent, (0, _extends3.default)({ ref: ref }, this.props));
}
}]);
return _class;
}(_react.Component), _class.displayName = (0, _utils.provideDisplayName)('sortableHandle', WrappedComponent), _temp;
}
/***/ }
/******/ ])
});
; |
front/src/components/Timer.js | ethbets/ebets | /* Copyright (C) 2017 ethbets
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*/
import React from 'react';
import moment from 'moment';
import Chip from 'material-ui/Chip';
import 'material-ui/styles/colors';
import { betTimeStates, betState } from 'utils/betStates';
class Clock extends React.Component {
secondsToEnd = 0;
constructor(props) {
super(props);
this.state = {
dateTimestamp : Date.now()
};
this.tick = this.tick.bind(this);
}
tick() {
this.setState({
dateTimestamp: this.state.dateTimestamp - 1000
});
// Match open
if (moment().unix() < this.props.beginDate) {
this.props.updateState(betTimeStates.matchOpen);
}
// Match running
else if ((moment().unix() >= this.props.beginDate) &&
(moment().unix() < this.props.endDate)) {
this.props.updateState(betTimeStates.matchRunning);
}// Match end
else if ((moment().unix() >= this.props.endDate) &&
(moment().unix() < this.props.resolverDeadline)) {
this.props.updateState(betTimeStates.matchEnded);
}
// Match expired
else if ((moment().unix() >= this.props.resolverDeadline) &&
(moment().unix() < this.props.terminateDeadline)) {
this.props.updateState(betTimeStates.matchExpired);
}
// Match can selfdestruct
else if (moment().unix() > this.props.terminateDeadline) {
this.props.updateState(betTimeStates.matchDestruct);
clearInterval(this.interval);
}
}
componentDidMount() {
this.interval = setInterval(this.tick, 1000);
}
componentWillUnmount() {
clearInterval(this.interval);
}
render() {
var deltaSeconds;
var msgString;
if (this.props.parentState === betState.matchOpen) {
deltaSeconds = this.props.beginDate - moment().unix();
msgString = 'Begins in: ';
}
else if (this.props.parentState === betState.matchRunning) {
deltaSeconds = this.props.endDate - moment().unix();
msgString = 'Ends in: '
}
else if (this.props.parentState === betState.shouldCallArbiter) {
deltaSeconds = this.props.resolverDeadline - moment().unix();
msgString = 'You may invoke Arbiter within: '
}
else if (this.props.parentState === betState.calledArbiter) {
deltaSeconds = this.props.resolverDeadline - moment().unix();
msgString = 'Arbiter must answer within: '
}
else if (this.props.parentState === betState.betExpired) {
deltaSeconds = this.props.terminateDeadline - moment().unix();
msgString = 'Bet expired, you may request draw within: '
}
else {
// Bet expired!
if (moment().unix() > this.props.terminateDeadline) {
msgString = 'Bet terminated, self-destruct may be invoked!'
return (
<div>
<Chip>
{msgString}
</Chip>
</div>
);
}
else {
deltaSeconds = this.props.terminateDeadline - moment().unix();
msgString = 'You may collect your reward within: '
}
}
var days = deltaSeconds / (60 * 60 * 24);
days = Math.floor(days);
deltaSeconds -= days * (60 * 60 * 24);
var hours = deltaSeconds / (60 * 60);
hours = Math.floor(hours);
deltaSeconds -= hours * (60 * 60);
var minutes = deltaSeconds / 60;
minutes = Math.floor(minutes);
deltaSeconds -= minutes * 60;
var result_str;
if (days > 0)
result_str = days + 'd ' + hours + 'h ' + minutes + 'm ' + deltaSeconds + 's';
else if (hours > 0)
result_str = hours + 'h ' + minutes + 'm ' + deltaSeconds + 's';
else if (minutes > 0)
result_str = minutes + 'm ' + deltaSeconds + 's';
else
result_str = deltaSeconds + 's';
return(
<div>
<Chip>
{msgString} {result_str}
</Chip>
</div>
);
}
}
export default Clock;
|
examples/03 - Basic auth/components/Login.js | Kureev/browserify-react-live | import React from 'react';
import auth from '../vendor/auth';
export default class Login extends React.Component {
constructor() {
super();
this.handleSubmit = this.handleSubmit.bind(this);
this.state = {
error: false,
};
}
handleSubmit(event) {
event.preventDefault();
var { router } = this.context;
var nextPath = router.getCurrentQuery().nextPath;
var email = this.refs.email.getDOMNode().value;
var pass = this.refs.pass.getDOMNode().value;
auth.login(email, pass, (loggedIn) => {
if (!loggedIn) {
return this.setState({ error: true, });
}
if (nextPath) {
router.replaceWith(nextPath);
} else {
router.replaceWith('/about');
}
});
}
render() {
return (
<form onSubmit={this.handleSubmit}>
<label><input ref="email" placeholder="email" defaultValue="[email protected]"/></label>
<label><input ref="pass" placeholder="password"/></label> (hint: password1)<br/>
<button type="submit">login</button>
{this.state.error && (
<p>Bad login information</p>
)}
</form>
);
}
static contextTypes = {
router: React.PropTypes.func,
}
}
|
ajax/libs/inferno-test-utils/3.4.0/inferno-test-utils.js | cdnjs/cdnjs |
/*!
* Inferno.TestUtils v3.4.0
* (c) 2017 Dominic Gannaway'
* Released under the MIT License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('inferno'), require('inferno-create-element')) :
typeof define === 'function' && define.amd ? define(['exports', 'inferno', 'inferno-create-element'], factory) :
(factory((global.Inferno = global.Inferno || {}, global.Inferno.TestUtils = global.Inferno.TestUtils || {}),global.Inferno,global.Inferno.createElement));
}(this, (function (exports,inferno,createElement) { 'use strict';
createElement = 'default' in createElement ? createElement['default'] : createElement;
var NO_OP = '$NO_OP';
var ERROR_MSG = 'a runtime error occured! Use Inferno in development environment to find the error.';
// This should be boolean and not reference to window.document
var isBrowser = !!(typeof window !== 'undefined' && window.document);
// this is MUCH faster than .constructor === Array and instanceof Array
// in Node 7 and the later versions of V8, slower in older versions though
var isArray = Array.isArray;
function isStringOrNumber(o) {
var type = typeof o;
return type === 'string' || type === 'number';
}
function isNullOrUndef(o) {
return isUndefined(o) || isNull(o);
}
function isInvalid(o) {
return isNull(o) || o === false || isTrue(o) || isUndefined(o);
}
function isFunction(o) {
return typeof o === 'function';
}
function isString(o) {
return typeof o === 'string';
}
function isNumber(o) {
return typeof o === 'number';
}
function isNull(o) {
return o === null;
}
function isTrue(o) {
return o === true;
}
function isUndefined(o) {
return o === void 0;
}
function isObject(o) {
return typeof o === 'object';
}
function throwError(message) {
if (!message) {
message = ERROR_MSG;
}
throw new Error(("Inferno Error: " + message));
}
function combineFrom(first, second) {
var out = {};
if (first) {
for (var key in first) {
out[key] = first[key];
}
}
if (second) {
for (var key$1 in second) {
out[key$1] = second[key$1];
}
}
return out;
}
// Make sure u use EMPTY_OBJ from 'inferno', otherwise it'll be a different reference
var noOp = ERROR_MSG;
{
noOp = 'Inferno Error: Can only update a mounted or mounting component. This usually means you called setState() or forceUpdate() on an unmounted component. This is a no-op.';
}
var componentCallbackQueue = new Map();
// when a components root VNode is also a component, we can run into issues
// this will recursively look for vNode.parentNode if the VNode is a component
function updateParentComponentVNodes(vNode, dom) {
if (vNode.flags & 28 /* Component */) {
var parentVNode = vNode.parentVNode;
if (parentVNode) {
parentVNode.dom = dom;
updateParentComponentVNodes(parentVNode, dom);
}
}
}
var resolvedPromise = Promise.resolve();
function addToQueue(component, force, callback) {
var queue = componentCallbackQueue.get(component);
if (queue === void 0) {
queue = [];
componentCallbackQueue.set(component, queue);
resolvedPromise.then(function () {
componentCallbackQueue.delete(component);
component._updating = true;
applyState(component, force, function () {
for (var i = 0, len = queue.length; i < len; i++) {
queue[i].call(component);
}
});
component._updating = false;
});
}
if (!isNullOrUndef(callback)) {
queue.push(callback);
}
}
function queueStateChanges(component, newState, callback) {
if (isFunction(newState)) {
newState = newState(component.state, component.props, component.context);
}
var pending = component._pendingState;
if (isNullOrUndef(pending)) {
component._pendingState = pending = newState;
}
else {
for (var stateKey in newState) {
pending[stateKey] = newState[stateKey];
}
}
if (isBrowser && !component._pendingSetState && !component._blockRender) {
if (!component._updating) {
component._pendingSetState = true;
component._updating = true;
applyState(component, false, callback);
component._updating = false;
}
else {
addToQueue(component, false, callback);
}
}
else {
var state = component.state;
if (state === null) {
component.state = pending;
}
else {
for (var key in pending) {
state[key] = pending[key];
}
}
component._pendingState = null;
if (!isNullOrUndef(callback) && component._blockRender) {
component._lifecycle.addListener(callback.bind(component));
}
}
}
function applyState(component, force, callback) {
if (component._unmounted) {
return;
}
if (force || !component._blockRender) {
component._pendingSetState = false;
var pendingState = component._pendingState;
var prevState = component.state;
var nextState = combineFrom(prevState, pendingState);
var props = component.props;
var context = component.context;
component._pendingState = null;
var nextInput = component._updateComponent(prevState, nextState, props, props, context, force, true);
var didUpdate = true;
if (isInvalid(nextInput)) {
nextInput = inferno.createVNode(4096 /* Void */, null);
}
else if (nextInput === NO_OP) {
nextInput = component._lastInput;
didUpdate = false;
}
else if (isStringOrNumber(nextInput)) {
nextInput = inferno.createVNode(1 /* Text */, null, null, nextInput);
}
else if (isArray(nextInput)) {
{
throwError('a valid Inferno VNode (or null) must be returned from a component render. You may have returned an array or an invalid object.');
}
throwError();
}
var lastInput = component._lastInput;
var vNode = component._vNode;
var parentDom = (lastInput.dom && lastInput.dom.parentNode) || (lastInput.dom = vNode.dom);
component._lastInput = nextInput;
if (didUpdate) {
var childContext;
if (!isNullOrUndef(component.getChildContext)) {
childContext = component.getChildContext();
}
if (isNullOrUndef(childContext)) {
childContext = component._childContext;
}
else {
childContext = combineFrom(context, childContext);
}
var lifeCycle = component._lifecycle;
inferno.internal_patch(lastInput, nextInput, parentDom, lifeCycle, childContext, component._isSVG, false);
lifeCycle.trigger();
if (!isNullOrUndef(component.componentDidUpdate)) {
component.componentDidUpdate(props, prevState, context);
}
if (!isNull(inferno.options.afterUpdate)) {
inferno.options.afterUpdate(vNode);
}
}
var dom = vNode.dom = nextInput.dom;
if (inferno.options.findDOMNodeEnabled) {
inferno.internal_DOMNodeMap.set(component, nextInput.dom);
}
updateParentComponentVNodes(vNode, dom);
}
else {
component.state = component._pendingState;
component._pendingState = null;
}
if (!isNullOrUndef(callback)) {
callback.call(component);
}
}
var alreadyWarned = false;
var Component = function Component(props, context) {
this.state = null;
this._blockRender = false;
this._blockSetState = true;
this._pendingSetState = false;
this._pendingState = null;
this._lastInput = null;
this._vNode = null;
this._unmounted = false;
this._lifecycle = null;
this._childContext = null;
this._isSVG = false;
this._updating = true;
/** @type {object} */
this.props = props || inferno.EMPTY_OBJ;
/** @type {object} */
this.context = context || inferno.EMPTY_OBJ; // context should not be mutable
};
Component.prototype.forceUpdate = function forceUpdate (callback) {
if (this._unmounted || !isBrowser) {
return;
}
applyState(this, true, callback);
};
Component.prototype.setState = function setState (newState, callback) {
if (this._unmounted) {
return;
}
if (!this._blockSetState) {
queueStateChanges(this, newState, callback);
}
else {
{
throwError('cannot update state via setState() in componentWillUpdate() or constructor.');
}
throwError();
}
};
Component.prototype.setStateSync = function setStateSync (newState) {
{
if (!alreadyWarned) {
alreadyWarned = true;
// tslint:disable-next-line:no-console
console.warn('Inferno WARNING: setStateSync has been deprecated and will be removed in next release. Use setState instead.');
}
}
this.setState(newState);
};
Component.prototype._updateComponent = function _updateComponent (prevState, nextState, prevProps, nextProps, context, force, fromSetState) {
if (this._unmounted === true) {
{
throwError(noOp);
}
throwError();
}
if ((prevProps !== nextProps || nextProps === inferno.EMPTY_OBJ) || prevState !== nextState || force) {
if (prevProps !== nextProps || nextProps === inferno.EMPTY_OBJ) {
if (!isNullOrUndef(this.componentWillReceiveProps) && !fromSetState) {
// keep a copy of state before componentWillReceiveProps
var beforeState = combineFrom(this.state);
this._blockRender = true;
this.componentWillReceiveProps(nextProps, context);
this._blockRender = false;
var afterState = this.state;
if (beforeState !== afterState) {
// if state changed in componentWillReceiveProps, reassign the beforeState
this.state = beforeState;
// set the afterState as pending state so the change gets picked up below
this._pendingSetState = true;
this._pendingState = afterState;
}
}
if (this._pendingSetState) {
nextState = combineFrom(nextState, this._pendingState);
this._pendingSetState = false;
this._pendingState = null;
}
}
/* Update if scu is not defined, or it returns truthy value or force */
if (isNullOrUndef(this.shouldComponentUpdate) || (this.shouldComponentUpdate && this.shouldComponentUpdate(nextProps, nextState, context)) || force) {
if (!isNullOrUndef(this.componentWillUpdate)) {
this._blockSetState = true;
this.componentWillUpdate(nextProps, nextState, context);
this._blockSetState = false;
}
this.props = nextProps;
this.state = nextState;
this.context = context;
if (inferno.options.beforeRender) {
inferno.options.beforeRender(this);
}
var render$$1 = this.render(nextProps, nextState, context);
if (inferno.options.afterRender) {
inferno.options.afterRender(this);
}
return render$$1;
}
else {
this.props = nextProps;
this.state = nextState;
this.context = context;
}
}
return NO_OP;
};
// tslint:disable-next-line:no-empty
Component.prototype.render = function render$$1 (nextProps, nextState, nextContext) { };
// Jest Snapshot Utilities
// Jest formats it's snapshots prettily because it knows how to play with the React test renderer.
// Symbols and algorithm have been reversed from the following file:
// https://github.com/facebook/react/blob/v15.4.2/src/renderers/testing/ReactTestRenderer.js#L98
function createSnapshotObject(object) {
Object.defineProperty(object, '$$typeof', {
value: Symbol.for('react.test.json')
});
return object;
}
function vNodeToSnapshot(node) {
var object;
var children = [];
if (isDOMVNode(node)) {
var props = Object.assign({}, node.props);
// Remove undefined props
Object.keys(props).forEach(function (propKey) {
if (props[propKey] === undefined) {
delete props[propKey];
}
});
// Create the actual object that Jest will interpret as the snapshot for this VNode
object = createSnapshotObject({
props: props,
type: getTagNameOfVNode(node)
});
}
if (isArray(node.children)) {
node.children.forEach(function (child) {
var asJSON = vNodeToSnapshot(child);
if (asJSON) {
children.push(asJSON);
}
});
}
else if (isString(node.children)) {
children.push(node.children);
}
else if (isObject(node.children) && !isNull(node.children)) {
var asJSON = vNodeToSnapshot(node.children);
if (asJSON) {
children.push(asJSON);
}
}
if (object) {
object.children = children.length ? children : null;
return object;
}
if (children.length > 1) {
return children;
}
else if (children.length === 1) {
return children[0];
}
return object;
}
function renderToSnapshot(input) {
var vnode = renderIntoDocument(input);
if (!isNull(vnode.props)) {
var snapshot = vNodeToSnapshot(vnode.props.children);
delete snapshot.props.children;
return snapshot;
}
return undefined;
}
// Type Checkers
function isVNode(instance) {
return Boolean(instance) && isObject(instance) &&
isNumber(instance.flags) && instance.flags > 0;
}
function isVNodeOfType(instance, type) {
return isVNode(instance) && instance.type === type;
}
function isDOMVNode(inst) {
return !isComponentVNode(inst) && !isTextVNode(inst);
}
function isDOMVNodeOfType(instance, type) {
return isDOMVNode(instance) && instance.type === type;
}
function isFunctionalVNode(instance) {
return isVNode(instance) && Boolean(instance.flags & 8 /* ComponentFunction */);
}
function isFunctionalVNodeOfType(instance, type) {
return isFunctionalVNode(instance) && instance.type === type;
}
function isClassVNode(instance) {
return isVNode(instance) && Boolean(instance.flags & 4 /* ComponentClass */);
}
function isClassVNodeOfType(instance, type) {
return isClassVNode(instance) && instance.type === type;
}
function isComponentVNode(inst) {
return isFunctionalVNode(inst) || isClassVNode(inst);
}
function isComponentVNodeOfType(inst, type) {
return (isFunctionalVNode(inst) || isClassVNode(inst)) && inst.type === type;
}
function isTextVNode(inst) {
return inst.flags === 1 /* Text */;
}
function isDOMElement(instance) {
return Boolean(instance) && isObject(instance) &&
instance.nodeType === 1 && isString(instance.tagName);
}
function isDOMElementOfType(instance, type) {
return isDOMElement(instance) && isString(type) &&
instance.tagName.toLowerCase() === type.toLowerCase();
}
function isRenderedClassComponent(instance) {
return Boolean(instance) && isObject(instance) && isVNode(instance._vNode) &&
isFunction(instance.render) && isFunction(instance.setState);
}
function isRenderedClassComponentOfType(instance, type) {
return isRenderedClassComponent(instance) &&
isFunction(type) && instance._vNode.type === type;
}
// Render Utilities
var Wrapper = (function (Component$$1) {
function Wrapper () {
Component$$1.apply(this, arguments);
}
if ( Component$$1 ) Wrapper.__proto__ = Component$$1;
Wrapper.prototype = Object.create( Component$$1 && Component$$1.prototype );
Wrapper.prototype.constructor = Wrapper;
Wrapper.prototype.render = function render$$1 () {
return this.props.children;
};
return Wrapper;
}(Component));
function renderIntoDocument(input) {
var wrappedInput = createElement(Wrapper, null, input);
var parent = document.createElement('div');
document.body.appendChild(parent);
return inferno.render(wrappedInput, parent);
}
// Recursive Finder Functions
function findAllInRenderedTree(renderedTree, predicate) {
if (isRenderedClassComponent(renderedTree)) {
return findAllInVNodeTree(renderedTree._lastInput, predicate);
}
else {
throwError('findAllInRenderedTree(renderedTree, predicate) renderedTree must be a rendered class component');
}
}
function findAllInVNodeTree(vNodeTree, predicate) {
if (isVNode(vNodeTree)) {
var result = predicate(vNodeTree) ? [vNodeTree] : [];
var children = vNodeTree.children;
if (isRenderedClassComponent(children)) {
result = result.concat(findAllInVNodeTree(children._lastInput, predicate));
}
else if (isVNode(children)) {
result = result.concat(findAllInVNodeTree(children, predicate));
}
else if (isArray(children)) {
children.forEach(function (child) {
result = result.concat(findAllInVNodeTree(child, predicate));
});
}
return result;
}
else {
throwError('findAllInVNodeTree(vNodeTree, predicate) vNodeTree must be a VNode instance');
}
}
// Finder Helpers
function parseSelector(filter) {
if (isArray(filter)) {
return filter;
}
else if (isString(filter)) {
return filter.trim().split(/\s+/);
}
else {
return [];
}
}
function findOneOf(tree, filter, name, finder) {
var all = finder(tree, filter);
if (all.length > 1) {
throwError(("Did not find exactly one match (found " + (all.length) + ") for " + name + ": " + filter));
}
else {
return all[0];
}
}
// Scry Utilities
function scryRenderedDOMElementsWithClass(renderedTree, classNames) {
return findAllInRenderedTree(renderedTree, function (instance) {
if (isDOMVNode(instance)) {
var domClassName = instance.dom.className;
if (!isString(domClassName)) {
domClassName = instance.dom.getAttribute('class') || '';
}
var domClassList = parseSelector(domClassName);
return parseSelector(classNames).every(function (className) {
return domClassList.indexOf(className) !== -1;
});
}
return false;
}).map(function (instance) { return instance.dom; });
}
function scryRenderedDOMElementsWithTag(renderedTree, tagName) {
return findAllInRenderedTree(renderedTree, function (instance) {
return isDOMVNodeOfType(instance, tagName);
}).map(function (instance) { return instance.dom; });
}
function scryRenderedVNodesWithType(renderedTree, type) {
return findAllInRenderedTree(renderedTree, function (instance) { return isVNodeOfType(instance, type); });
}
function scryVNodesWithType(vNodeTree, type) {
return findAllInVNodeTree(vNodeTree, function (instance) { return isVNodeOfType(instance, type); });
}
// Find Utilities
function findRenderedDOMElementWithClass(renderedTree, classNames) {
return findOneOf(renderedTree, classNames, 'class', scryRenderedDOMElementsWithClass);
}
function findRenderedDOMElementWithTag(renderedTree, tagName) {
return findOneOf(renderedTree, tagName, 'tag', scryRenderedDOMElementsWithTag);
}
function findRenderedVNodeWithType(renderedTree, type) {
return findOneOf(renderedTree, type, 'component', scryRenderedVNodesWithType);
}
function findVNodeWithType(vNodeTree, type) {
return findOneOf(vNodeTree, type, 'VNode', scryVNodesWithType);
}
function getTagNameOfVNode(inst) {
return (inst && inst.dom && inst.dom.tagName.toLowerCase()) ||
(inst && inst._vNode && inst._vNode.dom && inst._vNode.dom.tagName.toLowerCase()) ||
undefined;
}
var index = {
findAllInRenderedTree: findAllInRenderedTree,
findAllInVNodeTree: findAllInVNodeTree,
findRenderedDOMElementWithClass: findRenderedDOMElementWithClass,
findRenderedDOMElementWithTag: findRenderedDOMElementWithTag,
findRenderedVNodeWithType: findRenderedVNodeWithType,
findVNodeWithType: findVNodeWithType,
getTagNameOfVNode: getTagNameOfVNode,
isClassVNode: isClassVNode,
isClassVNodeOfType: isClassVNodeOfType,
isComponentVNode: isComponentVNode,
isComponentVNodeOfType: isComponentVNodeOfType,
isDOMElement: isDOMElement,
isDOMElementOfType: isDOMElementOfType,
isDOMVNode: isDOMVNode,
isDOMVNodeOfType: isDOMVNodeOfType,
isFunctionalVNode: isFunctionalVNode,
isFunctionalVNodeOfType: isFunctionalVNodeOfType,
isRenderedClassComponent: isRenderedClassComponent,
isRenderedClassComponentOfType: isRenderedClassComponentOfType,
isTextVNode: isTextVNode,
isVNode: isVNode,
isVNodeOfType: isVNodeOfType,
renderIntoDocument: renderIntoDocument,
renderToSnapshot: renderToSnapshot,
scryRenderedDOMElementsWithClass: scryRenderedDOMElementsWithClass,
scryRenderedDOMElementsWithTag: scryRenderedDOMElementsWithTag,
scryRenderedVNodesWithType: scryRenderedVNodesWithType,
scryVNodesWithType: scryVNodesWithType,
vNodeToSnapshot: vNodeToSnapshot
};
exports.isVNode = isVNode;
exports.isVNodeOfType = isVNodeOfType;
exports.isDOMVNode = isDOMVNode;
exports.isDOMVNodeOfType = isDOMVNodeOfType;
exports.isFunctionalVNode = isFunctionalVNode;
exports.isFunctionalVNodeOfType = isFunctionalVNodeOfType;
exports.isClassVNode = isClassVNode;
exports.isClassVNodeOfType = isClassVNodeOfType;
exports.isComponentVNode = isComponentVNode;
exports.isComponentVNodeOfType = isComponentVNodeOfType;
exports.isTextVNode = isTextVNode;
exports.isDOMElement = isDOMElement;
exports.isDOMElementOfType = isDOMElementOfType;
exports.isRenderedClassComponent = isRenderedClassComponent;
exports.isRenderedClassComponentOfType = isRenderedClassComponentOfType;
exports.renderIntoDocument = renderIntoDocument;
exports.findAllInRenderedTree = findAllInRenderedTree;
exports.findAllInVNodeTree = findAllInVNodeTree;
exports.scryRenderedDOMElementsWithClass = scryRenderedDOMElementsWithClass;
exports.scryRenderedDOMElementsWithTag = scryRenderedDOMElementsWithTag;
exports.scryRenderedVNodesWithType = scryRenderedVNodesWithType;
exports.scryVNodesWithType = scryVNodesWithType;
exports.findRenderedDOMElementWithClass = findRenderedDOMElementWithClass;
exports.findRenderedDOMElementWithTag = findRenderedDOMElementWithTag;
exports.findRenderedVNodeWithType = findRenderedVNodeWithType;
exports.findVNodeWithType = findVNodeWithType;
exports.getTagNameOfVNode = getTagNameOfVNode;
exports['default'] = index;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
ajax/libs/zoid/9.0.51/zoid.frameworks.frame.min.js | cdnjs/cdnjs | !function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("zoid",[],e):"object"==typeof exports?exports.zoid=e():n.zoid=e()}("undefined"!=typeof self?self:this,(function(){return function(n){var e={};function r(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=n,r.c=e,r.d=function(n,e,t){r.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:t})},r.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,e){if(1&e&&(n=r(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)r.d(t,o,function(e){return n[e]}.bind(null,o));return t},r.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(e,"a",e),e},r.o=function(n,e){return{}.hasOwnProperty.call(n,e)},r.p="",r(r.s=0)}([function(n,e,r){"use strict";function t(){return(t=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)({}).hasOwnProperty.call(r,t)&&(n[t]=r[t])}return n}).apply(this,arguments)}function o(n){try{if(!n)return!1;if("undefined"!=typeof Promise&&n instanceof Promise)return!0;if("undefined"!=typeof window&&"function"==typeof window.Window&&n instanceof window.Window)return!1;if("undefined"!=typeof window&&"function"==typeof window.constructor&&n instanceof window.constructor)return!1;var e={}.toString;if(e){var r=e.call(n);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof n.then)return!0}catch(n){return!1}return!1}r.r(e),r.d(e,"PopupOpenError",(function(){return Wn})),r.d(e,"create",(function(){return Ge})),r.d(e,"destroy",(function(){return nr})),r.d(e,"destroyComponents",(function(){return Qe})),r.d(e,"destroyAll",(function(){return Ke})),r.d(e,"PROP_TYPE",(function(){return Se})),r.d(e,"PROP_SERIALIZATION",(function(){return De})),r.d(e,"CONTEXT",(function(){return Ae})),r.d(e,"EVENT",(function(){return Re}));var i,a=[],u=[],c=0;function s(){if(!c&&i){var n=i;i=null,n.resolve()}}function f(){c+=1}function d(){c-=1,s()}var l=function(){function n(n){var e=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var r,t,o=!1,i=!1,a=!1;f();try{n((function(n){a?e.resolve(n):(o=!0,r=n)}),(function(n){a?e.reject(n):(i=!0,t=n)}))}catch(n){return d(),void this.reject(n)}d(),a=!0,o?this.resolve(r):i&&this.reject(t)}}var e=n.prototype;return e.resolve=function(n){if(this.resolved||this.rejected)return this;if(o(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},e.reject=function(n){var e=this;if(this.resolved||this.rejected)return this;if(o(n))throw new Error("Can not reject promise with another promise");if(!n){var r=n&&"function"==typeof n.toString?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout((function(){e.errorHandled||function(n,e){if(-1===a.indexOf(n)){a.push(n),setTimeout((function(){throw n}),1);for(var r=0;r<u.length;r++)u[r](n,e)}}(n,e)}),1),this.dispatch(),this},e.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},e.dispatch=function(){var e=this.resolved,r=this.rejected,t=this.handlers;if(!this.dispatching&&(e||r)){this.dispatching=!0,f();for(var i=function(n,e){return n.then((function(n){e.resolve(n)}),(function(n){e.reject(n)}))},a=0;a<t.length;a++){var u=t[a],c=u.onSuccess,s=u.onError,l=u.promise,h=void 0;if(e)try{h=c?c(this.value):this.value}catch(n){l.reject(n);continue}else if(r){if(!s){l.reject(this.error);continue}try{h=s(this.error)}catch(n){l.reject(n);continue}}h instanceof n&&(h.resolved||h.rejected)?(h.resolved?l.resolve(h.value):l.reject(h.error),h.errorHandled=!0):o(h)?h instanceof n&&(h.resolved||h.rejected)?h.resolved?l.resolve(h.value):l.reject(h.error):i(h,l):l.resolve(h)}t.length=0,this.dispatching=!1,d()}},e.then=function(e,r){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new n;return this.handlers.push({promise:t,onSuccess:e,onError:r}),this.errorHandled=!0,this.dispatch(),t},e.catch=function(n){return this.then(void 0,n)},e.finally=function(e){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.finally expected a function");return this.then((function(r){return n.try(e).then((function(){return r}))}),(function(r){return n.try(e).then((function(){throw r}))}))},e.timeout=function(n,e){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout((function(){r.resolved||r.rejected||r.reject(e||new Error("Promise timed out after "+n+"ms"))}),n);return this.then((function(n){return clearTimeout(t),n}))},e.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.resolve=function(e){return e instanceof n?e:o(e)?new n((function(n,r){return e.then(n,r)})):(new n).resolve(e)},n.reject=function(e){return(new n).reject(e)},n.asyncReject=function(e){return(new n).asyncReject(e)},n.all=function(e){var r=new n,t=e.length,i=[];if(!t)return r.resolve(i),r;for(var a=function(n,e,o){return e.then((function(e){i[n]=e,0==(t-=1)&&r.resolve(i)}),(function(n){o.reject(n)}))},u=0;u<e.length;u++){var c=e[u];if(c instanceof n){if(c.resolved){i[u]=c.value,t-=1;continue}}else if(!o(c)){i[u]=c,t-=1;continue}a(u,n.resolve(c),r)}return 0===t&&r.resolve(i),r},n.hash=function(e){var r={},t=[],i=function(n){if(e.hasOwnProperty(n)){var i=e[n];o(i)?t.push(i.then((function(e){r[n]=e}))):r[n]=i}};for(var a in e)i(a);return n.all(t).then((function(){return r}))},n.map=function(e,r){return n.all(e.map(r))},n.onPossiblyUnhandledException=function(n){return function(n){return u.push(n),{cancel:function(){u.splice(u.indexOf(n),1)}}}(n)},n.try=function(e,r,t){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.try expected a function");var o;f();try{o=e.apply(r,t||[])}catch(e){return d(),n.reject(e)}return d(),n.resolve(o)},n.delay=function(e){return new n((function(n){setTimeout(n,e)}))},n.isPromise=function(e){return!!(e&&e instanceof n)||o(e)},n.flush=function(){return e=i=i||new n,s(),e;var e},n}();function h(n){return"[object RegExp]"==={}.toString.call(n)}var p={IFRAME:"iframe",POPUP:"popup"},w="Call was rejected by callee.\r\n";function v(n){return void 0===n&&(n=window),"about:"===n.location.protocol}function m(n){if(void 0===n&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function y(n){if(void 0===n&&(n=window),n&&!m(n))try{return n.opener}catch(n){}}function g(n){try{return!0}catch(n){}return!1}function _(n){void 0===n&&(n=window);var e=n.location;if(!e)throw new Error("Can not read window location");var r=e.protocol;if(!r)throw new Error("Can not read window protocol");if("file:"===r)return"file://";if("about:"===r){var t=m(n);return t&&g()?_(t):"about://"}var o=e.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function E(n){void 0===n&&(n=window);var e=_(n);return e&&n.mockDomain&&0===n.mockDomain.indexOf("mock:")?n.mockDomain:e}function b(n){if(!function(n){try{if(n===window)return!0}catch(n){}try{var e=Object.getOwnPropertyDescriptor(n,"location");if(e&&!1===e.enumerable)return!1}catch(n){}try{if(v(n)&&g())return!0}catch(n){}try{if(_(n)===_(window))return!0}catch(n){}return!1}(n))return!1;try{if(n===window)return!0;if(v(n)&&g())return!0;if(E(window)===E(n))return!0}catch(n){}return!1}function x(n){if(!b(n))throw new Error("Expected window to be same domain");return n}function P(n,e){if(!n||!e)return!1;var r=m(e);return r?r===n:-1!==function(n){var e=[];try{for(;n.parent!==n;)e.push(n.parent),n=n.parent}catch(n){}return e}(e).indexOf(n)}function O(n){var e,r,t=[];try{e=n.frames}catch(r){e=n}try{r=e.length}catch(n){}if(0===r)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=e[o]}catch(n){continue}t.push(i)}return t}for(var a=0;a<100;a++){var u=void 0;try{u=e[a]}catch(n){return t}if(!u)return t;t.push(u)}return t}function W(n){for(var e=[],r=0,t=O(n);r<t.length;r++){var o=t[r];e.push(o);for(var i=0,a=W(o);i<a.length;i++)e.push(a[i])}return e}function C(n){void 0===n&&(n=window);try{if(n.top)return n.top}catch(n){}if(m(n)===n)return n;try{if(P(window,n)&&window.top)return window.top}catch(n){}try{if(P(n,window)&&window.top)return window.top}catch(n){}for(var e=0,r=W(n);e<r.length;e++){var t=r[e];try{if(t.top)return t.top}catch(n){}if(m(t)===t)return t}}function j(n){var e=C(n);if(!e)throw new Error("Can not determine top window");var r=[].concat(W(e),[e]);return-1===r.indexOf(n)&&(r=[].concat(r,[n],W(n))),r}var S=[],D=[];function A(n,e){void 0===e&&(e=!0);try{if(n===window)return!1}catch(n){return!0}try{if(!n)return!0}catch(n){return!0}try{if(n.closed)return!0}catch(n){return!n||n.message!==w}if(e&&b(n))try{if(n.mockclosed)return!0}catch(n){}try{if(!n.parent||!n.top)return!0}catch(n){}var r=function(n,e){for(var r=0;r<n.length;r++)try{if(n[r]===e)return r}catch(n){}return-1}(S,n);if(-1!==r){var t=D[r];if(t&&function(n){if(!n.contentWindow)return!0;if(!n.parentNode)return!0;var e=n.ownerDocument;if(e&&e.documentElement&&!e.documentElement.contains(n)){for(var r=n;r.parentNode&&r.parentNode!==r;)r=r.parentNode;if(!r.host||!e.documentElement.contains(r.host))return!0}return!1}(t))return!0}return!1}function R(n){return void 0===n&&(n=window),y(n=n||window)||m(n)||void 0}function k(n,e){for(var r=0;r<n.length;r++)for(var t=n[r],o=0;o<e.length;o++)if(t===e[o])return!0;return!1}function z(n){void 0===n&&(n=window);for(var e=0,r=n;r;)(r=m(r))&&(e+=1);return e}function N(n,e){var r=C(n)||n,t=C(e)||e;try{if(r&&t)return r===t}catch(n){}var o=j(n),i=j(e);if(k(o,i))return!0;var a=y(r),u=y(t);return a&&k(j(a),i)||u&&k(j(u),o),!1}function T(n,e){if("string"==typeof n){if("string"==typeof e)return"*"===n||e===n;if(h(e))return!1;if(Array.isArray(e))return!1}return h(n)?h(e)?n.toString()===e.toString():!Array.isArray(e)&&Boolean(e.match(n)):!!Array.isArray(n)&&(Array.isArray(e)?JSON.stringify(n)===JSON.stringify(e):!h(e)&&n.some((function(n){return T(n,e)})))}function I(n){return n.match(/^(https?|mock|file):\/\//)?n.split("/").slice(0,3).join("/"):E()}function F(n,e,r,t){var o;return void 0===r&&(r=1e3),void 0===t&&(t=1/0),function i(){if(A(n))return o&&clearTimeout(o),e();t<=0?clearTimeout(o):(t-=r,o=setTimeout(i,r))}(),{cancel:function(){o&&clearTimeout(o)}}}function M(n){try{if(n===window)return!0}catch(n){if(n&&n.message===w)return!0}try{if("[object Window]"==={}.toString.call(n))return!0}catch(n){if(n&&n.message===w)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(n){if(n&&n.message===w)return!0}try{if(n&&n.self===n)return!0}catch(n){if(n&&n.message===w)return!0}try{if(n&&n.parent===n)return!0}catch(n){if(n&&n.message===w)return!0}try{if(n&&n.top===n)return!0}catch(n){if(n&&n.message===w)return!0}try{if(n&&"__unlikely_value__"===n.__cross_domain_utils_window_check__)return!1}catch(n){return!0}try{if("postMessage"in n&&"self"in n&&"location"in n)return!0}catch(n){}return!1}function L(n){try{n.close()}catch(n){}}function q(n,e){for(var r=0;r<n.length;r++)try{if(n[r]===e)return r}catch(n){}return-1}var U,$=function(){function n(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,e={};return Object.freeze(e),n.set(e,"__testvalue__"),"__testvalue__"===n.get(e)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}var e=n.prototype;return e._cleanupClosedWindows=function(){for(var n=this.weakmap,e=this.keys,r=0;r<e.length;r++){var t=e[r];if(M(t)&&A(t)){if(n)try{n.delete(t)}catch(n){}e.splice(r,1),this.values.splice(r,1),r-=1}}},e.isSafeToReadWrite=function(n){return!M(n)},e.set=function(n,e){if(!n)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(n,e)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n))try{var t=this.name,o=n[t];return void(o&&o[0]===n?o[1]=e:Object.defineProperty(n,t,{value:[n,e],writable:!0}))}catch(n){}this._cleanupClosedWindows();var i=this.keys,a=this.values,u=q(i,n);-1===u?(i.push(n),a.push(e)):a[u]=e},e.get=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(n))return e.get(n)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n))try{var r=n[this.name];return r&&r[0]===n?r[1]:void 0}catch(n){}this._cleanupClosedWindows();var t=q(this.keys,n);if(-1!==t)return this.values[t]},e.delete=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.delete(n)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n))try{var r=n[this.name];r&&r[0]===n&&(r[0]=r[1]=void 0)}catch(n){}this._cleanupClosedWindows();var t=this.keys,o=q(t,n);-1!==o&&(t.splice(o,1),this.values.splice(o,1))},e.has=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(n))return!0}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n))try{var r=n[this.name];return!(!r||r[0]!==n)}catch(n){}return this._cleanupClosedWindows(),-1!==q(this.keys,n)},e.getOrSet=function(n,e){if(this.has(n))return this.get(n);var r=e();return this.set(n,r),r},n}();function B(n){return n.name||n.__name__||n.displayName||"anonymous"}function J(n,e){try{delete n.name,n.name=e}catch(n){}return n.__name__=n.displayName=e,n}function H(n){if("function"==typeof btoa)return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(function(n,e){return String.fromCharCode(parseInt(e,16))})));if("undefined"!=typeof Buffer)return Buffer.from(n,"utf8").toString("base64");throw new Error("Can not find window.btoa or Buffer")}function Y(){var n="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,(function(){return n.charAt(Math.floor(Math.random()*n.length))}))+"_"+H((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function Z(n){try{return JSON.stringify([].slice.call(n),(function(n,e){return"function"==typeof e?"memoize["+function(n){if(U=U||new $,null==n||"object"!=typeof n&&"function"!=typeof n)throw new Error("Invalid object");var e=U.get(n);return e||(e=typeof n+":"+Y(),U.set(n,e)),e}(e)+"]":e}))}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}var V,X=[];function G(n,e){var r=this;void 0===e&&(e={});var t=new $,o=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=t.getOrSet(e.thisNamespace?this:n,(function(){return{}})),u=Z(o),c=e.time;if(a[u]&&c&&Date.now()-a[u].time<c&&delete a[u],a[u])return a[u].value;var s=Date.now(),f=n.apply(this,arguments);return a[u]={time:s,value:f},a[u].value};return o.reset=function(){t.delete(e.thisNamespace?r:n)},X.push(o),J(o,(e.name||B(n))+"::memoized")}function K(n){var e={};function r(){for(var r=arguments,t=this,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var u=Z(i);return e.hasOwnProperty(u)||(e[u]=l.try((function(){return n.apply(t,r)})).finally((function(){delete e[u]}))),e[u]}return r.reset=function(){e={}},J(r,B(n)+"::promiseMemoized")}function Q(n,e,r){void 0===r&&(r=[]);var t=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},o=Z(r);return t.hasOwnProperty(o)?t[o]:t[o]=e.apply(void 0,r)}function nn(){}function en(n){var e=!1;return J((function(){if(!e)return e=!0,n.apply(this,arguments)}),B(n)+"::once")}function rn(n,e){if(void 0===e&&(e=1),e>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+{}.toString.call(n)+">";if("string"==typeof n)return n;if(n instanceof Error){var r=n&&n.stack,t=n&&n.message;if(r&&t)return-1!==r.indexOf(t)?r:t+"\n"+r;if(r)return r;if(t)return t}return n&&n.toString&&"function"==typeof n.toString?n.toString():{}.toString.call(n)}catch(n){return"Error while stringifying error: "+rn(n,e+1)}}function tn(n){return"string"==typeof n?n:n&&n.toString&&"function"==typeof n.toString?n.toString():{}.toString.call(n)}function on(n,e){if(!e)return n;if(Object.assign)return Object.assign(n,e);for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function an(n){return n}function un(n,e){var r;return function t(){r=setTimeout((function(){n(),t()}),e)}(),{cancel:function(){clearTimeout(r)}}}function cn(n,e,r){if(Array.isArray(n)){if("number"!=typeof e)throw new TypeError("Array key must be number")}else if("object"==typeof n&&null!==n&&"string"!=typeof e)throw new TypeError("Object key must be string");Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){delete n[e];var t=r();return n[e]=t,t},set:function(r){delete n[e],n[e]=r}})}function sn(n){return[].slice.call(n)}function fn(n){return"object"==typeof(e=n)&&null!==e&&"[object Object]"==={}.toString.call(n);var e}function dn(n){if(!fn(n))return!1;var e=n.constructor;if("function"!=typeof e)return!1;var r=e.prototype;return!!fn(r)&&!!r.hasOwnProperty("isPrototypeOf")}function ln(n,e,r){if(void 0===r&&(r=""),Array.isArray(n)){for(var t=n.length,o=[],i=function(t){cn(o,t,(function(){var o=r?r+"."+t:""+t,i=e(n[t],t,o);return(dn(i)||Array.isArray(i))&&(i=ln(i,e,o)),i}))},a=0;a<t;a++)i(a);return o}if(dn(n)){var u={},c=function(t){if(!n.hasOwnProperty(t))return"continue";cn(u,t,(function(){var o=r?r+"."+t:""+t,i=e(n[t],t,o);return(dn(i)||Array.isArray(i))&&(i=ln(i,e,o)),i}))};for(var s in n)c(s);return u}throw new Error("Pass an object or array")}function hn(n){return null!=n}function pn(n){return"[object RegExp]"==={}.toString.call(n)}function wn(n,e,r){if(n.hasOwnProperty(e))return n[e];var t=r();return n[e]=t,t}function vn(n){var e=[],r=!1;return{set:function(e,t){return r||(n[e]=t,this.register((function(){delete n[e]}))),t},register:function(n){r?n():e.push(en(n))},all:function(){var n=[];for(r=!0;e.length;){var t=e.shift();n.push(t())}return l.all(n).then(nn)}}}function mn(n,e){if(null==e)throw new Error("Expected "+n+" to be present");return e}function yn(){return Boolean(document.body)&&"complete"===document.readyState}function gn(n){return n.replace(/\?/g,"%3F").replace(/&/g,"%26").replace(/#/g,"%23").replace(/\+/g,"%2B")}function _n(){return Q(_n,(function(){return new l((function(n){if(yn())return n();var e=setInterval((function(){if(yn())return clearInterval(e),n()}),10)}))}))}function En(n){return Q(En,(function(){var e={};if(!n)return e;if(-1===n.indexOf("="))return e;for(var r=0,t=n.split("&");r<t.length;r++){var o=t[r];(o=o.split("="))[0]&&o[1]&&(e[decodeURIComponent(o[0])]=decodeURIComponent(o[1]))}return e}),[n])}function bn(n,e){return void 0===e&&(e={}),e&&Object.keys(e).length?(void 0===(r=t({},En(n),e))&&(r={}),Object.keys(r).filter((function(n){return"string"==typeof r[n]})).map((function(n){return gn(n)+"="+gn(r[n])})).join("&")):n;var r}function xn(n,e){n.appendChild(e)}function Pn(n){return n instanceof window.Element||null!==n&&"object"==typeof n&&1===n.nodeType&&"object"==typeof n.style&&"object"==typeof n.ownerDocument}function On(n,e){return void 0===e&&(e=document),Pn(n)?n:"string"==typeof n?e.querySelector(n):void 0}function Wn(n){this.message=n}function Cn(n){if((V=V||new $).has(n)){var e=V.get(n);if(e)return e}var r=new l((function(e,r){n.addEventListener("load",(function(){(function(n){if(function(){for(var n=0;n<S.length;n++){var e=!1;try{e=S[n].closed}catch(n){}e&&(D.splice(n,1),S.splice(n,1))}}(),n&&n.contentWindow)try{S.push(n.contentWindow),D.push(n)}catch(n){}})(n),e(n)})),n.addEventListener("error",(function(t){n.contentWindow?e(n):r(t)}))}));return V.set(n,r),r}function jn(n){return Cn(n).then((function(n){if(!n.contentWindow)throw new Error("Could not find window in iframe");return n.contentWindow}))}function Sn(n,e){void 0===n&&(n={});var r=n.style||{},o=function(n,e,r){void 0===n&&(n="div"),void 0===e&&(e={}),n=n.toLowerCase();var t,o,i,a=document.createElement(n);if(e.style&&on(a.style,e.style),e.class&&(a.className=e.class.join(" ")),e.id&&a.setAttribute("id",e.id),e.attributes)for(var u=0,c=Object.keys(e.attributes);u<c.length;u++){var s=c[u];a.setAttribute(s,e.attributes[s])}if(e.styleSheet&&(t=a,o=e.styleSheet,void 0===i&&(i=window.document),t.styleSheet?t.styleSheet.cssText=o:t.appendChild(i.createTextNode(o))),e.html){if("iframe"===n)throw new Error("Iframe html can not be written unless container provided and iframe in DOM");a.innerHTML=e.html}return a}("iframe",{attributes:t({allowTransparency:"true"},n.attributes||{}),style:t({backgroundColor:"transparent",border:"none"},r),html:n.html,class:n.class}),i=window.navigator.userAgent.match(/MSIE|Edge/i);return o.hasAttribute("id")||o.setAttribute("id",Y()),Cn(o),e&&function(n,e){void 0===e&&(e=document);var r=On(n,e);if(r)return r;throw new Error("Can not find element: "+tn(n))}(e).appendChild(o),(n.url||i)&&o.setAttribute("src",n.url||"about:blank"),o}function Dn(n,e,r){return n.addEventListener(e,r),{cancel:function(){n.removeEventListener(e,r)}}}function An(n){n.style.setProperty("display","")}function Rn(n){n.style.setProperty("display","none","important")}function kn(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function zn(n){return!n||!n.parentNode}function Nn(n,e,r){var t=void 0===r?{}:r,o=t.width,i=void 0===o||o,a=t.height,u=void 0===a||a,c=t.interval,s=void 0===c?100:c,f=t.win,d=void 0===f?window:f,l=n.offsetWidth,h=n.offsetHeight;e({width:l,height:h});var p,w,v=function(){var r=n.offsetWidth,t=n.offsetHeight;(i&&r!==l||u&&t!==h)&&e({width:r,height:t}),l=r,h=t};return void 0!==d.ResizeObserver?(p=new d.ResizeObserver(v)).observe(n):void 0!==d.MutationObserver?((p=new d.MutationObserver(v)).observe(n,{attributes:!0,childList:!0,subtree:!0,characterData:!1}),d.addEventListener("resize",v)):function n(){v(),w=setTimeout(n,s)}(),{cancel:function(){p.disconnect(),window.removeEventListener("resize",v),clearTimeout(w)}}}function Tn(n){for(;n.parentNode;)n=n.parentNode;return"[object ShadowRoot]"===n.toString()}function In(n){return function(n){if("number"==typeof n)return n;var e=n.match(/^([0-9]+)(px|%)$/);if(!e)throw new Error("Could not match css value from "+n);return parseInt(e[1],10)}(n)+"px"}function Fn(n){return"number"==typeof n?In(n):"string"==typeof(e=n)&&/^[0-9]+%$/.test(e)?n:In(n);var e}function Mn(n){return void 0===n&&(n=window),n!==window?n.__post_robot_10_0_38__:n.__post_robot_10_0_38__=n.__post_robot_10_0_38__||{}}G.clear=function(){for(var n=0;n<X.length;n++)X[n].reset()},Wn.prototype=Object.create(Error.prototype);var Ln=function(){return{}};function qn(n,e){return void 0===n&&(n="store"),void 0===e&&(e=Ln),wn(Mn(),n,(function(){var n=e();return{has:function(e){return n.hasOwnProperty(e)},get:function(e,r){return n.hasOwnProperty(e)?n[e]:r},set:function(e,r){return n[e]=r,r},del:function(e){delete n[e]},getOrSet:function(e,r){return wn(n,e,r)},reset:function(){n=e()},keys:function(){return Object.keys(n)}}}))}var Un,$n=function(){};function Bn(){var n=Mn();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new $n,n.WINDOW_WILDCARD}function Jn(n,e){return void 0===n&&(n="store"),void 0===e&&(e=Ln),qn("windowStore").getOrSet(n,(function(){var r=new $,t=function(n){return r.getOrSet(n,e)};return{has:function(e){return t(e).hasOwnProperty(n)},get:function(e,r){var o=t(e);return o.hasOwnProperty(n)?o[n]:r},set:function(e,r){return t(e)[n]=r,r},del:function(e){delete t(e)[n]},getOrSet:function(e,r){return wn(t(e),n,r)}}}))}function Hn(){return qn("instance").getOrSet("instanceID",Y)}function Yn(n,e){var r=e.domain,t=Jn("helloPromises"),o=t.get(n);o&&o.resolve({domain:r});var i=l.resolve({domain:r});return t.set(n,i),i}function Zn(n,e){return(0,e.send)(n,"postrobot_hello",{instanceID:Hn()},{domain:"*",timeout:-1}).then((function(e){var r=e.origin,t=e.data.instanceID;return Yn(n,{domain:r}),{win:n,domain:r,instanceID:t}}))}function Vn(n,e){var r=e.send;return Jn("windowInstanceIDPromises").getOrSet(n,(function(){return Zn(n,{send:r}).then((function(n){return n.instanceID}))}))}function Xn(n){Jn("knownWindows").set(n,!0)}function Gn(n){return"object"==typeof n&&null!==n&&"string"==typeof n.__type__}function Kn(n){return void 0===n?"undefined":null===n?"null":Array.isArray(n)?"array":"function"==typeof n?"function":"object"==typeof n?n instanceof Error?"error":"function"==typeof n.then?"promise":"[object RegExp]"==={}.toString.call(n)?"regex":"[object Date]"==={}.toString.call(n)?"date":"object":"string"==typeof n?"string":"number"==typeof n?"number":"boolean"==typeof n?"boolean":void 0}function Qn(n,e){return{__type__:n,__val__:e}}var ne,ee=((Un={}).function=function(){},Un.error=function(n){return Qn("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},Un.promise=function(){},Un.regex=function(n){return Qn("regex",n.source)},Un.date=function(n){return Qn("date",n.toJSON())},Un.array=function(n){return n},Un.object=function(n){return n},Un.string=function(n){return n},Un.number=function(n){return n},Un.boolean=function(n){return n},Un.null=function(n){return n},Un),re={},te=((ne={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},ne.error=function(n){var e=n.stack,r=n.code,t=n.data,o=new Error(n.message);return o.code=r,t&&(o.data=t),o.stack=e+"\n\n"+o.stack,o},ne.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},ne.regex=function(n){return new RegExp(n)},ne.date=function(n){return new Date(n)},ne.array=function(n){return n},ne.object=function(n){return n},ne.string=function(n){return n},ne.number=function(n){return n},ne.boolean=function(n){return n},ne.null=function(n){return n},ne),oe={};function ie(){for(var n=qn("idToProxyWindow"),e=0,r=n.keys();e<r.length;e++){var t=r[e];n.get(t).shouldClean()&&n.del(t)}}function ae(n,e){var r=e.send,t=e.id,o=void 0===t?Y():t,i=n.then((function(n){if(b(n))return x(n).name})),a=n.then((function(n){if(A(n))throw new Error("Window is closed, can not determine type");return y(n)?p.POPUP:p.IFRAME}));return i.catch(nn),a.catch(nn),{id:o,getType:function(){return a},getInstanceID:K((function(){return n.then((function(n){return Vn(n,{send:r})}))})),close:function(){return n.then(L)},getName:function(){return n.then((function(n){if(!A(n))return b(n)?x(n).name:i}))},focus:function(){return n.then((function(n){n.focus()}))},isClosed:function(){return n.then((function(n){return A(n)}))},setLocation:function(e){return n.then((function(n){var r=window.location.protocol+"//"+window.location.host;if(0===e.indexOf("/"))e=""+r+e;else if(!e.match(/^https?:\/\//)&&0!==e.indexOf(r))throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(e));if(b(n))try{if(n.location&&"function"==typeof n.location.replace)return void n.location.replace(e)}catch(n){}n.location=e}))},setName:function(e){return n.then((function(n){var r=b(n),t=function(n){if(b(n))return x(n).frameElement;for(var e=0,r=document.querySelectorAll("iframe");e<r.length;e++){var t=r[e];if(t&&t.contentWindow&&t.contentWindow===n)return t}}(n);if(!r)throw new Error("Can not set name for cross-domain window: "+e);x(n).name=e,t&&t.setAttribute("name",e),i=l.resolve(e)}))}}}new l((function(n){if(window.document&&window.document.body)return n(window.document.body);var e=setInterval((function(){if(window.document&&window.document.body)return clearInterval(e),n(window.document.body)}),10)}));var ue=function(){function n(n){var e=n.send,r=n.win,t=n.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new l,this.serializedWindow=t||ae(this.actualWindowPromise,{send:e}),qn("idToProxyWindow").set(this.getID(),this),r&&this.setWindow(r,{send:e})}var e=n.prototype;return e.getID=function(){return this.serializedWindow.id},e.getType=function(){return this.serializedWindow.getType()},e.isPopup=function(){return this.getType().then((function(n){return n===p.POPUP}))},e.setLocation=function(n){var e=this;return this.serializedWindow.setLocation(n).then((function(){return e}))},e.getName=function(){return this.serializedWindow.getName()},e.setName=function(n){var e=this;return this.serializedWindow.setName(n).then((function(){return e}))},e.close=function(){var n=this;return this.serializedWindow.close().then((function(){return n}))},e.focus=function(){var n=this,e=this.isPopup(),r=this.getName(),t=l.hash({isPopup:e,name:r}).then((function(n){var e=n.name;n.isPopup&&e&&window.open("",e)})),o=this.serializedWindow.focus();return l.all([t,o]).then((function(){return n}))},e.isClosed=function(){return this.serializedWindow.isClosed()},e.getWindow=function(){return this.actualWindow},e.setWindow=function(n,e){var r=e.send;this.actualWindow=n,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=ae(this.actualWindowPromise,{send:r,id:this.getID()}),Jn("winToProxyWindow").set(n,this)},e.awaitWindow=function(){return this.actualWindowPromise},e.matchWindow=function(n,e){var r=this,t=e.send;return l.try((function(){return r.actualWindow?n===r.actualWindow:l.hash({proxyInstanceID:r.getInstanceID(),knownWindowInstanceID:Vn(n,{send:t})}).then((function(e){var o=e.proxyInstanceID===e.knownWindowInstanceID;return o&&r.setWindow(n,{send:t}),o}))}))},e.unwrap=function(){return this.actualWindow||this},e.getInstanceID=function(){return this.serializedWindow.getInstanceID()},e.shouldClean=function(){return Boolean(this.actualWindow&&A(this.actualWindow))},e.serialize=function(){return this.serializedWindow},n.unwrap=function(e){return n.isProxyWindow(e)?e.unwrap():e},n.serialize=function(e,r){var t=r.send;return ie(),n.toProxyWindow(e,{send:t}).serialize()},n.deserialize=function(e,r){var t=r.send;return ie(),qn("idToProxyWindow").get(e.id)||new n({serializedWindow:e,send:t})},n.isProxyWindow=function(n){return Boolean(n&&!M(n)&&n.isProxyWindow)},n.toProxyWindow=function(e,r){var t=r.send;if(ie(),n.isProxyWindow(e))return e;var o=e;return Jn("winToProxyWindow").get(o)||new n({win:o,send:t})},n}();function ce(n,e,r,t,o){var i=Jn("methodStore"),a=qn("proxyWindowMethods");ue.isProxyWindow(t)?a.set(n,{val:e,name:r,domain:o,source:t}):(a.del(n),i.getOrSet(t,(function(){return{}}))[n]={domain:o,name:r,val:e,source:t})}function se(n,e){var r=Jn("methodStore"),t=qn("proxyWindowMethods");return r.getOrSet(n,(function(){return{}}))[e]||t.get(e)}function fe(n,e,r,t,o){var i,a,u;a=(i={on:o.on,send:o.send}).on,u=i.send,qn("builtinListeners").getOrSet("functionCalls",(function(){return a("postrobot_method",{domain:"*"},(function(n){var e=n.source,r=n.origin,t=n.data,o=t.id,i=t.name,a=se(e,o);if(!a)throw new Error("Could not find method '"+i+"' with id: "+t.id+" in "+E(window));var c=a.source,s=a.domain,f=a.val;return l.try((function(){if(!T(s,r))throw new Error("Method '"+t.name+"' domain "+JSON.stringify(pn(a.domain)?a.domain.source:a.domain)+" does not match origin "+r+" in "+E(window));if(ue.isProxyWindow(c))return c.matchWindow(e,{send:u}).then((function(n){if(!n)throw new Error("Method call '"+t.name+"' failed - proxy window does not match source in "+E(window))}))})).then((function(){return f.apply({source:e,origin:r},t.args)}),(function(n){return l.try((function(){if(f.onError)return f.onError(n)})).then((function(){var e;throw n.stack&&(n.stack="Remote call to "+i+"("+(void 0===(e=t.args)&&(e=[]),sn(e).map((function(n){return"string"==typeof n?"'"+n+"'":void 0===n?"undefined":null===n?"null":"boolean"==typeof n?n.toString():Array.isArray(n)?"[ ... ]":"object"==typeof n?"{ ... }":"function"==typeof n?"() => { ... }":"<"+typeof n+">"})).join(", ")+") failed\n\n")+n.stack),n}))})).then((function(n){return{result:n,id:o,name:i}}))}))}));var c=r.__id__||Y();n=ue.unwrap(n);var s=r.__name__||r.name||t;return"string"==typeof s&&"function"==typeof s.indexOf&&0===s.indexOf("anonymous::")&&(s=s.replace("anonymous::",t+"::")),ue.isProxyWindow(n)?(ce(c,r,s,n,e),n.awaitWindow().then((function(n){ce(c,r,s,n,e)}))):ce(c,r,s,n,e),Qn("cross_domain_function",{id:c,name:s})}function de(n,e,r,t){var o,i=t.on,a=t.send;return function(n,e){void 0===e&&(e=re);var r=JSON.stringify(n,(function(n){var r=this[n];if(Gn(this))return r;var t=Kn(r);if(!t)return r;var o=e[t]||ee[t];return o?o(r,n):r}));return void 0===r?"undefined":r}(r,((o={}).promise=function(r,t){return function(n,e,r,t,o){return Qn("cross_domain_zalgo_promise",{then:fe(n,e,(function(n,e){return r.then(n,e)}),t,{on:o.on,send:o.send})})}(n,e,r,t,{on:i,send:a})},o.function=function(r,t){return fe(n,e,r,t,{on:i,send:a})},o.object=function(n){return M(n)||ue.isProxyWindow(n)?Qn("cross_domain_window",ue.serialize(n,{send:a})):n},o))}function le(n,e,r,t){var o,i=t.send;return function(n,e){if(void 0===e&&(e=oe),"undefined"!==n)return JSON.parse(n,(function(n,r){if(Gn(this))return r;var t,o;if(Gn(r)?(t=r.__type__,o=r.__val__):(t=Kn(r),o=r),!t)return o;var i=e[t]||te[t];return i?i(o,n):o}))}(r,((o={}).cross_domain_zalgo_promise=function(n){return function(n,e,r){return new l(r.then)}(0,0,n)},o.cross_domain_function=function(r){return function(n,e,r,t){var o=r.id,i=r.name,a=t.send,u=function(r){function t(){var u=arguments;return ue.toProxyWindow(n,{send:a}).awaitWindow().then((function(n){var c=se(n,o);if(c&&c.val!==t)return c.val.apply({source:window,origin:E()},u);var s=[].slice.call(u);return r.fireAndForget?a(n,"postrobot_method",{id:o,name:i,args:s},{domain:e,fireAndForget:!0}):a(n,"postrobot_method",{id:o,name:i,args:s},{domain:e,fireAndForget:!1}).then((function(n){return n.data.result}))})).catch((function(n){throw n}))}return void 0===r&&(r={}),t.__name__=i,t.__origin__=e,t.__source__=n,t.__id__=o,t.origin=e,t},c=u();return c.fireAndForget=u({fireAndForget:!0}),c}(n,e,r,{send:i})},o.cross_domain_window=function(n){return ue.deserialize(n,{send:i})},o))}var he,pe={};function we(n,e,r,o){var i,a=o.on,u=o.send;if(A(n))throw new Error("Window is closed");for(var c=de(n,e,((i={}).__post_robot_10_0_38__=t({id:Y(),origin:E(window)},r),i),{on:a,send:u}),s=Object.keys(pe),f=[],d=0;d<s.length;d++){var l=s[d];try{pe[l](n,c,e)}catch(n){f.push(n)}}if(f.length===s.length)throw new Error("All post-robot messaging strategies failed:\n\n"+f.map((function(n,e){return e+". "+rn(n)})).join("\n\n"))}function ve(n){return qn("responseListeners").get(n)}function me(n){qn("responseListeners").del(n)}function ye(n){return qn("erroredResponseListeners").has(n)}function ge(n){var e=n.name,r=n.win,t=n.domain,o=Jn("requestListeners");if("*"===r&&(r=null),"*"===t&&(t=null),!e)throw new Error("Name required to get request listener");for(var i=0,a=[r,Bn()];i<a.length;i++){var u=a[i];if(u){var c=o.get(u);if(c){var s=c[e];if(s){if(t&&"string"==typeof t){if(s[t])return s[t];if(s.__domain_regex__)for(var f=0,d=s.__domain_regex__;f<d.length;f++){var l=d[f],h=l.listener;if(T(l.regex,t))return h}}if(s["*"])return s["*"]}}}}}pe.postrobot_post_message=function(n,e,r){(Array.isArray(r)?r:"string"==typeof r?[r]:["*"]).map((function(n){return 0===n.indexOf("file:")?"*":n})).forEach((function(r){n.postMessage(e,r)}))},pe.postrobot_global=function(n,e){if(!function(n){return(n=n||window).navigator.mockUserAgent||n.navigator.userAgent}(window).match(/MSIE|rv:11|trident|edge\/12|edge\/13/i))throw new Error("Global messaging not needed for browser");if(!b(n))throw new Error("Post message through global disabled between different domain windows");if(!1!==N(window,n))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=Mn(n);if(!r)throw new Error("Can not find postRobot global on foreign window");r.receiveMessage({source:window,origin:E(),data:e})};var _e=((he={}).postrobot_message_request=function(n,e,r,o){var i=o.on,a=o.send,u=ge({name:r.name,win:n,domain:e}),c="postrobot_method"===r.name&&r.data&&"string"==typeof r.data.name?r.data.name+"()":r.name;function s(o,u,s){if(void 0===s&&(s={}),!r.fireAndForget&&!A(n))try{we(n,e,t({type:o,ack:u,hash:r.hash,name:r.name},s),{on:i,send:a})}catch(n){throw new Error("Send response message failed for "+c+" in "+E()+"\n\n"+rn(n))}}return l.all([s("postrobot_message_ack"),l.try((function(){if(!u)throw new Error("No handler found for post message: "+r.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!T(u.domain,e))throw new Error("Request origin "+e+" does not match domain "+u.domain.toString());return u.handler({source:n,origin:e,data:r.data})})).then((function(n){return s("postrobot_message_response","success",{data:n})}),(function(n){return s("postrobot_message_response","error",{error:n})}))]).then(nn).catch((function(n){if(u&&u.handleError)return u.handleError(n);throw n}))},he.postrobot_message_ack=function(n,e,r){if(!ye(r.hash)){var t=ve(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!T(t.domain,e))throw new Error("Ack origin "+e+" does not match domain "+t.domain.toString());if(n!==t.win)throw new Error("Ack source does not match registered window")}catch(n){t.promise.reject(n)}t.ack=!0}},he.postrobot_message_response=function(n,e,r){if(!ye(r.hash)){var t,o=ve(r.hash);if(!o)throw new Error("No handler found for post message response for message: "+r.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!T(o.domain,e))throw new Error("Response origin "+e+" does not match domain "+(t=o.domain,Array.isArray(t)?"("+t.join(" | ")+")":h(t)?"RegExp("+t.toString():t.toString()));if(n!==o.win)throw new Error("Response source does not match registered window");me(r.hash),"error"===r.ack?o.promise.reject(r.error):"success"===r.ack&&o.promise.resolve({source:n,origin:e,data:r.data})}},he);function Ee(n,e){var r=e.on,t=e.send,o=qn("receivedMessages");try{if(!window||window.closed||!n.source)return}catch(n){return}var i=n.source,a=n.origin,u=function(n,e,r,t){var o,i=t.on,a=t.send;try{o=le(e,r,n,{on:i,send:a})}catch(n){return}if(o&&"object"==typeof o&&null!==o&&(o=o.__post_robot_10_0_38__)&&"object"==typeof o&&null!==o&&o.type&&"string"==typeof o.type&&_e[o.type])return o}(n.data,i,a,{on:r,send:t});u&&(Xn(i),o.has(u.id)||(o.set(u.id,!0),A(i)&&!u.fireAndForget||(0===u.origin.indexOf("file:")&&(a="file://"),_e[u.type](i,a,u,{on:r,send:t}))))}function be(n,e,r){if(!n)throw new Error("Expected name");if("function"==typeof(e=e||{})&&(r=e,e={}),!r)throw new Error("Expected handler");(e=e||{}).name=n,e.handler=r||e.handler;var t=e.window,o=e.domain,i=function n(e,r){var t=e.name,o=e.win,i=e.domain,a=Jn("requestListeners");if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var u=[],c=0,s=o;c<s.length;c++)u.push(n({name:t,domain:i,win:s[c]},r));return{cancel:function(){for(var n=0;n<u.length;n++)u[n].cancel()}}}if(Array.isArray(i)){for(var f=[],d=0,l=i;d<l.length;d++)f.push(n({name:t,win:o,domain:l[d]},r));return{cancel:function(){for(var n=0;n<f.length;n++)f[n].cancel()}}}var h=ge({name:t,win:o,domain:i});if(o&&"*"!==o||(o=Bn()),i=i||"*",h)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===Bn()?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===Bn()?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var p,w,v=a.getOrSet(o,(function(){return{}})),m=wn(v,t,(function(){return{}})),y=i.toString();return pn(i)?(p=wn(m,"__domain_regex__",(function(){return[]}))).push(w={regex:i,listener:r}):m[y]=r,{cancel:function(){delete m[y],w&&(p.splice(p.indexOf(w,1)),p.length||delete m.__domain_regex__),Object.keys(m).length||delete v[t],o&&!Object.keys(v).length&&a.del(o)}}}({name:n,win:t,domain:o},{handler:e.handler,handleError:e.errorHandler||function(n){throw n},window:t,domain:o||"*",name:n});return{cancel:function(){i.cancel()}}}var xe=function n(e,r,t,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,u=o.timeout||5e3,c=o.fireAndForget||!1;return l.try((function(){if(function(n,e,r){if(!n)throw new Error("Expected name");if(r&&"string"!=typeof r&&!Array.isArray(r)&&!pn(r))throw new TypeError("Can not send "+n+". Expected domain "+JSON.stringify(r)+" to be a string, array, or regex");if(A(e))throw new Error("Can not send "+n+". Target window is closed")}(r,e,i),function(n,e){var r=R(e);if(r)return r===n;if(e===n)return!1;if(C(e)===e)return!1;for(var t=0,o=O(n);t<o.length;t++)if(o[t]===e)return!0;return!1}(window,e))return function(n,e,r){void 0===e&&(e=5e3),void 0===r&&(r="Window");var t=function(n){return Jn("helloPromises").getOrSet(n,(function(){return new l}))}(n);return-1!==e&&(t=t.timeout(e,new Error(r+" did not load after "+e+"ms"))),t}(e,u)})).then((function(r){return function(n,e,r,t){var o=t.send;return"string"==typeof e?l.resolve(e):l.try((function(){return r||Zn(n,{send:o}).then((function(n){return n.domain}))})).then((function(n){if(!T(e,e))throw new Error("Domain "+tn(e)+" does not match "+tn(e));return n}))}(e,i,(void 0===r?{}:r).domain,{send:n})})).then((function(o){i=o;var u="postrobot_method"===r&&t&&"string"==typeof t.name?t.name+"()":r,s=new l,f=r+"_"+Y();if(!c){var d={name:r,win:e,domain:i,promise:s};!function(n,e){qn("responseListeners").set(n,e)}(f,d);var h=Jn("requestPromises").getOrSet(e,(function(){return[]}));h.push(s),s.catch((function(){!function(n){qn("erroredResponseListeners").set(n,!0)}(f),me(f)}));var p=function(n){return Jn("knownWindows").get(n,!1)}(e)?1e4:2e3,w=a,v=p,m=w,y=un((function(){return A(e)?s.reject(new Error("Window closed for "+r+" before "+(d.ack?"response":"ack"))):d.cancelled?s.reject(new Error("Response listener was cancelled for "+r)):(v=Math.max(v-500,0),-1!==m&&(m=Math.max(m-500,0)),d.ack||0!==v?0===m?s.reject(new Error("No response for postMessage "+u+" in "+E()+" in "+w+"ms")):void 0:s.reject(new Error("No ack for postMessage "+u+" in "+E()+" in "+p+"ms")))}),500);s.finally((function(){y.cancel(),h.splice(h.indexOf(s,1))})).catch(nn)}try{we(e,i,{type:"postrobot_message_request",hash:f,name:r,data:t,fireAndForget:c},{on:be,send:n})}catch(n){throw new Error("Send request message failed for "+u+" in "+E()+"\n\n"+rn(n))}return c?s.resolve():s}))};function Pe(n,e,r){return de(n,e,r,{on:be,send:xe})}function Oe(n,e,r){return le(n,e,r,{on:be,send:xe})}function We(n){return ue.toProxyWindow(n,{send:xe})}function Ce(n){if(void 0===n&&(n=window),!b(n))throw new Error("Can not get global for window on different domain");return n.__zoid_9_0_51__||(n.__zoid_9_0_51__={}),n.__zoid_9_0_51__}function je(n){return{get:function(){var e=this;return l.try((function(){if(e.source&&e.source!==window)throw new Error("Can not call get on proxy object from a remote window");return n}))}}}var Se={STRING:"string",OBJECT:"object",FUNCTION:"function",BOOLEAN:"boolean",NUMBER:"number",ARRAY:"array"},De={JSON:"json",DOTIFY:"dotify",BASE64:"base64"},Ae=p,Re={RENDER:"zoid-render",RENDERED:"zoid-rendered",DISPLAY:"zoid-display",ERROR:"zoid-error",CLOSE:"zoid-close",DESTROY:"zoid-destroy",PROPS:"zoid-props",RESIZE:"zoid-resize",FOCUS:"zoid-focus"};function ke(n,e,r,t,o){if(!n.hasOwnProperty(r))return t;var i=n[r];return"function"==typeof i.childDecorate?i.childDecorate({value:t,close:o.close,focus:o.focus,onError:o.onError,onProps:o.onProps,resize:o.resize,getParent:o.getParent,getParentDomain:o.getParentDomain,show:o.show,hide:o.hide}):t}function ze(n){return Q(ze,(function(){if(!n)throw new Error("No window name");var e=n.split("__"),r=e[1],t=e[2],o=e[3];if("zoid"!==r)throw new Error("Window not rendered by zoid - got "+r);if(!t)throw new Error("Expected component name");if(!o)throw new Error("Expected encoded payload");try{return JSON.parse(function(n){if("function"==typeof atob)return decodeURIComponent([].map.call(atob(n),(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)})).join(""));if("undefined"!=typeof Buffer)return Buffer.from(n,"base64").toString("utf8");throw new Error("Can not find window.atob or Buffer")}(o))}catch(n){throw new Error("Can not decode window name payload: "+o+": "+rn(n))}}),[n])}function Ne(){try{return ze(window.name)}catch(n){}}function Te(){return l.try((function(){window.focus()}))}function Ie(){return l.try((function(){window.close()}))}function Fe(n,e,r){return l.try((function(){return"function"==typeof n.queryParam?n.queryParam({value:r}):"string"==typeof n.queryParam?n.queryParam:e}))}function Me(n,e,r){return l.try((function(){return"function"==typeof n.queryValue&&hn(r)?n.queryValue({value:r}):r}))}function Le(n,e,r){void 0===e&&(e={}),void 0===r&&(r=window);var o,i,a,u,c,s=n.propsDef,f=n.containerTemplate,d=n.prerenderTemplate,h=n.tag,p=n.name,w=n.attributes,v=n.dimensions,m=n.autoResize,y=n.url,g=n.domain,_=new l,P=[],O=vn(),W={},C=e.event?e.event:(o={},i={},{on:function(n,e){var r=i[n]=i[n]||[];r.push(e);var t=!1;return{cancel:function(){t||(t=!0,r.splice(r.indexOf(e),1))}}},once:function(n,e){var r=this.on(n,(function(){r.cancel(),e()}));return r},trigger:function(n){for(var e=arguments.length,r=new Array(e>1?e-1:0),t=1;t<e;t++)r[t-1]=arguments[t];var o=i[n],a=[];if(o)for(var u=function(n){var e=o[n];a.push(l.try((function(){return e.apply(void 0,r)})))},c=0;c<o.length;c++)u(c);return l.all(a).then(nn)},triggerOnce:function(n){if(o[n])return l.resolve();o[n]=!0;for(var e=arguments.length,r=new Array(e>1?e-1:0),t=1;t<e;t++)r[t-1]=arguments[t];return this.trigger.apply(this,[n].concat(r))},reset:function(){i={}}}),j=e.props?e.props:{},S=!0,D=e.onError,R=e.getProxyContainer,k=e.show,M=e.hide,L=e.close,q=e.renderContainer,U=e.getProxyWindow,$=e.setProxyWin,B=e.openFrame,J=e.openPrerenderFrame,Z=e.prerender,V=e.open,X=e.openPrerender,G=e.watchForUnload,K=function(n){for(var e={},r=0,t=Object.keys(j);r<t.length;r++){var o=t[r],i=s[o];i&&!1===i.sendToChild||i&&i.sameDomain&&!T(n,E(window))||(e[o]=j[o])}return l.hash(e)},Q=function(){return U?U():l.try((function(){var n=j.window;if(n){var e=We(n);return O.register((function(){return n.close()})),e}return new ue({send:xe})}))},an=function(n){return R?R(n):l.try((function(){return e=n,new l((function(n,r){var t=tn(e),o=On(e);if(o)return n(o);if(yn())return r(new Error("Document is ready and element "+t+" does not exist"));var i=setInterval((function(){return(o=On(e))?(clearInterval(i),n(o)):yn()?(clearInterval(i),r(new Error("Document is ready and element "+t+" does not exist"))):void 0}),10)}));var e})).then((function(n){return Tn(n)&&(n=function(n){var e=function(n){var e=function(n){for(;n.parentNode;)n=n.parentNode;if(Tn(n))return n}(n);if(e.host)return e.host}(n);if(!e)throw new Error("Element is not in shadow dom");if(Tn(e))throw new Error("Host element is also in shadow dom");var r="shadow-slot-"+Y(),t=document.createElement("slot");t.setAttribute("name",r),n.appendChild(t);var o=document.createElement("div");return o.setAttribute("slot",r),e.appendChild(o),o}(n)),je(n)}))},cn=function(n){return $?$(n):l.try((function(){a=n}))},fn=function(){return k?k():l.try((function(){if(S=!0,u)return u.get().then(An)}))},dn=function(){return M?M():l.try((function(){if(S=!1,u)return u.get().then(Rn)}))},ln=function(){return"function"==typeof y?y({props:j}):y},wn=function(){return"function"==typeof w?w({props:j}):w},mn=function(){return g&&"string"==typeof g?g:I(ln())},gn=function(){return g&&pn(g)?g:mn()},_n=function(n,e){var r=e.windowName;return B?B(n,{windowName:r}):l.try((function(){if(n===Ae.IFRAME)return je(Sn({attributes:t({name:r,title:p},wn().iframe)}))}))},En=function(n){return J?J(n):l.try((function(){if(n===Ae.IFRAME)return je(Sn({attributes:t({name:"__zoid_prerender_frame__"+p+"_"+Y()+"__",title:"prerender__"+p},wn().iframe)}))}))},Pn=function(n,e,r){return X?X(n,e,r):l.try((function(){if(n===Ae.IFRAME){if(!r)throw new Error("Expected proxy frame to be passed");return r.get().then((function(n){return O.register((function(){return kn(n)})),jn(n).then((function(n){return x(n)})).then((function(n){return We(n)}))}))}throw new Error("No render context available for "+n)}))},Wn=function(){return l.try((function(){if(a)return l.all([C.trigger(Re.FOCUS),a.focus()]).then(nn)}))},Cn=function(n,e,r,t){if(e===E(window)){var o=Ce(window);return o.windows=o.windows||{},o.windows[r]=window,O.register((function(){delete o.windows[r]})),{type:"global",uid:r}}return t===Ae.POPUP?{type:"opener"}:{type:"parent",distance:z(window)}},In=function(n){return l.try((function(){c=n,_.resolve(),O.register((function(){return n.close.fireAndForget().catch(nn)}))}))},Fn=function(n){var e=n.width,r=n.height;return l.try((function(){C.trigger(Re.RESIZE,{width:e,height:r})}))},Mn=function(n){return l.try((function(){return C.trigger(Re.DESTROY)})).catch(nn).then((function(){return O.all()})).then((function(){_.asyncReject(n||new Error("Component destroyed"))}))},Ln=function(){return L?L():l.try((function(){return C.trigger(Re.CLOSE)})).then((function(){return Mn(new Error("Window closed"))}))},qn=function(n,e){var r=e.proxyWin,t=e.proxyFrame;return V?V(n,{proxyWin:r,proxyFrame:t,windowName:e.windowName}):l.try((function(){if(n===Ae.IFRAME){if(!t)throw new Error("Expected proxy frame to be passed");return t.get().then((function(n){return jn(n).then((function(e){var r,t,o,i=(r=n,t=en(t=Ln),zn(r)?t():o=un((function(){zn(r)&&(o.cancel(),t())}),50),{cancel:function(){o&&o.cancel()}});return O.register((function(){return i.cancel()})),O.register((function(){return kn(n)})),O.register((function(){return function(n){for(var e=0,r=Jn("requestPromises").get(n,[]);e<r.length;e++)r[e].reject(new Error("Window "+(A(n)?"closed":"cleaned up")+" before response")).catch(nn)}(e)})),e}))}))}throw new Error("No render context available for "+n)})).then((function(n){return r.setWindow(n,{send:xe}),r}))},Un=function(){return l.try((function(){var n=Dn(window,"unload",en((function(){Mn(new Error("Window navigated away"))}))),e=F(r,Mn,3e3);if(O.register(e.cancel),O.register(n.cancel),G)return G()}))},$n=function(n){var e=!1;return n.isClosed().then((function(r){return r?(e=!0,Ln()):l.delay(200).then((function(){return n.isClosed()})).then((function(n){if(n)return e=!0,Ln()}))})).then((function(){return e}))},Bn=function(n){return D?D(n):l.try((function(){if(-1===P.indexOf(n))return P.push(n),_.asyncReject(n),C.trigger(Re.ERROR,n)}))};In.onError=Bn;var Hn=function(n,e){return n({container:e.container,context:e.context,uid:e.uid,doc:e.doc,frame:e.frame,prerenderFrame:e.prerenderFrame,focus:Wn,close:Ln,state:W,props:j,tag:h,dimensions:v,event:C})},Yn=function(n,e){var r=e.context,t=e.uid;return Z?Z(n,{context:r,uid:t}):l.try((function(){if(d){var e=n.getWindow();if(e&&b(e)&&function(n){try{if(!n.location.href)return!0;if("about:blank"===n.location.href)return!0}catch(n){}return!1}(e)){var o=(e=x(e)).document,i=Hn(d,{context:r,uid:t,doc:o});if(i){if(i.ownerDocument!==o)throw new Error("Expected prerender template to have been created with document from child window");!function(n,e){var r=e.tagName.toLowerCase();if("html"!==r)throw new Error("Expected element to be html, got "+r);for(var t=n.document.documentElement,o=0,i=sn(t.children);o<i.length;o++)t.removeChild(i[o]);for(var a=0,u=sn(e.children);a<u.length;a++)t.appendChild(u[a])}(e,i);var a=m.width,u=void 0!==a&&a,c=m.height,s=void 0!==c&&c,f=m.element,l=void 0===f?"body":f;(l=On(l,o))&&(u||s)&&Nn(l,(function(n){Fn({width:u?n.width:void 0,height:s?n.height:void 0})}),{width:u,height:s,win:e})}}}}))},Zn=function(n,e){var r=e.proxyFrame,t=e.proxyPrerenderFrame,o=e.context,i=e.uid;return q?q(n,{proxyFrame:r,proxyPrerenderFrame:t,context:o,uid:i}):l.hash({container:n.get(),frame:r?r.get():null,prerenderFrame:t?t.get():null}).then((function(n){var e=n.container,r=Hn(f,{context:o,uid:i,container:e,frame:n.frame,prerenderFrame:n.prerenderFrame,doc:document});if(r)return S||Rn(r),xn(e,r),O.register((function(){return kn(r)})),u=je(r)}))},Vn=function(){return{state:W,event:C,close:Ln,focus:Wn,resize:Fn,onError:Bn,updateProps:Gn,show:fn,hide:dn}},Xn=function(n,e){void 0===e&&(e=!1);var r=Vn();!function(n,e,r,t,o){void 0===o&&(o=!1),on(e,r=r||{});for(var i=o?[]:[].concat(Object.keys(n)),a=0,u=Object.keys(r);a<u.length;a++){var c=u[a];-1===i.indexOf(c)&&i.push(c)}for(var s=[],f=t.state,d=t.close,l=t.focus,h=t.event,p=t.onError,w=0;w<i.length;w++){var v=i[w],m=n[v],y=r[v];if(m){var g=m.alias;if(g&&(!hn(y)&&hn(r[g])&&(y=r[g]),s.push(g)),m.value&&(y=m.value({props:e,state:f,close:d,focus:l,event:h,onError:p})),!hn(y)&&m.default&&(y=m.default({props:e,state:f,close:d,focus:l,event:h,onError:p})),hn(y)&&("array"===m.type?!Array.isArray(y):typeof y!==m.type))throw new TypeError("Prop is not of type "+m.type+": "+v);e[v]=y}}for(var _=0;_<s.length;_++)delete e[s[_]];for(var E=0,b=Object.keys(e);E<b.length;E++){var x=b[E],P=n[x],O=e[x];P&&hn(O)&&P.decorate&&(e[x]=P.decorate({value:O,props:e,state:f,close:d,focus:l,event:h,onError:p}))}for(var W=0,C=Object.keys(n);W<C.length;W++){var j=C[W];if(!1!==n[j].required&&!hn(e[j]))throw new Error('Expected prop "'+j+'" to be defined')}}(s,j,n,r,e)},Gn=function(n){return Xn(n,!0),_.then((function(){var n=c,e=a;if(n&&e)return K(gn()).then((function(r){return n.updateProps(r).catch((function(n){return $n(e).then((function(e){if(!e)throw n}))}))}))}))};return{init:function(){C.on(Re.RENDER,(function(){return j.onRender()})),C.on(Re.DISPLAY,(function(){return j.onDisplay()})),C.on(Re.RENDERED,(function(){return j.onRendered()})),C.on(Re.CLOSE,(function(){return j.onClose()})),C.on(Re.DESTROY,(function(){return j.onDestroy()})),C.on(Re.RESIZE,(function(){return j.onResize()})),C.on(Re.FOCUS,(function(){return j.onFocus()})),C.on(Re.PROPS,(function(n){return j.onProps(n)})),C.on(Re.ERROR,(function(n){return j&&j.onError?j.onError(n):_.reject(n).then((function(){setTimeout((function(){throw n}),1)}))})),O.register(C.reset)},render:function(n,e,r){return l.try((function(){var t="zoid-"+h+"-"+Y(),o=gn(),i=mn();!function(n,e,r){if(n!==window){if(!N(window,n))throw new Error("Can only renderTo an adjacent frame");var t=E();if(!T(e,t)&&!b(n))throw new Error("Can not render remotely to "+e.toString()+" - can only render to "+t);if(r&&"string"!=typeof r)throw new Error("Container passed to renderTo must be a string selector, got "+typeof r+" }")}}(n,o,e);var u=l.try((function(){if(n!==window)return function(n,e){for(var r={},t=0,o=Object.keys(j);t<o.length;t++){var i=o[t],a=s[i];a&&a.allowDelegate&&(r[i]=j[i])}var u=xe(e,"zoid_delegate_"+p,{overrides:{props:r,event:C,close:Ln,onError:Bn}}).then((function(n){var r=n.data.parent;return O.register((function(){if(!A(e))return r.destroy()})),r.getDelegateOverrides()})).catch((function(n){throw new Error("Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n"+rn(n))}));return R=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.getProxyContainer.apply(n,e)}))},q=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.renderContainer.apply(n,e)}))},k=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.show.apply(n,e)}))},M=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.hide.apply(n,e)}))},G=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.watchForUnload.apply(n,e)}))},n===Ae.IFRAME&&(U=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.getProxyWindow.apply(n,e)}))},B=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.openFrame.apply(n,e)}))},J=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.openPrerenderFrame.apply(n,e)}))},Z=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.prerender.apply(n,e)}))},V=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.open.apply(n,e)}))},X=function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return u.then((function(n){return n.openPrerender.apply(n,e)}))}),u}(r,n)})),c=j.window,f=Un(),d=function(n,e){var r={},t=Object.keys(e);return l.all(t.map((function(t){var o=n[t];if(o)return l.resolve().then((function(){var n=e[t];if(n&&o.queryParam)return n})).then((function(n){if(null!=n)return l.all([Fe(o,t,n),Me(o,0,n)]).then((function(n){var e,i=n[0],a=n[1];if("boolean"==typeof a)e=a.toString();else if("string"==typeof a)e=a.toString();else if("object"==typeof a&&null!==a){if(o.serialization===De.JSON)e=JSON.stringify(a);else if(o.serialization===De.BASE64)e=btoa(JSON.stringify(a));else if(o.serialization===De.DOTIFY||!o.serialization){e=function n(e,r,t){for(var o in void 0===r&&(r=""),void 0===t&&(t={}),r=r?r+".":r,e)e.hasOwnProperty(o)&&null!=e[o]&&"function"!=typeof e[o]&&(e[o]&&Array.isArray(e[o])&&e[o].length&&e[o].every((function(n){return"object"!=typeof n}))?t[""+r+o+"[]"]=e[o].join(","):e[o]&&"object"==typeof e[o]?t=n(e[o],""+r+o,t):t[""+r+o]=e[o].toString());return t}(a,t);for(var u=0,c=Object.keys(e);u<c.length;u++){var s=c[u];r[s]=e[s]}return}}else"number"==typeof a&&(e=a.toString());r[i]=e}))}))}))).then((function(){return r}))}(s,j).then((function(n){return function(n,e){var r,t,o=e.query||{},i=e.hash||{},a=n.split("#");t=a[1];var u=(r=a[0]).split("?");r=u[0];var c=bn(u[1],o),s=bn(t,i);return c&&(r=r+"?"+c),s&&(r=r+"#"+s),r}(function(n){if(0!==I(n).indexOf("mock:"))return n;throw new Error("Mock urls not supported out of test mode")}(ln()),{query:n})})),w=C.trigger(Re.RENDER),v=an(e),m=Q(),y=m.then((function(e){return function(n){var e=void 0===n?{}:n,r=e.proxyWin,t=e.childDomain,o=e.domain,i=(void 0===e.target&&window,e.context),a=e.uid;return function(n,e,r,t){return K(r).then((function(o){var i=Pe(n,r,o),a=e===E()?{type:"uid",uid:t}:{type:"raw",value:i};if("uid"===a.type){var u=Ce(window);u.props=u.props||{},u.props[t]=i,O.register((function(){delete u.props[t]}))}return a}))}(r,t,o,a).then((function(n){return{uid:a,context:i,tag:h,version:"9_0_51",childDomain:t,parentDomain:E(window),parent:Cn(0,t,a,i),props:n,exports:Pe(r,o,(e=r,{init:In,close:Ln,checkClose:function(){return $n(e)},resize:Fn,onError:Bn,show:fn,hide:dn}))};var e}))}({proxyWin:(a={proxyWin:e,childDomain:i,domain:o,target:n,context:r,uid:t}).proxyWin,childDomain:a.childDomain,domain:a.domain,target:a.target,context:a.context,uid:a.uid}).then((function(n){return"__zoid__"+p+"__"+H(JSON.stringify(n))+"__"}));var a})),g=y.then((function(n){return _n(r,{windowName:n})})),x=En(r),P=l.hash({proxyContainer:v,proxyFrame:g,proxyPrerenderFrame:x}).then((function(n){return Zn(n.proxyContainer,{context:r,uid:t,proxyFrame:n.proxyFrame,proxyPrerenderFrame:n.proxyPrerenderFrame})})).then((function(n){return n})),W=l.hash({windowName:y,proxyFrame:g,proxyWin:m}).then((function(n){var e=n.proxyWin;return c?e:qn(r,{windowName:n.windowName,proxyWin:e,proxyFrame:n.proxyFrame})})),S=l.hash({proxyWin:W,proxyPrerenderFrame:x}).then((function(n){return Pn(r,n.proxyWin,n.proxyPrerenderFrame)})),D=W.then((function(n){return a=n,cn(n)})),z=l.hash({proxyPrerenderWin:S,state:D}).then((function(n){return Yn(n.proxyPrerenderWin,{context:r,uid:t})})),F=l.hash({proxyWin:W,windowName:y}).then((function(n){if(c)return n.proxyWin.setName(n.windowName)})),L=l.hash({proxyWin:W,builtUrl:d,windowName:F,prerender:z}).then((function(n){return n.proxyWin.setLocation(n.builtUrl)})),$=W.then((function(n){!function n(e){var r=!1;return O.register((function(){r=!0})),l.delay(2e3).then((function(){return e.isClosed()})).then((function(t){return t?Ln():r?void 0:n(e)}))}(n)})),nn=l.hash({container:P,prerender:z}).then((function(){return C.trigger(Re.DISPLAY)})),en=W.then((function(n){})),tn=L.then((function(){return l.try((function(){var n=j.timeout;if(n)return _.timeout(n,new Error("Loading component timed out after "+n+" milliseconds"))}))})),on=_.then((function(){return C.trigger(Re.RENDERED)}));return l.hash({initPromise:_,buildUrlPromise:d,onRenderPromise:w,getProxyContainerPromise:v,openFramePromise:g,openPrerenderFramePromise:x,renderContainerPromise:P,openPromise:W,openPrerenderPromise:S,setStatePromise:D,prerenderPromise:z,loadUrlPromise:L,buildWindowNamePromise:y,setWindowNamePromise:F,watchForClosePromise:$,onDisplayPromise:nn,openBridgePromise:en,runTimeoutPromise:tn,onRenderedPromise:on,delegatePromise:u,watchForUnloadPromise:f})})).catch((function(n){return l.all([Bn(n),Mn(n)]).then((function(){throw n}),(function(){throw n}))})).then(nn)},destroy:Mn,setProps:Xn,getHelpers:Vn,getDelegateOverrides:function(){return l.try((function(){return{getProxyContainer:an,show:fn,hide:dn,renderContainer:Zn,getProxyWindow:Q,watchForUnload:Un,openFrame:_n,openPrerenderFrame:En,prerender:Yn,open:qn,openPrerender:Pn,setProxyWin:cn}}))}}}var qe={register:function(n,e,r,t){var o=t.React,i=t.ReactDOM;return function(n){var e,t;function a(){return n.apply(this,arguments)||this}t=n,(e=a).prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t;var u=a.prototype;return u.render=function(){return o.createElement("div",null)},u.componentDidMount=function(){var n=i.findDOMNode(this),e=r(on({},this.props));e.render(n,Ae.IFRAME),this.setState({parent:e})},u.componentDidUpdate=function(){this.state&&this.state.parent&&this.state.parent.updateProps(on({},this.props)).catch(nn)},a}(o.Component)}},Ue={register:function(n,e,r,o){return o.component(n,{render:function(n){return n("div")},inheritAttrs:!1,mounted:function(){var n=this.$el;this.parent=r(t({},this.$attrs)),this.parent.render(n,Ae.IFRAME)},watch:{$attrs:{handler:function(){this.parent&&this.$attrs&&this.parent.updateProps(t({},this.$attrs)).catch(nn)},deep:!0}}})}},$e={register:function(n,e,r,t){return t.module(n,[]).directive(n.replace(/-([a-z])/g,(function(n){return n[1].toUpperCase()})),(function(){for(var n={},t=0,o=Object.keys(e);t<o.length;t++)n[o[t]]="=";return n.props="=",{scope:n,restrict:"E",controller:["$scope","$element",function(n,e){function t(){if("$apply"!==n.$root.$$phase&&"$digest"!==n.$root.$$phase)try{n.$apply()}catch(n){}}var o=function(){return ln(n.props,(function(n){return"function"==typeof n?function(){var e=n.apply(this,arguments);return t(),e}:n}))},i=r(o());i.render(e[0],Ae.IFRAME),n.$watch((function(){i.updateProps(o()).catch(nn)}))}]}}))}},Be={register:function(n,e,r,o){var i=o.NgModule,a=o.ElementRef,u=o.NgZone,c=function(n){return ln(t({},n.internalProps,n.props),(function(e){return"function"==typeof e?function(){var r=arguments,t=this;return n.zone.run((function(){return e.apply(t,r)}))}:e}))},s=(0,o.Component)({selector:n,template:"<div></div>",inputs:["props"]}).Class({constructor:[a,u,function(n,e){this._props={},this.elementRef=n,this.zone=e}],ngOnInit:function(){var n=this.elementRef.nativeElement;this.parent=r(c(this)),this.parent.render(n,Ae.IFRAME)},ngDoCheck:function(){this.parent&&!function(n,e){var r={};for(var t in n)if(n.hasOwnProperty(t)&&(r[t]=!0,n[t]!==e[t]))return!1;for(var o in e)if(!r[o])return!1;return!0}(this._props,this.props)&&(this._props=t({},this.props),this.parent.updateProps(c(this)))}});return i({declarations:[s],exports:[s]}).Class({constructor:function(){}})}};function Je(n){var e=n.uid,r=n.frame,t=n.prerenderFrame,o=n.doc,i=n.props,a=n.event,u=n.dimensions,c=u.width,s=u.height;if(r&&t){var f=o.createElement("div");f.setAttribute("id",e);var d=o.createElement("style");return i.cspNonce&&d.setAttribute("nonce",i.cspNonce),d.appendChild(o.createTextNode("\n #"+e+" {\n display: inline-block;\n position: relative;\n width: "+c+";\n height: "+s+";\n }\n\n #"+e+" > iframe {\n display: inline-block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transition: opacity .2s ease-in-out;\n }\n\n #"+e+" > iframe.zoid-invisible {\n opacity: 0;\n }\n\n #"+e+" > iframe.zoid-visible {\n opacity: 1;\n }\n ")),f.appendChild(r),f.appendChild(t),f.appendChild(d),t.classList.add("zoid-visible"),r.classList.add("zoid-invisible"),a.on(Re.RENDERED,(function(){t.classList.remove("zoid-visible"),t.classList.add("zoid-invisible"),r.classList.remove("zoid-invisible"),r.classList.add("zoid-visible"),setTimeout((function(){kn(t)}),1)})),a.on(Re.RESIZE,(function(n){var e=n.width,r=n.height;"number"==typeof e&&(f.style.width=Fn(e)),"number"==typeof r&&(f.style.height=Fn(r))})),f}}function He(n){var e=n.doc,r=n.props,t=e.createElement("html"),o=e.createElement("body"),i=e.createElement("style"),a=e.createElement("div");return a.classList.add("spinner"),r.cspNonce&&i.setAttribute("nonce",r.cspNonce),t.appendChild(o),o.appendChild(a),o.appendChild(i),i.appendChild(e.createTextNode("\n html, body {\n width: 100%;\n height: 100%;\n }\n\n .spinner {\n position: fixed;\n max-height: 60vmin;\n max-width: 60vmin;\n height: 40px;\n width: 40px;\n top: 50%;\n left: 50%;\n box-sizing: border-box;\n border: 3px solid rgba(0, 0, 0, .2);\n border-top-color: rgba(33, 128, 192, 0.8);\n border-radius: 100%;\n animation: rotation .7s infinite linear;\n }\n\n @keyframes rotation {\n from {\n transform: translateX(-50%) translateY(-50%) rotate(0deg);\n }\n to {\n transform: translateX(-50%) translateY(-50%) rotate(359deg);\n }\n }\n ")),t}var Ye=function(){return nn},Ze=function(n){return en(n.value)},Ve=vn();function Xe(n){var e=function(n){var e=n.tag,r=n.url,o=n.domain,i=n.bridgeUrl,a=n.props,u=void 0===a?{}:a,c=n.dimensions,s=void 0===c?{}:c,f=n.autoResize,d=void 0===f?{}:f,l=n.allowedParentDomains,h=void 0===l?"*":l,p=n.attributes,w=void 0===p?{}:p,v=n.defaultContext,m=void 0===v?Ae.IFRAME:v,y=n.containerTemplate,g=void 0===y?Je:y,_=n.prerenderTemplate,E=void 0===_?He:_,x=n.validate,P=n.eligible,O=void 0===P?function(){return{eligible:!0}}:P,W=n.logger,C=void 0===W?{info:nn}:W,j=e.replace(/-/g,"_"),S=s.width,D=void 0===S?"300px":S,R=s.height,k=void 0===R?"150px":R;if(u=t({},{window:{type:"object",sendToChild:!1,required:!1,allowDelegate:!0,validate:function(n){var e=n.value;if(!M(e)&&!ue.isProxyWindow(e))throw new Error("Expected Window or ProxyWindow");if(M(e)){if(A(e))throw new Error("Window is closed");if(!b(e))throw new Error("Window is not same domain")}},decorate:function(n){return We(n.value)}},timeout:{type:"number",required:!1,sendToChild:!1},close:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.close}},focus:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.focus}},resize:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.resize}},cspNonce:{type:"string",required:!1},getParent:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.getParent}},getParentDomain:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.getParentDomain}},show:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.show}},hide:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.hide}},onDisplay:{type:"function",required:!1,sendToChild:!1,allowDelegate:!0,default:Ye,decorate:Ze},onRendered:{type:"function",required:!1,sendToChild:!1,default:Ye,decorate:Ze},onRender:{type:"function",required:!1,sendToChild:!1,default:Ye,decorate:Ze},onClose:{type:"function",required:!1,sendToChild:!1,allowDelegate:!0,default:Ye,decorate:Ze},onDestroy:{type:"function",required:!1,sendToChild:!1,allowDelegate:!0,default:Ye,decorate:Ze},onResize:{type:"function",required:!1,sendToChild:!1,allowDelegate:!0,default:Ye},onFocus:{type:"function",required:!1,sendToChild:!1,allowDelegate:!0,default:Ye},onError:{type:"function",required:!1,sendToChild:!1,childDecorate:function(n){return n.onError}},onProps:{type:"function",required:!1,sendToChild:!1,default:Ye,childDecorate:function(n){return n.onProps}}},u),!g)throw new Error("Container template required");return{name:j,tag:e,url:r,domain:o,bridgeUrl:i,propsDef:u,dimensions:{width:D,height:k},autoResize:d,allowedParentDomains:h,attributes:w,defaultContext:m,containerTemplate:g,prerenderTemplate:E,validate:x,logger:C,eligible:O}}(n),r=e.name,o=e.tag,i=e.defaultContext,a=e.propsDef,u=e.eligible,c=Ce(),s={},f=[],d=function(){var n=Ne();return Boolean(n&&n.tag===o&&n.childDomain===E())},h=G((function(){if(d()){if(window.xprops)throw delete c.components[o],new Error("Can not register "+r+" as child - child already registered");var n=function(n){var e,r=n.propsDef,t=n.autoResize,o=n.allowedParentDomains,i=[],a=Ne();if(!a)throw new Error("No child payload found");if("9_0_51"!==a.version)throw new Error("Parent window has zoid version "+a.version+", child window has version 9_0_51");var u=a.parentDomain,c=a.exports,s=a.context,f=a.props,d=function(n){var e,r,t=n.type;if("opener"===t)return mn("opener",y(window));if("parent"===t&&"number"==typeof n.distance)return mn("parent",(e=window,void 0===(r=n.distance)&&(r=1),function(n,e){void 0===e&&(e=1);for(var r=n,t=0;t<e;t++){if(!r)return;r=m(r)}return r}(e,z(e)-r)));if("global"===t&&n.uid&&"string"==typeof n.uid){var o=n.uid,i=R(window);if(!i)throw new Error("Can not find ancestor window");for(var a=0,u=j(i);a<u.length;a++){var c=u[a];if(b(c)){var s=Ce(c);if(s&&s.windows&&s.windows[o])return s.windows[o]}}}throw new Error("Unable to find "+t+" parent component window")}(a.parent),h=Oe(d,u,c),p=h.show,w=h.hide,v=h.close,g=function(){return d},_=function(){return u},x=function(n){i.push(n)},P=function(n){return l.try((function(){if(h&&h.onError)return h.onError(n);throw n}))},O=function(n){return h.resize.fireAndForget({width:n.width,height:n.height})},W=function(n,t,o){void 0===o&&(o=!1);var a=function(n,e,r,t,o,i){void 0===i&&(i=!1);for(var a={},u=0,c=Object.keys(r);u<c.length;u++){var s=c[u],f=e[s];if(!f||!f.sameDomain||t===E(window)&&b(n)){var d=ke(e,0,s,r[s],o);a[s]=d,f&&f.alias&&!a[f.alias]&&(a[f.alias]=d)}}if(!i)for(var l=0,h=Object.keys(e);l<h.length;l++){var p=h[l];r.hasOwnProperty(p)||(a[p]=ke(e,0,p,void 0,o))}return a}(d,r,n,t,{show:p,hide:w,close:v,focus:Te,onError:P,resize:O,onProps:x,getParent:g,getParentDomain:_},o);e?on(e,a):e=a;for(var u=0;u<i.length;u++)(0,i[u])(e)},C=function(n){return l.try((function(){return W(n,u,!0)}))};return{init:function(){return l.try((function(){return function(n,e){if(!T(n,e))throw new Error("Can not be rendered by domain: "+e)}(o,u),Xn(d),window.addEventListener("beforeunload",(function(){h.checkClose.fireAndForget()})),window.addEventListener("unload",(function(){h.checkClose.fireAndForget()})),F(d,(function(){Ie()})),h.init({updateProps:C,close:Ie})})).then((function(){return _n().then((function(){if(document.body)return document.body;throw new Error("Document ready but document.body not present")})).then((function(){var n=function(){var n=t.width,e=t.height,r=t.element,o=void 0===r?"body":r;return{width:void 0!==n&&n,height:void 0!==e&&e,element:o=On(o)}}(),e=n.width,r=n.height,o=n.element;o&&(e||r)&&s!==Ae.POPUP&&Nn(o,(function(n){O({width:e?n.width:void 0,height:r?n.height:void 0})}),{width:e,height:r})}))})).catch((function(n){P(n)}))},getProps:function(){return e||(W(function(n,e,r){var t,o=r.type,i=r.uid;if("raw"===o)t=r.value;else if("uid"===o){if(!b(n))throw new Error("Parent component window is on a different domain - expected "+E()+" - can not retrieve props");var a=Ce(n);t=mn("props",a&&a.props[i])}if(!t)throw new Error("Could not find props");return Oe(n,e,t)}(d,u,f),u),e)}}}(e);return n.init(),n}})),p=function n(o){var a,c=u({props:o=o||{}}),s=c.eligible,d=c.reason,h=o.onDestroy;o.onDestroy=function(){if(a&&s&&f.splice(f.indexOf(a),1),h)return h.apply(void 0,arguments)};var p=Le(e);p.init(),s?p.setProps(o):o.onDestroy&&o.onDestroy(),Ve.register((function(){p.destroy(new Error("zoid destroyed all components"))}));var w=function(n,e,t){return l.try((function(){if(!s)return p.destroy().then((function(){throw new Error(d||r+" component is not eligible")}));if(!M(n))throw new Error("Must pass window to renderTo");return function(n,e){return l.try((function(){if(n.window)return We(n.window).getType();if(e){if(e!==Ae.IFRAME&&e!==Ae.POPUP)throw new Error("Unrecognized context: "+e);return e}return i}))}(o,t)})).then((function(r){return e=function(n,e){if(e){if("string"!=typeof e&&!Pn(e))throw new TypeError("Expected string or element selector to be passed");return e}if(n===Ae.POPUP)return"body";throw new Error("Expected element to be passed to render iframe")}(r,e),p.render(n,e,r)})).catch((function(n){return p.destroy(n).then((function(){throw n}))}))};return a=t({},p.getHelpers(),{isEligible:function(){return s},clone:function(e){var r=(void 0===e?{}:e).decorate;return n((void 0===r?an:r)(o))},render:function(n,e){return w(window,n,e)},renderTo:function(n,e,r){return w(n,e,r)}}),s&&f.push(a),a};if(h(),be("zoid_allow_delegate_"+r,(function(){return!0})),be("zoid_delegate_"+r,(function(n){return{parent:Le(e,n.data.overrides,n.source)}})),c.components=c.components||{},c.components[o])throw new Error("Can not register multiple components with the same tag: "+o);return c.components[o]=!0,{init:p,instances:f,driver:function(n,e){var r={react:qe,angular:$e,vue:Ue,angular2:Be};if(!r[n])throw new Error("Could not find driver for framework: "+n);return s[n]||(s[n]=r[n].register(o,a,p,e)),s[n]},isChild:d,canRenderTo:function(n){return xe(n,"zoid_allow_delegate_"+r).then((function(n){return n.data})).catch((function(){return!1}))},registerChild:h}}function Ge(n){var e,r,t,o;Mn().initialized||(Mn().initialized=!0,r=(e={on:be,send:xe}).on,t=e.send,(o=Mn()).receiveMessage=o.receiveMessage||function(n){return Ee(n,{on:r,send:t})},function(n){var e=n.on,r=n.send;qn().getOrSet("postMessageListener",(function(){return Dn(window,"message",(function(n){!function(n,e){var r=e.on,t=e.send,o=n.source||n.sourceElement,i=n.origin||n.originalEvent&&n.originalEvent.origin,a=n.data;if("null"===i&&(i="file://"),o){if(!i)throw new Error("Post message did not have origin domain");Ee({source:o,origin:i,data:a},{on:r,send:t})}}(n,{on:e,send:r})}))}))}({on:be,send:xe}),function(n){var e=n.on,r=n.send;qn("builtinListeners").getOrSet("helloListener",(function(){var n=e("postrobot_hello",{domain:"*"},(function(n){return Yn(n.source,{domain:n.origin}),{instanceID:Hn()}})),t=R();return t&&Zn(t,{send:r}).catch(nn),n}))}({on:be,send:xe}));var i=Xe(n),a=function(n){return i.init(n)};a.driver=function(n,e){return i.driver(n,e)},a.isChild=function(){return i.isChild()},a.canRenderTo=function(n){return i.canRenderTo(n)},a.instances=i.instances;var u=i.registerChild();return u&&(window.xprops=a.xprops=u.getProps()),a}function Ke(){var n=Ve.all();return Ve=vn(),n}var Qe=Ke;function nr(){var n;Ke(),delete window.__zoid_9_0_51__,function(){for(var n=qn("responseListeners"),e=0,r=n.keys();e<r.length;e++){var t=r[e],o=n.get(t);o&&(o.cancelled=!0),n.del(t)}}(),(n=qn().get("postMessageListener"))&&n.cancel(),delete window.__post_robot_10_0_38__}}])}));
//# sourceMappingURL=zoid.frameworks.frame.min.js.map |
public/components/ui_code_editor/index.js | sirensolutions/sentinl | import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { uiModules } from 'ui/modules';
import UiCodeEditor from './ui_code_editor';
const module = uiModules.get('apps/sentinl');
module.directive('uiCodeEditor', function () {
return {
restrict: 'E',
scope: {
value: '=',
mode: '@',
maxLines: '=',
minLines: '=',
isReadOnly: '=',
debounce: '=',
onValueChange: '&'
},
controller: function ($scope, $element, $timeout) {
function renderComponent() {
render(
<UiCodeEditor
value={$scope.value}
mode={$scope.mode}
maxLines={$scope.maxLines}
minLines={$scope.minLines}
isReadOnly={$scope.isReadOnly}
debounce={$scope.debounce}
onValueChange={(value) => {
$scope.onValueChange({ value });
}}
></UiCodeEditor>,
$element[0]
);
};
renderComponent();
$scope.$watch('value', () => {
renderComponent();
});
$scope.$on('$destroy', () => unmountComponentAtNode($element[0]));
}
};
});
|
ajax/libs/cyclejs-dom/3.1.1/cycle-dom.js | extend1994/cdnjs | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.CycleDOM = f()}})(function(){var define,module,exports;return (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){
'use strict';
var Rx = require('rx');
function makeRequestProxies(drivers) {
var requestProxies = {};
for (var _name in drivers) {
if (drivers.hasOwnProperty(_name)) {
requestProxies[_name] = new Rx.ReplaySubject(1);
}
}
return requestProxies;
}
function callDrivers(drivers, requestProxies) {
var responses = {};
for (var _name2 in drivers) {
if (drivers.hasOwnProperty(_name2)) {
responses[_name2] = drivers[_name2](requestProxies[_name2], _name2);
}
}
return responses;
}
function makeDispose(requestProxies, rawResponses) {
return function dispose() {
for (var x in requestProxies) {
if (requestProxies.hasOwnProperty(x)) {
requestProxies[x].dispose();
}
}
for (var _name3 in rawResponses) {
if (rawResponses.hasOwnProperty(_name3) && typeof rawResponses[_name3].dispose === 'function') {
rawResponses[_name3].dispose();
}
}
};
}
function makeAppInput(requestProxies, rawResponses) {
Object.defineProperty(rawResponses, 'dispose', {
enumerable: false,
value: makeDispose(requestProxies, rawResponses)
});
return rawResponses;
}
function replicateMany(original, imitators) {
for (var _name4 in original) {
if (original.hasOwnProperty(_name4)) {
if (imitators.hasOwnProperty(_name4) && !imitators[_name4].isDisposed) {
original[_name4].subscribe(imitators[_name4].asObserver());
}
}
}
}
function isObjectEmpty(obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return false;
}
}
return true;
}
function run(main, drivers) {
if (typeof main !== 'function') {
throw new Error('First argument given to Cycle.run() must be the `main` ' + 'function.');
}
if (typeof drivers !== 'object' || drivers === null) {
throw new Error('Second argument given to Cycle.run() must be an object ' + 'with driver functions as properties.');
}
if (isObjectEmpty(drivers)) {
throw new Error('Second argument given to Cycle.run() must be an object ' + 'with at least one driver function declared as a property.');
}
var requestProxies = makeRequestProxies(drivers);
var rawResponses = callDrivers(drivers, requestProxies);
var responses = makeAppInput(requestProxies, rawResponses);
var requests = main(responses);
setTimeout(function () {
return replicateMany(requests, requestProxies);
}, 1);
return [requests, responses];
}
var Cycle = {
/**
* Takes an `main` function and circularly connects it to the given collection
* of driver functions.
*
* The `main` function expects a collection of "driver response" Observables
* as input, and should return a collection of "driver request" Observables.
* A "collection of Observables" is a JavaScript object where
* keys match the driver names registered by the `drivers` object, and values
* are Observables or a collection of Observables.
*
* @param {Function} main a function that takes `responses` as input
* and outputs a collection of `requests` Observables.
* @param {Object} drivers an object where keys are driver names and values
* are driver functions.
* @return {Array} an array where the first object is the collection of driver
* requests, and the second object is the collection of driver responses, that
* can be used for debugging or testing.
* @function run
*/
run: run,
/**
* A shortcut to the root object of
* [RxJS](https://github.com/Reactive-Extensions/RxJS).
* @name Rx
*/
Rx: Rx
};
module.exports = Cycle;
},{"rx":59}],2:[function(require,module,exports){
},{}],3:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
currentQueue[queueIndex].run();
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
clearTimeout(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) {
setTimeout(drainQueue, 0);
}
};
// 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');
};
// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
},{}],4:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')() ? Map : require('./polyfill');
},{"./is-implemented":5,"./polyfill":58}],5:[function(require,module,exports){
'use strict';
module.exports = function () {
var map, iterator, result;
if (typeof Map !== 'function') return false;
try {
// WebKit doesn't support arguments and crashes
map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]);
} catch (e) {
return false;
}
if (map.size !== 3) return false;
if (typeof map.clear !== 'function') return false;
if (typeof map.delete !== 'function') return false;
if (typeof map.entries !== 'function') return false;
if (typeof map.forEach !== 'function') return false;
if (typeof map.get !== 'function') return false;
if (typeof map.has !== 'function') return false;
if (typeof map.keys !== 'function') return false;
if (typeof map.set !== 'function') return false;
if (typeof map.values !== 'function') return false;
iterator = map.entries();
result = iterator.next();
if (result.done !== false) return false;
if (!result.value) return false;
if (result.value[0] !== 'raz') return false;
if (result.value[1] !== 'one') return false;
return true;
};
},{}],6:[function(require,module,exports){
// Exports true if environment provides native `Map` implementation,
// whatever that is.
'use strict';
module.exports = (function () {
if (typeof Map === 'undefined') return false;
return (Object.prototype.toString.call(Map.prototype) === '[object Map]');
}());
},{}],7:[function(require,module,exports){
'use strict';
module.exports = require('es5-ext/object/primitive-set')('key',
'value', 'key+value');
},{"es5-ext/object/primitive-set":32}],8:[function(require,module,exports){
'use strict';
var setPrototypeOf = require('es5-ext/object/set-prototype-of')
, d = require('d')
, Iterator = require('es6-iterator')
, toStringTagSymbol = require('es6-symbol').toStringTag
, kinds = require('./iterator-kinds')
, defineProperties = Object.defineProperties
, unBind = Iterator.prototype._unBind
, MapIterator;
MapIterator = module.exports = function (map, kind) {
if (!(this instanceof MapIterator)) return new MapIterator(map, kind);
Iterator.call(this, map.__mapKeysData__, map);
if (!kind || !kinds[kind]) kind = 'key+value';
defineProperties(this, {
__kind__: d('', kind),
__values__: d('w', map.__mapValuesData__)
});
};
if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator);
MapIterator.prototype = Object.create(Iterator.prototype, {
constructor: d(MapIterator),
_resolve: d(function (i) {
if (this.__kind__ === 'value') return this.__values__[i];
if (this.__kind__ === 'key') return this.__list__[i];
return [this.__list__[i], this.__values__[i]];
}),
_unBind: d(function () {
this.__values__ = null;
unBind.call(this);
}),
toString: d(function () { return '[object Map Iterator]'; })
});
Object.defineProperty(MapIterator.prototype, toStringTagSymbol,
d('c', 'Map Iterator'));
},{"./iterator-kinds":7,"d":10,"es5-ext/object/set-prototype-of":33,"es6-iterator":45,"es6-symbol":54}],9:[function(require,module,exports){
'use strict';
var copy = require('es5-ext/object/copy')
, map = require('es5-ext/object/map')
, callable = require('es5-ext/object/valid-callable')
, validValue = require('es5-ext/object/valid-value')
, bind = Function.prototype.bind, defineProperty = Object.defineProperty
, hasOwnProperty = Object.prototype.hasOwnProperty
, define;
define = function (name, desc, bindTo) {
var value = validValue(desc) && callable(desc.value), dgs;
dgs = copy(desc);
delete dgs.writable;
delete dgs.value;
dgs.get = function () {
if (hasOwnProperty.call(this, name)) return value;
desc.value = bind.call(value, (bindTo == null) ? this : this[bindTo]);
defineProperty(this, name, desc);
return this[name];
};
return dgs;
};
module.exports = function (props/*, bindTo*/) {
var bindTo = arguments[1];
return map(props, function (desc, name) {
return define(name, desc, bindTo);
});
};
},{"es5-ext/object/copy":22,"es5-ext/object/map":30,"es5-ext/object/valid-callable":36,"es5-ext/object/valid-value":37}],10:[function(require,module,exports){
'use strict';
var assign = require('es5-ext/object/assign')
, normalizeOpts = require('es5-ext/object/normalize-options')
, isCallable = require('es5-ext/object/is-callable')
, contains = require('es5-ext/string/#/contains')
, d;
d = module.exports = function (dscr, value/*, options*/) {
var c, e, w, options, desc;
if ((arguments.length < 2) || (typeof dscr !== 'string')) {
options = value;
value = dscr;
dscr = null;
} else {
options = arguments[2];
}
if (dscr == null) {
c = w = true;
e = false;
} else {
c = contains.call(dscr, 'c');
e = contains.call(dscr, 'e');
w = contains.call(dscr, 'w');
}
desc = { value: value, configurable: c, enumerable: e, writable: w };
return !options ? desc : assign(normalizeOpts(options), desc);
};
d.gs = function (dscr, get, set/*, options*/) {
var c, e, options, desc;
if (typeof dscr !== 'string') {
options = set;
set = get;
get = dscr;
dscr = null;
} else {
options = arguments[3];
}
if (get == null) {
get = undefined;
} else if (!isCallable(get)) {
options = get;
get = set = undefined;
} else if (set == null) {
set = undefined;
} else if (!isCallable(set)) {
options = set;
set = undefined;
}
if (dscr == null) {
c = true;
e = false;
} else {
c = contains.call(dscr, 'c');
e = contains.call(dscr, 'e');
}
desc = { get: get, set: set, configurable: c, enumerable: e };
return !options ? desc : assign(normalizeOpts(options), desc);
};
},{"es5-ext/object/assign":19,"es5-ext/object/is-callable":25,"es5-ext/object/normalize-options":31,"es5-ext/string/#/contains":38}],11:[function(require,module,exports){
// Inspired by Google Closure:
// http://closure-library.googlecode.com/svn/docs/
// closure_goog_array_array.js.html#goog.array.clear
'use strict';
var value = require('../../object/valid-value');
module.exports = function () {
value(this).length = 0;
return this;
};
},{"../../object/valid-value":37}],12:[function(require,module,exports){
'use strict';
var toPosInt = require('../../number/to-pos-integer')
, value = require('../../object/valid-value')
, indexOf = Array.prototype.indexOf
, hasOwnProperty = Object.prototype.hasOwnProperty
, abs = Math.abs, floor = Math.floor;
module.exports = function (searchElement/*, fromIndex*/) {
var i, l, fromIndex, val;
if (searchElement === searchElement) { //jslint: ignore
return indexOf.apply(this, arguments);
}
l = toPosInt(value(this).length);
fromIndex = arguments[1];
if (isNaN(fromIndex)) fromIndex = 0;
else if (fromIndex >= 0) fromIndex = floor(fromIndex);
else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
for (i = fromIndex; i < l; ++i) {
if (hasOwnProperty.call(this, i)) {
val = this[i];
if (val !== val) return i; //jslint: ignore
}
}
return -1;
};
},{"../../number/to-pos-integer":17,"../../object/valid-value":37}],13:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')()
? Math.sign
: require('./shim');
},{"./is-implemented":14,"./shim":15}],14:[function(require,module,exports){
'use strict';
module.exports = function () {
var sign = Math.sign;
if (typeof sign !== 'function') return false;
return ((sign(10) === 1) && (sign(-20) === -1));
};
},{}],15:[function(require,module,exports){
'use strict';
module.exports = function (value) {
value = Number(value);
if (isNaN(value) || (value === 0)) return value;
return (value > 0) ? 1 : -1;
};
},{}],16:[function(require,module,exports){
'use strict';
var sign = require('../math/sign')
, abs = Math.abs, floor = Math.floor;
module.exports = function (value) {
if (isNaN(value)) return 0;
value = Number(value);
if ((value === 0) || !isFinite(value)) return value;
return sign(value) * floor(abs(value));
};
},{"../math/sign":13}],17:[function(require,module,exports){
'use strict';
var toInteger = require('./to-integer')
, max = Math.max;
module.exports = function (value) { return max(0, toInteger(value)); };
},{"./to-integer":16}],18:[function(require,module,exports){
// Internal method, used by iteration functions.
// Calls a function for each key-value pair found in object
// Optionally takes compareFn to iterate object in specific order
'use strict';
var isCallable = require('./is-callable')
, callable = require('./valid-callable')
, value = require('./valid-value')
, call = Function.prototype.call, keys = Object.keys
, propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = function (method, defVal) {
return function (obj, cb/*, thisArg, compareFn*/) {
var list, thisArg = arguments[2], compareFn = arguments[3];
obj = Object(value(obj));
callable(cb);
list = keys(obj);
if (compareFn) {
list.sort(isCallable(compareFn) ? compareFn.bind(obj) : undefined);
}
return list[method](function (key, index) {
if (!propertyIsEnumerable.call(obj, key)) return defVal;
return call.call(cb, thisArg, obj[key], key, obj, index);
});
};
};
},{"./is-callable":25,"./valid-callable":36,"./valid-value":37}],19:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')()
? Object.assign
: require('./shim');
},{"./is-implemented":20,"./shim":21}],20:[function(require,module,exports){
'use strict';
module.exports = function () {
var assign = Object.assign, obj;
if (typeof assign !== 'function') return false;
obj = { foo: 'raz' };
assign(obj, { bar: 'dwa' }, { trzy: 'trzy' });
return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy';
};
},{}],21:[function(require,module,exports){
'use strict';
var keys = require('../keys')
, value = require('../valid-value')
, max = Math.max;
module.exports = function (dest, src/*, …srcn*/) {
var error, i, l = max(arguments.length, 2), assign;
dest = Object(value(dest));
assign = function (key) {
try { dest[key] = src[key]; } catch (e) {
if (!error) error = e;
}
};
for (i = 1; i < l; ++i) {
src = arguments[i];
keys(src).forEach(assign);
}
if (error !== undefined) throw error;
return dest;
};
},{"../keys":27,"../valid-value":37}],22:[function(require,module,exports){
'use strict';
var assign = require('./assign')
, value = require('./valid-value');
module.exports = function (obj) {
var copy = Object(value(obj));
if (copy !== obj) return copy;
return assign({}, obj);
};
},{"./assign":19,"./valid-value":37}],23:[function(require,module,exports){
// Workaround for http://code.google.com/p/v8/issues/detail?id=2804
'use strict';
var create = Object.create, shim;
if (!require('./set-prototype-of/is-implemented')()) {
shim = require('./set-prototype-of/shim');
}
module.exports = (function () {
var nullObject, props, desc;
if (!shim) return create;
if (shim.level !== 1) return create;
nullObject = {};
props = {};
desc = { configurable: false, enumerable: false, writable: true,
value: undefined };
Object.getOwnPropertyNames(Object.prototype).forEach(function (name) {
if (name === '__proto__') {
props[name] = { configurable: true, enumerable: false, writable: true,
value: undefined };
return;
}
props[name] = desc;
});
Object.defineProperties(nullObject, props);
Object.defineProperty(shim, 'nullPolyfill', { configurable: false,
enumerable: false, writable: false, value: nullObject });
return function (prototype, props) {
return create((prototype === null) ? nullObject : prototype, props);
};
}());
},{"./set-prototype-of/is-implemented":34,"./set-prototype-of/shim":35}],24:[function(require,module,exports){
'use strict';
module.exports = require('./_iterate')('forEach');
},{"./_iterate":18}],25:[function(require,module,exports){
// Deprecated
'use strict';
module.exports = function (obj) { return typeof obj === 'function'; };
},{}],26:[function(require,module,exports){
'use strict';
var map = { function: true, object: true };
module.exports = function (x) {
return ((x != null) && map[typeof x]) || false;
};
},{}],27:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')()
? Object.keys
: require('./shim');
},{"./is-implemented":28,"./shim":29}],28:[function(require,module,exports){
'use strict';
module.exports = function () {
try {
Object.keys('primitive');
return true;
} catch (e) { return false; }
};
},{}],29:[function(require,module,exports){
'use strict';
var keys = Object.keys;
module.exports = function (object) {
return keys(object == null ? object : Object(object));
};
},{}],30:[function(require,module,exports){
'use strict';
var callable = require('./valid-callable')
, forEach = require('./for-each')
, call = Function.prototype.call;
module.exports = function (obj, cb/*, thisArg*/) {
var o = {}, thisArg = arguments[2];
callable(cb);
forEach(obj, function (value, key, obj, index) {
o[key] = call.call(cb, thisArg, value, key, obj, index);
});
return o;
};
},{"./for-each":24,"./valid-callable":36}],31:[function(require,module,exports){
'use strict';
var forEach = Array.prototype.forEach, create = Object.create;
var process = function (src, obj) {
var key;
for (key in src) obj[key] = src[key];
};
module.exports = function (options/*, …options*/) {
var result = create(null);
forEach.call(arguments, function (options) {
if (options == null) return;
process(Object(options), result);
});
return result;
};
},{}],32:[function(require,module,exports){
'use strict';
var forEach = Array.prototype.forEach, create = Object.create;
module.exports = function (arg/*, …args*/) {
var set = create(null);
forEach.call(arguments, function (name) { set[name] = true; });
return set;
};
},{}],33:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')()
? Object.setPrototypeOf
: require('./shim');
},{"./is-implemented":34,"./shim":35}],34:[function(require,module,exports){
'use strict';
var create = Object.create, getPrototypeOf = Object.getPrototypeOf
, x = {};
module.exports = function (/*customCreate*/) {
var setPrototypeOf = Object.setPrototypeOf
, customCreate = arguments[0] || create;
if (typeof setPrototypeOf !== 'function') return false;
return getPrototypeOf(setPrototypeOf(customCreate(null), x)) === x;
};
},{}],35:[function(require,module,exports){
// Big thanks to @WebReflection for sorting this out
// https://gist.github.com/WebReflection/5593554
'use strict';
var isObject = require('../is-object')
, value = require('../valid-value')
, isPrototypeOf = Object.prototype.isPrototypeOf
, defineProperty = Object.defineProperty
, nullDesc = { configurable: true, enumerable: false, writable: true,
value: undefined }
, validate;
validate = function (obj, prototype) {
value(obj);
if ((prototype === null) || isObject(prototype)) return obj;
throw new TypeError('Prototype must be null or an object');
};
module.exports = (function (status) {
var fn, set;
if (!status) return null;
if (status.level === 2) {
if (status.set) {
set = status.set;
fn = function (obj, prototype) {
set.call(validate(obj, prototype), prototype);
return obj;
};
} else {
fn = function (obj, prototype) {
validate(obj, prototype).__proto__ = prototype;
return obj;
};
}
} else {
fn = function self(obj, prototype) {
var isNullBase;
validate(obj, prototype);
isNullBase = isPrototypeOf.call(self.nullPolyfill, obj);
if (isNullBase) delete self.nullPolyfill.__proto__;
if (prototype === null) prototype = self.nullPolyfill;
obj.__proto__ = prototype;
if (isNullBase) defineProperty(self.nullPolyfill, '__proto__', nullDesc);
return obj;
};
}
return Object.defineProperty(fn, 'level', { configurable: false,
enumerable: false, writable: false, value: status.level });
}((function () {
var x = Object.create(null), y = {}, set
, desc = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__');
if (desc) {
try {
set = desc.set; // Opera crashes at this point
set.call(x, y);
} catch (ignore) { }
if (Object.getPrototypeOf(x) === y) return { set: set, level: 2 };
}
x.__proto__ = y;
if (Object.getPrototypeOf(x) === y) return { level: 2 };
x = {};
x.__proto__ = y;
if (Object.getPrototypeOf(x) === y) return { level: 1 };
return false;
}())));
require('../create');
},{"../create":23,"../is-object":26,"../valid-value":37}],36:[function(require,module,exports){
'use strict';
module.exports = function (fn) {
if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");
return fn;
};
},{}],37:[function(require,module,exports){
'use strict';
module.exports = function (value) {
if (value == null) throw new TypeError("Cannot use null or undefined");
return value;
};
},{}],38:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')()
? String.prototype.contains
: require('./shim');
},{"./is-implemented":39,"./shim":40}],39:[function(require,module,exports){
'use strict';
var str = 'razdwatrzy';
module.exports = function () {
if (typeof str.contains !== 'function') return false;
return ((str.contains('dwa') === true) && (str.contains('foo') === false));
};
},{}],40:[function(require,module,exports){
'use strict';
var indexOf = String.prototype.indexOf;
module.exports = function (searchString/*, position*/) {
return indexOf.call(this, searchString, arguments[1]) > -1;
};
},{}],41:[function(require,module,exports){
'use strict';
var toString = Object.prototype.toString
, id = toString.call('');
module.exports = function (x) {
return (typeof x === 'string') || (x && (typeof x === 'object') &&
((x instanceof String) || (toString.call(x) === id))) || false;
};
},{}],42:[function(require,module,exports){
'use strict';
var setPrototypeOf = require('es5-ext/object/set-prototype-of')
, contains = require('es5-ext/string/#/contains')
, d = require('d')
, Iterator = require('./')
, defineProperty = Object.defineProperty
, ArrayIterator;
ArrayIterator = module.exports = function (arr, kind) {
if (!(this instanceof ArrayIterator)) return new ArrayIterator(arr, kind);
Iterator.call(this, arr);
if (!kind) kind = 'value';
else if (contains.call(kind, 'key+value')) kind = 'key+value';
else if (contains.call(kind, 'key')) kind = 'key';
else kind = 'value';
defineProperty(this, '__kind__', d('', kind));
};
if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator);
ArrayIterator.prototype = Object.create(Iterator.prototype, {
constructor: d(ArrayIterator),
_resolve: d(function (i) {
if (this.__kind__ === 'value') return this.__list__[i];
if (this.__kind__ === 'key+value') return [i, this.__list__[i]];
return i;
}),
toString: d(function () { return '[object Array Iterator]'; })
});
},{"./":45,"d":10,"es5-ext/object/set-prototype-of":33,"es5-ext/string/#/contains":38}],43:[function(require,module,exports){
'use strict';
var callable = require('es5-ext/object/valid-callable')
, isString = require('es5-ext/string/is-string')
, get = require('./get')
, isArray = Array.isArray, call = Function.prototype.call;
module.exports = function (iterable, cb/*, thisArg*/) {
var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code;
if (isArray(iterable)) mode = 'array';
else if (isString(iterable)) mode = 'string';
else iterable = get(iterable);
callable(cb);
doBreak = function () { broken = true; };
if (mode === 'array') {
iterable.some(function (value) {
call.call(cb, thisArg, value, doBreak);
if (broken) return true;
});
return;
}
if (mode === 'string') {
l = iterable.length;
for (i = 0; i < l; ++i) {
char = iterable[i];
if ((i + 1) < l) {
code = char.charCodeAt(0);
if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i];
}
call.call(cb, thisArg, char, doBreak);
if (broken) break;
}
return;
}
result = iterable.next();
while (!result.done) {
call.call(cb, thisArg, result.value, doBreak);
if (broken) return;
result = iterable.next();
}
};
},{"./get":44,"es5-ext/object/valid-callable":36,"es5-ext/string/is-string":41}],44:[function(require,module,exports){
'use strict';
var isString = require('es5-ext/string/is-string')
, ArrayIterator = require('./array')
, StringIterator = require('./string')
, iterable = require('./valid-iterable')
, iteratorSymbol = require('es6-symbol').iterator;
module.exports = function (obj) {
if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();
if (isString(obj)) return new StringIterator(obj);
return new ArrayIterator(obj);
};
},{"./array":42,"./string":52,"./valid-iterable":53,"es5-ext/string/is-string":41,"es6-symbol":47}],45:[function(require,module,exports){
'use strict';
var clear = require('es5-ext/array/#/clear')
, assign = require('es5-ext/object/assign')
, callable = require('es5-ext/object/valid-callable')
, value = require('es5-ext/object/valid-value')
, d = require('d')
, autoBind = require('d/auto-bind')
, Symbol = require('es6-symbol')
, defineProperty = Object.defineProperty
, defineProperties = Object.defineProperties
, Iterator;
module.exports = Iterator = function (list, context) {
if (!(this instanceof Iterator)) return new Iterator(list, context);
defineProperties(this, {
__list__: d('w', value(list)),
__context__: d('w', context),
__nextIndex__: d('w', 0)
});
if (!context) return;
callable(context.on);
context.on('_add', this._onAdd);
context.on('_delete', this._onDelete);
context.on('_clear', this._onClear);
};
defineProperties(Iterator.prototype, assign({
constructor: d(Iterator),
_next: d(function () {
var i;
if (!this.__list__) return;
if (this.__redo__) {
i = this.__redo__.shift();
if (i !== undefined) return i;
}
if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++;
this._unBind();
}),
next: d(function () { return this._createResult(this._next()); }),
_createResult: d(function (i) {
if (i === undefined) return { done: true, value: undefined };
return { done: false, value: this._resolve(i) };
}),
_resolve: d(function (i) { return this.__list__[i]; }),
_unBind: d(function () {
this.__list__ = null;
delete this.__redo__;
if (!this.__context__) return;
this.__context__.off('_add', this._onAdd);
this.__context__.off('_delete', this._onDelete);
this.__context__.off('_clear', this._onClear);
this.__context__ = null;
}),
toString: d(function () { return '[object Iterator]'; })
}, autoBind({
_onAdd: d(function (index) {
if (index >= this.__nextIndex__) return;
++this.__nextIndex__;
if (!this.__redo__) {
defineProperty(this, '__redo__', d('c', [index]));
return;
}
this.__redo__.forEach(function (redo, i) {
if (redo >= index) this.__redo__[i] = ++redo;
}, this);
this.__redo__.push(index);
}),
_onDelete: d(function (index) {
var i;
if (index >= this.__nextIndex__) return;
--this.__nextIndex__;
if (!this.__redo__) return;
i = this.__redo__.indexOf(index);
if (i !== -1) this.__redo__.splice(i, 1);
this.__redo__.forEach(function (redo, i) {
if (redo > index) this.__redo__[i] = --redo;
}, this);
}),
_onClear: d(function () {
if (this.__redo__) clear.call(this.__redo__);
this.__nextIndex__ = 0;
})
})));
defineProperty(Iterator.prototype, Symbol.iterator, d(function () {
return this;
}));
defineProperty(Iterator.prototype, Symbol.toStringTag, d('', 'Iterator'));
},{"d":10,"d/auto-bind":9,"es5-ext/array/#/clear":11,"es5-ext/object/assign":19,"es5-ext/object/valid-callable":36,"es5-ext/object/valid-value":37,"es6-symbol":47}],46:[function(require,module,exports){
'use strict';
var isString = require('es5-ext/string/is-string')
, iteratorSymbol = require('es6-symbol').iterator
, isArray = Array.isArray;
module.exports = function (value) {
if (value == null) return false;
if (isArray(value)) return true;
if (isString(value)) return true;
return (typeof value[iteratorSymbol] === 'function');
};
},{"es5-ext/string/is-string":41,"es6-symbol":47}],47:[function(require,module,exports){
'use strict';
module.exports = require('./is-implemented')() ? Symbol : require('./polyfill');
},{"./is-implemented":48,"./polyfill":50}],48:[function(require,module,exports){
'use strict';
module.exports = function () {
var symbol;
if (typeof Symbol !== 'function') return false;
symbol = Symbol('test symbol');
try { String(symbol); } catch (e) { return false; }
if (typeof Symbol.iterator === 'symbol') return true;
// Return 'true' for polyfills
if (typeof Symbol.isConcatSpreadable !== 'object') return false;
if (typeof Symbol.iterator !== 'object') return false;
if (typeof Symbol.toPrimitive !== 'object') return false;
if (typeof Symbol.toStringTag !== 'object') return false;
if (typeof Symbol.unscopables !== 'object') return false;
return true;
};
},{}],49:[function(require,module,exports){
'use strict';
module.exports = function (x) {
return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false;
};
},{}],50:[function(require,module,exports){
'use strict';
var d = require('d')
, validateSymbol = require('./validate-symbol')
, create = Object.create, defineProperties = Object.defineProperties
, defineProperty = Object.defineProperty, objPrototype = Object.prototype
, Symbol, HiddenSymbol, globalSymbols = create(null);
var generateName = (function () {
var created = create(null);
return function (desc) {
var postfix = 0, name;
while (created[desc + (postfix || '')]) ++postfix;
desc += (postfix || '');
created[desc] = true;
name = '@@' + desc;
defineProperty(objPrototype, name, d.gs(null, function (value) {
defineProperty(this, name, d(value));
}));
return name;
};
}());
HiddenSymbol = function Symbol(description) {
if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');
return Symbol(description);
};
module.exports = Symbol = function Symbol(description) {
var symbol;
if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');
symbol = create(HiddenSymbol.prototype);
description = (description === undefined ? '' : String(description));
return defineProperties(symbol, {
__description__: d('', description),
__name__: d('', generateName(description))
});
};
defineProperties(Symbol, {
for: d(function (key) {
if (globalSymbols[key]) return globalSymbols[key];
return (globalSymbols[key] = Symbol(String(key)));
}),
keyFor: d(function (s) {
var key;
validateSymbol(s);
for (key in globalSymbols) if (globalSymbols[key] === s) return key;
}),
hasInstance: d('', Symbol('hasInstance')),
isConcatSpreadable: d('', Symbol('isConcatSpreadable')),
iterator: d('', Symbol('iterator')),
match: d('', Symbol('match')),
replace: d('', Symbol('replace')),
search: d('', Symbol('search')),
species: d('', Symbol('species')),
split: d('', Symbol('split')),
toPrimitive: d('', Symbol('toPrimitive')),
toStringTag: d('', Symbol('toStringTag')),
unscopables: d('', Symbol('unscopables'))
});
defineProperties(HiddenSymbol.prototype, {
constructor: d(Symbol),
toString: d('', function () { return this.__name__; })
});
defineProperties(Symbol.prototype, {
toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
valueOf: d(function () { return validateSymbol(this); })
});
defineProperty(Symbol.prototype, Symbol.toPrimitive, d('',
function () { return validateSymbol(this); }));
defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol'));
defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive,
d('c', Symbol.prototype[Symbol.toPrimitive]));
defineProperty(HiddenSymbol.prototype, Symbol.toStringTag,
d('c', Symbol.prototype[Symbol.toStringTag]));
},{"./validate-symbol":51,"d":10}],51:[function(require,module,exports){
'use strict';
var isSymbol = require('./is-symbol');
module.exports = function (value) {
if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
return value;
};
},{"./is-symbol":49}],52:[function(require,module,exports){
// Thanks @mathiasbynens
// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols
'use strict';
var setPrototypeOf = require('es5-ext/object/set-prototype-of')
, d = require('d')
, Iterator = require('./')
, defineProperty = Object.defineProperty
, StringIterator;
StringIterator = module.exports = function (str) {
if (!(this instanceof StringIterator)) return new StringIterator(str);
str = String(str);
Iterator.call(this, str);
defineProperty(this, '__length__', d('', str.length));
};
if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator);
StringIterator.prototype = Object.create(Iterator.prototype, {
constructor: d(StringIterator),
_next: d(function () {
if (!this.__list__) return;
if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;
this._unBind();
}),
_resolve: d(function (i) {
var char = this.__list__[i], code;
if (this.__nextIndex__ === this.__length__) return char;
code = char.charCodeAt(0);
if ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++];
return char;
}),
toString: d(function () { return '[object String Iterator]'; })
});
},{"./":45,"d":10,"es5-ext/object/set-prototype-of":33}],53:[function(require,module,exports){
'use strict';
var isIterable = require('./is-iterable');
module.exports = function (value) {
if (!isIterable(value)) throw new TypeError(value + " is not iterable");
return value;
};
},{"./is-iterable":46}],54:[function(require,module,exports){
arguments[4][47][0].apply(exports,arguments)
},{"./is-implemented":55,"./polyfill":56,"dup":47}],55:[function(require,module,exports){
'use strict';
module.exports = function () {
var symbol;
if (typeof Symbol !== 'function') return false;
symbol = Symbol('test symbol');
try { String(symbol); } catch (e) { return false; }
if (typeof Symbol.iterator === 'symbol') return true;
// Return 'true' for polyfills
if (typeof Symbol.isConcatSpreadable !== 'object') return false;
if (typeof Symbol.isRegExp !== 'object') return false;
if (typeof Symbol.iterator !== 'object') return false;
if (typeof Symbol.toPrimitive !== 'object') return false;
if (typeof Symbol.toStringTag !== 'object') return false;
if (typeof Symbol.unscopables !== 'object') return false;
return true;
};
},{}],56:[function(require,module,exports){
'use strict';
var d = require('d')
, create = Object.create, defineProperties = Object.defineProperties
, generateName, Symbol;
generateName = (function () {
var created = create(null);
return function (desc) {
var postfix = 0;
while (created[desc + (postfix || '')]) ++postfix;
desc += (postfix || '');
created[desc] = true;
return '@@' + desc;
};
}());
module.exports = Symbol = function (description) {
var symbol;
if (this instanceof Symbol) {
throw new TypeError('TypeError: Symbol is not a constructor');
}
symbol = create(Symbol.prototype);
description = (description === undefined ? '' : String(description));
return defineProperties(symbol, {
__description__: d('', description),
__name__: d('', generateName(description))
});
};
Object.defineProperties(Symbol, {
create: d('', Symbol('create')),
hasInstance: d('', Symbol('hasInstance')),
isConcatSpreadable: d('', Symbol('isConcatSpreadable')),
isRegExp: d('', Symbol('isRegExp')),
iterator: d('', Symbol('iterator')),
toPrimitive: d('', Symbol('toPrimitive')),
toStringTag: d('', Symbol('toStringTag')),
unscopables: d('', Symbol('unscopables'))
});
defineProperties(Symbol.prototype, {
properToString: d(function () {
return 'Symbol (' + this.__description__ + ')';
}),
toString: d('', function () { return this.__name__; })
});
Object.defineProperty(Symbol.prototype, Symbol.toPrimitive, d('',
function (hint) {
throw new TypeError("Conversion of symbol objects is not allowed");
}));
Object.defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol'));
},{"d":10}],57:[function(require,module,exports){
'use strict';
var d = require('d')
, callable = require('es5-ext/object/valid-callable')
, apply = Function.prototype.apply, call = Function.prototype.call
, create = Object.create, defineProperty = Object.defineProperty
, defineProperties = Object.defineProperties
, hasOwnProperty = Object.prototype.hasOwnProperty
, descriptor = { configurable: true, enumerable: false, writable: true }
, on, once, off, emit, methods, descriptors, base;
on = function (type, listener) {
var data;
callable(listener);
if (!hasOwnProperty.call(this, '__ee__')) {
data = descriptor.value = create(null);
defineProperty(this, '__ee__', descriptor);
descriptor.value = null;
} else {
data = this.__ee__;
}
if (!data[type]) data[type] = listener;
else if (typeof data[type] === 'object') data[type].push(listener);
else data[type] = [data[type], listener];
return this;
};
once = function (type, listener) {
var once, self;
callable(listener);
self = this;
on.call(this, type, once = function () {
off.call(self, type, once);
apply.call(listener, this, arguments);
});
once.__eeOnceListener__ = listener;
return this;
};
off = function (type, listener) {
var data, listeners, candidate, i;
callable(listener);
if (!hasOwnProperty.call(this, '__ee__')) return this;
data = this.__ee__;
if (!data[type]) return this;
listeners = data[type];
if (typeof listeners === 'object') {
for (i = 0; (candidate = listeners[i]); ++i) {
if ((candidate === listener) ||
(candidate.__eeOnceListener__ === listener)) {
if (listeners.length === 2) data[type] = listeners[i ? 0 : 1];
else listeners.splice(i, 1);
}
}
} else {
if ((listeners === listener) ||
(listeners.__eeOnceListener__ === listener)) {
delete data[type];
}
}
return this;
};
emit = function (type) {
var i, l, listener, listeners, args;
if (!hasOwnProperty.call(this, '__ee__')) return;
listeners = this.__ee__[type];
if (!listeners) return;
if (typeof listeners === 'object') {
l = arguments.length;
args = new Array(l - 1);
for (i = 1; i < l; ++i) args[i - 1] = arguments[i];
listeners = listeners.slice();
for (i = 0; (listener = listeners[i]); ++i) {
apply.call(listener, this, args);
}
} else {
switch (arguments.length) {
case 1:
call.call(listeners, this);
break;
case 2:
call.call(listeners, this, arguments[1]);
break;
case 3:
call.call(listeners, this, arguments[1], arguments[2]);
break;
default:
l = arguments.length;
args = new Array(l - 1);
for (i = 1; i < l; ++i) {
args[i - 1] = arguments[i];
}
apply.call(listeners, this, args);
}
}
};
methods = {
on: on,
once: once,
off: off,
emit: emit
};
descriptors = {
on: d(on),
once: d(once),
off: d(off),
emit: d(emit)
};
base = defineProperties({}, descriptors);
module.exports = exports = function (o) {
return (o == null) ? create(base) : defineProperties(Object(o), descriptors);
};
exports.methods = methods;
},{"d":10,"es5-ext/object/valid-callable":36}],58:[function(require,module,exports){
'use strict';
var clear = require('es5-ext/array/#/clear')
, eIndexOf = require('es5-ext/array/#/e-index-of')
, setPrototypeOf = require('es5-ext/object/set-prototype-of')
, callable = require('es5-ext/object/valid-callable')
, validValue = require('es5-ext/object/valid-value')
, d = require('d')
, ee = require('event-emitter')
, Symbol = require('es6-symbol')
, iterator = require('es6-iterator/valid-iterable')
, forOf = require('es6-iterator/for-of')
, Iterator = require('./lib/iterator')
, isNative = require('./is-native-implemented')
, call = Function.prototype.call, defineProperties = Object.defineProperties
, MapPoly;
module.exports = MapPoly = function (/*iterable*/) {
var iterable = arguments[0], keys, values;
if (!(this instanceof MapPoly)) return new MapPoly(iterable);
if (this.__mapKeysData__ !== undefined) {
throw new TypeError(this + " cannot be reinitialized");
}
if (iterable != null) iterator(iterable);
defineProperties(this, {
__mapKeysData__: d('c', keys = []),
__mapValuesData__: d('c', values = [])
});
if (!iterable) return;
forOf(iterable, function (value) {
var key = validValue(value)[0];
value = value[1];
if (eIndexOf.call(keys, key) !== -1) return;
keys.push(key);
values.push(value);
}, this);
};
if (isNative) {
if (setPrototypeOf) setPrototypeOf(MapPoly, Map);
MapPoly.prototype = Object.create(Map.prototype, {
constructor: d(MapPoly)
});
}
ee(defineProperties(MapPoly.prototype, {
clear: d(function () {
if (!this.__mapKeysData__.length) return;
clear.call(this.__mapKeysData__);
clear.call(this.__mapValuesData__);
this.emit('_clear');
}),
delete: d(function (key) {
var index = eIndexOf.call(this.__mapKeysData__, key);
if (index === -1) return false;
this.__mapKeysData__.splice(index, 1);
this.__mapValuesData__.splice(index, 1);
this.emit('_delete', index, key);
return true;
}),
entries: d(function () { return new Iterator(this, 'key+value'); }),
forEach: d(function (cb/*, thisArg*/) {
var thisArg = arguments[1], iterator, result;
callable(cb);
iterator = this.entries();
result = iterator._next();
while (result !== undefined) {
call.call(cb, thisArg, this.__mapValuesData__[result],
this.__mapKeysData__[result], this);
result = iterator._next();
}
}),
get: d(function (key) {
var index = eIndexOf.call(this.__mapKeysData__, key);
if (index === -1) return;
return this.__mapValuesData__[index];
}),
has: d(function (key) {
return (eIndexOf.call(this.__mapKeysData__, key) !== -1);
}),
keys: d(function () { return new Iterator(this, 'key'); }),
set: d(function (key, value) {
var index = eIndexOf.call(this.__mapKeysData__, key), emit;
if (index === -1) {
index = this.__mapKeysData__.push(key) - 1;
emit = true;
}
this.__mapValuesData__[index] = value;
if (emit) this.emit('_add', index, key);
return this;
}),
size: d.gs(function () { return this.__mapKeysData__.length; }),
values: d(function () { return new Iterator(this, 'value'); }),
toString: d(function () { return '[object Map]'; })
}));
Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () {
return this.entries();
}));
Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map'));
},{"./is-native-implemented":6,"./lib/iterator":8,"d":10,"es5-ext/array/#/clear":11,"es5-ext/array/#/e-index-of":12,"es5-ext/object/set-prototype-of":33,"es5-ext/object/valid-callable":36,"es5-ext/object/valid-value":37,"es6-iterator/for-of":43,"es6-iterator/valid-iterable":53,"es6-symbol":54,"event-emitter":57}],59:[function(require,module,exports){
(function (process,global){
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
;(function (undefined) {
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
var root = (objectTypes[typeof window] && window) || this,
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
root = freeGlobal;
}
var Rx = {
internals: {},
config: {
Promise: root.Promise
},
helpers: { }
};
// Defaults
var noop = Rx.helpers.noop = function () { },
notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
identity = Rx.helpers.identity = function (x) { return x; },
pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
just = Rx.helpers.just = function (value) { return function () { return value; }; },
defaultNow = Rx.helpers.defaultNow = Date.now,
defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
defaultError = Rx.helpers.defaultError = function (err) { throw err; },
isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
not = Rx.helpers.not = function (a) { return !a; },
isFunction = Rx.helpers.isFunction = (function () {
var isFn = function (value) {
return typeof value == 'function' || false;
}
// fallback for older versions of Chrome and Safari
if (isFn(/x/)) {
isFn = function(value) {
return typeof value == 'function' && toString.call(value) == '[object Function]';
};
}
return isFn;
}());
function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
Rx.config.longStackSupport = false;
var hasStacks = false;
try {
throw new Error();
} catch (e) {
hasStacks = !!e.stack;
}
// All code after this point will be filtered from stack traces reported by RxJS
var rStartingLine = captureLine(), rFileName;
var STACK_JUMP_SEPARATOR = "From previous event:";
function makeStackTraceLong(error, observable) {
// If possible, transform the error stack trace by removing Node and RxJS
// cruft, then concatenating with the stack trace of `observable`.
if (hasStacks &&
observable.stack &&
typeof error === "object" &&
error !== null &&
error.stack &&
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
) {
var stacks = [];
for (var o = observable; !!o; o = o.source) {
if (o.stack) {
stacks.unshift(o.stack);
}
}
stacks.unshift(error.stack);
var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
error.stack = filterStackString(concatedStacks);
}
}
function filterStackString(stackString) {
var lines = stackString.split("\n"),
desiredLines = [];
for (var i = 0, len = lines.length; i < len; i++) {
var line = lines[i];
if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
desiredLines.push(line);
}
}
return desiredLines.join("\n");
}
function isInternalFrame(stackLine) {
var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
if (!fileNameAndLineNumber) {
return false;
}
var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
return fileName === rFileName &&
lineNumber >= rStartingLine &&
lineNumber <= rEndingLine;
}
function isNodeFrame(stackLine) {
return stackLine.indexOf("(module.js:") !== -1 ||
stackLine.indexOf("(node.js:") !== -1;
}
function captureLine() {
if (!hasStacks) { return; }
try {
throw new Error();
} catch (e) {
var lines = e.stack.split("\n");
var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
if (!fileNameAndLineNumber) { return; }
rFileName = fileNameAndLineNumber[0];
return fileNameAndLineNumber[1];
}
}
function getFileNameAndLineNumber(stackLine) {
// Named functions: "at functionName (filename:lineNumber:columnNumber)"
var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
// Anonymous functions: "at filename:lineNumber:columnNumber"
var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
// Firefox style: "function@filename:lineNumber or @filename:lineNumber"
var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
}
var EmptyError = Rx.EmptyError = function() {
this.message = 'Sequence contains no elements.';
Error.call(this);
};
EmptyError.prototype = Error.prototype;
var ObjectDisposedError = Rx.ObjectDisposedError = function() {
this.message = 'Object has been disposed';
Error.call(this);
};
ObjectDisposedError.prototype = Error.prototype;
var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
this.message = 'Argument out of range';
Error.call(this);
};
ArgumentOutOfRangeError.prototype = Error.prototype;
var NotSupportedError = Rx.NotSupportedError = function (message) {
this.message = message || 'This operation is not supported';
Error.call(this);
};
NotSupportedError.prototype = Error.prototype;
var NotImplementedError = Rx.NotImplementedError = function (message) {
this.message = message || 'This operation is not implemented';
Error.call(this);
};
NotImplementedError.prototype = Error.prototype;
var notImplemented = Rx.helpers.notImplemented = function () {
throw new NotImplementedError();
};
var notSupported = Rx.helpers.notSupported = function () {
throw new NotSupportedError();
};
// Shim in iterator support
var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
'_es6shim_iterator_';
// Bug for mozilla version
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
$iterator$ = '@@iterator';
}
var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
var isIterable = Rx.helpers.isIterable = function (o) {
return o[$iterator$] !== undefined;
}
var isArrayLike = Rx.helpers.isArrayLike = function (o) {
return o && o.length !== undefined;
}
Rx.helpers.iterator = $iterator$;
var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
if (typeof thisArg === 'undefined') { return func; }
switch(argCount) {
case 0:
return function() {
return func.call(thisArg)
};
case 1:
return function(arg) {
return func.call(thisArg, arg);
}
case 2:
return function(value, index) {
return func.call(thisArg, value, index);
};
case 3:
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
}
return function() {
return func.apply(thisArg, arguments);
};
};
/** Used to determine if values are of the language type Object */
var dontEnums = ['toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'],
dontEnumsLength = dontEnums.length;
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
supportNodeClass,
errorProto = Error.prototype,
objectProto = Object.prototype,
stringProto = String.prototype,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
try {
supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch (e) {
supportNodeClass = true;
}
var nonEnumProps = {};
nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
nonEnumProps[objectClass] = { 'constructor': true };
var support = {};
(function () {
var ctor = function() { this.x = 1; },
props = [];
ctor.prototype = { 'valueOf': 1, 'y': 1 };
for (var key in new ctor) { props.push(key); }
for (key in arguments) { }
// Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
// Detect if `prototype` properties are enumerable by default.
support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
// Detect if `arguments` object indexes are non-enumerable
support.nonEnumArgs = key != 0;
// Detect if properties shadowing those on `Object.prototype` are non-enumerable.
support.nonEnumShadows = !/valueOf/.test(props);
}(1));
var isObject = Rx.internals.isObject = function(value) {
var type = typeof value;
return value && (type == 'function' || type == 'object') || false;
};
function keysIn(object) {
var result = [];
if (!isObject(object)) {
return result;
}
if (support.nonEnumArgs && object.length && isArguments(object)) {
object = slice.call(object);
}
var skipProto = support.enumPrototypes && typeof object == 'function',
skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
for (var key in object) {
if (!(skipProto && key == 'prototype') &&
!(skipErrorProps && (key == 'message' || key == 'name'))) {
result.push(key);
}
}
if (support.nonEnumShadows && object !== objectProto) {
var ctor = object.constructor,
index = -1,
length = dontEnumsLength;
if (object === (ctor && ctor.prototype)) {
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
nonEnum = nonEnumProps[className];
}
while (++index < length) {
key = dontEnums[index];
if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
result.push(key);
}
}
}
return result;
}
function internalFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
}
function internalForIn(object, callback) {
return internalFor(object, callback, keysIn);
}
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
var isArguments = function(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!supportsArgsClass) {
isArguments = function(value) {
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
};
}
var isEqual = Rx.internals.isEqual = function (x, y) {
return deepEquals(x, y, [], []);
};
/** @private
* Used for deep comparison
**/
function deepEquals(a, b, stackA, stackB) {
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a && (a == null || b == null ||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
return false;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
if (className == argsClass) {
className = objectClass;
}
if (otherClass == argsClass) {
otherClass = objectClass;
}
if (className != otherClass) {
return false;
}
switch (className) {
case boolClass:
case dateClass:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a) ?
b != +b :
// but treat `-0` vs. `+0` as not equal
(a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// exit for functions and DOM nodes
if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB &&
!(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
('constructor' in a && 'constructor' in b)
) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var initedStack = !stackA;
stackA || (stackA = []);
stackB || (stackB = []);
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
var result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
// compare lengths to determine if a deep comparison is necessary
length = a.length;
size = b.length;
result = size == length;
if (result) {
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (!(result = deepEquals(a[size], value, stackA, stackB))) {
break;
}
}
}
}
else {
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
// which, in this case, is more costly
internalForIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
// count the number of properties.
size++;
// deep compare each property value.
return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
}
});
if (result) {
// ensure both objects have the same number of properties
internalForIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
});
}
}
stackA.pop();
stackB.pop();
return result;
}
var hasProp = {}.hasOwnProperty,
slice = Array.prototype.slice;
var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
var addProperties = Rx.internals.addProperties = function (obj) {
for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
for (var idx = 0, ln = sources.length; idx < ln; idx++) {
var source = sources[idx];
for (var prop in source) {
obj[prop] = source[prop];
}
}
};
// Rx Utils
var addRef = Rx.internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
return a;
}
var errorObj = {e: {}};
var tryCatchTarget;
function tryCatcher() {
try {
return tryCatchTarget.apply(this, arguments);
} catch (e) {
errorObj.e = e;
return errorObj;
}
}
function tryCatch(fn) {
if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
tryCatchTarget = fn;
return tryCatcher;
}
function thrower(e) {
throw e;
}
// Collections
function IndexedItem(id, value) {
this.id = id;
this.value = value;
}
IndexedItem.prototype.compareTo = function (other) {
var c = this.value.compareTo(other.value);
c === 0 && (c = this.id - other.id);
return c;
};
// Priority Queue for Scheduling
var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
var priorityProto = PriorityQueue.prototype;
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) { return; }
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) { return; }
if (this.isHigherPriority(index, parent)) {
var temp = this.items[index];
this.items[index] = this.items[parent];
this.items[parent] = temp;
this.percolate(parent);
}
};
priorityProto.heapify = function (index) {
+index || (index = 0);
if (index >= this.length || index < 0) { return; }
var left = 2 * index + 1,
right = 2 * index + 2,
first = index;
if (left < this.length && this.isHigherPriority(left, first)) {
first = left;
}
if (right < this.length && this.isHigherPriority(right, first)) {
first = right;
}
if (first !== index) {
var temp = this.items[index];
this.items[index] = this.items[first];
this.items[first] = temp;
this.heapify(first);
}
};
priorityProto.peek = function () { return this.items[0].value; };
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
this.items[this.length] = undefined;
this.heapify();
};
priorityProto.dequeue = function () {
var result = this.peek();
this.removeAt(0);
return result;
};
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
}
}
return false;
};
PriorityQueue.count = 0;
/**
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
var CompositeDisposable = Rx.CompositeDisposable = function () {
var args = [], i, len;
if (Array.isArray(arguments[0])) {
args = arguments[0];
len = args.length;
} else {
len = arguments.length;
args = new Array(len);
for(i = 0; i < len; i++) { args[i] = arguments[i]; }
}
for(i = 0; i < len; i++) {
if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
}
this.disposables = args;
this.isDisposed = false;
this.length = args.length;
};
var CompositeDisposablePrototype = CompositeDisposable.prototype;
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Mixed} item Disposable to add.
*/
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
this.length++;
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Mixed} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
this.length--;
item.dispose();
}
}
return shouldDispose;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var len = this.disposables.length, currentDisposables = new Array(len);
for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
this.disposables = [];
this.length = 0;
for (i = 0; i < len; i++) {
currentDisposables[i].dispose();
}
}
};
/**
* Provides a set of static methods for creating Disposables.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
*/
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
/** Performs the task of cleaning up resources. */
Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
};
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
/**
* Gets the disposable that does nothing when disposed.
*/
var disposableEmpty = Disposable.empty = { dispose: noop };
/**
* Validates whether the given object is a disposable
* @param {Object} Object to test whether it has a dispose method
* @returns {Boolean} true if a disposable object, else false.
*/
var isDisposable = Disposable.isDisposable = function (d) {
return d && isFunction(d.dispose);
};
var checkDisposed = Disposable.checkDisposed = function (disposable) {
if (disposable.isDisposed) { throw new ObjectDisposedError(); }
};
// Single assignment
var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
this.isDisposed = false;
this.current = null;
};
SingleAssignmentDisposable.prototype.getDisposable = function () {
return this.current;
};
SingleAssignmentDisposable.prototype.setDisposable = function (value) {
if (this.current) { throw new Error('Disposable has already been assigned'); }
var shouldDispose = this.isDisposed;
!shouldDispose && (this.current = value);
shouldDispose && value && value.dispose();
};
SingleAssignmentDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
}
old && old.dispose();
};
// Multiple assignment disposable
var SerialDisposable = Rx.SerialDisposable = function () {
this.isDisposed = false;
this.current = null;
};
SerialDisposable.prototype.getDisposable = function () {
return this.current;
};
SerialDisposable.prototype.setDisposable = function (value) {
var shouldDispose = this.isDisposed;
if (!shouldDispose) {
var old = this.current;
this.current = value;
}
old && old.dispose();
shouldDispose && value && value.dispose();
};
SerialDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var old = this.current;
this.current = null;
}
old && old.dispose();
};
/**
* Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
*/
var RefCountDisposable = Rx.RefCountDisposable = (function () {
function InnerDisposable(disposable) {
this.disposable = disposable;
this.disposable.count++;
this.isInnerDisposed = false;
}
InnerDisposable.prototype.dispose = function () {
if (!this.disposable.isDisposed && !this.isInnerDisposed) {
this.isInnerDisposed = true;
this.disposable.count--;
if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
this.disposable.isDisposed = true;
this.disposable.underlyingDisposable.dispose();
}
}
};
/**
* Initializes a new instance of the RefCountDisposable with the specified disposable.
* @constructor
* @param {Disposable} disposable Underlying disposable.
*/
function RefCountDisposable(disposable) {
this.underlyingDisposable = disposable;
this.isDisposed = false;
this.isPrimaryDisposed = false;
this.count = 0;
}
/**
* Disposes the underlying disposable only when all dependent disposables have been disposed
*/
RefCountDisposable.prototype.dispose = function () {
if (!this.isDisposed && !this.isPrimaryDisposed) {
this.isPrimaryDisposed = true;
if (this.count === 0) {
this.isDisposed = true;
this.underlyingDisposable.dispose();
}
}
};
/**
* Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
* @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
*/
RefCountDisposable.prototype.getDisposable = function () {
return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
};
return RefCountDisposable;
})();
function ScheduledDisposable(scheduler, disposable) {
this.scheduler = scheduler;
this.disposable = disposable;
this.isDisposed = false;
}
function scheduleItem(s, self) {
if (!self.isDisposed) {
self.isDisposed = true;
self.disposable.dispose();
}
}
ScheduledDisposable.prototype.dispose = function () {
this.scheduler.scheduleWithState(this, scheduleItem);
};
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
this.comparer = comparer || defaultSubComparer;
this.disposable = new SingleAssignmentDisposable();
}
ScheduledItem.prototype.invoke = function () {
this.disposable.setDisposable(this.invokeCore());
};
ScheduledItem.prototype.compareTo = function (other) {
return this.comparer(this.dueTime, other.dueTime);
};
ScheduledItem.prototype.isCancelled = function () {
return this.disposable.isDisposed;
};
ScheduledItem.prototype.invokeCore = function () {
return this.action(this.scheduler, this.state);
};
/** Provides a set of static properties to access commonly used schedulers. */
var Scheduler = Rx.Scheduler = (function () {
function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
this.now = now;
this._schedule = schedule;
this._scheduleRelative = scheduleRelative;
this._scheduleAbsolute = scheduleAbsolute;
}
/** Determines whether the given object is a scheduler */
Scheduler.isScheduler = function (s) {
return s instanceof Scheduler;
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
var schedulerProto = Scheduler.prototype;
/**
* Schedules an action to be executed.
* @param {Function} action Action to execute.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.schedule = function (action) {
return this._schedule(action, invokeAction);
};
/**
* Schedules an action to be executed.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithState = function (state, action) {
return this._schedule(state, action);
};
/**
* Schedules an action to be executed after the specified relative due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelative = function (dueTime, action) {
return this._scheduleRelative(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed after dueTime.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative(state, dueTime, action);
};
/**
* Schedules an action to be executed at the specified absolute due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
return this._scheduleAbsolute(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number}dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute(state, dueTime, action);
};
/** Gets the current time according to the local machine's system clock. */
Scheduler.now = defaultNow;
/**
* Normalizes the specified TimeSpan value to a positive value.
* @param {Number} timeSpan The time span value to normalize.
* @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
*/
Scheduler.normalize = function (timeSpan) {
timeSpan < 0 && (timeSpan = 0);
return timeSpan;
};
return Scheduler;
}());
var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
(function (schedulerProto) {
function invokeRecImmediate(scheduler, pair) {
var state = pair[0], action = pair[1], group = new CompositeDisposable();
function recursiveAction(state1) {
action(state1, function (state2) {
var isAdded = false, isDone = false,
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
}
recursiveAction(state);
return group;
}
function invokeRecDate(scheduler, pair, method) {
var state = pair[0], action = pair[1], group = new CompositeDisposable();
function recursiveAction(state1) {
action(state1, function (state2, dueTime1) {
var isAdded = false, isDone = false,
d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function scheduleInnerRecursive(action, self) {
action(function(dt) { self(action, dt); });
}
/**
* Schedules an action to be executed recursively.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursive = function (action) {
return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithState = function (state, action) {
return this.scheduleWithState([state, action], invokeRecImmediate);
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative([state, action], dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
});
};
}(Scheduler.prototype));
(function (schedulerProto) {
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
Scheduler.prototype.schedulePeriodic = function (period, action) {
return this.schedulePeriodicWithState(null, period, action);
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
period = normalizeTime(period);
var s = state, id = root.setInterval(function () { s = action(s); }, period);
return disposableCreate(function () { root.clearInterval(id); });
};
}(Scheduler.prototype));
(function (schedulerProto) {
/**
* Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
* @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
* @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
*/
schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
return new CatchScheduler(this, handler);
};
}(Scheduler.prototype));
var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
function tick(command, recurse) {
recurse(0, this._period);
try {
this._state = this._action(this._state);
} catch (e) {
this._cancel.dispose();
throw e;
}
}
function SchedulePeriodicRecursive(scheduler, state, period, action) {
this._scheduler = scheduler;
this._state = state;
this._period = period;
this._action = action;
}
SchedulePeriodicRecursive.prototype.start = function () {
var d = new SingleAssignmentDisposable();
this._cancel = d;
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
return d;
};
return SchedulePeriodicRecursive;
}());
/** Gets a scheduler that schedules work immediately on the current thread. */
var immediateScheduler = Scheduler.immediate = (function () {
function scheduleNow(state, action) { return action(this, state); }
return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
}());
/**
* Gets a scheduler that schedules work as soon as possible on the current thread.
*/
var currentThreadScheduler = Scheduler.currentThread = (function () {
var queue;
function runTrampoline () {
while (queue.length > 0) {
var item = queue.dequeue();
!item.isCancelled() && item.invoke();
}
}
function scheduleNow(state, action) {
var si = new ScheduledItem(this, state, action, this.now());
if (!queue) {
queue = new PriorityQueue(4);
queue.enqueue(si);
var result = tryCatch(runTrampoline)();
queue = null;
if (result === errorObj) { return thrower(result.e); }
} else {
queue.enqueue(si);
}
return si.disposable;
}
var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
currentScheduler.scheduleRequired = function () { return !queue; };
return currentScheduler;
}());
var scheduleMethod, clearMethod;
var localTimer = (function () {
var localSetTimeout, localClearTimeout = noop;
if (!!root.setTimeout) {
localSetTimeout = root.setTimeout;
localClearTimeout = root.clearTimeout;
} else if (!!root.WScript) {
localSetTimeout = function (fn, time) {
root.WScript.Sleep(time);
fn();
};
} else {
throw new NotSupportedError();
}
return {
setTimeout: localSetTimeout,
clearTimeout: localClearTimeout
};
}());
var localSetTimeout = localTimer.setTimeout,
localClearTimeout = localTimer.clearTimeout;
(function () {
var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
clearMethod = function (handle) {
delete tasksByHandle[handle];
};
function runTask(handle) {
if (currentlyRunning) {
localSetTimeout(function () { runTask(handle) }, 0);
} else {
var task = tasksByHandle[handle];
if (task) {
currentlyRunning = true;
var result = tryCatch(task)();
clearMethod(handle);
currentlyRunning = false;
if (result === errorObj) { return thrower(result.e); }
}
}
}
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
);
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
!reNative.test(setImmediate) && setImmediate;
function postMessageSupported () {
// Ensure not in a worker
if (!root.postMessage || root.importScripts) { return false; }
var isAsync = false, oldHandler = root.onmessage;
// Test for async
root.onmessage = function () { isAsync = true; };
root.postMessage('', '*');
root.onmessage = oldHandler;
return isAsync;
}
// Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
if (isFunction(setImmediate)) {
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
setImmediate(function () { runTask(id); });
return id;
};
} else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
process.nextTick(function () { runTask(id); });
return id;
};
} else if (postMessageSupported()) {
var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
function onGlobalPostMessage(event) {
// Only if we're a match to avoid any other global events
if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
runTask(event.data.substring(MSG_PREFIX.length));
}
}
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else if (root.attachEvent) {
root.attachEvent('onmessage', onGlobalPostMessage);
} else {
root.onmessage = onGlobalPostMessage;
}
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
root.postMessage(MSG_PREFIX + currentId, '*');
return id;
};
} else if (!!root.MessageChannel) {
var channel = new root.MessageChannel();
channel.port1.onmessage = function (e) { runTask(e.data); };
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
channel.port2.postMessage(id);
return id;
};
} else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
scheduleMethod = function (action) {
var scriptElement = root.document.createElement('script');
var id = nextHandle++;
tasksByHandle[id] = action;
scriptElement.onreadystatechange = function () {
runTask(id);
scriptElement.onreadystatechange = null;
scriptElement.parentNode.removeChild(scriptElement);
scriptElement = null;
};
root.document.documentElement.appendChild(scriptElement);
return id;
};
} else {
scheduleMethod = function (action) {
var id = nextHandle++;
tasksByHandle[id] = action;
localSetTimeout(function () {
runTask(id);
}, 0);
return id;
};
}
}());
/**
* Gets a scheduler that schedules work via a timed callback based upon platform.
*/
var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
function scheduleNow(state, action) {
var scheduler = this, disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
!disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
});
return new CompositeDisposable(disposable, disposableCreate(function () {
clearMethod(id);
}));
}
function scheduleRelative(state, dueTime, action) {
var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
if (dt === 0) { return scheduler.scheduleWithState(state, action); }
var id = localSetTimeout(function () {
!disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
}, dt);
return new CompositeDisposable(disposable, disposableCreate(function () {
localClearTimeout(id);
}));
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
})();
var CatchScheduler = (function (__super__) {
function scheduleNow(state, action) {
return this._scheduler.scheduleWithState(state, this._wrap(action));
}
function scheduleRelative(state, dueTime, action) {
return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
}
function scheduleAbsolute(state, dueTime, action) {
return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
}
inherits(CatchScheduler, __super__);
function CatchScheduler(scheduler, handler) {
this._scheduler = scheduler;
this._handler = handler;
this._recursiveOriginal = null;
this._recursiveWrapper = null;
__super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
}
CatchScheduler.prototype._clone = function (scheduler) {
return new CatchScheduler(scheduler, this._handler);
};
CatchScheduler.prototype._wrap = function (action) {
var parent = this;
return function (self, state) {
try {
return action(parent._getRecursiveWrapper(self), state);
} catch (e) {
if (!parent._handler(e)) { throw e; }
return disposableEmpty;
}
};
};
CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
if (this._recursiveOriginal !== scheduler) {
this._recursiveOriginal = scheduler;
var wrapper = this._clone(scheduler);
wrapper._recursiveOriginal = scheduler;
wrapper._recursiveWrapper = wrapper;
this._recursiveWrapper = wrapper;
}
return this._recursiveWrapper;
};
CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
var self = this, failed = false, d = new SingleAssignmentDisposable();
d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
if (failed) { return null; }
try {
return action(state1);
} catch (e) {
failed = true;
if (!self._handler(e)) { throw e; }
d.dispose();
return null;
}
}));
return d;
};
return CatchScheduler;
}(Scheduler));
/**
* Represents a notification to an observer.
*/
var Notification = Rx.Notification = (function () {
function Notification(kind, value, exception, accept, acceptObservable, toString) {
this.kind = kind;
this.value = value;
this.exception = exception;
this._accept = accept;
this._acceptObservable = acceptObservable;
this.toString = toString;
}
/**
* Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
*
* @memberOf Notification
* @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
* @param {Function} onError Delegate to invoke for an OnError notification.
* @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
* @returns {Any} Result produced by the observation.
*/
Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
return observerOrOnNext && typeof observerOrOnNext === 'object' ?
this._acceptObservable(observerOrOnNext) :
this._accept(observerOrOnNext, onError, onCompleted);
};
/**
* Returns an observable sequence with a single notification.
*
* @memberOf Notifications
* @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
* @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
*/
Notification.prototype.toObservable = function (scheduler) {
var self = this;
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithState(self, function (_, notification) {
notification._acceptObservable(observer);
notification.kind === 'N' && observer.onCompleted();
});
});
};
return Notification;
})();
/**
* Creates an object that represents an OnNext notification to an observer.
* @param {Any} value The value contained in the notification.
* @returns {Notification} The OnNext notification containing the value.
*/
var notificationCreateOnNext = Notification.createOnNext = (function () {
function _accept(onNext) { return onNext(this.value); }
function _acceptObservable(observer) { return observer.onNext(this.value); }
function toString() { return 'OnNext(' + this.value + ')'; }
return function (value) {
return new Notification('N', value, null, _accept, _acceptObservable, toString);
};
}());
/**
* Creates an object that represents an OnError notification to an observer.
* @param {Any} error The exception contained in the notification.
* @returns {Notification} The OnError notification containing the exception.
*/
var notificationCreateOnError = Notification.createOnError = (function () {
function _accept (onNext, onError) { return onError(this.exception); }
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }
return function (e) {
return new Notification('E', null, e, _accept, _acceptObservable, toString);
};
}());
/**
* Creates an object that represents an OnCompleted notification to an observer.
* @returns {Notification} The OnCompleted notification.
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
return function () {
return new Notification('C', null, null, _accept, _acceptObservable, toString);
};
}());
/**
* Supports push-style iteration over an observable sequence.
*/
var Observer = Rx.Observer = function () { };
/**
* Creates a notification callback from an observer.
* @returns The action that forwards its input notification to the underlying observer.
*/
Observer.prototype.toNotifier = function () {
var observer = this;
return function (n) { return n.accept(observer); };
};
/**
* Hides the identity of an observer.
* @returns An observer that hides the identity of the specified observer.
*/
Observer.prototype.asObserver = function () {
return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
};
/**
* Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
* If a violation is detected, an Error is thrown from the offending observer method call.
* @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
*/
Observer.prototype.checked = function () { return new CheckedObserver(this); };
/**
* Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
* @param {Function} [onNext] Observer's OnNext action implementation.
* @param {Function} [onError] Observer's OnError action implementation.
* @param {Function} [onCompleted] Observer's OnCompleted action implementation.
* @returns {Observer} The observer object implemented using the given actions.
*/
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
};
/**
* Creates an observer from a notification callback.
*
* @static
* @memberOf Observer
* @param {Function} handler Action that handles a notification.
* @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
*/
Observer.fromNotifier = function (handler, thisArg) {
return new AnonymousObserver(function (x) {
return handler.call(thisArg, notificationCreateOnNext(x));
}, function (e) {
return handler.call(thisArg, notificationCreateOnError(e));
}, function () {
return handler.call(thisArg, notificationCreateOnCompleted());
});
};
/**
* Schedules the invocation of observer methods on the given scheduler.
* @param {Scheduler} scheduler Scheduler to schedule observer messages on.
* @returns {Observer} Observer whose messages are scheduled on the given scheduler.
*/
Observer.prototype.notifyOn = function (scheduler) {
return new ObserveOnObserver(scheduler, this);
};
Observer.prototype.makeSafe = function(disposable) {
return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
};
/**
* Abstract base class for implementations of the Observer class.
* This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
*/
var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
inherits(AbstractObserver, __super__);
/**
* Creates a new observer in a non-stopped state.
*/
function AbstractObserver() {
this.isStopped = false;
__super__.call(this);
}
// Must be implemented by other observers
AbstractObserver.prototype.next = notImplemented;
AbstractObserver.prototype.error = notImplemented;
AbstractObserver.prototype.completed = notImplemented;
/**
* Notifies the observer of a new element in the sequence.
* @param {Any} value Next element in the sequence.
*/
AbstractObserver.prototype.onNext = function (value) {
if (!this.isStopped) { this.next(value); }
};
/**
* Notifies the observer that an exception has occurred.
* @param {Any} error The error that has occurred.
*/
AbstractObserver.prototype.onError = function (error) {
if (!this.isStopped) {
this.isStopped = true;
this.error(error);
}
};
/**
* Notifies the observer of the end of the sequence.
*/
AbstractObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.completed();
}
};
/**
* Disposes the observer, causing it to transition to the stopped state.
*/
AbstractObserver.prototype.dispose = function () {
this.isStopped = true;
};
AbstractObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.error(e);
return true;
}
return false;
};
return AbstractObserver;
}(Observer));
/**
* Class to create an Observer instance from delegate-based implementations of the on* methods.
*/
var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
inherits(AnonymousObserver, __super__);
/**
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
* @param {Any} onNext Observer's OnNext action implementation.
* @param {Any} onError Observer's OnError action implementation.
* @param {Any} onCompleted Observer's OnCompleted action implementation.
*/
function AnonymousObserver(onNext, onError, onCompleted) {
__super__.call(this);
this._onNext = onNext;
this._onError = onError;
this._onCompleted = onCompleted;
}
/**
* Calls the onNext action.
* @param {Any} value Next element in the sequence.
*/
AnonymousObserver.prototype.next = function (value) {
this._onNext(value);
};
/**
* Calls the onError action.
* @param {Any} error The error that has occurred.
*/
AnonymousObserver.prototype.error = function (error) {
this._onError(error);
};
/**
* Calls the onCompleted action.
*/
AnonymousObserver.prototype.completed = function () {
this._onCompleted();
};
return AnonymousObserver;
}(AbstractObserver));
var CheckedObserver = (function (__super__) {
inherits(CheckedObserver, __super__);
function CheckedObserver(observer) {
__super__.call(this);
this._observer = observer;
this._state = 0; // 0 - idle, 1 - busy, 2 - done
}
var CheckedObserverPrototype = CheckedObserver.prototype;
CheckedObserverPrototype.onNext = function (value) {
this.checkAccess();
var res = tryCatch(this._observer.onNext).call(this._observer, value);
this._state = 0;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.onError = function (err) {
this.checkAccess();
var res = tryCatch(this._observer.onError).call(this._observer, err);
this._state = 2;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.onCompleted = function () {
this.checkAccess();
var res = tryCatch(this._observer.onCompleted).call(this._observer);
this._state = 2;
res === errorObj && thrower(res.e);
};
CheckedObserverPrototype.checkAccess = function () {
if (this._state === 1) { throw new Error('Re-entrancy detected'); }
if (this._state === 2) { throw new Error('Observer completed'); }
if (this._state === 0) { this._state = 1; }
};
return CheckedObserver;
}(Observer));
var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
inherits(ScheduledObserver, __super__);
function ScheduledObserver(scheduler, observer) {
__super__.call(this);
this.scheduler = scheduler;
this.observer = observer;
this.isAcquired = false;
this.hasFaulted = false;
this.queue = [];
this.disposable = new SerialDisposable();
}
ScheduledObserver.prototype.next = function (value) {
var self = this;
this.queue.push(function () { self.observer.onNext(value); });
};
ScheduledObserver.prototype.error = function (e) {
var self = this;
this.queue.push(function () { self.observer.onError(e); });
};
ScheduledObserver.prototype.completed = function () {
var self = this;
this.queue.push(function () { self.observer.onCompleted(); });
};
ScheduledObserver.prototype.ensureActive = function () {
var isOwner = false, parent = this;
if (!this.hasFaulted && this.queue.length > 0) {
isOwner = !this.isAcquired;
this.isAcquired = true;
}
if (isOwner) {
this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
var work;
if (parent.queue.length > 0) {
work = parent.queue.shift();
} else {
parent.isAcquired = false;
return;
}
try {
work();
} catch (ex) {
parent.queue = [];
parent.hasFaulted = true;
throw ex;
}
self();
}));
}
};
ScheduledObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.disposable.dispose();
};
return ScheduledObserver;
}(AbstractObserver));
var ObserveOnObserver = (function (__super__) {
inherits(ObserveOnObserver, __super__);
function ObserveOnObserver(scheduler, observer, cancel) {
__super__.call(this, scheduler, observer);
this._cancel = cancel;
}
ObserveOnObserver.prototype.next = function (value) {
__super__.prototype.next.call(this, value);
this.ensureActive();
};
ObserveOnObserver.prototype.error = function (e) {
__super__.prototype.error.call(this, e);
this.ensureActive();
};
ObserveOnObserver.prototype.completed = function () {
__super__.prototype.completed.call(this);
this.ensureActive();
};
ObserveOnObserver.prototype.dispose = function () {
__super__.prototype.dispose.call(this);
this._cancel && this._cancel.dispose();
this._cancel = null;
};
return ObserveOnObserver;
})(ScheduledObserver);
var observableProto;
/**
* Represents a push-style collection.
*/
var Observable = Rx.Observable = (function () {
function Observable(subscribe) {
if (Rx.config.longStackSupport && hasStacks) {
try {
throw new Error();
} catch (e) {
this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
}
var self = this;
this._subscribe = function (observer) {
var oldOnError = observer.onError.bind(observer);
observer.onError = function (err) {
makeStackTraceLong(err, self);
oldOnError(err);
};
return subscribe.call(self, observer);
};
} else {
this._subscribe = subscribe;
}
}
observableProto = Observable.prototype;
/**
* Subscribes an observer to the observable sequence.
* @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
return this._subscribe(typeof observerOrOnNext === 'object' ?
observerOrOnNext :
observerCreate(observerOrOnNext, onError, onCompleted));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onNext The function to invoke on each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnNext = function (onNext, thisArg) {
return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
};
/**
* Subscribes to an exceptional condition in the sequence with an optional "this" argument.
* @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnError = function (onError, thisArg) {
return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
};
/**
* Subscribes to the next value in the sequence with an optional "this" argument.
* @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
*/
observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
};
return Observable;
})();
var ObservableBase = Rx.ObservableBase = (function (__super__) {
inherits(ObservableBase, __super__);
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
}
function setDisposable(s, state) {
var ado = state[0], self = state[1];
var sub = tryCatch(self.subscribeCore).call(self, ado);
if (sub === errorObj) {
if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
}
ado.setDisposable(fixSubscriber(sub));
}
function subscribe(observer) {
var ado = new AutoDetachObserver(observer), state = [ado, this];
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.scheduleWithState(state, setDisposable);
} else {
setDisposable(null, state);
}
return ado;
}
function ObservableBase() {
__super__.call(this, subscribe);
}
ObservableBase.prototype.subscribeCore = notImplemented;
return ObservableBase;
}(Observable));
var Enumerable = Rx.internals.Enumerable = function () { };
var ConcatEnumerableObservable = (function(__super__) {
inherits(ConcatEnumerableObservable, __super__);
function ConcatEnumerableObservable(sources) {
this.sources = sources;
__super__.call(this);
}
ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
var isDisposed, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
if (isDisposed) { return; }
var currentItem = tryCatch(e.next).call(e);
if (currentItem === errorObj) { return o.onError(currentItem.e); }
if (currentItem.done) {
return o.onCompleted();
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
};
function InnerObserver(o, s, e) {
this.o = o;
this.s = s;
this.e = e;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
InnerObserver.prototype.onError = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.s(this.e);
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; };
InnerObserver.prototype.fail = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
return true;
}
return false;
};
return ConcatEnumerableObservable;
}(ObservableBase));
Enumerable.prototype.concat = function () {
return new ConcatEnumerableObservable(this);
};
var CatchErrorObservable = (function(__super__) {
inherits(CatchErrorObservable, __super__);
function CatchErrorObservable(sources) {
this.sources = sources;
__super__.call(this);
}
CatchErrorObservable.prototype.subscribeCore = function (o) {
var e = this.sources[$iterator$]();
var isDisposed, subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
if (isDisposed) { return; }
var currentItem = tryCatch(e.next).call(e);
if (currentItem === errorObj) { return o.onError(currentItem.e); }
if (currentItem.done) {
return lastException !== null ? o.onError(lastException) : o.onCompleted();
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
self,
function() { o.onCompleted(); }));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
};
return CatchErrorObservable;
}(ObservableBase));
Enumerable.prototype.catchError = function () {
return new CatchErrorObservable(this);
};
Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
var sources = this;
return new AnonymousObservable(function (o) {
var exceptions = new Subject(),
notifier = new Subject(),
handled = notificationHandler(exceptions),
notificationDisposable = handled.subscribe(notifier);
var e = sources[$iterator$]();
var isDisposed,
lastException,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
if (isDisposed) { return; }
var currentItem = tryCatch(e.next).call(e);
if (currentItem === errorObj) { return o.onError(currentItem.e); }
if (currentItem.done) {
if (lastException) {
o.onError(lastException);
} else {
o.onCompleted();
}
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var outer = new SingleAssignmentDisposable();
var inner = new SingleAssignmentDisposable();
subscription.setDisposable(new CompositeDisposable(inner, outer));
outer.setDisposable(currentValue.subscribe(
function(x) { o.onNext(x); },
function (exn) {
inner.setDisposable(notifier.subscribe(self, function(ex) {
o.onError(ex);
}, function() {
o.onCompleted();
}));
exceptions.onNext(exn);
},
function() { o.onCompleted(); }));
});
return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
var RepeatEnumerable = (function (__super__) {
inherits(RepeatEnumerable, __super__);
function RepeatEnumerable(v, c) {
this.v = v;
this.c = c == null ? -1 : c;
}
RepeatEnumerable.prototype[$iterator$] = function () {
return new RepeatEnumerator(this);
};
function RepeatEnumerator(p) {
this.v = p.v;
this.l = p.c;
}
RepeatEnumerator.prototype.next = function () {
if (this.l === 0) { return doneEnumerator; }
if (this.l > 0) { this.l--; }
return { done: false, value: this.v };
};
return RepeatEnumerable;
}(Enumerable));
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
return new RepeatEnumerable(value, repeatCount);
};
var OfEnumerable = (function(__super__) {
inherits(OfEnumerable, __super__);
function OfEnumerable(s, fn, thisArg) {
this.s = s;
this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
}
OfEnumerable.prototype[$iterator$] = function () {
return new OfEnumerator(this);
};
function OfEnumerator(p) {
this.i = -1;
this.s = p.s;
this.l = this.s.length;
this.fn = p.fn;
}
OfEnumerator.prototype.next = function () {
return ++this.i < this.l ?
{ done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
doneEnumerator;
};
return OfEnumerable;
}(Enumerable));
var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
return new OfEnumerable(source, selector, thisArg);
};
/**
* Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
*
* This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
* that require to be run on a scheduler, use subscribeOn.
*
* @param {Scheduler} scheduler Scheduler to notify observers on.
* @returns {Observable} The source sequence whose observations happen on the specified scheduler.
*/
observableProto.observeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(new ObserveOnObserver(scheduler, observer));
}, source);
};
/**
* Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
* see the remarks section for more information on the distinction between subscribeOn and observeOn.
* This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
* callbacks on a scheduler, use observeOn.
* @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
* @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribeOn = function (scheduler) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
d.setDisposable(m);
m.setDisposable(scheduler.schedule(function () {
d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
}));
return d;
}, source);
};
var FromPromiseObservable = (function(__super__) {
inherits(FromPromiseObservable, __super__);
function FromPromiseObservable(p) {
this.p = p;
__super__.call(this);
}
FromPromiseObservable.prototype.subscribeCore = function(o) {
this.p.then(function (data) {
o.onNext(data);
o.onCompleted();
}, function (err) { o.onError(err); });
return disposableEmpty;
};
return FromPromiseObservable;
}(ObservableBase));
/**
* Converts a Promise to an Observable sequence
* @param {Promise} An ES6 Compliant promise.
* @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
*/
var observableFromPromise = Observable.fromPromise = function (promise) {
return new FromPromiseObservable(promise);
};
/*
* Converts an existing observable sequence to an ES6 Compatible Promise
* @example
* var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
*
* // With config
* Rx.config.Promise = RSVP.Promise;
* var promise = Rx.Observable.return(42).toPromise();
* @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
* @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
*/
observableProto.toPromise = function (promiseCtor) {
promiseCtor || (promiseCtor = Rx.config.Promise);
if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
var source = this;
return new promiseCtor(function (resolve, reject) {
// No cancellation can be done
var value, hasValue = false;
source.subscribe(function (v) {
value = v;
hasValue = true;
}, reject, function () {
hasValue && resolve(value);
});
});
};
var ToArrayObservable = (function(__super__) {
inherits(ToArrayObservable, __super__);
function ToArrayObservable(source) {
this.source = source;
__super__.call(this);
}
ToArrayObservable.prototype.subscribeCore = function(o) {
return this.source.subscribe(new InnerObserver(o));
};
function InnerObserver(o) {
this.o = o;
this.a = [];
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.o.onNext(this.a);
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; }
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return ToArrayObservable;
}(ObservableBase));
/**
* Creates an array from an observable sequence.
* @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
*/
observableProto.toArray = function () {
return new ToArrayObservable(this);
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
* @example
* var res = Rx.Observable.create(function (observer) { return function () { } );
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
* var res = Rx.Observable.create(function (observer) { } );
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
return new AnonymousObservable(subscribe, parent);
};
/**
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
*
* @example
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
*/
var observableDefer = Observable.defer = function (observableFactory) {
return new AnonymousObservable(function (observer) {
var result;
try {
result = observableFactory();
} catch (e) {
return observableThrow(e).subscribe(observer);
}
isPromise(result) && (result = observableFromPromise(result));
return result.subscribe(observer);
});
};
var EmptyObservable = (function(__super__) {
inherits(EmptyObservable, __super__);
function EmptyObservable(scheduler) {
this.scheduler = scheduler;
__super__.call(this);
}
EmptyObservable.prototype.subscribeCore = function (observer) {
var sink = new EmptySink(observer, this);
return sink.run();
};
function EmptySink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
function scheduleItem(s, state) {
state.onCompleted();
}
EmptySink.prototype.run = function () {
return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
};
return EmptyObservable;
}(ObservableBase));
/**
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
*
* @example
* var res = Rx.Observable.empty();
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
* @returns {Observable} An observable sequence with no elements.
*/
var observableEmpty = Observable.empty = function (scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new EmptyObservable(scheduler);
};
var FromObservable = (function(__super__) {
inherits(FromObservable, __super__);
function FromObservable(iterable, mapper, scheduler) {
this.iterable = iterable;
this.mapper = mapper;
this.scheduler = scheduler;
__super__.call(this);
}
FromObservable.prototype.subscribeCore = function (observer) {
var sink = new FromSink(observer, this);
return sink.run();
};
return FromObservable;
}(ObservableBase));
var FromSink = (function () {
function FromSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
FromSink.prototype.run = function () {
var list = Object(this.parent.iterable),
it = getIterable(list),
observer = this.observer,
mapper = this.parent.mapper;
function loopRecursive(i, recurse) {
try {
var next = it.next();
} catch (e) {
return observer.onError(e);
}
if (next.done) {
return observer.onCompleted();
}
var result = next.value;
if (mapper) {
try {
result = mapper(result, i);
} catch (e) {
return observer.onError(e);
}
}
observer.onNext(result);
recurse(i + 1);
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
return FromSink;
}());
var maxSafeInteger = Math.pow(2, 53) - 1;
function StringIterable(str) {
this._s = s;
}
StringIterable.prototype[$iterator$] = function () {
return new StringIterator(this._s);
};
function StringIterator(str) {
this._s = s;
this._l = s.length;
this._i = 0;
}
StringIterator.prototype[$iterator$] = function () {
return this;
};
StringIterator.prototype.next = function () {
return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
};
function ArrayIterable(a) {
this._a = a;
}
ArrayIterable.prototype[$iterator$] = function () {
return new ArrayIterator(this._a);
};
function ArrayIterator(a) {
this._a = a;
this._l = toLength(a);
this._i = 0;
}
ArrayIterator.prototype[$iterator$] = function () {
return this;
};
ArrayIterator.prototype.next = function () {
return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
};
function numberIsFinite(value) {
return typeof value === 'number' && root.isFinite(value);
}
function isNan(n) {
return n !== n;
}
function getIterable(o) {
var i = o[$iterator$], it;
if (!i && typeof o === 'string') {
it = new StringIterable(o);
return it[$iterator$]();
}
if (!i && o.length !== undefined) {
it = new ArrayIterable(o);
return it[$iterator$]();
}
if (!i) { throw new TypeError('Object is not iterable'); }
return o[$iterator$]();
}
function sign(value) {
var number = +value;
if (number === 0) { return number; }
if (isNaN(number)) { return number; }
return number < 0 ? -1 : 1;
}
function toLength(o) {
var len = +o.length;
if (isNaN(len)) { return 0; }
if (len === 0 || !numberIsFinite(len)) { return len; }
len = sign(len) * Math.floor(Math.abs(len));
if (len <= 0) { return 0; }
if (len > maxSafeInteger) { return maxSafeInteger; }
return len;
}
/**
* This method creates a new Observable sequence from an array-like or iterable object.
* @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
* @param {Function} [mapFn] Map function to call on every element of the array.
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
*/
var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
if (iterable == null) {
throw new Error('iterable cannot be null.')
}
if (mapFn && !isFunction(mapFn)) {
throw new Error('mapFn when provided must be a function');
}
if (mapFn) {
var mapper = bindCallback(mapFn, thisArg, 2);
}
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromObservable(iterable, mapper, scheduler);
}
var FromArrayObservable = (function(__super__) {
inherits(FromArrayObservable, __super__);
function FromArrayObservable(args, scheduler) {
this.args = args;
this.scheduler = scheduler;
__super__.call(this);
}
FromArrayObservable.prototype.subscribeCore = function (observer) {
var sink = new FromArraySink(observer, this);
return sink.run();
};
return FromArrayObservable;
}(ObservableBase));
function FromArraySink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
FromArraySink.prototype.run = function () {
var observer = this.observer, args = this.parent.args, len = args.length;
function loopRecursive(i, recurse) {
if (i < len) {
observer.onNext(args[i]);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
/**
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
* @deprecated use Observable.from or Observable.of
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
*/
var observableFromArray = Observable.fromArray = function (array, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromArrayObservable(array, scheduler)
};
/**
* Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
* var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
* @returns {Observable} The generated sequence.
*/
Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (o) {
var first = true;
return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
var hasResult, result;
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
hasResult && (result = resultSelector(state));
} catch (e) {
return o.onError(e);
}
if (hasResult) {
o.onNext(result);
self(state);
} else {
o.onCompleted();
}
});
});
};
function observableOf (scheduler, array) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new FromArrayObservable(array, scheduler);
}
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.of = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new FromArrayObservable(args, currentThreadScheduler);
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.ofWithScheduler = function (scheduler) {
var len = arguments.length, args = new Array(len - 1);
for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
return new FromArrayObservable(args, scheduler);
};
/**
* Creates an Observable sequence from changes to an array using Array.observe.
* @param {Array} array An array to observe changes.
* @returns {Observable} An observable sequence containing changes to an array from Array.observe.
*/
Observable.ofArrayChanges = function(array) {
if (!Array.isArray(array)) { throw new TypeError('Array.observe only accepts arrays.'); }
if (typeof Array.observe !== 'function' && typeof Array.unobserve !== 'function') { throw new TypeError('Array.observe is not supported on your platform') }
return new AnonymousObservable(function(observer) {
function observerFn(changes) {
for(var i = 0, len = changes.length; i < len; i++) {
observer.onNext(changes[i]);
}
}
Array.observe(array, observerFn);
return function () {
Array.unobserve(array, observerFn);
};
});
};
/**
* Creates an Observable sequence from changes to an object using Object.observe.
* @param {Object} obj An object to observe changes.
* @returns {Observable} An observable sequence containing changes to an object from Object.observe.
*/
Observable.ofObjectChanges = function(obj) {
if (obj == null) { throw new TypeError('object must not be null or undefined.'); }
if (typeof Object.observe !== 'function' && typeof Object.unobserve !== 'function') { throw new TypeError('Object.observe is not supported on your platform') }
return new AnonymousObservable(function(observer) {
function observerFn(changes) {
for(var i = 0, len = changes.length; i < len; i++) {
observer.onNext(changes[i]);
}
}
Object.observe(obj, observerFn);
return function () {
Object.unobserve(obj, observerFn);
};
});
};
var NeverObservable = (function(__super__) {
inherits(NeverObservable, __super__);
function NeverObservable() {
__super__.call(this);
}
NeverObservable.prototype.subscribeCore = function (observer) {
return disposableEmpty;
};
return NeverObservable;
}(ObservableBase));
/**
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
* @returns {Observable} An observable sequence whose observers will never get called.
*/
var observableNever = Observable.never = function () {
return new NeverObservable();
};
var PairsObservable = (function(__super__) {
inherits(PairsObservable, __super__);
function PairsObservable(obj, scheduler) {
this.obj = obj;
this.keys = Object.keys(obj);
this.scheduler = scheduler;
__super__.call(this);
}
PairsObservable.prototype.subscribeCore = function (observer) {
var sink = new PairsSink(observer, this);
return sink.run();
};
return PairsObservable;
}(ObservableBase));
function PairsSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
PairsSink.prototype.run = function () {
var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
function loopRecursive(i, recurse) {
if (i < len) {
var key = keys[i];
observer.onNext([key, obj[key]]);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
/**
* Convert an object into an observable sequence of [key, value] pairs.
* @param {Object} obj The object to inspect.
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} An observable sequence of [key, value] pairs from the object.
*/
Observable.pairs = function (obj, scheduler) {
scheduler || (scheduler = currentThreadScheduler);
return new PairsObservable(obj, scheduler);
};
var RangeObservable = (function(__super__) {
inherits(RangeObservable, __super__);
function RangeObservable(start, count, scheduler) {
this.start = start;
this.rangeCount = count;
this.scheduler = scheduler;
__super__.call(this);
}
RangeObservable.prototype.subscribeCore = function (observer) {
var sink = new RangeSink(observer, this);
return sink.run();
};
return RangeObservable;
}(ObservableBase));
var RangeSink = (function () {
function RangeSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
RangeSink.prototype.run = function () {
var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
function loopRecursive(i, recurse) {
if (i < count) {
observer.onNext(start + i);
recurse(i + 1);
} else {
observer.onCompleted();
}
}
return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
};
return RangeSink;
}());
/**
* Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
* @param {Number} start The value of the first integer in the sequence.
* @param {Number} count The number of sequential integers to generate.
* @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
* @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
*/
Observable.range = function (start, count, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new RangeObservable(start, count, scheduler);
};
var RepeatObservable = (function(__super__) {
inherits(RepeatObservable, __super__);
function RepeatObservable(value, repeatCount, scheduler) {
this.value = value;
this.repeatCount = repeatCount == null ? -1 : repeatCount;
this.scheduler = scheduler;
__super__.call(this);
}
RepeatObservable.prototype.subscribeCore = function (observer) {
var sink = new RepeatSink(observer, this);
return sink.run();
};
return RepeatObservable;
}(ObservableBase));
function RepeatSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
RepeatSink.prototype.run = function () {
var observer = this.observer, value = this.parent.value;
function loopRecursive(i, recurse) {
if (i === -1 || i > 0) {
observer.onNext(value);
i > 0 && i--;
}
if (i === 0) { return observer.onCompleted(); }
recurse(i);
}
return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
};
/**
* Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
* @param {Mixed} value Element to repeat.
* @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
* @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence that repeats the given element the specified number of times.
*/
Observable.repeat = function (value, repeatCount, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new RepeatObservable(value, repeatCount, scheduler);
};
var JustObservable = (function(__super__) {
inherits(JustObservable, __super__);
function JustObservable(value, scheduler) {
this.value = value;
this.scheduler = scheduler;
__super__.call(this);
}
JustObservable.prototype.subscribeCore = function (observer) {
var sink = new JustSink(observer, this);
return sink.run();
};
function JustSink(observer, parent) {
this.observer = observer;
this.parent = parent;
}
function scheduleItem(s, state) {
var value = state[0], observer = state[1];
observer.onNext(value);
observer.onCompleted();
}
JustSink.prototype.run = function () {
return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
};
return JustObservable;
}(ObservableBase));
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'just' or browsers <IE9.
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new JustObservable(value, scheduler);
};
var ThrowObservable = (function(__super__) {
inherits(ThrowObservable, __super__);
function ThrowObservable(error, scheduler) {
this.error = error;
this.scheduler = scheduler;
__super__.call(this);
}
ThrowObservable.prototype.subscribeCore = function (o) {
var sink = new ThrowSink(o, this);
return sink.run();
};
function ThrowSink(o, p) {
this.o = o;
this.p = p;
}
function scheduleItem(s, state) {
var e = state[0], o = state[1];
o.onError(e);
}
ThrowSink.prototype.run = function () {
return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
};
return ThrowObservable;
}(ObservableBase));
/**
* Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
* There is an alias to this method called 'throwError' for browsers <IE9.
* @param {Mixed} error An object used for the sequence's termination.
* @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
*/
var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new ThrowObservable(error, scheduler);
};
/**
* Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
* @param {Function} resourceFactory Factory function to obtain a resource object.
* @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
* @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
*/
Observable.using = function (resourceFactory, observableFactory) {
return new AnonymousObservable(function (observer) {
var disposable = disposableEmpty, resource, source;
try {
resource = resourceFactory();
resource && (disposable = resource);
source = observableFactory(resource);
} catch (exception) {
return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
}
return new CompositeDisposable(source.subscribe(observer), disposable);
});
};
/**
* Propagates the observable sequence or Promise that reacts first.
* @param {Observable} rightSource Second observable sequence or Promise.
* @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
*/
observableProto.amb = function (rightSource) {
var leftSource = this;
return new AnonymousObservable(function (observer) {
var choice,
leftChoice = 'L', rightChoice = 'R',
leftSubscription = new SingleAssignmentDisposable(),
rightSubscription = new SingleAssignmentDisposable();
isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
function choiceL() {
if (!choice) {
choice = leftChoice;
rightSubscription.dispose();
}
}
function choiceR() {
if (!choice) {
choice = rightChoice;
leftSubscription.dispose();
}
}
leftSubscription.setDisposable(leftSource.subscribe(function (left) {
choiceL();
choice === leftChoice && observer.onNext(left);
}, function (err) {
choiceL();
choice === leftChoice && observer.onError(err);
}, function () {
choiceL();
choice === leftChoice && observer.onCompleted();
}));
rightSubscription.setDisposable(rightSource.subscribe(function (right) {
choiceR();
choice === rightChoice && observer.onNext(right);
}, function (err) {
choiceR();
choice === rightChoice && observer.onError(err);
}, function () {
choiceR();
choice === rightChoice && observer.onCompleted();
}));
return new CompositeDisposable(leftSubscription, rightSubscription);
});
};
/**
* Propagates the observable sequence or Promise that reacts first.
*
* @example
* var = Rx.Observable.amb(xs, ys, zs);
* @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
*/
Observable.amb = function () {
var acc = observableNever(), items = [];
if (Array.isArray(arguments[0])) {
items = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
}
function func(previous, current) {
return previous.amb(current);
}
for (var i = 0, len = items.length; i < len; i++) {
acc = func(acc, items[i]);
}
return acc;
};
function observableCatchHandler(source, handler) {
return new AnonymousObservable(function (o) {
var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
subscription.setDisposable(d1);
d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
try {
var result = handler(e);
} catch (ex) {
return o.onError(ex);
}
isPromise(result) && (result = observableFromPromise(result));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(result.subscribe(o));
}, function (x) { o.onCompleted(x); }));
return subscription;
}, source);
}
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @example
* 1 - xs.catchException(ys)
* 2 - xs.catchException(function (ex) { return ys(ex); })
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
*/
observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
return typeof handlerOrSecond === 'function' ?
observableCatchHandler(this, handlerOrSecond) :
observableCatch([this, handlerOrSecond]);
};
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
*/
var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
var items = [];
if (Array.isArray(arguments[0])) {
items = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
}
return enumerableOf(items).catchError();
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
* This can be in the form of an argument list of observables or an array.
*
* @example
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.combineLatest = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
if (Array.isArray(args[0])) {
args[0].unshift(this);
} else {
args.unshift(this);
}
return combineLatest.apply(this, args);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
var combineLatest = Observable.combineLatest = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var resultSelector = args.pop();
Array.isArray(args[0]) && (args = args[0]);
return new AnonymousObservable(function (o) {
var n = args.length,
falseFactory = function () { return false; },
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
isDone = arrayInitialize(n, falseFactory),
values = new Array(n);
function next(i) {
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
var res = resultSelector.apply(null, values);
} catch (e) {
return o.onError(e);
}
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
o.onCompleted();
}
}
function done (i) {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
values[i] = x;
next(i);
},
function(e) { o.onError(e); },
function () { done(i); }
));
subscriptions[i] = sad;
}(idx));
}
return new CompositeDisposable(subscriptions);
}, this);
};
/**
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
observableProto.concat = function () {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
args.unshift(this);
return observableConcat.apply(null, args);
};
var ConcatObservable = (function(__super__) {
inherits(ConcatObservable, __super__);
function ConcatObservable(sources) {
this.sources = sources;
__super__.call(this);
}
ConcatObservable.prototype.subscribeCore = function(o) {
var sink = new ConcatSink(this.sources, o);
return sink.run();
};
function ConcatSink(sources, o) {
this.sources = sources;
this.o = o;
}
ConcatSink.prototype.run = function () {
var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
if (isDisposed) { return; }
if (i === length) {
return o.onCompleted();
}
// Check if promise
var currentValue = sources[i];
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
function (x) { o.onNext(x); },
function (e) { o.onError(e); },
function () { self(i + 1); }
));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
};
return ConcatObservable;
}(ObservableBase));
/**
* Concatenates all the observable sequences.
* @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
var observableConcat = Observable.concat = function () {
var args;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
args = new Array(arguments.length);
for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
}
return new ConcatObservable(args);
};
/**
* Concatenates an observable sequence of observable sequences.
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
*/
observableProto.concatAll = observableProto.concatObservable = function () {
return this.merge(1);
};
var MergeObservable = (function (__super__) {
inherits(MergeObservable, __super__);
function MergeObservable(source, maxConcurrent) {
this.source = source;
this.maxConcurrent = maxConcurrent;
__super__.call(this);
}
MergeObservable.prototype.subscribeCore = function(observer) {
var g = new CompositeDisposable();
g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
return g;
};
return MergeObservable;
}(ObservableBase));
var MergeObserver = (function () {
function MergeObserver(o, max, g) {
this.o = o;
this.max = max;
this.g = g;
this.done = false;
this.q = [];
this.activeCount = 0;
this.isStopped = false;
}
MergeObserver.prototype.handleSubscribe = function (xs) {
var sad = new SingleAssignmentDisposable();
this.g.add(sad);
isPromise(xs) && (xs = observableFromPromise(xs));
sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
};
MergeObserver.prototype.onNext = function (innerSource) {
if (this.isStopped) { return; }
if(this.activeCount < this.max) {
this.activeCount++;
this.handleSubscribe(innerSource);
} else {
this.q.push(innerSource);
}
};
MergeObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
MergeObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.done = true;
this.activeCount === 0 && this.o.onCompleted();
}
};
MergeObserver.prototype.dispose = function() { this.isStopped = true; };
MergeObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, sad) {
this.parent = parent;
this.sad = sad;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
var parent = this.parent;
parent.g.remove(this.sad);
if (parent.q.length > 0) {
parent.handleSubscribe(parent.q.shift());
} else {
parent.activeCount--;
parent.done && parent.activeCount === 0 && parent.o.onCompleted();
}
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return MergeObserver;
}());
/**
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
* Or merges two observable sequences into a single observable sequence.
*
* @example
* 1 - merged = sources.merge(1);
* 2 - merged = source.merge(otherSource);
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.merge = function (maxConcurrentOrOther) {
return typeof maxConcurrentOrOther !== 'number' ?
observableMerge(this, maxConcurrentOrOther) :
new MergeObservable(this, maxConcurrentOrOther);
};
/**
* Merges all the observable sequences into a single observable sequence.
* The scheduler is optional and if not specified, the immediate scheduler is used.
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
*/
var observableMerge = Observable.merge = function () {
var scheduler, sources = [], i, len = arguments.length;
if (!arguments[0]) {
scheduler = immediateScheduler;
for(i = 1; i < len; i++) { sources.push(arguments[i]); }
} else if (isScheduler(arguments[0])) {
scheduler = arguments[0];
for(i = 1; i < len; i++) { sources.push(arguments[i]); }
} else {
scheduler = immediateScheduler;
for(i = 0; i < len; i++) { sources.push(arguments[i]); }
}
if (Array.isArray(sources[0])) {
sources = sources[0];
}
return observableOf(scheduler, sources).mergeAll();
};
var MergeAllObservable = (function (__super__) {
inherits(MergeAllObservable, __super__);
function MergeAllObservable(source) {
this.source = source;
__super__.call(this);
}
MergeAllObservable.prototype.subscribeCore = function (observer) {
var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
g.add(m);
m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
return g;
};
function MergeAllObserver(o, g) {
this.o = o;
this.g = g;
this.isStopped = false;
this.done = false;
}
MergeAllObserver.prototype.onNext = function(innerSource) {
if(this.isStopped) { return; }
var sad = new SingleAssignmentDisposable();
this.g.add(sad);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
};
MergeAllObserver.prototype.onError = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
MergeAllObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
this.done = true;
this.g.length === 1 && this.o.onCompleted();
}
};
MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
MergeAllObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, g, sad) {
this.parent = parent;
this.g = g;
this.sad = sad;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
var parent = this.parent;
this.isStopped = true;
parent.g.remove(this.sad);
parent.done && parent.g.length === 1 && parent.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return MergeAllObservable;
}(ObservableBase));
/**
* Merges an observable sequence of observable sequences into an observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.mergeAll = observableProto.mergeObservable = function () {
return new MergeAllObservable(this);
};
var CompositeError = Rx.CompositeError = function(errors) {
this.name = "NotImplementedError";
this.innerErrors = errors;
this.message = 'This contains multiple errors. Check the innerErrors';
Error.call(this);
}
CompositeError.prototype = Error.prototype;
/**
* Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
* receive all successfully emitted items from all of the source Observables without being interrupted by
* an error notification from one of them.
*
* This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
* error via the Observer's onError, mergeDelayError will refrain from propagating that
* error notification until all of the merged Observables have finished emitting items.
* @param {Array | Arguments} args Arguments or an array to merge.
* @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
*/
Observable.mergeDelayError = function() {
var args;
if (Array.isArray(arguments[0])) {
args = arguments[0];
} else {
var len = arguments.length;
args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
}
var source = observableOf(null, args);
return new AnonymousObservable(function (o) {
var group = new CompositeDisposable(),
m = new SingleAssignmentDisposable(),
isStopped = false,
errors = [];
function setCompletion() {
if (errors.length === 0) {
o.onCompleted();
} else if (errors.length === 1) {
o.onError(errors[0]);
} else {
o.onError(new CompositeError(errors));
}
}
group.add(m);
m.setDisposable(source.subscribe(
function (innerSource) {
var innerSubscription = new SingleAssignmentDisposable();
group.add(innerSubscription);
// Check for promises support
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) { o.onNext(x); },
function (e) {
errors.push(e);
group.remove(innerSubscription);
isStopped && group.length === 1 && setCompletion();
},
function () {
group.remove(innerSubscription);
isStopped && group.length === 1 && setCompletion();
}));
},
function (e) {
errors.push(e);
isStopped = true;
group.length === 1 && setCompletion();
},
function () {
isStopped = true;
group.length === 1 && setCompletion();
}));
return group;
});
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
* @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
* @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
*/
observableProto.onErrorResumeNext = function (second) {
if (!second) { throw new Error('Second observable is required'); }
return onErrorResumeNext([this, second]);
};
/**
* Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
* 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
* @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
*/
var onErrorResumeNext = Observable.onErrorResumeNext = function () {
var sources = [];
if (Array.isArray(arguments[0])) {
sources = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
}
return new AnonymousObservable(function (observer) {
var pos = 0, subscription = new SerialDisposable(),
cancelable = immediateScheduler.scheduleRecursive(function (self) {
var current, d;
if (pos < sources.length) {
current = sources[pos++];
isPromise(current) && (current = observableFromPromise(current));
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
} else {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Returns the values from the source observable sequence only after the other observable sequence produces a value.
* @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
*/
observableProto.skipUntil = function (other) {
var source = this;
return new AnonymousObservable(function (o) {
var isOpen = false;
var disposables = new CompositeDisposable(source.subscribe(function (left) {
isOpen && o.onNext(left);
}, function (e) { o.onError(e); }, function () {
isOpen && o.onCompleted();
}));
isPromise(other) && (other = observableFromPromise(other));
var rightSubscription = new SingleAssignmentDisposable();
disposables.add(rightSubscription);
rightSubscription.setDisposable(other.subscribe(function () {
isOpen = true;
rightSubscription.dispose();
}, function (e) { o.onError(e); }, function () {
rightSubscription.dispose();
}));
return disposables;
}, source);
};
var SwitchObservable = (function(__super__) {
inherits(SwitchObservable, __super__);
function SwitchObservable(source) {
this.source = source;
__super__.call(this);
}
SwitchObservable.prototype.subscribeCore = function (o) {
var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
return new CompositeDisposable(s, inner);
};
function SwitchObserver(o, inner) {
this.o = o;
this.inner = inner;
this.stopped = false;
this.latest = 0;
this.hasLatest = false;
this.isStopped = false;
}
SwitchObserver.prototype.onNext = function (innerSource) {
if (this.isStopped) { return; }
var d = new SingleAssignmentDisposable(), id = ++this.latest;
this.hasLatest = true;
this.inner.setDisposable(d);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
};
SwitchObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
}
};
SwitchObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.stopped = true;
!this.hasLatest && this.o.onCompleted();
}
};
SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
SwitchObserver.prototype.fail = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
function InnerObserver(parent, id) {
this.parent = parent;
this.id = id;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
this.parent.latest === this.id && this.parent.o.onNext(x);
};
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.parent.latest === this.id && this.parent.o.onError(e);
}
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
if (this.parent.latest === this.id) {
this.parent.hasLatest = false;
this.parent.isStopped && this.parent.o.onCompleted();
}
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; }
InnerObserver.prototype.fail = function (e) {
if(!this.isStopped) {
this.isStopped = true;
this.parent.o.onError(e);
return true;
}
return false;
};
return SwitchObservable;
}(ObservableBase));
/**
* Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto['switch'] = observableProto.switchLatest = function () {
return new SwitchObservable(this);
};
var TakeUntilObservable = (function(__super__) {
inherits(TakeUntilObservable, __super__);
function TakeUntilObservable(source, other) {
this.source = source;
this.other = isPromise(other) ? observableFromPromise(other) : other;
__super__.call(this);
}
TakeUntilObservable.prototype.subscribeCore = function(o) {
return new CompositeDisposable(
this.source.subscribe(o),
this.other.subscribe(new InnerObserver(o))
);
};
function InnerObserver(o) {
this.o = o;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
this.o.onCompleted();
};
InnerObserver.prototype.onError = function (err) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function () {
!this.isStopped && (this.isStopped = true);
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return TakeUntilObservable;
}(ObservableBase));
/**
* Returns the values from the source observable sequence until the other observable sequence produces a value.
* @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
*/
observableProto.takeUntil = function (other) {
return new TakeUntilObservable(this, other);
};
function falseFactory() { return false; }
/**
* Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.withLatestFrom = function () {
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var resultSelector = args.pop(), source = this;
Array.isArray(args[0]) && (args = args[0]);
return new AnonymousObservable(function (observer) {
var n = args.length,
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
values = new Array(n);
var subscriptions = new Array(n + 1);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var other = args[i], sad = new SingleAssignmentDisposable();
isPromise(other) && (other = observableFromPromise(other));
sad.setDisposable(other.subscribe(function (x) {
values[i] = x;
hasValue[i] = true;
hasValueAll = hasValue.every(identity);
}, function (e) { observer.onError(e); }, noop));
subscriptions[i] = sad;
}(idx));
}
var sad = new SingleAssignmentDisposable();
sad.setDisposable(source.subscribe(function (x) {
var allValues = [x].concat(values);
if (!hasValueAll) { return; }
var res = tryCatch(resultSelector).apply(null, allValues);
if (res === errorObj) { return observer.onError(res.e); }
observer.onNext(res);
}, function (e) { observer.onError(e); }, function () {
observer.onCompleted();
}));
subscriptions[n] = sad;
return new CompositeDisposable(subscriptions);
}, this);
};
function zipArray(second, resultSelector) {
var first = this;
return new AnonymousObservable(function (o) {
var index = 0, len = second.length;
return first.subscribe(function (left) {
if (index < len) {
var right = second[index++], res = tryCatch(resultSelector)(left, right);
if (res === errorObj) { return o.onError(res.e); }
o.onNext(res);
} else {
o.onCompleted();
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, first);
}
function falseFactory() { return false; }
function emptyArrayFactory() { return []; }
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
* The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
* @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
*/
observableProto.zip = function () {
if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var parent = this, resultSelector = args.pop();
args.unshift(parent);
return new AnonymousObservable(function (o) {
var n = args.length,
queues = arrayInitialize(n, emptyArrayFactory),
isDone = arrayInitialize(n, falseFactory);
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
queues[i].push(x);
if (queues.every(function (x) { return x.length > 0; })) {
var queuedValues = queues.map(function (x) { return x.shift(); }),
res = tryCatch(resultSelector).apply(parent, queuedValues);
if (res === errorObj) { return o.onError(res.e); }
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
o.onCompleted();
}
}, function (e) { o.onError(e); }, function () {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}));
subscriptions[i] = sad;
})(idx);
}
return new CompositeDisposable(subscriptions);
}, parent);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
* @param arguments Observable sources.
* @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
Observable.zip = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
var first = args.shift();
return first.zip.apply(first, args);
};
function falseFactory() { return false; }
function arrayFactory() { return []; }
/**
* Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
* @param arguments Observable sources.
* @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
*/
Observable.zipArray = function () {
var sources;
if (Array.isArray(arguments[0])) {
sources = arguments[0];
} else {
var len = arguments.length;
sources = new Array(len);
for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
}
return new AnonymousObservable(function (o) {
var n = sources.length,
queues = arrayInitialize(n, arrayFactory),
isDone = arrayInitialize(n, falseFactory);
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
if (queues.every(function (x) { return x.length > 0; })) {
var res = queues.map(function (x) { return x.shift(); });
o.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
return o.onCompleted();
}
}, function (e) { o.onError(e); }, function () {
isDone[i] = true;
isDone.every(identity) && o.onCompleted();
}));
})(idx);
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Hides the identity of an observable sequence.
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
*/
observableProto.asObservable = function () {
var source = this;
return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
};
/**
* Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
*
* @example
* var res = xs.bufferWithCount(10);
* var res = xs.bufferWithCount(10, 1);
* @param {Number} count Length of each buffer.
* @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithCount = function (count, skip) {
if (typeof skip !== 'number') {
skip = count;
}
return this.windowWithCount(count, skip).selectMany(function (x) {
return x.toArray();
}).where(function (x) {
return x.length > 0;
});
};
/**
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
*/
observableProto.dematerialize = function () {
var source = this;
return new AnonymousObservable(function (o) {
return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
/**
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
*
* var obs = observable.distinctUntilChanged();
* var obs = observable.distinctUntilChanged(function (x) { return x.id; });
* var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
*
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
*/
observableProto.distinctUntilChanged = function (keySelector, comparer) {
var source = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var hasCurrentKey = false, currentKey;
return source.subscribe(function (value) {
var key = value;
if (keySelector) {
key = tryCatch(keySelector)(value);
if (key === errorObj) { return o.onError(key.e); }
}
if (hasCurrentKey) {
var comparerEquals = tryCatch(comparer)(currentKey, key);
if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
}
if (!hasCurrentKey || !comparerEquals) {
hasCurrentKey = true;
currentKey = key;
o.onNext(value);
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
var TapObservable = (function(__super__) {
inherits(TapObservable,__super__);
function TapObservable(source, observerOrOnNext, onError, onCompleted) {
this.source = source;
this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
observerOrOnNext;
__super__.call(this);
}
TapObservable.prototype.subscribeCore = function(o) {
return this.source.subscribe(new InnerObserver(o, this.t));
};
function InnerObserver(o, t) {
this.o = o;
this.t = t;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var res = tryCatch(this.t.onNext).call(this.t, x);
if (res === errorObj) { this.o.onError(res.e); }
this.o.onNext(x);
};
InnerObserver.prototype.onError = function(err) {
if (!this.isStopped) {
this.isStopped = true;
var res = tryCatch(this.t.onError).call(this.t, err);
if (res === errorObj) { return this.o.onError(res.e); }
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function() {
if (!this.isStopped) {
this.isStopped = true;
var res = tryCatch(this.t.onCompleted).call(this.t);
if (res === errorObj) { return this.o.onError(res.e); }
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return TapObservable;
}(ObservableBase));
/**
* Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
return new TapObservable(this, observerOrOnNext, onError, onCompleted);
};
/**
* Invokes an action for each element in the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onNext Action to invoke for each element in the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
};
/**
* Invokes an action upon exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
};
/**
* Invokes an action upon graceful termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
* @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
};
/**
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
*/
observableProto['finally'] = observableProto.ensure = function (action) {
var source = this;
return new AnonymousObservable(function (observer) {
var subscription;
try {
subscription = source.subscribe(observer);
} catch (e) {
action();
throw e;
}
return disposableCreate(function () {
try {
subscription.dispose();
} catch (e) {
throw e;
} finally {
action();
}
});
}, this);
};
/**
* @deprecated use #finally or #ensure instead.
*/
observableProto.finallyAction = function (action) {
//deprecate('finallyAction', 'finally or ensure');
return this.ensure(action);
};
var IgnoreElementsObservable = (function(__super__) {
inherits(IgnoreElementsObservable, __super__);
function IgnoreElementsObservable(source) {
this.source = source;
__super__.call(this);
}
IgnoreElementsObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o));
};
function InnerObserver(o) {
this.o = o;
this.isStopped = false;
}
InnerObserver.prototype.onNext = noop;
InnerObserver.prototype.onError = function (err) {
if(!this.isStopped) {
this.isStopped = true;
this.o.onError(err);
}
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) {
this.isStopped = true;
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
return IgnoreElementsObservable;
}(ObservableBase));
/**
* Ignores all elements in an observable sequence leaving only the termination messages.
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
*/
observableProto.ignoreElements = function () {
return new IgnoreElementsObservable(this);
};
/**
* Materializes the implicit notifications of an observable sequence as explicit notification values.
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
*/
observableProto.materialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (value) {
observer.onNext(notificationCreateOnNext(value));
}, function (e) {
observer.onNext(notificationCreateOnError(e));
observer.onCompleted();
}, function () {
observer.onNext(notificationCreateOnCompleted());
observer.onCompleted();
});
}, source);
};
/**
* Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
* @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
* @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
*/
observableProto.repeat = function (repeatCount) {
return enumerableRepeat(this, repeatCount).concat();
};
/**
* Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
* Note if you encounter an error and want it to retry once, then you must use .retry(2);
*
* @example
* var res = retried = retry.repeat();
* var res = retried = retry.repeat(2);
* @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retry = function (retryCount) {
return enumerableRepeat(this, retryCount).catchError();
};
/**
* Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
* if the notifier completes, the observable sequence completes.
*
* @example
* var timer = Observable.timer(500);
* var source = observable.retryWhen(timer);
* @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retryWhen = function (notifier) {
return enumerableRepeat(this).catchErrorWhen(notifier);
};
var ScanObservable = (function(__super__) {
inherits(ScanObservable, __super__);
function ScanObservable(source, accumulator, hasSeed, seed) {
this.source = source;
this.accumulator = accumulator;
this.hasSeed = hasSeed;
this.seed = seed;
__super__.call(this);
}
ScanObservable.prototype.subscribeCore = function(observer) {
return this.source.subscribe(new ScanObserver(observer,this));
};
return ScanObservable;
}(ObservableBase));
function ScanObserver(observer, parent) {
this.observer = observer;
this.accumulator = parent.accumulator;
this.hasSeed = parent.hasSeed;
this.seed = parent.seed;
this.hasAccumulation = false;
this.accumulation = null;
this.hasValue = false;
this.isStopped = false;
}
ScanObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
!this.hasValue && (this.hasValue = true);
try {
if (this.hasAccumulation) {
this.accumulation = this.accumulator(this.accumulation, x);
} else {
this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
this.hasAccumulation = true;
}
} catch (e) {
return this.observer.onError(e);
}
this.observer.onNext(this.accumulation);
};
ScanObserver.prototype.onError = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
}
};
ScanObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
!this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
this.observer.onCompleted();
}
};
ScanObserver.prototype.dispose = function() { this.isStopped = true; };
ScanObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.observer.onError(e);
return true;
}
return false;
};
/**
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
* For aggregation behavior with no intermediate results, see Observable.aggregate.
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing the accumulated values.
*/
observableProto.scan = function () {
var hasSeed = false, seed, accumulator, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new ScanObservable(this, accumulator, hasSeed, seed);
};
/**
* Bypasses a specified number of elements at the end of an observable sequence.
* @description
* This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
* received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
* @param count Number of elements to bypass at the end of the source sequence.
* @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
*/
observableProto.skipLast = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && o.onNext(q.shift());
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
* @example
* var res = source.startWith(1, 2, 3);
* var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
* @param {Arguments} args The specified values to prepend to the observable sequence
* @returns {Observable} The source sequence prepended with the specified values.
*/
observableProto.startWith = function () {
var values, scheduler, start = 0;
if (!!arguments.length && isScheduler(arguments[0])) {
scheduler = arguments[0];
start = 1;
} else {
scheduler = immediateScheduler;
}
for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
return enumerableOf([observableFromArray(args, scheduler), this]).concat();
};
/**
* Returns a specified number of contiguous elements from the end of an observable sequence.
* @description
* This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
* the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
*/
observableProto.takeLast = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, function (e) { o.onError(e); }, function () {
while (q.length > 0) { o.onNext(q.shift()); }
o.onCompleted();
});
}, source);
};
/**
* Returns an array with the specified number of contiguous elements from the end of an observable sequence.
*
* @description
* This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
* source sequence, this buffer is produced on the result sequence.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
*/
observableProto.takeLastBuffer = function (count) {
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, function (e) { o.onError(e); }, function () {
o.onNext(q);
o.onCompleted();
});
}, source);
};
/**
* Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
*
* var res = xs.windowWithCount(10);
* var res = xs.windowWithCount(10, 1);
* @param {Number} count Length of each window.
* @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithCount = function (count, skip) {
var source = this;
+count || (count = 0);
Math.abs(count) === Infinity && (count = 0);
if (count <= 0) { throw new ArgumentOutOfRangeError(); }
skip == null && (skip = count);
+skip || (skip = 0);
Math.abs(skip) === Infinity && (skip = 0);
if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
return new AnonymousObservable(function (observer) {
var m = new SingleAssignmentDisposable(),
refCountDisposable = new RefCountDisposable(m),
n = 0,
q = [];
function createWindow () {
var s = new Subject();
q.push(s);
observer.onNext(addRef(s, refCountDisposable));
}
createWindow();
m.setDisposable(source.subscribe(
function (x) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
var c = n - count + 1;
c >= 0 && c % skip === 0 && q.shift().onCompleted();
++n % skip === 0 && createWindow();
},
function (e) {
while (q.length > 0) { q.shift().onError(e); }
observer.onError(e);
},
function () {
while (q.length > 0) { q.shift().onCompleted(); }
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
function concatMap(source, selector, thisArg) {
var selectorFunc = bindCallback(selector, thisArg, 3);
return source.map(function (x, i) {
var result = selectorFunc(x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
return result;
}).concatAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (isFunction(selector) && isFunction(resultSelector)) {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
(isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
return selectorResult.map(function (y, i2) {
return resultSelector(x, y, i, i2);
});
});
}
return isFunction(selector) ?
concatMap(this, selector, thisArg) :
concatMap(this, function () { return selector; });
};
/**
* Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
*/
observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
var source = this,
onNextFunc = bindCallback(onNext, thisArg, 2),
onErrorFunc = bindCallback(onError, thisArg, 1),
onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
var result;
try {
result = onNextFunc(x, index++);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
},
function (err) {
var result;
try {
result = onErrorFunc(err);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
},
function () {
var result;
try {
result = onCompletedFunc();
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
});
}, this).concatAll();
};
/**
* Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
*
* var res = obs = xs.defaultIfEmpty();
* 2 - obs = xs.defaultIfEmpty(false);
*
* @memberOf Observable#
* @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
* @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
*/
observableProto.defaultIfEmpty = function (defaultValue) {
var source = this;
defaultValue === undefined && (defaultValue = null);
return new AnonymousObservable(function (observer) {
var found = false;
return source.subscribe(function (x) {
found = true;
observer.onNext(x);
},
function (e) { observer.onError(e); },
function () {
!found && observer.onNext(defaultValue);
observer.onCompleted();
});
}, source);
};
// Swap out for Array.findIndex
function arrayIndexOfComparer(array, item, comparer) {
for (var i = 0, len = array.length; i < len; i++) {
if (comparer(array[i], item)) { return i; }
}
return -1;
}
function HashSet(comparer) {
this.comparer = comparer;
this.set = [];
}
HashSet.prototype.push = function(value) {
var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
retValue && this.set.push(value);
return retValue;
};
/**
* Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
* Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
*
* @example
* var res = obs = xs.distinct();
* 2 - obs = xs.distinct(function (x) { return x.id; });
* 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
* @param {Function} [keySelector] A function to compute the comparison key for each element.
* @param {Function} [comparer] Used to compare items in the collection.
* @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
*/
observableProto.distinct = function (keySelector, comparer) {
var source = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var hashSet = new HashSet(comparer);
return source.subscribe(function (x) {
var key = x;
if (keySelector) {
try {
key = keySelector(x);
} catch (e) {
o.onError(e);
return;
}
}
hashSet.push(key) && o.onNext(x);
},
function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, this);
};
/**
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
*
* @example
* var res = observable.groupBy(function (x) { return x.id; });
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
* @param {Function} keySelector A function to extract the key for each element.
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
* @param {Function} [comparer] Used to determine whether the objects are equal.
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
*/
observableProto.groupBy = function (keySelector, elementSelector, comparer) {
return this.groupByUntil(keySelector, elementSelector, observableNever, comparer);
};
/**
* Groups the elements of an observable sequence according to a specified key selector function.
* A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
* key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
*
* @example
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
* @param {Function} keySelector A function to extract the key for each element.
* @param {Function} durationSelector A function to signal the expiration of a group.
* @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used.
* @returns {Observable}
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
*
*/
observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) {
var source = this;
elementSelector || (elementSelector = identity);
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (observer) {
function handleError(e) { return function (item) { item.onError(e); }; }
var map = new Dictionary(0, comparer),
groupDisposable = new CompositeDisposable(),
refCountDisposable = new RefCountDisposable(groupDisposable);
groupDisposable.add(source.subscribe(function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
map.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
var fireNewMapEntry = false,
writer = map.tryGetValue(key);
if (!writer) {
writer = new Subject();
map.set(key, writer);
fireNewMapEntry = true;
}
if (fireNewMapEntry) {
var group = new GroupedObservable(key, writer, refCountDisposable),
durationGroup = new GroupedObservable(key, writer);
try {
duration = durationSelector(durationGroup);
} catch (e) {
map.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
observer.onNext(group);
var md = new SingleAssignmentDisposable();
groupDisposable.add(md);
var expire = function () {
map.remove(key) && writer.onCompleted();
groupDisposable.remove(md);
};
md.setDisposable(duration.take(1).subscribe(
noop,
function (exn) {
map.getValues().forEach(handleError(exn));
observer.onError(exn);
},
expire)
);
}
var element;
try {
element = elementSelector(x);
} catch (e) {
map.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
writer.onNext(element);
}, function (ex) {
map.getValues().forEach(handleError(ex));
observer.onError(ex);
}, function () {
map.getValues().forEach(function (item) { item.onCompleted(); });
observer.onCompleted();
}));
return refCountDisposable;
}, source);
};
var MapObservable = (function (__super__) {
inherits(MapObservable, __super__);
function MapObservable(source, selector, thisArg) {
this.source = source;
this.selector = bindCallback(selector, thisArg, 3);
__super__.call(this);
}
function innerMap(selector, self) {
return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
}
MapObservable.prototype.internalMap = function (selector, thisArg) {
return new MapObservable(this.source, innerMap(selector, this), thisArg);
};
MapObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o, this.selector, this));
};
function InnerObserver(o, selector, source) {
this.o = o;
this.selector = selector;
this.source = source;
this.i = 0;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var result = tryCatch(this.selector)(x, this.i++, this.source);
if (result === errorObj) {
return this.o.onError(result.e);
}
this.o.onNext(result);
};
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return MapObservable;
}(ObservableBase));
/**
* Projects each element of an observable sequence into a new form by incorporating the element's index.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
*/
observableProto.map = observableProto.select = function (selector, thisArg) {
var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
return this instanceof MapObservable ?
this.internalMap(selectorFn, thisArg) :
new MapObservable(this, selectorFn, thisArg);
};
/**
* Retrieves the value of a specified nested property from all elements in
* the Observable sequence.
* @param {Arguments} arguments The nested properties to pluck.
* @returns {Observable} Returns a new Observable sequence of property values.
*/
observableProto.pluck = function () {
var args = arguments, len = arguments.length;
if (len === 0) { throw new Error('List of properties cannot be empty.'); }
return this.map(function (x) {
var currentProp = x;
for (var i = 0; i < len; i++) {
var p = currentProp[args[i]];
if (typeof p !== 'undefined') {
currentProp = p;
} else {
return undefined;
}
}
return currentProp;
});
};
function flatMap(source, selector, thisArg) {
var selectorFunc = bindCallback(selector, thisArg, 3);
return source.map(function (x, i) {
var result = selectorFunc(x, i, source);
isPromise(result) && (result = observableFromPromise(result));
(isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
return result;
}).mergeAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (isFunction(selector) && isFunction(resultSelector)) {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i);
isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
(isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
return selectorResult.map(function (y, i2) {
return resultSelector(x, y, i, i2);
});
}, thisArg);
}
return isFunction(selector) ?
flatMap(this, selector, thisArg) :
flatMap(this, function () { return selector; });
};
/**
* Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
* @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
* @param {Function} onError A transform function to apply when an error occurs in the source sequence.
* @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
* @param {Any} [thisArg] An optional "this" to use to invoke each transform.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
*/
observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
var source = this;
return new AnonymousObservable(function (observer) {
var index = 0;
return source.subscribe(
function (x) {
var result;
try {
result = onNext.call(thisArg, x, index++);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
},
function (err) {
var result;
try {
result = onError.call(thisArg, err);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
},
function () {
var result;
try {
result = onCompleted.call(thisArg);
} catch (e) {
observer.onError(e);
return;
}
isPromise(result) && (result = observableFromPromise(result));
observer.onNext(result);
observer.onCompleted();
});
}, source).mergeAll();
};
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
return this.select(selector, thisArg).switchLatest();
};
var SkipObservable = (function(__super__) {
inherits(SkipObservable, __super__);
function SkipObservable(source, count) {
this.source = source;
this.skipCount = count;
__super__.call(this);
}
SkipObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o, this.skipCount));
};
function InnerObserver(o, c) {
this.c = c;
this.r = c;
this.o = o;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
if (this.r <= 0) {
this.o.onNext(x);
} else {
this.r--;
}
};
InnerObserver.prototype.onError = function(e) {
if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function() {
if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function(e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return SkipObservable;
}(ObservableBase));
/**
* Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
* @param {Number} count The number of elements to skip before returning the remaining elements.
* @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
*/
observableProto.skip = function (count) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
return new SkipObservable(this, count);
};
/**
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
* The element's index is used in the logic of the predicate function.
*
* var res = source.skipWhile(function (value) { return value < 10; });
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
*/
observableProto.skipWhile = function (predicate, thisArg) {
var source = this,
callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0, running = false;
return source.subscribe(function (x) {
if (!running) {
try {
running = !callback(x, i++, source);
} catch (e) {
o.onError(e);
return;
}
}
running && o.onNext(x);
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
*
* var res = source.take(5);
* var res = source.take(0, Rx.Scheduler.timeout);
* @param {Number} count The number of elements to return.
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
*/
observableProto.take = function (count, scheduler) {
if (count < 0) { throw new ArgumentOutOfRangeError(); }
if (count === 0) { return observableEmpty(scheduler); }
var source = this;
return new AnonymousObservable(function (o) {
var remaining = count;
return source.subscribe(function (x) {
if (remaining-- > 0) {
o.onNext(x);
remaining <= 0 && o.onCompleted();
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
/**
* Returns elements from an observable sequence as long as a specified condition is true.
* The element's index is used in the logic of the predicate function.
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
*/
observableProto.takeWhile = function (predicate, thisArg) {
var source = this,
callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0, running = true;
return source.subscribe(function (x) {
if (running) {
try {
running = callback(x, i++, source);
} catch (e) {
o.onError(e);
return;
}
if (running) {
o.onNext(x);
} else {
o.onCompleted();
}
}
}, function (e) { o.onError(e); }, function () { o.onCompleted(); });
}, source);
};
var FilterObservable = (function (__super__) {
inherits(FilterObservable, __super__);
function FilterObservable(source, predicate, thisArg) {
this.source = source;
this.predicate = bindCallback(predicate, thisArg, 3);
__super__.call(this);
}
FilterObservable.prototype.subscribeCore = function (o) {
return this.source.subscribe(new InnerObserver(o, this.predicate, this));
};
function innerPredicate(predicate, self) {
return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
}
FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
};
function InnerObserver(o, predicate, source) {
this.o = o;
this.predicate = predicate;
this.source = source;
this.i = 0;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function(x) {
if (this.isStopped) { return; }
var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
if (shouldYield === errorObj) {
return this.o.onError(shouldYield.e);
}
shouldYield && this.o.onNext(x);
};
InnerObserver.prototype.onError = function (e) {
if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function () {
if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
};
InnerObserver.prototype.dispose = function() { this.isStopped = true; };
InnerObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return FilterObservable;
}(ObservableBase));
/**
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
*/
observableProto.filter = observableProto.where = function (predicate, thisArg) {
return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
new FilterObservable(this, predicate, thisArg);
};
function extremaBy(source, keySelector, comparer) {
return new AnonymousObservable(function (o) {
var hasValue = false, lastKey = null, list = [];
return source.subscribe(function (x) {
var comparison, key;
try {
key = keySelector(x);
} catch (ex) {
o.onError(ex);
return;
}
comparison = 0;
if (!hasValue) {
hasValue = true;
lastKey = key;
} else {
try {
comparison = comparer(key, lastKey);
} catch (ex1) {
o.onError(ex1);
return;
}
}
if (comparison > 0) {
lastKey = key;
list = [];
}
if (comparison >= 0) { list.push(x); }
}, function (e) { o.onError(e); }, function () {
o.onNext(list);
o.onCompleted();
});
}, source);
}
function firstOnly(x) {
if (x.length === 0) { throw new EmptyError(); }
return x[0];
}
/**
* Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
* For aggregation behavior with incremental intermediate results, see Observable.scan.
* @deprecated Use #reduce instead
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing a single element with the final accumulator value.
*/
observableProto.aggregate = function () {
var hasSeed = false, accumulator, seed, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new AnonymousObservable(function (o) {
var hasAccumulation, accumulation, hasValue;
return source.subscribe (
function (x) {
!hasValue && (hasValue = true);
try {
if (hasAccumulation) {
accumulation = accumulator(accumulation, x);
} else {
accumulation = hasSeed ? accumulator(seed, x) : x;
hasAccumulation = true;
}
} catch (e) {
return o.onError(e);
}
},
function (e) { o.onError(e); },
function () {
hasValue && o.onNext(accumulation);
!hasValue && hasSeed && o.onNext(seed);
!hasValue && !hasSeed && o.onError(new EmptyError());
o.onCompleted();
}
);
}, source);
};
var ReduceObservable = (function(__super__) {
inherits(ReduceObservable, __super__);
function ReduceObservable(source, acc, hasSeed, seed) {
this.source = source;
this.acc = acc;
this.hasSeed = hasSeed;
this.seed = seed;
__super__.call(this);
}
ReduceObservable.prototype.subscribeCore = function(observer) {
return this.source.subscribe(new InnerObserver(observer,this));
};
function InnerObserver(o, parent) {
this.o = o;
this.acc = parent.acc;
this.hasSeed = parent.hasSeed;
this.seed = parent.seed;
this.hasAccumulation = false;
this.result = null;
this.hasValue = false;
this.isStopped = false;
}
InnerObserver.prototype.onNext = function (x) {
if (this.isStopped) { return; }
!this.hasValue && (this.hasValue = true);
if (this.hasAccumulation) {
this.result = tryCatch(this.acc)(this.result, x);
} else {
this.result = this.hasSeed ? tryCatch(this.acc)(this.seed, x) : x;
this.hasAccumulation = true;
}
if (this.result === errorObj) { this.o.onError(this.result.e); }
};
InnerObserver.prototype.onError = function (e) {
if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
};
InnerObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.hasValue && this.o.onNext(this.result);
!this.hasValue && this.hasSeed && this.o.onNext(this.seed);
!this.hasValue && !this.hasSeed && this.o.onError(new EmptyError());
this.o.onCompleted();
}
};
InnerObserver.prototype.dispose = function () { this.isStopped = true; };
InnerObserver.prototype.fail = function(e) {
if (!this.isStopped) {
this.isStopped = true;
this.o.onError(e);
return true;
}
return false;
};
return ReduceObservable;
}(ObservableBase));
/**
* Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
* For aggregation behavior with incremental intermediate results, see Observable.scan.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @param {Any} [seed] The initial accumulator value.
* @returns {Observable} An observable sequence containing a single element with the final accumulator value.
*/
observableProto.reduce = function (accumulator) {
var hasSeed = false;
if (arguments.length === 2) {
hasSeed = true;
var seed = arguments[1];
}
return new ReduceObservable(this, accumulator, hasSeed, seed);
};
/**
* Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence.
* @param {Function} [predicate] A function to test each element for a condition.
* @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence.
*/
observableProto.some = function (predicate, thisArg) {
var source = this;
return predicate ?
source.filter(predicate, thisArg).some() :
new AnonymousObservable(function (observer) {
return source.subscribe(function () {
observer.onNext(true);
observer.onCompleted();
}, function (e) { observer.onError(e); }, function () {
observer.onNext(false);
observer.onCompleted();
});
}, source);
};
/** @deprecated use #some instead */
observableProto.any = function () {
//deprecate('any', 'some');
return this.some.apply(this, arguments);
};
/**
* Determines whether an observable sequence is empty.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
*/
observableProto.isEmpty = function () {
return this.any().map(not);
};
/**
* Determines whether all elements of an observable sequence satisfy a condition.
* @param {Function} [predicate] A function to test each element for a condition.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.
*/
observableProto.every = function (predicate, thisArg) {
return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not);
};
/** @deprecated use #every instead */
observableProto.all = function () {
//deprecate('all', 'every');
return this.every.apply(this, arguments);
};
/**
* Determines whether an observable sequence includes a specified element with an optional equality comparer.
* @param searchElement The value to locate in the source sequence.
* @param {Number} [fromIndex] An equality comparer to compare elements.
* @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
*/
observableProto.includes = function (searchElement, fromIndex) {
var source = this;
function comparer(a, b) {
return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
}
return new AnonymousObservable(function (o) {
var i = 0, n = +fromIndex || 0;
Math.abs(n) === Infinity && (n = 0);
if (n < 0) {
o.onNext(false);
o.onCompleted();
return disposableEmpty;
}
return source.subscribe(
function (x) {
if (i++ >= n && comparer(x, searchElement)) {
o.onNext(true);
o.onCompleted();
}
},
function (e) { o.onError(e); },
function () {
o.onNext(false);
o.onCompleted();
});
}, this);
};
/**
* @deprecated use #includes instead.
*/
observableProto.contains = function (searchElement, fromIndex) {
//deprecate('contains', 'includes');
observableProto.includes(searchElement, fromIndex);
};
/**
* Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
* @example
* res = source.count();
* res = source.count(function (x) { return x > 3; });
* @param {Function} [predicate]A function to test each element for a condition.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
*/
observableProto.count = function (predicate, thisArg) {
return predicate ?
this.filter(predicate, thisArg).count() :
this.reduce(function (count) { return count + 1; }, 0);
};
/**
* Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
* @param {Any} searchElement Element to locate in the array.
* @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
* @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
*/
observableProto.indexOf = function(searchElement, fromIndex) {
var source = this;
return new AnonymousObservable(function (o) {
var i = 0, n = +fromIndex || 0;
Math.abs(n) === Infinity && (n = 0);
if (n < 0) {
o.onNext(-1);
o.onCompleted();
return disposableEmpty;
}
return source.subscribe(
function (x) {
if (i >= n && x === searchElement) {
o.onNext(i);
o.onCompleted();
}
i++;
},
function (e) { o.onError(e); },
function () {
o.onNext(-1);
o.onCompleted();
});
}, source);
};
/**
* Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
* @param {Function} [selector] A transform function to apply to each element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
*/
observableProto.sum = function (keySelector, thisArg) {
return keySelector && isFunction(keySelector) ?
this.map(keySelector, thisArg).sum() :
this.reduce(function (prev, curr) { return prev + curr; }, 0);
};
/**
* Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
* @example
* var res = source.minBy(function (x) { return x.value; });
* var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
* @param {Function} keySelector Key selector function.
* @param {Function} [comparer] Comparer used to compare key values.
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
*/
observableProto.minBy = function (keySelector, comparer) {
comparer || (comparer = defaultSubComparer);
return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; });
};
/**
* Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check.
* @example
* var res = source.min();
* var res = source.min(function (x, y) { return x.value - y.value; });
* @param {Function} [comparer] Comparer used to compare elements.
* @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence.
*/
observableProto.min = function (comparer) {
return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); });
};
/**
* Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
* @example
* var res = source.maxBy(function (x) { return x.value; });
* var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
* @param {Function} keySelector Key selector function.
* @param {Function} [comparer] Comparer used to compare key values.
* @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
*/
observableProto.maxBy = function (keySelector, comparer) {
comparer || (comparer = defaultSubComparer);
return extremaBy(this, keySelector, comparer);
};
/**
* Returns the maximum value in an observable sequence according to the specified comparer.
* @example
* var res = source.max();
* var res = source.max(function (x, y) { return x.value - y.value; });
* @param {Function} [comparer] Comparer used to compare elements.
* @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.
*/
observableProto.max = function (comparer) {
return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); });
};
/**
* Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present.
* @param {Function} [selector] A transform function to apply to each element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
*/
observableProto.average = function (keySelector, thisArg) {
return keySelector && isFunction(keySelector) ?
this.map(keySelector, thisArg).average() :
this.reduce(function (prev, cur) {
return {
sum: prev.sum + cur,
count: prev.count + 1
};
}, {sum: 0, count: 0 }).map(function (s) {
if (s.count === 0) { throw new EmptyError(); }
return s.sum / s.count;
});
};
/**
* Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
*
* @example
* var res = res = source.sequenceEqual([1,2,3]);
* var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; });
* 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42));
* 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; });
* @param {Observable} second Second observable sequence or array to compare.
* @param {Function} [comparer] Comparer used to compare elements of both sequences.
* @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer.
*/
observableProto.sequenceEqual = function (second, comparer) {
var first = this;
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (o) {
var donel = false, doner = false, ql = [], qr = [];
var subscription1 = first.subscribe(function (x) {
var equal, v;
if (qr.length > 0) {
v = qr.shift();
try {
equal = comparer(v, x);
} catch (e) {
o.onError(e);
return;
}
if (!equal) {
o.onNext(false);
o.onCompleted();
}
} else if (doner) {
o.onNext(false);
o.onCompleted();
} else {
ql.push(x);
}
}, function(e) { o.onError(e); }, function () {
donel = true;
if (ql.length === 0) {
if (qr.length > 0) {
o.onNext(false);
o.onCompleted();
} else if (doner) {
o.onNext(true);
o.onCompleted();
}
}
});
(isArrayLike(second) || isIterable(second)) && (second = observableFrom(second));
isPromise(second) && (second = observableFromPromise(second));
var subscription2 = second.subscribe(function (x) {
var equal;
if (ql.length > 0) {
var v = ql.shift();
try {
equal = comparer(v, x);
} catch (exception) {
o.onError(exception);
return;
}
if (!equal) {
o.onNext(false);
o.onCompleted();
}
} else if (donel) {
o.onNext(false);
o.onCompleted();
} else {
qr.push(x);
}
}, function(e) { o.onError(e); }, function () {
doner = true;
if (qr.length === 0) {
if (ql.length > 0) {
o.onNext(false);
o.onCompleted();
} else if (donel) {
o.onNext(true);
o.onCompleted();
}
}
});
return new CompositeDisposable(subscription1, subscription2);
}, first);
};
function elementAtOrDefault(source, index, hasDefault, defaultValue) {
if (index < 0) { throw new ArgumentOutOfRangeError(); }
return new AnonymousObservable(function (o) {
var i = index;
return source.subscribe(function (x) {
if (i-- === 0) {
o.onNext(x);
o.onCompleted();
}
}, function (e) { o.onError(e); }, function () {
if (!hasDefault) {
o.onError(new ArgumentOutOfRangeError());
} else {
o.onNext(defaultValue);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the element at a specified index in a sequence.
* @example
* var res = source.elementAt(5);
* @param {Number} index The zero-based index of the element to retrieve.
* @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence.
*/
observableProto.elementAt = function (index) {
return elementAtOrDefault(this, index, false);
};
/**
* Returns the element at a specified index in a sequence or a default value if the index is out of range.
* @example
* var res = source.elementAtOrDefault(5);
* var res = source.elementAtOrDefault(5, 0);
* @param {Number} index The zero-based index of the element to retrieve.
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
* @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.
*/
observableProto.elementAtOrDefault = function (index, defaultValue) {
return elementAtOrDefault(this, index, true, defaultValue);
};
function singleOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
var value = defaultValue, seenValue = false;
return source.subscribe(function (x) {
if (seenValue) {
o.onError(new Error('Sequence contains more than one element'));
} else {
value = x;
seenValue = true;
}
}, function (e) { o.onError(e); }, function () {
if (!seenValue && !hasDefault) {
o.onError(new EmptyError());
} else {
o.onNext(value);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
*/
observableProto.single = function (predicate, thisArg) {
return predicate && isFunction(predicate) ?
this.where(predicate, thisArg).single() :
singleOrDefaultAsync(this, false);
};
/**
* Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence.
* @example
* var res = res = source.singleOrDefault();
* var res = res = source.singleOrDefault(function (x) { return x === 42; });
* res = source.singleOrDefault(function (x) { return x === 42; }, 0);
* res = source.singleOrDefault(null, 0);
* @memberOf Observable#
* @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
*/
observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
return predicate && isFunction(predicate) ?
this.filter(predicate, thisArg).singleOrDefault(null, defaultValue) :
singleOrDefaultAsync(this, true, defaultValue);
};
function firstOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
return source.subscribe(function (x) {
o.onNext(x);
o.onCompleted();
}, function (e) { o.onError(e); }, function () {
if (!hasDefault) {
o.onError(new EmptyError());
} else {
o.onNext(defaultValue);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence.
* @example
* var res = res = source.first();
* var res = res = source.first(function (x) { return x > 3; });
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
*/
observableProto.first = function (predicate, thisArg) {
return predicate ?
this.where(predicate, thisArg).first() :
firstOrDefaultAsync(this, false);
};
/**
* Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
*/
observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) {
return predicate ?
this.where(predicate).firstOrDefault(null, defaultValue) :
firstOrDefaultAsync(this, true, defaultValue);
};
function lastOrDefaultAsync(source, hasDefault, defaultValue) {
return new AnonymousObservable(function (o) {
var value = defaultValue, seenValue = false;
return source.subscribe(function (x) {
value = x;
seenValue = true;
}, function (e) { o.onError(e); }, function () {
if (!seenValue && !hasDefault) {
o.onError(new EmptyError());
} else {
o.onNext(value);
o.onCompleted();
}
});
}, source);
}
/**
* Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
*/
observableProto.last = function (predicate, thisArg) {
return predicate ?
this.where(predicate, thisArg).last() :
lastOrDefaultAsync(this, false);
};
/**
* Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
* @param [defaultValue] The default value if no such element exists. If not specified, defaults to null.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
*/
observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) {
return predicate ?
this.where(predicate, thisArg).lastOrDefault(null, defaultValue) :
lastOrDefaultAsync(this, true, defaultValue);
};
function findValue (source, predicate, thisArg, yieldIndex) {
var callback = bindCallback(predicate, thisArg, 3);
return new AnonymousObservable(function (o) {
var i = 0;
return source.subscribe(function (x) {
var shouldRun;
try {
shouldRun = callback(x, i, source);
} catch (e) {
o.onError(e);
return;
}
if (shouldRun) {
o.onNext(yieldIndex ? i : x);
o.onCompleted();
} else {
i++;
}
}, function (e) { o.onError(e); }, function () {
o.onNext(yieldIndex ? -1 : undefined);
o.onCompleted();
});
}, source);
}
/**
* Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
*/
observableProto.find = function (predicate, thisArg) {
return findValue(this, predicate, thisArg, false);
};
/**
* Searches for an element that matches the conditions defined by the specified predicate, and returns
* an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
* @param {Function} predicate The predicate that defines the conditions of the element to search for.
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
* @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
*/
observableProto.findIndex = function (predicate, thisArg) {
return findValue(this, predicate, thisArg, true);
};
/**
* Converts the observable sequence to a Set if it exists.
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
*/
observableProto.toSet = function () {
if (typeof root.Set === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var s = new root.Set();
return source.subscribe(
function (x) { s.add(x); },
function (e) { o.onError(e); },
function () {
o.onNext(s);
o.onCompleted();
});
}, source);
};
/**
* Converts the observable sequence to a Map if it exists.
* @param {Function} keySelector A function which produces the key for the Map.
* @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
*/
observableProto.toMap = function (keySelector, elementSelector) {
if (typeof root.Map === 'undefined') { throw new TypeError(); }
var source = this;
return new AnonymousObservable(function (o) {
var m = new root.Map();
return source.subscribe(
function (x) {
var key;
try {
key = keySelector(x);
} catch (e) {
o.onError(e);
return;
}
var element = x;
if (elementSelector) {
try {
element = elementSelector(x);
} catch (e) {
o.onError(e);
return;
}
}
m.set(key, element);
},
function (e) { o.onError(e); },
function () {
o.onNext(m);
o.onCompleted();
});
}, source);
};
var fnString = 'function',
throwString = 'throw',
isObject = Rx.internals.isObject;
function toThunk(obj, ctx) {
if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
if (isGenerator(obj)) { return observableSpawn(obj); }
if (isObservable(obj)) { return observableToThunk(obj); }
if (isPromise(obj)) { return promiseToThunk(obj); }
if (typeof obj === fnString) { return obj; }
if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
return obj;
}
function objectToThunk(obj) {
var ctx = this;
return function (done) {
var keys = Object.keys(obj),
pending = keys.length,
results = new obj.constructor(),
finished;
if (!pending) {
timeoutScheduler.schedule(function () { done(null, results); });
return;
}
for (var i = 0, len = keys.length; i < len; i++) {
run(obj[keys[i]], keys[i]);
}
function run(fn, key) {
if (finished) { return; }
try {
fn = toThunk(fn, ctx);
if (typeof fn !== fnString) {
results[key] = fn;
return --pending || done(null, results);
}
fn.call(ctx, function(err, res) {
if (finished) { return; }
if (err) {
finished = true;
return done(err);
}
results[key] = res;
--pending || done(null, results);
});
} catch (e) {
finished = true;
done(e);
}
}
}
}
function observableToThunk(observable) {
return function (fn) {
var value, hasValue = false;
observable.subscribe(
function (v) {
value = v;
hasValue = true;
},
fn,
function () {
hasValue && fn(null, value);
});
}
}
function promiseToThunk(promise) {
return function(fn) {
promise.then(function(res) {
fn(null, res);
}, fn);
}
}
function isObservable(obj) {
return obj && typeof obj.subscribe === fnString;
}
function isGeneratorFunction(obj) {
return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction';
}
function isGenerator(obj) {
return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString;
}
/*
* Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
* @param {Function} The spawning function.
* @returns {Function} a function which has a done continuation.
*/
var observableSpawn = Rx.spawn = function (fn) {
var isGenFun = isGeneratorFunction(fn);
return function (done) {
var ctx = this,
gen = fn;
if (isGenFun) {
for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
var len = args.length,
hasCallback = len && typeof args[len - 1] === fnString;
done = hasCallback ? args.pop() : handleError;
gen = fn.apply(this, args);
} else {
done = done || handleError;
}
next();
function exit(err, res) {
timeoutScheduler.schedule(done.bind(ctx, err, res));
}
function next(err, res) {
var ret;
// multiple args
if (arguments.length > 2) {
for(var res = [], i = 1, len = arguments.length; i < len; i++) { res.push(arguments[i]); }
}
if (err) {
try {
ret = gen[throwString](err);
} catch (e) {
return exit(e);
}
}
if (!err) {
try {
ret = gen.next(res);
} catch (e) {
return exit(e);
}
}
if (ret.done) {
return exit(null, ret.value);
}
ret.value = toThunk(ret.value, ctx);
if (typeof ret.value === fnString) {
var called = false;
try {
ret.value.call(ctx, function() {
if (called) {
return;
}
called = true;
next.apply(ctx, arguments);
});
} catch (e) {
timeoutScheduler.schedule(function () {
if (called) {
return;
}
called = true;
next.call(ctx, e);
});
}
return;
}
// Not supported
next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
}
}
};
function handleError(err) {
if (!err) { return; }
timeoutScheduler.schedule(function() {
throw err;
});
}
/**
* Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
*
* @example
* var res = Rx.Observable.start(function () { console.log('hello'); });
* var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
* var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
*
* @param {Function} func Function to run asynchronously.
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
* @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
*
* Remarks
* * The function is called immediately, not during the subscription of the resulting sequence.
* * Multiple subscriptions to the resulting sequence can observe the function's result.
*/
Observable.start = function (func, context, scheduler) {
return observableToAsync(func, context, scheduler)();
};
/**
* Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
* @param {Function} function Function to convert to an asynchronous function.
* @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @returns {Function} Asynchronous function.
*/
var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return function () {
var args = arguments,
subject = new AsyncSubject();
scheduler.schedule(function () {
var result;
try {
result = func.apply(context, args);
} catch (e) {
subject.onError(e);
return;
}
subject.onNext(result);
subject.onCompleted();
});
return subject.asObservable();
};
};
/**
* Converts a callback function to an observable sequence.
*
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
*/
Observable.fromCallback = function (func, context, selector) {
return function () {
var len = arguments.length, args = new Array(len)
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler() {
var len = arguments.length, results = new Array(len);
for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
if (selector) {
try {
results = selector.apply(context, results);
} catch (e) {
return observer.onError(e);
}
observer.onNext(results);
} else {
if (results.length <= 1) {
observer.onNext.apply(observer, results);
} else {
observer.onNext(results);
}
}
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
}).publishLast().refCount();
};
};
/**
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
* @param {Function} func The function to call
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
*/
Observable.fromNodeCallback = function (func, context, selector) {
return function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return new AnonymousObservable(function (observer) {
function handler(err) {
if (err) {
observer.onError(err);
return;
}
var len = arguments.length, results = [];
for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
if (selector) {
try {
results = selector.apply(context, results);
} catch (e) {
return observer.onError(e);
}
observer.onNext(results);
} else {
if (results.length <= 1) {
observer.onNext.apply(observer, results);
} else {
observer.onNext(results);
}
}
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
}).publishLast().refCount();
};
};
function createListener (element, name, handler) {
if (element.addEventListener) {
element.addEventListener(name, handler, false);
return disposableCreate(function () {
element.removeEventListener(name, handler, false);
});
}
throw new Error('No listener found');
}
function createEventListener (el, eventName, handler) {
var disposables = new CompositeDisposable();
// Asume NodeList or HTMLCollection
var toStr = Object.prototype.toString;
if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
for (var i = 0, len = el.length; i < len; i++) {
disposables.add(createEventListener(el.item(i), eventName, handler));
}
} else if (el) {
disposables.add(createListener(el, eventName, handler));
}
return disposables;
}
/**
* Configuration option to determine whether to use native events only
*/
Rx.config.useNativeEvents = false;
/**
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
*
* @example
* var source = Rx.Observable.fromEvent(element, 'mouseup');
*
* @param {Object} element The DOMElement or NodeList to attach a listener.
* @param {String} eventName The event name to attach the observable sequence.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence of events from the specified element and the specified event.
*/
Observable.fromEvent = function (element, eventName, selector) {
// Node.js specific
if (element.addListener) {
return fromEventPattern(
function (h) { element.addListener(eventName, h); },
function (h) { element.removeListener(eventName, h); },
selector);
}
// Use only if non-native events are allowed
if (!Rx.config.useNativeEvents) {
// Handles jq, Angular.js, Zepto, Marionette, Ember.js
if (typeof element.on === 'function' && typeof element.off === 'function') {
return fromEventPattern(
function (h) { element.on(eventName, h); },
function (h) { element.off(eventName, h); },
selector);
}
}
return new AnonymousObservable(function (observer) {
return createEventListener(
element,
eventName,
function handler (e) {
var results = e;
if (selector) {
try {
results = selector(arguments);
} catch (err) {
return observer.onError(err);
}
}
observer.onNext(results);
});
}).publish().refCount();
};
/**
* Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
* @param {Function} addHandler The function to add a handler to the emitter.
* @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new AnonymousObservable(function (observer) {
function innerHandler (e) {
var result = e;
if (selector) {
try {
result = selector(arguments);
} catch (err) {
return observer.onError(err);
}
}
observer.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
if (removeHandler) {
removeHandler(innerHandler, returnValue);
}
});
}).publish().refCount();
};
/**
* Invokes the asynchronous function, surfacing the result through an observable sequence.
* @param {Function} functionAsync Asynchronous function which returns a Promise to run.
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
*/
Observable.startAsync = function (functionAsync) {
var promise;
try {
promise = functionAsync();
} catch (e) {
return observableThrow(e);
}
return observableFromPromise(promise);
}
var PausableObservable = (function (__super__) {
inherits(PausableObservable, __super__);
function subscribe(observer) {
var conn = this.source.publish(),
subscription = conn.subscribe(observer),
connection = disposableEmpty;
var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
if (b) {
connection = conn.connect();
} else {
connection.dispose();
connection = disposableEmpty;
}
});
return new CompositeDisposable(subscription, connection, pausable);
}
function PausableObservable(source, pauser) {
this.source = source;
this.controller = new Subject();
if (pauser && pauser.subscribe) {
this.pauser = this.controller.merge(pauser);
} else {
this.pauser = this.controller;
}
__super__.call(this, subscribe, source);
}
PausableObservable.prototype.pause = function () {
this.controller.onNext(false);
};
PausableObservable.prototype.resume = function () {
this.controller.onNext(true);
};
return PausableObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausable(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausable = function (pauser) {
return new PausableObservable(this, pauser);
};
function combineLatestSource(source, subject, resultSelector) {
return new AnonymousObservable(function (o) {
var hasValue = [false, false],
hasValueAll = false,
isDone = false,
values = new Array(2),
err;
function next(x, i) {
values[i] = x
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
if (err) { return o.onError(err); }
var res = tryCatch(resultSelector).apply(null, values);
if (res === errorObj) { return o.onError(res.e); }
o.onNext(res);
}
isDone && values[1] && o.onCompleted();
}
return new CompositeDisposable(
source.subscribe(
function (x) {
next(x, 0);
},
function (e) {
if (values[1]) {
o.onError(e);
} else {
err = e;
}
},
function () {
isDone = true;
values[1] && o.onCompleted();
}),
subject.subscribe(
function (x) {
next(x, 1);
},
function (e) { o.onError(e); },
function () {
isDone = true;
next(true, 1);
})
);
}, source);
}
var PausableBufferedObservable = (function (__super__) {
inherits(PausableBufferedObservable, __super__);
function subscribe(o) {
var q = [], previousShouldFire;
function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
var subscription =
combineLatestSource(
this.source,
this.pauser.distinctUntilChanged().startWith(false),
function (data, shouldFire) {
return { data: data, shouldFire: shouldFire };
})
.subscribe(
function (results) {
if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
previousShouldFire = results.shouldFire;
// change in shouldFire
if (results.shouldFire) { drainQueue(); }
} else {
previousShouldFire = results.shouldFire;
// new data
if (results.shouldFire) {
o.onNext(results.data);
} else {
q.push(results.data);
}
}
},
function (err) {
drainQueue();
o.onError(err);
},
function () {
drainQueue();
o.onCompleted();
}
);
return subscription;
}
function PausableBufferedObservable(source, pauser) {
this.source = source;
this.controller = new Subject();
if (pauser && pauser.subscribe) {
this.pauser = this.controller.merge(pauser);
} else {
this.pauser = this.controller;
}
__super__.call(this, subscribe, source);
}
PausableBufferedObservable.prototype.pause = function () {
this.controller.onNext(false);
};
PausableBufferedObservable.prototype.resume = function () {
this.controller.onNext(true);
};
return PausableBufferedObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
* and yields the values that were buffered while paused.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausableBuffered(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausableBuffered = function (subject) {
return new PausableBufferedObservable(this, subject);
};
var ControlledObservable = (function (__super__) {
inherits(ControlledObservable, __super__);
function subscribe (observer) {
return this.source.subscribe(observer);
}
function ControlledObservable (source, enableQueue, scheduler) {
__super__.call(this, subscribe, source);
this.subject = new ControlledSubject(enableQueue, scheduler);
this.source = source.multicast(this.subject).refCount();
}
ControlledObservable.prototype.request = function (numberOfItems) {
return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
};
return ControlledObservable;
}(Observable));
var ControlledSubject = (function (__super__) {
function subscribe (observer) {
return this.subject.subscribe(observer);
}
inherits(ControlledSubject, __super__);
function ControlledSubject(enableQueue, scheduler) {
enableQueue == null && (enableQueue = true);
__super__.call(this, subscribe);
this.subject = new Subject();
this.enableQueue = enableQueue;
this.queue = enableQueue ? [] : null;
this.requestedCount = 0;
this.requestedDisposable = disposableEmpty;
this.error = null;
this.hasFailed = false;
this.hasCompleted = false;
this.scheduler = scheduler || currentThreadScheduler;
}
addProperties(ControlledSubject.prototype, Observer, {
onCompleted: function () {
this.hasCompleted = true;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onCompleted();
} else {
this.queue.push(Notification.createOnCompleted());
}
},
onError: function (error) {
this.hasFailed = true;
this.error = error;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onError(error);
} else {
this.queue.push(Notification.createOnError(error));
}
},
onNext: function (value) {
var hasRequested = false;
if (this.requestedCount === 0) {
this.enableQueue && this.queue.push(Notification.createOnNext(value));
} else {
(this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
hasRequested = true;
}
hasRequested && this.subject.onNext(value);
},
_processRequest: function (numberOfItems) {
if (this.enableQueue) {
while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
(this.queue.length > 0 && this.queue[0].kind !== 'N')) {
var first = this.queue.shift();
first.accept(this.subject);
if (first.kind === 'N') {
numberOfItems--;
} else {
this.disposeCurrentRequest();
this.queue = [];
}
}
return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
}
return { numberOfItems: numberOfItems, returnValue: false };
},
request: function (number) {
this.disposeCurrentRequest();
var self = this;
this.requestedDisposable = this.scheduler.scheduleWithState(number,
function(s, i) {
var r = self._processRequest(i), remaining = r.numberOfItems;
if (!r.returnValue) {
self.requestedCount = remaining;
self.requestedDisposable = disposableCreate(function () {
self.requestedCount = 0;
});
}
});
return this.requestedDisposable;
},
disposeCurrentRequest: function () {
this.requestedDisposable.dispose();
this.requestedDisposable = disposableEmpty;
}
});
return ControlledSubject;
}(Observable));
/**
* Attaches a controller to the observable sequence with the ability to queue.
* @example
* var source = Rx.Observable.interval(100).controlled();
* source.request(3); // Reads 3 values
* @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
* @param {Scheduler} scheduler determines how the requests will be scheduled
* @returns {Observable} The observable sequence which only propagates values on request.
*/
observableProto.controlled = function (enableQueue, scheduler) {
if (enableQueue && isScheduler(enableQueue)) {
scheduler = enableQueue;
enableQueue = true;
}
if (enableQueue == null) { enableQueue = true; }
return new ControlledObservable(this, enableQueue, scheduler);
};
var StopAndWaitObservable = (function (__super__) {
function subscribe (observer) {
this.subscription = this.source.subscribe(new StopAndWaitObserver(observer, this, this.subscription));
var self = this;
timeoutScheduler.schedule(function () { self.source.request(1); });
return this.subscription;
}
inherits(StopAndWaitObservable, __super__);
function StopAndWaitObservable (source) {
__super__.call(this, subscribe, source);
this.source = source;
}
var StopAndWaitObserver = (function (__sub__) {
inherits(StopAndWaitObserver, __sub__);
function StopAndWaitObserver (observer, observable, cancel) {
__sub__.call(this);
this.observer = observer;
this.observable = observable;
this.cancel = cancel;
}
var stopAndWaitObserverProto = StopAndWaitObserver.prototype;
stopAndWaitObserverProto.completed = function () {
this.observer.onCompleted();
this.dispose();
};
stopAndWaitObserverProto.error = function (error) {
this.observer.onError(error);
this.dispose();
}
stopAndWaitObserverProto.next = function (value) {
this.observer.onNext(value);
var self = this;
timeoutScheduler.schedule(function () {
self.observable.source.request(1);
});
};
stopAndWaitObserverProto.dispose = function () {
this.observer = null;
if (this.cancel) {
this.cancel.dispose();
this.cancel = null;
}
__sub__.prototype.dispose.call(this);
};
return StopAndWaitObserver;
}(AbstractObserver));
return StopAndWaitObservable;
}(Observable));
/**
* Attaches a stop and wait observable to the current observable.
* @returns {Observable} A stop and wait observable.
*/
ControlledObservable.prototype.stopAndWait = function () {
return new StopAndWaitObservable(this);
};
var WindowedObservable = (function (__super__) {
function subscribe (observer) {
this.subscription = this.source.subscribe(new WindowedObserver(observer, this, this.subscription));
var self = this;
timeoutScheduler.schedule(function () {
self.source.request(self.windowSize);
});
return this.subscription;
}
inherits(WindowedObservable, __super__);
function WindowedObservable(source, windowSize) {
__super__.call(this, subscribe, source);
this.source = source;
this.windowSize = windowSize;
}
var WindowedObserver = (function (__sub__) {
inherits(WindowedObserver, __sub__);
function WindowedObserver(observer, observable, cancel) {
this.observer = observer;
this.observable = observable;
this.cancel = cancel;
this.received = 0;
}
var windowedObserverPrototype = WindowedObserver.prototype;
windowedObserverPrototype.completed = function () {
this.observer.onCompleted();
this.dispose();
};
windowedObserverPrototype.error = function (error) {
this.observer.onError(error);
this.dispose();
};
windowedObserverPrototype.next = function (value) {
this.observer.onNext(value);
this.received = ++this.received % this.observable.windowSize;
if (this.received === 0) {
var self = this;
timeoutScheduler.schedule(function () {
self.observable.source.request(self.observable.windowSize);
});
}
};
windowedObserverPrototype.dispose = function () {
this.observer = null;
if (this.cancel) {
this.cancel.dispose();
this.cancel = null;
}
__sub__.prototype.dispose.call(this);
};
return WindowedObserver;
}(AbstractObserver));
return WindowedObservable;
}(Observable));
/**
* Creates a sliding windowed observable based upon the window size.
* @param {Number} windowSize The number of items in the window
* @returns {Observable} A windowed observable based upon the window size.
*/
ControlledObservable.prototype.windowed = function (windowSize) {
return new WindowedObservable(this, windowSize);
};
/**
* Pipes the existing Observable sequence into a Node.js Stream.
* @param {Stream} dest The destination Node.js stream.
* @returns {Stream} The destination stream.
*/
observableProto.pipe = function (dest) {
var source = this.pausableBuffered();
function onDrain() {
source.resume();
}
dest.addListener('drain', onDrain);
source.subscribe(
function (x) {
!dest.write(String(x)) && source.pause();
},
function (err) {
dest.emit('error', err);
},
function () {
// Hack check because STDIO is not closable
!dest._isStdio && dest.end();
dest.removeListener('drain', onDrain);
});
source.resume();
return dest;
};
/**
* Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
* subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
* invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
*
* @example
* 1 - res = source.multicast(observable);
* 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
*
* @param {Function|Subject} subjectOrSubjectSelector
* Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
* Or:
* Subject to push source elements into.
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.multicast = function (subjectOrSubjectSelector, selector) {
var source = this;
return typeof subjectOrSubjectSelector === 'function' ?
new AnonymousObservable(function (observer) {
var connectable = source.multicast(subjectOrSubjectSelector());
return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
}, source) :
new ConnectableObservable(source, subjectOrSubjectSelector);
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of Multicast using a regular Subject.
*
* @example
* var resres = source.publish();
* var res = source.publish(function (x) { return x; });
*
* @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publish = function (selector) {
return selector && isFunction(selector) ?
this.multicast(function () { return new Subject(); }, selector) :
this.multicast(new Subject());
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.share = function () {
return this.publish().refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
* This operator is a specialization of Multicast using a AsyncSubject.
*
* @example
* var res = source.publishLast();
* var res = source.publishLast(function (x) { return x; });
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishLast = function (selector) {
return selector && isFunction(selector) ?
this.multicast(function () { return new AsyncSubject(); }, selector) :
this.multicast(new AsyncSubject());
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
* This operator is a specialization of Multicast using a BehaviorSubject.
*
* @example
* var res = source.publishValue(42);
* var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishValue = function (initialValueOrSelector, initialValue) {
return arguments.length === 2 ?
this.multicast(function () {
return new BehaviorSubject(initialValue);
}, initialValueOrSelector) :
this.multicast(new BehaviorSubject(initialValueOrSelector));
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
* This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareValue = function (initialValue) {
return this.publishValue(initialValue).refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of Multicast using a ReplaySubject.
*
* @example
* var res = source.replay(null, 3);
* var res = source.replay(null, 3, 500);
* var res = source.replay(null, 3, 500, scheduler);
* var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param windowSize [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
return selector && isFunction(selector) ?
this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.shareReplay(3);
* var res = source.shareReplay(3, 500);
* var res = source.shareReplay(3, 500, scheduler);
*
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param window [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
return this.replay(null, bufferSize, windowSize, scheduler).refCount();
};
var InnerSubscription = function (subject, observer) {
this.subject = subject;
this.observer = observer;
};
InnerSubscription.prototype.dispose = function () {
if (!this.subject.isDisposed && this.observer !== null) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
this.observer = null;
}
};
/**
* Represents a value that changes over time.
* Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
*/
var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
observer.onNext(this.value);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(BehaviorSubject, __super__);
/**
* Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
* @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
*/
function BehaviorSubject(value) {
__super__.call(this, subscribe);
this.value = value,
this.observers = [],
this.isDisposed = false,
this.isStopped = false,
this.hasError = false;
}
addProperties(BehaviorSubject.prototype, Observer, {
/**
* Gets the current value or throws an exception.
* Value is frozen after onCompleted is called.
* After onError is called always throws the specified exception.
* An exception is always thrown after dispose is called.
* @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
*/
getValue: function () {
checkDisposed(this);
if (this.hasError) {
throw this.error;
}
return this.value;
},
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () { return this.observers.length > 0; },
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers.length = 0;
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
this.hasError = true;
this.error = error;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
this.value = value;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onNext(value);
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.value = null;
this.exception = null;
}
});
return BehaviorSubject;
}(Observable));
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
*/
var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
var maxSafeInteger = Math.pow(2, 53) - 1;
function createRemovableDisposable(subject, observer) {
return disposableCreate(function () {
observer.dispose();
!subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
});
}
function subscribe(observer) {
var so = new ScheduledObserver(this.scheduler, observer),
subscription = createRemovableDisposable(this, so);
checkDisposed(this);
this._trim(this.scheduler.now());
this.observers.push(so);
for (var i = 0, len = this.q.length; i < len; i++) {
so.onNext(this.q[i].value);
}
if (this.hasError) {
so.onError(this.error);
} else if (this.isStopped) {
so.onCompleted();
}
so.ensureActive();
return subscription;
}
inherits(ReplaySubject, __super__);
/**
* Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
* @param {Number} [bufferSize] Maximum element count of the replay buffer.
* @param {Number} [windowSize] Maximum time length of the replay buffer.
* @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
*/
function ReplaySubject(bufferSize, windowSize, scheduler) {
this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
this.scheduler = scheduler || currentThreadScheduler;
this.q = [];
this.observers = [];
this.isStopped = false;
this.isDisposed = false;
this.hasError = false;
this.error = null;
__super__.call(this, subscribe);
}
addProperties(ReplaySubject.prototype, Observer.prototype, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
_trim: function (now) {
while (this.q.length > this.bufferSize) {
this.q.shift();
}
while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
this.q.shift();
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
var now = this.scheduler.now();
this.q.push({ interval: now, value: value });
this._trim(now);
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
var observer = os[i];
observer.onNext(value);
observer.ensureActive();
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
this.error = error;
this.hasError = true;
var now = this.scheduler.now();
this._trim(now);
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
var observer = os[i];
observer.onError(error);
observer.ensureActive();
}
this.observers.length = 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (this.isStopped) { return; }
this.isStopped = true;
var now = this.scheduler.now();
this._trim(now);
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
var observer = os[i];
observer.onCompleted();
observer.ensureActive();
}
this.observers.length = 0;
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
return ReplaySubject;
}(Observable));
var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
inherits(ConnectableObservable, __super__);
function ConnectableObservable(source, subject) {
var hasSubscription = false,
subscription,
sourceObservable = source.asObservable();
this.connect = function () {
if (!hasSubscription) {
hasSubscription = true;
subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
hasSubscription = false;
}));
}
return subscription;
};
__super__.call(this, function (o) { return subject.subscribe(o); });
}
ConnectableObservable.prototype.refCount = function () {
var connectableSubscription, count = 0, source = this;
return new AnonymousObservable(function (observer) {
var shouldConnect = ++count === 1,
subscription = source.subscribe(observer);
shouldConnect && (connectableSubscription = source.connect());
return function () {
subscription.dispose();
--count === 0 && connectableSubscription.dispose();
};
});
};
return ConnectableObservable;
}(Observable));
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
* can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
*/
observableProto.singleInstance = function() {
var source = this, hasObservable = false, observable;
function getObservable() {
if (!hasObservable) {
hasObservable = true;
observable = source.finally(function() { hasObservable = false; }).publish().refCount();
}
return observable;
};
return new AnonymousObservable(function(o) {
return getObservable().subscribe(o);
});
};
var Dictionary = (function () {
var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647],
noSuchkey = "no such key",
duplicatekey = "duplicate key";
function isPrime(candidate) {
if ((candidate & 1) === 0) { return candidate === 2; }
var num1 = Math.sqrt(candidate),
num2 = 3;
while (num2 <= num1) {
if (candidate % num2 === 0) { return false; }
num2 += 2;
}
return true;
}
function getPrime(min) {
var index, num, candidate;
for (index = 0; index < primes.length; ++index) {
num = primes[index];
if (num >= min) { return num; }
}
candidate = min | 1;
while (candidate < primes[primes.length - 1]) {
if (isPrime(candidate)) { return candidate; }
candidate += 2;
}
return min;
}
function stringHashFn(str) {
var hash = 757602046;
if (!str.length) { return hash; }
for (var i = 0, len = str.length; i < len; i++) {
var character = str.charCodeAt(i);
hash = ((hash << 5) - hash) + character;
hash = hash & hash;
}
return hash;
}
function numberHashFn(key) {
var c2 = 0x27d4eb2d;
key = (key ^ 61) ^ (key >>> 16);
key = key + (key << 3);
key = key ^ (key >>> 4);
key = key * c2;
key = key ^ (key >>> 15);
return key;
}
var getHashCode = (function () {
var uniqueIdCounter = 0;
return function (obj) {
if (obj == null) { throw new Error(noSuchkey); }
// Check for built-ins before tacking on our own for any object
if (typeof obj === 'string') { return stringHashFn(obj); }
if (typeof obj === 'number') { return numberHashFn(obj); }
if (typeof obj === 'boolean') { return obj === true ? 1 : 0; }
if (obj instanceof Date) { return numberHashFn(obj.valueOf()); }
if (obj instanceof RegExp) { return stringHashFn(obj.toString()); }
if (typeof obj.valueOf === 'function') {
// Hack check for valueOf
var valueOf = obj.valueOf();
if (typeof valueOf === 'number') { return numberHashFn(valueOf); }
if (typeof valueOf === 'string') { return stringHashFn(valueOf); }
}
if (obj.hashCode) { return obj.hashCode(); }
var id = 17 * uniqueIdCounter++;
obj.hashCode = function () { return id; };
return id;
};
}());
function newEntry() {
return { key: null, value: null, next: 0, hashCode: 0 };
}
function Dictionary(capacity, comparer) {
if (capacity < 0) { throw new ArgumentOutOfRangeError(); }
if (capacity > 0) { this._initialize(capacity); }
this.comparer = comparer || defaultComparer;
this.freeCount = 0;
this.size = 0;
this.freeList = -1;
}
var dictionaryProto = Dictionary.prototype;
dictionaryProto._initialize = function (capacity) {
var prime = getPrime(capacity), i;
this.buckets = new Array(prime);
this.entries = new Array(prime);
for (i = 0; i < prime; i++) {
this.buckets[i] = -1;
this.entries[i] = newEntry();
}
this.freeList = -1;
};
dictionaryProto.add = function (key, value) {
this._insert(key, value, true);
};
dictionaryProto._insert = function (key, value, add) {
if (!this.buckets) { this._initialize(0); }
var index3,
num = getHashCode(key) & 2147483647,
index1 = num % this.buckets.length;
for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) {
if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) {
if (add) { throw new Error(duplicatekey); }
this.entries[index2].value = value;
return;
}
}
if (this.freeCount > 0) {
index3 = this.freeList;
this.freeList = this.entries[index3].next;
--this.freeCount;
} else {
if (this.size === this.entries.length) {
this._resize();
index1 = num % this.buckets.length;
}
index3 = this.size;
++this.size;
}
this.entries[index3].hashCode = num;
this.entries[index3].next = this.buckets[index1];
this.entries[index3].key = key;
this.entries[index3].value = value;
this.buckets[index1] = index3;
};
dictionaryProto._resize = function () {
var prime = getPrime(this.size * 2),
numArray = new Array(prime);
for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; }
var entryArray = new Array(prime);
for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; }
for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); }
for (var index1 = 0; index1 < this.size; ++index1) {
var index2 = entryArray[index1].hashCode % prime;
entryArray[index1].next = numArray[index2];
numArray[index2] = index1;
}
this.buckets = numArray;
this.entries = entryArray;
};
dictionaryProto.remove = function (key) {
if (this.buckets) {
var num = getHashCode(key) & 2147483647,
index1 = num % this.buckets.length,
index2 = -1;
for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) {
if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) {
if (index2 < 0) {
this.buckets[index1] = this.entries[index3].next;
} else {
this.entries[index2].next = this.entries[index3].next;
}
this.entries[index3].hashCode = -1;
this.entries[index3].next = this.freeList;
this.entries[index3].key = null;
this.entries[index3].value = null;
this.freeList = index3;
++this.freeCount;
return true;
} else {
index2 = index3;
}
}
}
return false;
};
dictionaryProto.clear = function () {
var index, len;
if (this.size <= 0) { return; }
for (index = 0, len = this.buckets.length; index < len; ++index) {
this.buckets[index] = -1;
}
for (index = 0; index < this.size; ++index) {
this.entries[index] = newEntry();
}
this.freeList = -1;
this.size = 0;
};
dictionaryProto._findEntry = function (key) {
if (this.buckets) {
var num = getHashCode(key) & 2147483647;
for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) {
if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) {
return index;
}
}
}
return -1;
};
dictionaryProto.count = function () {
return this.size - this.freeCount;
};
dictionaryProto.tryGetValue = function (key) {
var entry = this._findEntry(key);
return entry >= 0 ?
this.entries[entry].value :
undefined;
};
dictionaryProto.getValues = function () {
var index = 0, results = [];
if (this.entries) {
for (var index1 = 0; index1 < this.size; index1++) {
if (this.entries[index1].hashCode >= 0) {
results[index++] = this.entries[index1].value;
}
}
}
return results;
};
dictionaryProto.get = function (key) {
var entry = this._findEntry(key);
if (entry >= 0) { return this.entries[entry].value; }
throw new Error(noSuchkey);
};
dictionaryProto.set = function (key, value) {
this._insert(key, value, false);
};
dictionaryProto.containskey = function (key) {
return this._findEntry(key) >= 0;
};
return Dictionary;
}());
/**
* Correlates the elements of two sequences based on overlapping durations.
*
* @param {Observable} right The right observable sequence to join elements for.
* @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
* @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
* @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs.
* @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
*/
observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
var left = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable();
var leftDone = false, rightDone = false;
var leftId = 0, rightId = 0;
var leftMap = new Dictionary(), rightMap = new Dictionary();
group.add(left.subscribe(
function (value) {
var id = leftId++;
var md = new SingleAssignmentDisposable();
leftMap.add(id, value);
group.add(md);
var expire = function () {
leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted();
group.remove(md);
};
var duration;
try {
duration = leftDurationSelector(value);
} catch (e) {
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
rightMap.getValues().forEach(function (v) {
var result;
try {
result = resultSelector(value, v);
} catch (exn) {
observer.onError(exn);
return;
}
observer.onNext(result);
});
},
observer.onError.bind(observer),
function () {
leftDone = true;
(rightDone || leftMap.count() === 0) && observer.onCompleted();
})
);
group.add(right.subscribe(
function (value) {
var id = rightId++;
var md = new SingleAssignmentDisposable();
rightMap.add(id, value);
group.add(md);
var expire = function () {
rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted();
group.remove(md);
};
var duration;
try {
duration = rightDurationSelector(value);
} catch (e) {
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
leftMap.getValues().forEach(function (v) {
var result;
try {
result = resultSelector(v, value);
} catch (exn) {
observer.onError(exn);
return;
}
observer.onNext(result);
});
},
observer.onError.bind(observer),
function () {
rightDone = true;
(leftDone || rightMap.count() === 0) && observer.onCompleted();
})
);
return group;
}, left);
};
/**
* Correlates the elements of two sequences based on overlapping durations, and groups the results.
*
* @param {Observable} right The right observable sequence to join elements for.
* @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
* @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
* @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element.
* @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
*/
observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
var left = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable();
var r = new RefCountDisposable(group);
var leftMap = new Dictionary(), rightMap = new Dictionary();
var leftId = 0, rightId = 0;
function handleError(e) { return function (v) { v.onError(e); }; };
group.add(left.subscribe(
function (value) {
var s = new Subject();
var id = leftId++;
leftMap.add(id, s);
var result;
try {
result = resultSelector(value, addRef(s, r));
} catch (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
observer.onNext(result);
rightMap.getValues().forEach(function (v) { s.onNext(v); });
var md = new SingleAssignmentDisposable();
group.add(md);
var expire = function () {
leftMap.remove(id) && s.onCompleted();
group.remove(md);
};
var duration;
try {
duration = leftDurationSelector(value);
} catch (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(
noop,
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
},
expire)
);
},
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
},
observer.onCompleted.bind(observer))
);
group.add(right.subscribe(
function (value) {
var id = rightId++;
rightMap.add(id, value);
var md = new SingleAssignmentDisposable();
group.add(md);
var expire = function () {
rightMap.remove(id);
group.remove(md);
};
var duration;
try {
duration = rightDurationSelector(value);
} catch (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
return;
}
md.setDisposable(duration.take(1).subscribe(
noop,
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
},
expire)
);
leftMap.getValues().forEach(function (v) { v.onNext(value); });
},
function (e) {
leftMap.getValues().forEach(handleError(e));
observer.onError(e);
})
);
return r;
}, left);
};
/**
* Projects each element of an observable sequence into zero or more buffers.
*
* @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
* @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) {
return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
};
/**
* Projects each element of an observable sequence into zero or more windows.
*
* @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
* @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) {
if (arguments.length === 1 && typeof arguments[0] !== 'function') {
return observableWindowWithBoundaries.call(this, windowOpeningsOrClosingSelector);
}
return typeof windowOpeningsOrClosingSelector === 'function' ?
observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) :
observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector);
};
function observableWindowWithOpenings(windowOpenings, windowClosingSelector) {
return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) {
return win;
});
}
function observableWindowWithBoundaries(windowBoundaries) {
var source = this;
return new AnonymousObservable(function (observer) {
var win = new Subject(),
d = new CompositeDisposable(),
r = new RefCountDisposable(d);
observer.onNext(addRef(win, r));
d.add(source.subscribe(function (x) {
win.onNext(x);
}, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
observer.onCompleted();
}));
isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries));
d.add(windowBoundaries.subscribe(function (w) {
win.onCompleted();
win = new Subject();
observer.onNext(addRef(win, r));
}, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
observer.onCompleted();
}));
return r;
}, source);
}
function observableWindowWithClosingSelector(windowClosingSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var m = new SerialDisposable(),
d = new CompositeDisposable(m),
r = new RefCountDisposable(d),
win = new Subject();
observer.onNext(addRef(win, r));
d.add(source.subscribe(function (x) {
win.onNext(x);
}, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
observer.onCompleted();
}));
function createWindowClose () {
var windowClose;
try {
windowClose = windowClosingSelector();
} catch (e) {
observer.onError(e);
return;
}
isPromise(windowClose) && (windowClose = observableFromPromise(windowClose));
var m1 = new SingleAssignmentDisposable();
m.setDisposable(m1);
m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) {
win.onError(err);
observer.onError(err);
}, function () {
win.onCompleted();
win = new Subject();
observer.onNext(addRef(win, r));
createWindowClose();
}));
}
createWindowClose();
return r;
}, source);
}
/**
* Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
* The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
* The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
* @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
*/
observableProto.pairwise = function () {
var source = this;
return new AnonymousObservable(function (observer) {
var previous, hasPrevious = false;
return source.subscribe(
function (x) {
if (hasPrevious) {
observer.onNext([previous, x]);
} else {
hasPrevious = true;
}
previous = x;
},
observer.onError.bind(observer),
observer.onCompleted.bind(observer));
}, source);
};
/**
* Returns two observables which partition the observations of the source by the given function.
* The first will trigger observations for those values for which the predicate returns true.
* The second will trigger observations for those values where the predicate returns false.
* The predicate is executed once for each subscribed observer.
* Both also propagate all error observations arising from the source and each completes
* when the source completes.
* @param {Function} predicate
* The function to determine which output Observable will trigger a particular observation.
* @returns {Array}
* An array of observables. The first triggers when the predicate returns true,
* and the second triggers when the predicate returns false.
*/
observableProto.partition = function(predicate, thisArg) {
return [
this.filter(predicate, thisArg),
this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
];
};
var WhileEnumerable = (function(__super__) {
inherits(WhileEnumerable, __super__);
function WhileEnumerable(c, s) {
this.c = c;
this.s = s;
}
WhileEnumerable.prototype[$iterator$] = function () {
var self = this;
return {
next: function () {
return self.c() ?
{ done: false, value: self.s } :
{ done: true, value: void 0 };
}
};
};
return WhileEnumerable;
}(Enumerable));
function enumerableWhile(condition, source) {
return new WhileEnumerable(condition, source);
}
/**
* Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
* This operator allows for a fluent style of writing queries that use the same sequence multiple times.
*
* @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.letBind = observableProto['let'] = function (func) {
return func(this);
};
/**
* Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
*
* @example
* 1 - res = Rx.Observable.if(condition, obs1);
* 2 - res = Rx.Observable.if(condition, obs1, obs2);
* 3 - res = Rx.Observable.if(condition, obs1, scheduler);
* @param {Function} condition The condition which determines if the thenSource or elseSource will be run.
* @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true.
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler.
* @returns {Observable} An observable sequence which is either the thenSource or elseSource.
*/
Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) {
return observableDefer(function () {
elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty());
isPromise(thenSource) && (thenSource = observableFromPromise(thenSource));
isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler));
// Assume a scheduler for empty only
typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler));
return condition() ? thenSource : elseSourceOrScheduler;
});
};
/**
* Concatenates the observable sequences obtained by running the specified result selector for each element in source.
* There is an alias for this method called 'forIn' for browsers <IE9
* @param {Array} sources An array of values to turn into an observable sequence.
* @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
* @returns {Observable} An observable sequence from the concatenated observable sequences.
*/
Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) {
return enumerableOf(sources, resultSelector, thisArg).concat();
};
/**
* Repeats source as long as condition holds emulating a while loop.
* There is an alias for this method called 'whileDo' for browsers <IE9
*
* @param {Function} condition The condition which determines if the source will be repeated.
* @param {Observable} source The observable sequence that will be run if the condition function returns true.
* @returns {Observable} An observable sequence which is repeated as long as the condition holds.
*/
var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) {
isPromise(source) && (source = observableFromPromise(source));
return enumerableWhile(condition, source).concat();
};
/**
* Repeats source as long as condition holds emulating a do while loop.
*
* @param {Function} condition The condition which determines if the source will be repeated.
* @param {Observable} source The observable sequence that will be run if the condition function returns true.
* @returns {Observable} An observable sequence which is repeated as long as the condition holds.
*/
observableProto.doWhile = function (condition) {
return observableConcat([this, observableWhileDo(condition, this)]);
};
/**
* Uses selector to determine which source in sources to use.
* There is an alias 'switchCase' for browsers <IE9.
*
* @example
* 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
* 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
* 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
*
* @param {Function} selector The function which extracts the value for to test in a case statement.
* @param {Array} sources A object which has keys which correspond to the case statement labels.
* @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
*
* @returns {Observable} An observable sequence which is determined by a case statement.
*/
Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) {
return observableDefer(function () {
isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler));
defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty());
typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler));
var result = sources[selector()];
isPromise(result) && (result = observableFromPromise(result));
return result || defaultSourceOrScheduler;
});
};
/**
* Expands an observable sequence by recursively invoking selector.
*
* @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
* @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
* @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion.
*/
observableProto.expand = function (selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var q = [],
m = new SerialDisposable(),
d = new CompositeDisposable(m),
activeCount = 0,
isAcquired = false;
var ensureActive = function () {
var isOwner = false;
if (q.length > 0) {
isOwner = !isAcquired;
isAcquired = true;
}
if (isOwner) {
m.setDisposable(scheduler.scheduleRecursive(function (self) {
var work;
if (q.length > 0) {
work = q.shift();
} else {
isAcquired = false;
return;
}
var m1 = new SingleAssignmentDisposable();
d.add(m1);
m1.setDisposable(work.subscribe(function (x) {
observer.onNext(x);
var result = null;
try {
result = selector(x);
} catch (e) {
observer.onError(e);
}
q.push(result);
activeCount++;
ensureActive();
}, observer.onError.bind(observer), function () {
d.remove(m1);
activeCount--;
if (activeCount === 0) {
observer.onCompleted();
}
}));
self();
}));
}
};
q.push(source);
activeCount++;
ensureActive();
return d;
}, this);
};
/**
* Runs all observable sequences in parallel and collect their last elements.
*
* @example
* 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
* 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
* @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
*/
Observable.forkJoin = function () {
var allSources = [];
if (Array.isArray(arguments[0])) {
allSources = arguments[0];
} else {
for(var i = 0, len = arguments.length; i < len; i++) { allSources.push(arguments[i]); }
}
return new AnonymousObservable(function (subscriber) {
var count = allSources.length;
if (count === 0) {
subscriber.onCompleted();
return disposableEmpty;
}
var group = new CompositeDisposable(),
finished = false,
hasResults = new Array(count),
hasCompleted = new Array(count),
results = new Array(count);
for (var idx = 0; idx < count; idx++) {
(function (i) {
var source = allSources[i];
isPromise(source) && (source = observableFromPromise(source));
group.add(
source.subscribe(
function (value) {
if (!finished) {
hasResults[i] = true;
results[i] = value;
}
},
function (e) {
finished = true;
subscriber.onError(e);
group.dispose();
},
function () {
if (!finished) {
if (!hasResults[i]) {
subscriber.onCompleted();
return;
}
hasCompleted[i] = true;
for (var ix = 0; ix < count; ix++) {
if (!hasCompleted[ix]) { return; }
}
finished = true;
subscriber.onNext(results);
subscriber.onCompleted();
}
}));
})(idx);
}
return group;
});
};
/**
* Runs two observable sequences in parallel and combines their last elemenets.
*
* @param {Observable} second Second observable sequence.
* @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.
* @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences.
*/
observableProto.forkJoin = function (second, resultSelector) {
var first = this;
return new AnonymousObservable(function (observer) {
var leftStopped = false, rightStopped = false,
hasLeft = false, hasRight = false,
lastLeft, lastRight,
leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable();
isPromise(second) && (second = observableFromPromise(second));
leftSubscription.setDisposable(
first.subscribe(function (left) {
hasLeft = true;
lastLeft = left;
}, function (err) {
rightSubscription.dispose();
observer.onError(err);
}, function () {
leftStopped = true;
if (rightStopped) {
if (!hasLeft) {
observer.onCompleted();
} else if (!hasRight) {
observer.onCompleted();
} else {
var result;
try {
result = resultSelector(lastLeft, lastRight);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
observer.onCompleted();
}
}
})
);
rightSubscription.setDisposable(
second.subscribe(function (right) {
hasRight = true;
lastRight = right;
}, function (err) {
leftSubscription.dispose();
observer.onError(err);
}, function () {
rightStopped = true;
if (leftStopped) {
if (!hasLeft) {
observer.onCompleted();
} else if (!hasRight) {
observer.onCompleted();
} else {
var result;
try {
result = resultSelector(lastLeft, lastRight);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
observer.onCompleted();
}
}
})
);
return new CompositeDisposable(leftSubscription, rightSubscription);
}, first);
};
/**
* Comonadic bind operator.
* @param {Function} selector A transform function to apply to each element.
* @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
* @returns {Observable} An observable sequence which results from the comonadic bind operation.
*/
observableProto.manySelect = observableProto.extend = function (selector, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
var source = this;
return observableDefer(function () {
var chain;
return source
.map(function (x) {
var curr = new ChainObservable(x);
chain && chain.onNext(x);
chain = curr;
return curr;
})
.tap(
noop,
function (e) { chain && chain.onError(e); },
function () { chain && chain.onCompleted(); }
)
.observeOn(scheduler)
.map(selector);
}, source);
};
var ChainObservable = (function (__super__) {
function subscribe (observer) {
var self = this, g = new CompositeDisposable();
g.add(currentThreadScheduler.schedule(function () {
observer.onNext(self.head);
g.add(self.tail.mergeAll().subscribe(observer));
}));
return g;
}
inherits(ChainObservable, __super__);
function ChainObservable(head) {
__super__.call(this, subscribe);
this.head = head;
this.tail = new AsyncSubject();
}
addProperties(ChainObservable.prototype, Observer, {
onCompleted: function () {
this.onNext(Observable.empty());
},
onError: function (e) {
this.onNext(Observable.throwError(e));
},
onNext: function (v) {
this.tail.onNext(v);
this.tail.onCompleted();
}
});
return ChainObservable;
}(Observable));
/** @private */
var Map = root.Map || (function () {
function Map() {
this._keys = [];
this._values = [];
}
Map.prototype.get = function (key) {
var i = this._keys.indexOf(key);
return i !== -1 ? this._values[i] : undefined;
};
Map.prototype.set = function (key, value) {
var i = this._keys.indexOf(key);
i !== -1 && (this._values[i] = value);
this._values[this._keys.push(key) - 1] = value;
};
Map.prototype.forEach = function (callback, thisArg) {
for (var i = 0, len = this._keys.length; i < len; i++) {
callback.call(thisArg, this._values[i], this._keys[i]);
}
};
return Map;
}());
/**
* @constructor
* Represents a join pattern over observable sequences.
*/
function Pattern(patterns) {
this.patterns = patterns;
}
/**
* Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value.
* @param other Observable sequence to match in addition to the current pattern.
* @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value.
*/
Pattern.prototype.and = function (other) {
return new Pattern(this.patterns.concat(other));
};
/**
* Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values.
* @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern.
* @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
*/
Pattern.prototype.thenDo = function (selector) {
return new Plan(this, selector);
};
function Plan(expression, selector) {
this.expression = expression;
this.selector = selector;
}
Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) {
var self = this;
var joinObservers = [];
for (var i = 0, len = this.expression.patterns.length; i < len; i++) {
joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer)));
}
var activePlan = new ActivePlan(joinObservers, function () {
var result;
try {
result = self.selector.apply(self, arguments);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
}, function () {
for (var j = 0, jlen = joinObservers.length; j < jlen; j++) {
joinObservers[j].removeActivePlan(activePlan);
}
deactivate(activePlan);
});
for (i = 0, len = joinObservers.length; i < len; i++) {
joinObservers[i].addActivePlan(activePlan);
}
return activePlan;
};
function planCreateObserver(externalSubscriptions, observable, onError) {
var entry = externalSubscriptions.get(observable);
if (!entry) {
var observer = new JoinObserver(observable, onError);
externalSubscriptions.set(observable, observer);
return observer;
}
return entry;
}
function ActivePlan(joinObserverArray, onNext, onCompleted) {
this.joinObserverArray = joinObserverArray;
this.onNext = onNext;
this.onCompleted = onCompleted;
this.joinObservers = new Map();
for (var i = 0, len = this.joinObserverArray.length; i < len; i++) {
var joinObserver = this.joinObserverArray[i];
this.joinObservers.set(joinObserver, joinObserver);
}
}
ActivePlan.prototype.dequeue = function () {
this.joinObservers.forEach(function (v) { v.queue.shift(); });
};
ActivePlan.prototype.match = function () {
var i, len, hasValues = true;
for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
if (this.joinObserverArray[i].queue.length === 0) {
hasValues = false;
break;
}
}
if (hasValues) {
var firstValues = [],
isCompleted = false;
for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
firstValues.push(this.joinObserverArray[i].queue[0]);
this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true);
}
if (isCompleted) {
this.onCompleted();
} else {
this.dequeue();
var values = [];
for (i = 0, len = firstValues.length; i < firstValues.length; i++) {
values.push(firstValues[i].value);
}
this.onNext.apply(this, values);
}
}
};
var JoinObserver = (function (__super__) {
inherits(JoinObserver, __super__);
function JoinObserver(source, onError) {
__super__.call(this);
this.source = source;
this.onError = onError;
this.queue = [];
this.activePlans = [];
this.subscription = new SingleAssignmentDisposable();
this.isDisposed = false;
}
var JoinObserverPrototype = JoinObserver.prototype;
JoinObserverPrototype.next = function (notification) {
if (!this.isDisposed) {
if (notification.kind === 'E') {
return this.onError(notification.exception);
}
this.queue.push(notification);
var activePlans = this.activePlans.slice(0);
for (var i = 0, len = activePlans.length; i < len; i++) {
activePlans[i].match();
}
}
};
JoinObserverPrototype.error = noop;
JoinObserverPrototype.completed = noop;
JoinObserverPrototype.addActivePlan = function (activePlan) {
this.activePlans.push(activePlan);
};
JoinObserverPrototype.subscribe = function () {
this.subscription.setDisposable(this.source.materialize().subscribe(this));
};
JoinObserverPrototype.removeActivePlan = function (activePlan) {
this.activePlans.splice(this.activePlans.indexOf(activePlan), 1);
this.activePlans.length === 0 && this.dispose();
};
JoinObserverPrototype.dispose = function () {
__super__.prototype.dispose.call(this);
if (!this.isDisposed) {
this.isDisposed = true;
this.subscription.dispose();
}
};
return JoinObserver;
} (AbstractObserver));
/**
* Creates a pattern that matches when both observable sequences have an available value.
*
* @param right Observable sequence to match with the current sequence.
* @return {Pattern} Pattern object that matches when both observable sequences have an available value.
*/
observableProto.and = function (right) {
return new Pattern([this, right]);
};
/**
* Matches when the observable sequence has an available value and projects the value.
*
* @param {Function} selector Selector that will be invoked for values in the source sequence.
* @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
*/
observableProto.thenDo = function (selector) {
return new Pattern([this]).thenDo(selector);
};
/**
* Joins together the results from several patterns.
*
* @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns.
* @returns {Observable} Observable sequence with the results form matching several patterns.
*/
Observable.when = function () {
var len = arguments.length, plans;
if (Array.isArray(arguments[0])) {
plans = arguments[0];
} else {
plans = new Array(len);
for(var i = 0; i < len; i++) { plans[i] = arguments[i]; }
}
return new AnonymousObservable(function (o) {
var activePlans = [],
externalSubscriptions = new Map();
var outObserver = observerCreate(
function (x) { o.onNext(x); },
function (err) {
externalSubscriptions.forEach(function (v) { v.onError(err); });
o.onError(err);
},
function (x) { o.onCompleted(); }
);
try {
for (var i = 0, len = plans.length; i < len; i++) {
activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) {
var idx = activePlans.indexOf(activePlan);
activePlans.splice(idx, 1);
activePlans.length === 0 && o.onCompleted();
}));
}
} catch (e) {
observableThrow(e).subscribe(o);
}
var group = new CompositeDisposable();
externalSubscriptions.forEach(function (joinObserver) {
joinObserver.subscribe();
group.add(joinObserver);
});
return group;
});
};
function observableTimerDate(dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithAbsolute(dueTime, function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerDateAndPeriod(dueTime, period, scheduler) {
return new AnonymousObservable(function (observer) {
var d = dueTime, p = normalizeTime(period);
return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
if (p > 0) {
var now = scheduler.now();
d = d + p;
d <= now && (d = now + p);
}
observer.onNext(count);
self(count + 1, d);
});
});
}
function observableTimerTimeSpan(dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
return dueTime === period ?
new AnonymousObservable(function (observer) {
return scheduler.schedulePeriodicWithState(0, period, function (count) {
observer.onNext(count);
return count + 1;
});
}) :
observableDefer(function () {
return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
});
}
/**
* Returns an observable sequence that produces a value after each period.
*
* @example
* 1 - res = Rx.Observable.interval(1000);
* 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
*
* @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
* @returns {Observable} An observable sequence that produces a value after each period.
*/
var observableinterval = Observable.interval = function (period, scheduler) {
return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
};
/**
* Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
* @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
*/
var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
var period;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
period = periodOrScheduler;
} else if (isScheduler(periodOrScheduler)) {
scheduler = periodOrScheduler;
}
if (dueTime instanceof Date && period === undefined) {
return observableTimerDate(dueTime.getTime(), scheduler);
}
if (dueTime instanceof Date && period !== undefined) {
period = periodOrScheduler;
return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
}
return period === undefined ?
observableTimerTimeSpan(dueTime, scheduler) :
observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
};
function observableDelayTimeSpan(source, dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
var active = false,
cancelable = new SerialDisposable(),
exception = null,
q = [],
running = false,
subscription;
subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
var d, shouldRun;
if (notification.value.kind === 'E') {
q = [];
q.push(notification);
exception = notification.value.exception;
shouldRun = !running;
} else {
q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
shouldRun = !active;
active = true;
}
if (shouldRun) {
if (exception !== null) {
observer.onError(exception);
} else {
d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
var e, recurseDueTime, result, shouldRecurse;
if (exception !== null) {
return;
}
running = true;
do {
result = null;
if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
result = q.shift().value;
}
if (result !== null) {
result.accept(observer);
}
} while (result !== null);
shouldRecurse = false;
recurseDueTime = 0;
if (q.length > 0) {
shouldRecurse = true;
recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
} else {
active = false;
}
e = exception;
running = false;
if (e !== null) {
observer.onError(e);
} else if (shouldRecurse) {
self(recurseDueTime);
}
}));
}
}
});
return new CompositeDisposable(subscription, cancelable);
}, source);
}
function observableDelayDate(source, dueTime, scheduler) {
return observableDefer(function () {
return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
});
}
/**
* Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
*
* @example
* 1 - res = Rx.Observable.delay(new Date());
* 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
*
* 3 - res = Rx.Observable.delay(5000);
* 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
* @memberOf Observable#
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
* @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delay = function (dueTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return dueTime instanceof Date ?
observableDelayDate(this, dueTime.getTime(), scheduler) :
observableDelayTimeSpan(this, dueTime, scheduler);
};
/**
* Ignores values from an observable sequence which are followed by another value before dueTime.
* @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The debounced sequence.
*/
observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
var subscription = source.subscribe(
function (x) {
hasvalue = true;
value = x;
id++;
var currentId = id,
d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
hasvalue && id === currentId && observer.onNext(value);
hasvalue = false;
}));
},
function (e) {
cancelable.dispose();
observer.onError(e);
hasvalue = false;
id++;
},
function () {
cancelable.dispose();
hasvalue && observer.onNext(value);
observer.onCompleted();
hasvalue = false;
id++;
});
return new CompositeDisposable(subscription, cancelable);
}, this);
};
/**
* @deprecated use #debounce or #throttleWithTimeout instead.
*/
observableProto.throttle = function(dueTime, scheduler) {
//deprecate('throttle', 'debounce or throttleWithTimeout');
return this.debounce(dueTime, scheduler);
};
/**
* Projects each element of an observable sequence into zero or more windows which are produced based on timing information.
* @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds).
* @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows.
* @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
var source = this, timeShift;
timeShiftOrScheduler == null && (timeShift = timeSpan);
isScheduler(scheduler) || (scheduler = timeoutScheduler);
if (typeof timeShiftOrScheduler === 'number') {
timeShift = timeShiftOrScheduler;
} else if (isScheduler(timeShiftOrScheduler)) {
timeShift = timeSpan;
scheduler = timeShiftOrScheduler;
}
return new AnonymousObservable(function (observer) {
var groupDisposable,
nextShift = timeShift,
nextSpan = timeSpan,
q = [],
refCountDisposable,
timerD = new SerialDisposable(),
totalTime = 0;
groupDisposable = new CompositeDisposable(timerD),
refCountDisposable = new RefCountDisposable(groupDisposable);
function createTimer () {
var m = new SingleAssignmentDisposable(),
isSpan = false,
isShift = false;
timerD.setDisposable(m);
if (nextSpan === nextShift) {
isSpan = true;
isShift = true;
} else if (nextSpan < nextShift) {
isSpan = true;
} else {
isShift = true;
}
var newTotalTime = isSpan ? nextSpan : nextShift,
ts = newTotalTime - totalTime;
totalTime = newTotalTime;
if (isSpan) {
nextSpan += timeShift;
}
if (isShift) {
nextShift += timeShift;
}
m.setDisposable(scheduler.scheduleWithRelative(ts, function () {
if (isShift) {
var s = new Subject();
q.push(s);
observer.onNext(addRef(s, refCountDisposable));
}
isSpan && q.shift().onCompleted();
createTimer();
}));
};
q.push(new Subject());
observer.onNext(addRef(q[0], refCountDisposable));
createTimer();
groupDisposable.add(source.subscribe(
function (x) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
},
function (e) {
for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); }
observer.onError(e);
},
function () {
for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); }
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
/**
* Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed.
* @param {Number} timeSpan Maximum time length of a window.
* @param {Number} count Maximum element count of a window.
* @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of windows.
*/
observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var timerD = new SerialDisposable(),
groupDisposable = new CompositeDisposable(timerD),
refCountDisposable = new RefCountDisposable(groupDisposable),
n = 0,
windowId = 0,
s = new Subject();
function createTimer(id) {
var m = new SingleAssignmentDisposable();
timerD.setDisposable(m);
m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () {
if (id !== windowId) { return; }
n = 0;
var newId = ++windowId;
s.onCompleted();
s = new Subject();
observer.onNext(addRef(s, refCountDisposable));
createTimer(newId);
}));
}
observer.onNext(addRef(s, refCountDisposable));
createTimer(0);
groupDisposable.add(source.subscribe(
function (x) {
var newId = 0, newWindow = false;
s.onNext(x);
if (++n === count) {
newWindow = true;
n = 0;
newId = ++windowId;
s.onCompleted();
s = new Subject();
observer.onNext(addRef(s, refCountDisposable));
}
newWindow && createTimer(newId);
},
function (e) {
s.onError(e);
observer.onError(e);
}, function () {
s.onCompleted();
observer.onCompleted();
}
));
return refCountDisposable;
}, source);
};
/**
* Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
*
* @example
* 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second
* 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds
*
* @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
* @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
* @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
};
/**
* Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed.
*
* @example
* 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array
* 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array
*
* @param {Number} timeSpan Maximum time length of a buffer.
* @param {Number} count Maximum element count of a buffer.
* @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence of buffers.
*/
observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) {
return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) {
return x.toArray();
});
};
/**
* Records the time interval between consecutive values in an observable sequence.
*
* @example
* 1 - res = source.timeInterval();
* 2 - res = source.timeInterval(Rx.Scheduler.timeout);
*
* @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence with time interval information on values.
*/
observableProto.timeInterval = function (scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return observableDefer(function () {
var last = scheduler.now();
return source.map(function (x) {
var now = scheduler.now(), span = now - last;
last = now;
return { value: x, interval: span };
});
});
};
/**
* Records the timestamp for each value in an observable sequence.
*
* @example
* 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
* 2 - res = source.timestamp(Rx.Scheduler.default);
*
* @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
* @returns {Observable} An observable sequence with timestamp information on values.
*/
observableProto.timestamp = function (scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return this.map(function (x) {
return { value: x, timestamp: scheduler.now() };
});
};
function sampleObservable(source, sampler) {
return new AnonymousObservable(function (o) {
var atEnd = false, value, hasValue = false;
function sampleSubscribe() {
if (hasValue) {
hasValue = false;
o.onNext(value);
}
atEnd && o.onCompleted();
}
var sourceSubscription = new SingleAssignmentDisposable();
sourceSubscription.setDisposable(source.subscribe(
function (newValue) {
hasValue = true;
value = newValue;
},
function (e) { o.onError(e); },
function () {
atEnd = true;
sourceSubscription.dispose();
}
));
return new CompositeDisposable(
sourceSubscription,
sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
);
}, source);
}
/**
* Samples the observable sequence at each interval.
*
* @example
* 1 - res = source.sample(sampleObservable); // Sampler tick sequence
* 2 - res = source.sample(5000); // 5 seconds
* 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
*
* @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
* @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Sampled observable sequence.
*/
observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return typeof intervalOrSampler === 'number' ?
sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
sampleObservable(this, intervalOrSampler);
};
/**
* Returns the source observable sequence or the other observable sequence if dueTime elapses.
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
* @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
* @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeout = function (dueTime, other, scheduler) {
(other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = dueTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (observer) {
var id = 0,
original = new SingleAssignmentDisposable(),
subscription = new SerialDisposable(),
switched = false,
timer = new SerialDisposable();
subscription.setDisposable(original);
function createTimer() {
var myId = id;
timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
if (id === myId) {
isPromise(other) && (other = observableFromPromise(other));
subscription.setDisposable(other.subscribe(observer));
}
}));
}
createTimer();
original.setDisposable(source.subscribe(function (x) {
if (!switched) {
id++;
observer.onNext(x);
createTimer();
}
}, function (e) {
if (!switched) {
id++;
observer.onError(e);
}
}, function () {
if (!switched) {
id++;
observer.onCompleted();
}
}));
return new CompositeDisposable(subscription, timer);
}, source);
};
/**
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
*
* @example
* res = source.generateWithAbsoluteTime(0,
* function (x) { return return true; },
* function (x) { return x + 1; },
* function (x) { return x; },
* function (x) { return new Date(); }
* });
*
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
* @returns {Observable} The generated sequence.
*/
Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var first = true,
hasResult = false;
return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
hasResult && observer.onNext(state);
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
var result = resultSelector(state);
var time = timeSelector(state);
}
} catch (e) {
observer.onError(e);
return;
}
if (hasResult) {
self(result, time);
} else {
observer.onCompleted();
}
});
});
};
/**
* Generates an observable sequence by iterating a state from an initial state until the condition fails.
*
* @example
* res = source.generateWithRelativeTime(0,
* function (x) { return return true; },
* function (x) { return x + 1; },
* function (x) { return x; },
* function (x) { return 500; }
* );
*
* @param {Mixed} initialState Initial state.
* @param {Function} condition Condition to terminate generation (upon returning false).
* @param {Function} iterate Iteration step function.
* @param {Function} resultSelector Selector function for results produced in the sequence.
* @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
* @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
* @returns {Observable} The generated sequence.
*/
Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var first = true,
hasResult = false;
return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
hasResult && observer.onNext(state);
try {
if (first) {
first = false;
} else {
state = iterate(state);
}
hasResult = condition(state);
if (hasResult) {
var result = resultSelector(state);
var time = timeSelector(state);
}
} catch (e) {
observer.onError(e);
return;
}
if (hasResult) {
self(result, time);
} else {
observer.onCompleted();
}
});
});
};
/**
* Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.delaySubscription(5000); // 5s
* 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
*
* @param {Number} dueTime Relative or absolute time shift of the subscription.
* @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delaySubscription = function (dueTime, scheduler) {
var scheduleMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative';
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
var d = new SerialDisposable();
d.setDisposable(scheduler[scheduleMethod](dueTime, function() {
d.setDisposable(source.subscribe(o));
}));
return d;
}, this);
};
/**
* Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
*
* @example
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
*
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
* @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
var source = this, subDelay, selector;
if (isFunction(subscriptionDelay)) {
selector = subscriptionDelay;
} else {
subDelay = subscriptionDelay;
selector = delayDurationSelector;
}
return new AnonymousObservable(function (observer) {
var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable();
function start() {
subscription.setDisposable(source.subscribe(
function (x) {
var delay = tryCatch(selector)(x);
if (delay === errorObj) { return observer.onError(delay.e); }
var d = new SingleAssignmentDisposable();
delays.add(d);
d.setDisposable(delay.subscribe(
function () {
observer.onNext(x);
delays.remove(d);
done();
},
function (e) { observer.onError(e); },
function () {
observer.onNext(x);
delays.remove(d);
done();
}
))
},
function (e) { observer.onError(e); },
function () {
atEnd = true;
subscription.dispose();
done();
}
))
}
function done () {
atEnd && delays.length === 0 && observer.onCompleted();
}
if (!subDelay) {
start();
} else {
subscription.setDisposable(subDelay.subscribe(start, function (e) { observer.onError(e); }, start));
}
return new CompositeDisposable(subscription, delays);
}, this);
};
/**
* Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
* @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
* @param {Function} timeoutDurationSelector Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
* @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
if (arguments.length === 1) {
timeoutdurationSelector = firstTimeout;
firstTimeout = observableNever();
}
other || (other = observableThrow(new Error('Timeout')));
var source = this;
return new AnonymousObservable(function (observer) {
var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
subscription.setDisposable(original);
var id = 0, switched = false;
function setTimer(timeout) {
var myId = id;
function timerWins () {
return id === myId;
}
var d = new SingleAssignmentDisposable();
timer.setDisposable(d);
d.setDisposable(timeout.subscribe(function () {
timerWins() && subscription.setDisposable(other.subscribe(observer));
d.dispose();
}, function (e) {
timerWins() && observer.onError(e);
}, function () {
timerWins() && subscription.setDisposable(other.subscribe(observer));
}));
};
setTimer(firstTimeout);
function observerWins() {
var res = !switched;
if (res) { id++; }
return res;
}
original.setDisposable(source.subscribe(function (x) {
if (observerWins()) {
observer.onNext(x);
var timeout;
try {
timeout = timeoutdurationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout);
}
}, function (e) {
observerWins() && observer.onError(e);
}, function () {
observerWins() && observer.onCompleted();
}));
return new CompositeDisposable(subscription, timer);
}, source);
};
/**
* Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
* @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
* @returns {Observable} The debounced sequence.
*/
observableProto.debounceWithSelector = function (durationSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var value, hasValue = false, cancelable = new SerialDisposable(), id = 0;
var subscription = source.subscribe(function (x) {
var throttle;
try {
throttle = durationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
isPromise(throttle) && (throttle = observableFromPromise(throttle));
hasValue = true;
value = x;
id++;
var currentid = id, d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(throttle.subscribe(function () {
hasValue && id === currentid && observer.onNext(value);
hasValue = false;
d.dispose();
}, observer.onError.bind(observer), function () {
hasValue && id === currentid && observer.onNext(value);
hasValue = false;
d.dispose();
}));
}, function (e) {
cancelable.dispose();
observer.onError(e);
hasValue = false;
id++;
}, function () {
cancelable.dispose();
hasValue && observer.onNext(value);
observer.onCompleted();
hasValue = false;
id++;
});
return new CompositeDisposable(subscription, cancelable);
}, source);
};
/**
* @deprecated use #debounceWithSelector instead.
*/
observableProto.throttleWithSelector = function (durationSelector) {
//deprecate('throttleWithSelector', 'debounceWithSelector');
return this.debounceWithSelector(durationSelector);
};
/**
* Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
*
* 1 - res = source.skipLastWithTime(5000);
* 2 - res = source.skipLastWithTime(5000, scheduler);
*
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for skipping elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
*/
observableProto.skipLastWithTime = function (duration, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
o.onNext(q.shift().value);
}
}, function (e) { o.onError(e); }, function () {
var now = scheduler.now();
while (q.length > 0 && now - q[0].interval >= duration) {
o.onNext(q.shift().value);
}
o.onCompleted();
});
}, source);
};
/**
* Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
q.shift();
}
}, function (e) { o.onError(e); }, function () {
var now = scheduler.now();
while (q.length > 0) {
var next = q.shift();
if (now - next.interval <= duration) { o.onNext(next.value); }
}
o.onCompleted();
});
}, source);
};
/**
* Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastBufferWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
q.shift();
}
}, function (e) { o.onError(e); }, function () {
var now = scheduler.now(), res = [];
while (q.length > 0) {
var next = q.shift();
now - next.interval <= duration && res.push(next.value);
}
o.onNext(res);
o.onCompleted();
});
}, source);
};
/**
* Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.takeWithTime(5000, [optional scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
*/
observableProto.takeWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (o) {
return new CompositeDisposable(scheduler.scheduleWithRelative(duration, function () { o.onCompleted(); }), source.subscribe(o));
}, source);
};
/**
* Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.skipWithTime(5000, [optional scheduler]);
*
* @description
* Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
* This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
* may not execute immediately, despite the zero due time.
*
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
* @param {Number} duration Duration for skipping elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
*/
observableProto.skipWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var open = false;
return new CompositeDisposable(
scheduler.scheduleWithRelative(duration, function () { open = true; }),
source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)));
}, source);
};
/**
* Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time.
*
* @examples
* 1 - res = source.skipUntilWithTime(new Date(), [scheduler]);
* 2 - res = source.skipUntilWithTime(5000, [scheduler]);
* @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped until the specified start time.
*/
observableProto.skipUntilWithTime = function (startTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = startTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (o) {
var open = false;
return new CompositeDisposable(
scheduler[schedulerMethod](startTime, function () { open = true; }),
source.subscribe(
function (x) { open && o.onNext(x); },
function (e) { o.onError(e); }, function () { o.onCompleted(); }));
}, source);
};
/**
* Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
* @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.
* @param {Scheduler} [scheduler] Scheduler to run the timer on.
* @returns {Observable} An observable sequence with the elements taken until the specified end time.
*/
observableProto.takeUntilWithTime = function (endTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = endTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (o) {
return new CompositeDisposable(
scheduler[schedulerMethod](endTime, function () { o.onCompleted(); }),
source.subscribe(o));
}, source);
};
/**
* Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
* @param {Number} windowDuration time to wait before emitting another item after emitting the last item
* @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
* @returns {Observable} An Observable that performs the throttle operation.
*/
observableProto.throttleFirst = function (windowDuration, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var duration = +windowDuration || 0;
if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
var source = this;
return new AnonymousObservable(function (o) {
var lastOnNext = 0;
return source.subscribe(
function (x) {
var now = scheduler.now();
if (lastOnNext === 0 || now - lastOnNext >= duration) {
lastOnNext = now;
o.onNext(x);
}
},function (e) { o.onError(e); }, function () { o.onCompleted(); }
);
}, source);
};
/**
* Executes a transducer to transform the observable sequence
* @param {Transducer} transducer A transducer to execute
* @returns {Observable} An Observable sequence containing the results from the transducer.
*/
observableProto.transduce = function(transducer) {
var source = this;
function transformForObserver(o) {
return {
'@@transducer/init': function() {
return o;
},
'@@transducer/step': function(obs, input) {
return obs.onNext(input);
},
'@@transducer/result': function(obs) {
return obs.onCompleted();
}
};
}
return new AnonymousObservable(function(o) {
var xform = transducer(transformForObserver(o));
return source.subscribe(
function(v) {
try {
xform['@@transducer/step'](o, v);
} catch (e) {
o.onError(e);
}
},
function (e) { o.onError(e); },
function() { xform['@@transducer/result'](o); }
);
}, source);
};
/*
* Performs a exclusive waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @returns {Observable} A exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusive = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasCurrent = false,
isStopped = false,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
var innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
innerSubscription.setDisposable(innerSource.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
observer.onError.bind(observer),
function () {
isStopped = true;
if (!hasCurrent && g.length === 1) {
observer.onCompleted();
}
}));
return g;
}, this);
};
/*
* Performs a exclusive map waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @param {Function} selector Selector to invoke for every item in the current subscription.
* @param {Any} [thisArg] An optional context to invoke with the selector parameter.
* @returns {Observable} An exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusiveMap = function (selector, thisArg) {
var sources = this,
selectorFunc = bindCallback(selector, thisArg, 3);
return new AnonymousObservable(function (observer) {
var index = 0,
hasCurrent = false,
isStopped = true,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) {
var result;
try {
result = selectorFunc(x, index++, innerSource);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
},
function (e) { observer.onError(e); },
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
function (e) { observer.onError(e); },
function () {
isStopped = true;
if (g.length === 1 && !hasCurrent) {
observer.onCompleted();
}
}));
return g;
}, this);
};
/** Provides a set of extension methods for virtual time scheduling. */
Rx.VirtualTimeScheduler = (function (__super__) {
function localNow() {
return this.toDateTimeOffset(this.clock);
}
function scheduleNow(state, action) {
return this.scheduleAbsoluteWithState(state, this.clock, action);
}
function scheduleRelative(state, dueTime, action) {
return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action);
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action);
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
inherits(VirtualTimeScheduler, __super__);
/**
* Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
*
* @constructor
* @param {Number} initialClock Initial value for the clock.
* @param {Function} comparer Comparer to determine causality of events based on absolute time.
*/
function VirtualTimeScheduler(initialClock, comparer) {
this.clock = initialClock;
this.comparer = comparer;
this.isEnabled = false;
this.queue = new PriorityQueue(1024);
__super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute);
}
var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype;
/**
* Adds a relative time value to an absolute time value.
* @param {Number} absolute Absolute virtual time value.
* @param {Number} relative Relative virtual time value to add.
* @return {Number} Resulting absolute virtual time sum value.
*/
VirtualTimeSchedulerPrototype.add = notImplemented;
/**
* Converts an absolute time to a number
* @param {Any} The absolute time.
* @returns {Number} The absolute time in ms
*/
VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented;
/**
* Converts the TimeSpan value to a relative virtual time value.
* @param {Number} timeSpan TimeSpan value to convert.
* @return {Number} Corresponding relative virtual time value.
*/
VirtualTimeSchedulerPrototype.toRelative = notImplemented;
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) {
var s = new SchedulePeriodicRecursive(this, state, period, action);
return s.start();
};
/**
* Schedules an action to be executed after dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) {
var runAt = this.add(this.clock, dueTime);
return this.scheduleAbsoluteWithState(state, runAt, action);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Number} dueTime Relative time after which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) {
return this.scheduleRelativeWithState(action, dueTime, invokeAction);
};
/**
* Starts the virtual time scheduler.
*/
VirtualTimeSchedulerPrototype.start = function () {
if (!this.isEnabled) {
this.isEnabled = true;
do {
var next = this.getNext();
if (next !== null) {
this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
next.invoke();
} else {
this.isEnabled = false;
}
} while (this.isEnabled);
}
};
/**
* Stops the virtual time scheduler.
*/
VirtualTimeSchedulerPrototype.stop = function () {
this.isEnabled = false;
};
/**
* Advances the scheduler's clock to the specified time, running all work till that point.
* @param {Number} time Absolute time to advance the scheduler's clock to.
*/
VirtualTimeSchedulerPrototype.advanceTo = function (time) {
var dueToClock = this.comparer(this.clock, time);
if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); }
if (dueToClock === 0) { return; }
if (!this.isEnabled) {
this.isEnabled = true;
do {
var next = this.getNext();
if (next !== null && this.comparer(next.dueTime, time) <= 0) {
this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
next.invoke();
} else {
this.isEnabled = false;
}
} while (this.isEnabled);
this.clock = time;
}
};
/**
* Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
* @param {Number} time Relative time to advance the scheduler's clock by.
*/
VirtualTimeSchedulerPrototype.advanceBy = function (time) {
var dt = this.add(this.clock, time),
dueToClock = this.comparer(this.clock, dt);
if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); }
if (dueToClock === 0) { return; }
this.advanceTo(dt);
};
/**
* Advances the scheduler's clock by the specified relative time.
* @param {Number} time Relative time to advance the scheduler's clock by.
*/
VirtualTimeSchedulerPrototype.sleep = function (time) {
var dt = this.add(this.clock, time);
if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); }
this.clock = dt;
};
/**
* Gets the next scheduled item to be executed.
* @returns {ScheduledItem} The next scheduled item.
*/
VirtualTimeSchedulerPrototype.getNext = function () {
while (this.queue.length > 0) {
var next = this.queue.peek();
if (next.isCancelled()) {
this.queue.dequeue();
} else {
return next;
}
}
return null;
};
/**
* Schedules an action to be executed at dueTime.
* @param {Scheduler} scheduler Scheduler to execute the action on.
* @param {Number} dueTime Absolute time at which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) {
return this.scheduleAbsoluteWithState(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Number} dueTime Absolute time at which to execute the action.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) {
var self = this;
function run(scheduler, state1) {
self.queue.remove(si);
return action(scheduler, state1);
}
var si = new ScheduledItem(this, state, run, dueTime, this.comparer);
this.queue.enqueue(si);
return si.disposable;
};
return VirtualTimeScheduler;
}(Scheduler));
/** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */
Rx.HistoricalScheduler = (function (__super__) {
inherits(HistoricalScheduler, __super__);
/**
* Creates a new historical scheduler with the specified initial clock value.
* @constructor
* @param {Number} initialClock Initial value for the clock.
* @param {Function} comparer Comparer to determine causality of events based on absolute time.
*/
function HistoricalScheduler(initialClock, comparer) {
var clock = initialClock == null ? 0 : initialClock;
var cmp = comparer || defaultSubComparer;
__super__.call(this, clock, cmp);
}
var HistoricalSchedulerProto = HistoricalScheduler.prototype;
/**
* Adds a relative time value to an absolute time value.
* @param {Number} absolute Absolute virtual time value.
* @param {Number} relative Relative virtual time value to add.
* @return {Number} Resulting absolute virtual time sum value.
*/
HistoricalSchedulerProto.add = function (absolute, relative) {
return absolute + relative;
};
HistoricalSchedulerProto.toDateTimeOffset = function (absolute) {
return new Date(absolute).getTime();
};
/**
* Converts the TimeSpan value to a relative virtual time value.
* @memberOf HistoricalScheduler
* @param {Number} timeSpan TimeSpan value to convert.
* @return {Number} Corresponding relative virtual time value.
*/
HistoricalSchedulerProto.toRelative = function (timeSpan) {
return timeSpan;
};
return HistoricalScheduler;
}(Rx.VirtualTimeScheduler));
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
// Fix subscriber to check for undefined or function returned to decorate as Disposable
function fixSubscriber(subscriber) {
return subscriber && isFunction(subscriber.dispose) ? subscriber :
isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
}
function setDisposable(s, state) {
var ado = state[0], subscribe = state[1];
var sub = tryCatch(subscribe)(ado);
if (sub === errorObj) {
if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
}
ado.setDisposable(fixSubscriber(sub));
}
function AnonymousObservable(subscribe, parent) {
this.source = parent;
function s(observer) {
var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.scheduleWithState(state, setDisposable);
} else {
setDisposable(null, state);
}
return ado;
}
__super__.call(this, s);
}
return AnonymousObservable;
}(Observable));
var AutoDetachObserver = (function (__super__) {
inherits(AutoDetachObserver, __super__);
function AutoDetachObserver(observer) {
__super__.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var result = tryCatch(this.observer.onNext).call(this.observer, value);
if (result === errorObj) {
this.dispose();
thrower(result.e);
}
};
AutoDetachObserverPrototype.error = function (err) {
var result = tryCatch(this.observer.onError).call(this.observer, err);
this.dispose();
result === errorObj && thrower(result.e);
};
AutoDetachObserverPrototype.completed = function () {
var result = tryCatch(this.observer.onCompleted).call(this.observer);
this.dispose();
result === errorObj && thrower(result.e);
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
AutoDetachObserverPrototype.dispose = function () {
__super__.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
var GroupedObservable = (function (__super__) {
inherits(GroupedObservable, __super__);
function subscribe(observer) {
return this.underlyingObservable.subscribe(observer);
}
function GroupedObservable(key, underlyingObservable, mergedDisposable) {
__super__.call(this, subscribe);
this.key = key;
this.underlyingObservable = !mergedDisposable ?
underlyingObservable :
new AnonymousObservable(function (observer) {
return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer));
});
}
return GroupedObservable;
}(Observable));
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed observers.
*/
var Subject = Rx.Subject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
return disposableEmpty;
}
observer.onCompleted();
return disposableEmpty;
}
inherits(Subject, __super__);
/**
* Creates a subject.
*/
function Subject() {
__super__.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.observers = [];
this.hasError = false;
}
addProperties(Subject.prototype, Observer.prototype, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () { return this.observers.length > 0; },
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
this.error = error;
this.hasError = true;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed(this);
if (!this.isStopped) {
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
/**
* Creates a subject from the specified observer and observable.
* @param {Observer} observer The observer used to send messages to the subject.
* @param {Observable} observable The observable used to subscribe to messages sent from the subject.
* @returns {Subject} Subject implemented using the given observer and observable.
*/
Subject.create = function (observer, observable) {
return new AnonymousSubject(observer, observable);
};
return Subject;
}(Observable));
/**
* Represents the result of an asynchronous operation.
* The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
*/
var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
function subscribe(observer) {
checkDisposed(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.hasError) {
observer.onError(this.error);
} else if (this.hasValue) {
observer.onNext(this.value);
observer.onCompleted();
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(AsyncSubject, __super__);
/**
* Creates a subject that can only receive one value and that value is cached for all future observations.
* @constructor
*/
function AsyncSubject() {
__super__.call(this, subscribe);
this.isDisposed = false;
this.isStopped = false;
this.hasValue = false;
this.observers = [];
this.hasError = false;
}
addProperties(AsyncSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
checkDisposed(this);
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
*/
onCompleted: function () {
var i, len;
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
var os = cloneArray(this.observers), len = os.length;
if (this.hasValue) {
for (i = 0; i < len; i++) {
var o = os[i];
o.onNext(this.value);
o.onCompleted();
}
} else {
for (i = 0; i < len; i++) {
os[i].onCompleted();
}
}
this.observers.length = 0;
}
},
/**
* Notifies all subscribed observers about the error.
* @param {Mixed} error The Error to send to all observers.
*/
onError: function (error) {
checkDisposed(this);
if (!this.isStopped) {
this.isStopped = true;
this.hasError = true;
this.error = error;
for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers.length = 0;
}
},
/**
* Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
* @param {Mixed} value The value to store in the subject.
*/
onNext: function (value) {
checkDisposed(this);
if (this.isStopped) { return; }
this.value = value;
this.hasValue = true;
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.exception = null;
this.value = null;
}
});
return AsyncSubject;
}(Observable));
var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
inherits(AnonymousSubject, __super__);
function subscribe(observer) {
return this.observable.subscribe(observer);
}
function AnonymousSubject(observer, observable) {
this.observer = observer;
this.observable = observable;
__super__.call(this, subscribe);
}
addProperties(AnonymousSubject.prototype, Observer.prototype, {
onCompleted: function () {
this.observer.onCompleted();
},
onError: function (error) {
this.observer.onError(error);
},
onNext: function (value) {
this.observer.onNext(value);
}
});
return AnonymousSubject;
}(Observable));
/**
* Used to pause and resume streams.
*/
Rx.Pauser = (function (__super__) {
inherits(Pauser, __super__);
function Pauser() {
__super__.call(this);
}
/**
* Pauses the underlying sequence.
*/
Pauser.prototype.pause = function () { this.onNext(false); };
/**
* Resumes the underlying sequence.
*/
Pauser.prototype.resume = function () { this.onNext(true); };
return Pauser;
}(Subject));
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
root.Rx = Rx;
define(function() {
return Rx;
});
} else if (freeExports && freeModule) {
// in Node.js or RingoJS
if (moduleExports) {
(freeModule.exports = Rx).Rx = Rx;
} else {
freeExports.Rx = Rx;
}
} else {
// in a browser or Rhino
root.Rx = Rx;
}
// All code before this point will be filtered from stack traces.
var rEndingLine = captureLine();
}.call(this));
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"_process":3}],60:[function(require,module,exports){
/**
* index.js
*
* A client-side DOM to vdom parser based on DOMParser API
*/
'use strict';
var VNode = require('virtual-dom/vnode/vnode');
var VText = require('virtual-dom/vnode/vtext');
var domParser = new DOMParser();
var propertyMap = require('./property-map');
var namespaceMap = require('./namespace-map');
var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
module.exports = parser;
/**
* DOM/html string to vdom parser
*
* @param Mixed el DOM element or html string
* @param String attr Attribute name that contains vdom key
* @return Object VNode or VText
*/
function parser(el, attr) {
// empty input fallback to empty text node
if (!el) {
return createNode(document.createTextNode(''));
}
if (typeof el === 'string') {
var doc = domParser.parseFromString(el, 'text/html');
// most tags default to body
if (doc.body.firstChild) {
el = doc.body.firstChild;
// some tags, like script and style, default to head
} else if (doc.head.firstChild && (doc.head.firstChild.tagName !== 'TITLE' || doc.title)) {
el = doc.head.firstChild;
// special case for html comment, cdata, doctype
} else if (doc.firstChild && doc.firstChild.tagName !== 'HTML') {
el = doc.firstChild;
// other element, such as whitespace, or html/body/head tag, fallback to empty text node
} else {
el = document.createTextNode('');
}
}
if (typeof el !== 'object' || !el || !el.nodeType) {
throw new Error('invalid dom node', el);
}
return createNode(el, attr);
}
/**
* Create vdom from dom node
*
* @param Object el DOM element
* @param String attr Attribute name that contains vdom key
* @return Object VNode or VText
*/
function createNode(el, attr) {
// html comment is not currently supported by virtual-dom
if (el.nodeType === 3) {
return createVirtualTextNode(el);
// cdata or doctype is not currently supported by virtual-dom
} else if (el.nodeType === 1 || el.nodeType === 9) {
return createVirtualDomNode(el, attr);
}
// default to empty text node
return new VText('');
}
/**
* Create vtext from dom node
*
* @param Object el Text node
* @return Object VText
*/
function createVirtualTextNode(el) {
return new VText(el.nodeValue);
}
/**
* Create vnode from dom node
*
* @param Object el DOM element
* @param String attr Attribute name that contains vdom key
* @return Object VNode
*/
function createVirtualDomNode(el, attr) {
var ns = el.namespaceURI !== HTML_NAMESPACE ? el.namespaceURI : null;
var key = attr && el.getAttribute(attr) ? el.getAttribute(attr) : null;
return new VNode(
el.tagName
, createProperties(el)
, createChildren(el, attr)
, key
, ns
);
}
/**
* Recursively create vdom
*
* @param Object el Parent element
* @param String attr Attribute name that contains vdom key
* @return Array Child vnode or vtext
*/
function createChildren(el, attr) {
var children = [];
for (var i = 0; i < el.childNodes.length; i++) {
children.push(createNode(el.childNodes[i], attr));
};
return children;
}
/**
* Create properties from dom node
*
* @param Object el DOM element
* @return Object Node properties and attributes
*/
function createProperties(el) {
var properties = {};
if (!el.hasAttributes()) {
return properties;
}
var ns;
if (el.namespaceURI && el.namespaceURI !== HTML_NAMESPACE) {
ns = el.namespaceURI;
}
var attr;
for (var i = 0; i < el.attributes.length; i++) {
if (ns) {
attr = createPropertyNS(el.attributes[i]);
} else {
attr = createProperty(el.attributes[i]);
}
// special case, namespaced attribute, use properties.foobar
if (attr.ns) {
properties[attr.name] = {
namespace: attr.ns
, value: attr.value
};
// special case, use properties.attributes.foobar
} else if (attr.isAttr) {
// init attributes object only when necessary
if (!properties.attributes) {
properties.attributes = {}
}
properties.attributes[attr.name] = attr.value;
// default case, use properties.foobar
} else {
properties[attr.name] = attr.value;
}
};
return properties;
}
/**
* Create property from dom attribute
*
* @param Object attr DOM attribute
* @return Object Normalized attribute
*/
function createProperty(attr) {
var name, value, isAttr;
// using a map to find the correct case of property name
if (propertyMap[attr.name]) {
name = propertyMap[attr.name];
} else {
name = attr.name;
}
// special cases for style attribute, we default to properties.style
if (name === 'style') {
var style = {};
attr.value.split(';').forEach(function (s) {
var pos = s.indexOf(':');
if (pos < 0) {
return;
}
style[s.substr(0, pos).trim()] = s.substr(pos + 1).trim();
});
value = style;
// special cases for data attribute, we default to properties.attributes.data
} else if (name.indexOf('data-') === 0) {
value = attr.value;
isAttr = true;
} else {
value = attr.value;
}
return {
name: name
, value: value
, isAttr: isAttr || false
};
}
/**
* Create namespaced property from dom attribute
*
* @param Object attr DOM attribute
* @return Object Normalized attribute
*/
function createPropertyNS(attr) {
var name, value;
return {
name: attr.name
, value: attr.value
, ns: namespaceMap[attr.name] || ''
};
}
},{"./namespace-map":61,"./property-map":62,"virtual-dom/vnode/vnode":107,"virtual-dom/vnode/vtext":109}],61:[function(require,module,exports){
/**
* namespace-map.js
*
* Necessary to map svg attributes back to their namespace
*/
'use strict';
// extracted from https://github.com/Matt-Esch/virtual-dom/blob/master/virtual-hyperscript/svg-attribute-namespace.js
var DEFAULT_NAMESPACE = null;
var EV_NAMESPACE = 'http://www.w3.org/2001/xml-events';
var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
var namespaces = {
'about': DEFAULT_NAMESPACE
, 'accent-height': DEFAULT_NAMESPACE
, 'accumulate': DEFAULT_NAMESPACE
, 'additive': DEFAULT_NAMESPACE
, 'alignment-baseline': DEFAULT_NAMESPACE
, 'alphabetic': DEFAULT_NAMESPACE
, 'amplitude': DEFAULT_NAMESPACE
, 'arabic-form': DEFAULT_NAMESPACE
, 'ascent': DEFAULT_NAMESPACE
, 'attributeName': DEFAULT_NAMESPACE
, 'attributeType': DEFAULT_NAMESPACE
, 'azimuth': DEFAULT_NAMESPACE
, 'bandwidth': DEFAULT_NAMESPACE
, 'baseFrequency': DEFAULT_NAMESPACE
, 'baseProfile': DEFAULT_NAMESPACE
, 'baseline-shift': DEFAULT_NAMESPACE
, 'bbox': DEFAULT_NAMESPACE
, 'begin': DEFAULT_NAMESPACE
, 'bias': DEFAULT_NAMESPACE
, 'by': DEFAULT_NAMESPACE
, 'calcMode': DEFAULT_NAMESPACE
, 'cap-height': DEFAULT_NAMESPACE
, 'class': DEFAULT_NAMESPACE
, 'clip': DEFAULT_NAMESPACE
, 'clip-path': DEFAULT_NAMESPACE
, 'clip-rule': DEFAULT_NAMESPACE
, 'clipPathUnits': DEFAULT_NAMESPACE
, 'color': DEFAULT_NAMESPACE
, 'color-interpolation': DEFAULT_NAMESPACE
, 'color-interpolation-filters': DEFAULT_NAMESPACE
, 'color-profile': DEFAULT_NAMESPACE
, 'color-rendering': DEFAULT_NAMESPACE
, 'content': DEFAULT_NAMESPACE
, 'contentScriptType': DEFAULT_NAMESPACE
, 'contentStyleType': DEFAULT_NAMESPACE
, 'cursor': DEFAULT_NAMESPACE
, 'cx': DEFAULT_NAMESPACE
, 'cy': DEFAULT_NAMESPACE
, 'd': DEFAULT_NAMESPACE
, 'datatype': DEFAULT_NAMESPACE
, 'defaultAction': DEFAULT_NAMESPACE
, 'descent': DEFAULT_NAMESPACE
, 'diffuseConstant': DEFAULT_NAMESPACE
, 'direction': DEFAULT_NAMESPACE
, 'display': DEFAULT_NAMESPACE
, 'divisor': DEFAULT_NAMESPACE
, 'dominant-baseline': DEFAULT_NAMESPACE
, 'dur': DEFAULT_NAMESPACE
, 'dx': DEFAULT_NAMESPACE
, 'dy': DEFAULT_NAMESPACE
, 'edgeMode': DEFAULT_NAMESPACE
, 'editable': DEFAULT_NAMESPACE
, 'elevation': DEFAULT_NAMESPACE
, 'enable-background': DEFAULT_NAMESPACE
, 'end': DEFAULT_NAMESPACE
, 'ev:event': EV_NAMESPACE
, 'event': DEFAULT_NAMESPACE
, 'exponent': DEFAULT_NAMESPACE
, 'externalResourcesRequired': DEFAULT_NAMESPACE
, 'fill': DEFAULT_NAMESPACE
, 'fill-opacity': DEFAULT_NAMESPACE
, 'fill-rule': DEFAULT_NAMESPACE
, 'filter': DEFAULT_NAMESPACE
, 'filterRes': DEFAULT_NAMESPACE
, 'filterUnits': DEFAULT_NAMESPACE
, 'flood-color': DEFAULT_NAMESPACE
, 'flood-opacity': DEFAULT_NAMESPACE
, 'focusHighlight': DEFAULT_NAMESPACE
, 'focusable': DEFAULT_NAMESPACE
, 'font-family': DEFAULT_NAMESPACE
, 'font-size': DEFAULT_NAMESPACE
, 'font-size-adjust': DEFAULT_NAMESPACE
, 'font-stretch': DEFAULT_NAMESPACE
, 'font-style': DEFAULT_NAMESPACE
, 'font-variant': DEFAULT_NAMESPACE
, 'font-weight': DEFAULT_NAMESPACE
, 'format': DEFAULT_NAMESPACE
, 'from': DEFAULT_NAMESPACE
, 'fx': DEFAULT_NAMESPACE
, 'fy': DEFAULT_NAMESPACE
, 'g1': DEFAULT_NAMESPACE
, 'g2': DEFAULT_NAMESPACE
, 'glyph-name': DEFAULT_NAMESPACE
, 'glyph-orientation-horizontal': DEFAULT_NAMESPACE
, 'glyph-orientation-vertical': DEFAULT_NAMESPACE
, 'glyphRef': DEFAULT_NAMESPACE
, 'gradientTransform': DEFAULT_NAMESPACE
, 'gradientUnits': DEFAULT_NAMESPACE
, 'handler': DEFAULT_NAMESPACE
, 'hanging': DEFAULT_NAMESPACE
, 'height': DEFAULT_NAMESPACE
, 'horiz-adv-x': DEFAULT_NAMESPACE
, 'horiz-origin-x': DEFAULT_NAMESPACE
, 'horiz-origin-y': DEFAULT_NAMESPACE
, 'id': DEFAULT_NAMESPACE
, 'ideographic': DEFAULT_NAMESPACE
, 'image-rendering': DEFAULT_NAMESPACE
, 'in': DEFAULT_NAMESPACE
, 'in2': DEFAULT_NAMESPACE
, 'initialVisibility': DEFAULT_NAMESPACE
, 'intercept': DEFAULT_NAMESPACE
, 'k': DEFAULT_NAMESPACE
, 'k1': DEFAULT_NAMESPACE
, 'k2': DEFAULT_NAMESPACE
, 'k3': DEFAULT_NAMESPACE
, 'k4': DEFAULT_NAMESPACE
, 'kernelMatrix': DEFAULT_NAMESPACE
, 'kernelUnitLength': DEFAULT_NAMESPACE
, 'kerning': DEFAULT_NAMESPACE
, 'keyPoints': DEFAULT_NAMESPACE
, 'keySplines': DEFAULT_NAMESPACE
, 'keyTimes': DEFAULT_NAMESPACE
, 'lang': DEFAULT_NAMESPACE
, 'lengthAdjust': DEFAULT_NAMESPACE
, 'letter-spacing': DEFAULT_NAMESPACE
, 'lighting-color': DEFAULT_NAMESPACE
, 'limitingConeAngle': DEFAULT_NAMESPACE
, 'local': DEFAULT_NAMESPACE
, 'marker-end': DEFAULT_NAMESPACE
, 'marker-mid': DEFAULT_NAMESPACE
, 'marker-start': DEFAULT_NAMESPACE
, 'markerHeight': DEFAULT_NAMESPACE
, 'markerUnits': DEFAULT_NAMESPACE
, 'markerWidth': DEFAULT_NAMESPACE
, 'mask': DEFAULT_NAMESPACE
, 'maskContentUnits': DEFAULT_NAMESPACE
, 'maskUnits': DEFAULT_NAMESPACE
, 'mathematical': DEFAULT_NAMESPACE
, 'max': DEFAULT_NAMESPACE
, 'media': DEFAULT_NAMESPACE
, 'mediaCharacterEncoding': DEFAULT_NAMESPACE
, 'mediaContentEncodings': DEFAULT_NAMESPACE
, 'mediaSize': DEFAULT_NAMESPACE
, 'mediaTime': DEFAULT_NAMESPACE
, 'method': DEFAULT_NAMESPACE
, 'min': DEFAULT_NAMESPACE
, 'mode': DEFAULT_NAMESPACE
, 'name': DEFAULT_NAMESPACE
, 'nav-down': DEFAULT_NAMESPACE
, 'nav-down-left': DEFAULT_NAMESPACE
, 'nav-down-right': DEFAULT_NAMESPACE
, 'nav-left': DEFAULT_NAMESPACE
, 'nav-next': DEFAULT_NAMESPACE
, 'nav-prev': DEFAULT_NAMESPACE
, 'nav-right': DEFAULT_NAMESPACE
, 'nav-up': DEFAULT_NAMESPACE
, 'nav-up-left': DEFAULT_NAMESPACE
, 'nav-up-right': DEFAULT_NAMESPACE
, 'numOctaves': DEFAULT_NAMESPACE
, 'observer': DEFAULT_NAMESPACE
, 'offset': DEFAULT_NAMESPACE
, 'opacity': DEFAULT_NAMESPACE
, 'operator': DEFAULT_NAMESPACE
, 'order': DEFAULT_NAMESPACE
, 'orient': DEFAULT_NAMESPACE
, 'orientation': DEFAULT_NAMESPACE
, 'origin': DEFAULT_NAMESPACE
, 'overflow': DEFAULT_NAMESPACE
, 'overlay': DEFAULT_NAMESPACE
, 'overline-position': DEFAULT_NAMESPACE
, 'overline-thickness': DEFAULT_NAMESPACE
, 'panose-1': DEFAULT_NAMESPACE
, 'path': DEFAULT_NAMESPACE
, 'pathLength': DEFAULT_NAMESPACE
, 'patternContentUnits': DEFAULT_NAMESPACE
, 'patternTransform': DEFAULT_NAMESPACE
, 'patternUnits': DEFAULT_NAMESPACE
, 'phase': DEFAULT_NAMESPACE
, 'playbackOrder': DEFAULT_NAMESPACE
, 'pointer-events': DEFAULT_NAMESPACE
, 'points': DEFAULT_NAMESPACE
, 'pointsAtX': DEFAULT_NAMESPACE
, 'pointsAtY': DEFAULT_NAMESPACE
, 'pointsAtZ': DEFAULT_NAMESPACE
, 'preserveAlpha': DEFAULT_NAMESPACE
, 'preserveAspectRatio': DEFAULT_NAMESPACE
, 'primitiveUnits': DEFAULT_NAMESPACE
, 'propagate': DEFAULT_NAMESPACE
, 'property': DEFAULT_NAMESPACE
, 'r': DEFAULT_NAMESPACE
, 'radius': DEFAULT_NAMESPACE
, 'refX': DEFAULT_NAMESPACE
, 'refY': DEFAULT_NAMESPACE
, 'rel': DEFAULT_NAMESPACE
, 'rendering-intent': DEFAULT_NAMESPACE
, 'repeatCount': DEFAULT_NAMESPACE
, 'repeatDur': DEFAULT_NAMESPACE
, 'requiredExtensions': DEFAULT_NAMESPACE
, 'requiredFeatures': DEFAULT_NAMESPACE
, 'requiredFonts': DEFAULT_NAMESPACE
, 'requiredFormats': DEFAULT_NAMESPACE
, 'resource': DEFAULT_NAMESPACE
, 'restart': DEFAULT_NAMESPACE
, 'result': DEFAULT_NAMESPACE
, 'rev': DEFAULT_NAMESPACE
, 'role': DEFAULT_NAMESPACE
, 'rotate': DEFAULT_NAMESPACE
, 'rx': DEFAULT_NAMESPACE
, 'ry': DEFAULT_NAMESPACE
, 'scale': DEFAULT_NAMESPACE
, 'seed': DEFAULT_NAMESPACE
, 'shape-rendering': DEFAULT_NAMESPACE
, 'slope': DEFAULT_NAMESPACE
, 'snapshotTime': DEFAULT_NAMESPACE
, 'spacing': DEFAULT_NAMESPACE
, 'specularConstant': DEFAULT_NAMESPACE
, 'specularExponent': DEFAULT_NAMESPACE
, 'spreadMethod': DEFAULT_NAMESPACE
, 'startOffset': DEFAULT_NAMESPACE
, 'stdDeviation': DEFAULT_NAMESPACE
, 'stemh': DEFAULT_NAMESPACE
, 'stemv': DEFAULT_NAMESPACE
, 'stitchTiles': DEFAULT_NAMESPACE
, 'stop-color': DEFAULT_NAMESPACE
, 'stop-opacity': DEFAULT_NAMESPACE
, 'strikethrough-position': DEFAULT_NAMESPACE
, 'strikethrough-thickness': DEFAULT_NAMESPACE
, 'string': DEFAULT_NAMESPACE
, 'stroke': DEFAULT_NAMESPACE
, 'stroke-dasharray': DEFAULT_NAMESPACE
, 'stroke-dashoffset': DEFAULT_NAMESPACE
, 'stroke-linecap': DEFAULT_NAMESPACE
, 'stroke-linejoin': DEFAULT_NAMESPACE
, 'stroke-miterlimit': DEFAULT_NAMESPACE
, 'stroke-opacity': DEFAULT_NAMESPACE
, 'stroke-width': DEFAULT_NAMESPACE
, 'surfaceScale': DEFAULT_NAMESPACE
, 'syncBehavior': DEFAULT_NAMESPACE
, 'syncBehaviorDefault': DEFAULT_NAMESPACE
, 'syncMaster': DEFAULT_NAMESPACE
, 'syncTolerance': DEFAULT_NAMESPACE
, 'syncToleranceDefault': DEFAULT_NAMESPACE
, 'systemLanguage': DEFAULT_NAMESPACE
, 'tableValues': DEFAULT_NAMESPACE
, 'target': DEFAULT_NAMESPACE
, 'targetX': DEFAULT_NAMESPACE
, 'targetY': DEFAULT_NAMESPACE
, 'text-anchor': DEFAULT_NAMESPACE
, 'text-decoration': DEFAULT_NAMESPACE
, 'text-rendering': DEFAULT_NAMESPACE
, 'textLength': DEFAULT_NAMESPACE
, 'timelineBegin': DEFAULT_NAMESPACE
, 'title': DEFAULT_NAMESPACE
, 'to': DEFAULT_NAMESPACE
, 'transform': DEFAULT_NAMESPACE
, 'transformBehavior': DEFAULT_NAMESPACE
, 'type': DEFAULT_NAMESPACE
, 'typeof': DEFAULT_NAMESPACE
, 'u1': DEFAULT_NAMESPACE
, 'u2': DEFAULT_NAMESPACE
, 'underline-position': DEFAULT_NAMESPACE
, 'underline-thickness': DEFAULT_NAMESPACE
, 'unicode': DEFAULT_NAMESPACE
, 'unicode-bidi': DEFAULT_NAMESPACE
, 'unicode-range': DEFAULT_NAMESPACE
, 'units-per-em': DEFAULT_NAMESPACE
, 'v-alphabetic': DEFAULT_NAMESPACE
, 'v-hanging': DEFAULT_NAMESPACE
, 'v-ideographic': DEFAULT_NAMESPACE
, 'v-mathematical': DEFAULT_NAMESPACE
, 'values': DEFAULT_NAMESPACE
, 'version': DEFAULT_NAMESPACE
, 'vert-adv-y': DEFAULT_NAMESPACE
, 'vert-origin-x': DEFAULT_NAMESPACE
, 'vert-origin-y': DEFAULT_NAMESPACE
, 'viewBox': DEFAULT_NAMESPACE
, 'viewTarget': DEFAULT_NAMESPACE
, 'visibility': DEFAULT_NAMESPACE
, 'width': DEFAULT_NAMESPACE
, 'widths': DEFAULT_NAMESPACE
, 'word-spacing': DEFAULT_NAMESPACE
, 'writing-mode': DEFAULT_NAMESPACE
, 'x': DEFAULT_NAMESPACE
, 'x-height': DEFAULT_NAMESPACE
, 'x1': DEFAULT_NAMESPACE
, 'x2': DEFAULT_NAMESPACE
, 'xChannelSelector': DEFAULT_NAMESPACE
, 'xlink:actuate': XLINK_NAMESPACE
, 'xlink:arcrole': XLINK_NAMESPACE
, 'xlink:href': XLINK_NAMESPACE
, 'xlink:role': XLINK_NAMESPACE
, 'xlink:show': XLINK_NAMESPACE
, 'xlink:title': XLINK_NAMESPACE
, 'xlink:type': XLINK_NAMESPACE
, 'xml:base': XML_NAMESPACE
, 'xml:id': XML_NAMESPACE
, 'xml:lang': XML_NAMESPACE
, 'xml:space': XML_NAMESPACE
, 'y': DEFAULT_NAMESPACE
, 'y1': DEFAULT_NAMESPACE
, 'y2': DEFAULT_NAMESPACE
, 'yChannelSelector': DEFAULT_NAMESPACE
, 'z': DEFAULT_NAMESPACE
, 'zoomAndPan': DEFAULT_NAMESPACE
};
module.exports = namespaces;
},{}],62:[function(require,module,exports){
/**
* property-map.js
*
* Necessary to map dom attributes back to vdom properties
*/
'use strict';
// invert of https://www.npmjs.com/package/html-attributes
var properties = {
'abbr': 'abbr'
, 'accept': 'accept'
, 'accept-charset': 'acceptCharset'
, 'accesskey': 'accessKey'
, 'action': 'action'
, 'allowfullscreen': 'allowFullScreen'
, 'allowtransparency': 'allowTransparency'
, 'alt': 'alt'
, 'async': 'async'
, 'autocomplete': 'autoComplete'
, 'autofocus': 'autoFocus'
, 'autoplay': 'autoPlay'
, 'cellpadding': 'cellPadding'
, 'cellspacing': 'cellSpacing'
, 'challenge': 'challenge'
, 'charset': 'charset'
, 'checked': 'checked'
, 'cite': 'cite'
, 'class': 'className'
, 'cols': 'cols'
, 'colspan': 'colSpan'
, 'command': 'command'
, 'content': 'content'
, 'contenteditable': 'contentEditable'
, 'contextmenu': 'contextMenu'
, 'controls': 'controls'
, 'coords': 'coords'
, 'crossorigin': 'crossOrigin'
, 'data': 'data'
, 'datetime': 'dateTime'
, 'default': 'default'
, 'defer': 'defer'
, 'dir': 'dir'
, 'disabled': 'disabled'
, 'download': 'download'
, 'draggable': 'draggable'
, 'dropzone': 'dropzone'
, 'enctype': 'encType'
, 'for': 'htmlFor'
, 'form': 'form'
, 'formaction': 'formAction'
, 'formenctype': 'formEncType'
, 'formmethod': 'formMethod'
, 'formnovalidate': 'formNoValidate'
, 'formtarget': 'formTarget'
, 'frameBorder': 'frameBorder'
, 'headers': 'headers'
, 'height': 'height'
, 'hidden': 'hidden'
, 'high': 'high'
, 'href': 'href'
, 'hreflang': 'hrefLang'
, 'http-equiv': 'httpEquiv'
, 'icon': 'icon'
, 'id': 'id'
, 'inputmode': 'inputMode'
, 'ismap': 'isMap'
, 'itemid': 'itemId'
, 'itemprop': 'itemProp'
, 'itemref': 'itemRef'
, 'itemscope': 'itemScope'
, 'itemtype': 'itemType'
, 'kind': 'kind'
, 'label': 'label'
, 'lang': 'lang'
, 'list': 'list'
, 'loop': 'loop'
, 'manifest': 'manifest'
, 'max': 'max'
, 'maxlength': 'maxLength'
, 'media': 'media'
, 'mediagroup': 'mediaGroup'
, 'method': 'method'
, 'min': 'min'
, 'minlength': 'minLength'
, 'multiple': 'multiple'
, 'muted': 'muted'
, 'name': 'name'
, 'novalidate': 'noValidate'
, 'open': 'open'
, 'optimum': 'optimum'
, 'pattern': 'pattern'
, 'ping': 'ping'
, 'placeholder': 'placeholder'
, 'poster': 'poster'
, 'preload': 'preload'
, 'radiogroup': 'radioGroup'
, 'readonly': 'readOnly'
, 'rel': 'rel'
, 'required': 'required'
, 'role': 'role'
, 'rows': 'rows'
, 'rowspan': 'rowSpan'
, 'sandbox': 'sandbox'
, 'scope': 'scope'
, 'scoped': 'scoped'
, 'scrolling': 'scrolling'
, 'seamless': 'seamless'
, 'selected': 'selected'
, 'shape': 'shape'
, 'size': 'size'
, 'sizes': 'sizes'
, 'sortable': 'sortable'
, 'span': 'span'
, 'spellcheck': 'spellCheck'
, 'src': 'src'
, 'srcdoc': 'srcDoc'
, 'srcset': 'srcSet'
, 'start': 'start'
, 'step': 'step'
, 'style': 'style'
, 'tabindex': 'tabIndex'
, 'target': 'target'
, 'title': 'title'
, 'translate': 'translate'
, 'type': 'type'
, 'typemustmatch': 'typeMustMatch'
, 'usemap': 'useMap'
, 'value': 'value'
, 'width': 'width'
, 'wmode': 'wmode'
, 'wrap': 'wrap'
};
module.exports = properties;
},{}],63:[function(require,module,exports){
var escape = require('escape-html');
var propConfig = require('./property-config');
var types = propConfig.attributeTypes;
var properties = propConfig.properties;
var attributeNames = propConfig.attributeNames;
var prefixAttribute = memoizeString(function (name) {
return escape(name) + '="';
});
module.exports = createAttribute;
/**
* Create attribute string.
*
* @param {String} name The name of the property or attribute
* @param {*} value The value
* @param {Boolean} [isAttribute] Denotes whether `name` is an attribute.
* @return {?String} Attribute string || null if not a valid property or custom attribute.
*/
function createAttribute(name, value, isAttribute) {
if (properties.hasOwnProperty(name)) {
if (shouldSkip(name, value)) return '';
name = (attributeNames[name] || name).toLowerCase();
var attrType = properties[name];
// for BOOLEAN `value` only has to be truthy
// for OVERLOADED_BOOLEAN `value` has to be === true
if ((attrType === types.BOOLEAN) ||
(attrType === types.OVERLOADED_BOOLEAN && value === true)) {
return escape(name);
}
return prefixAttribute(name) + escape(value) + '"';
} else if (isAttribute) {
if (value == null) return '';
return prefixAttribute(name) + escape(value) + '"';
}
// return null if `name` is neither a valid property nor an attribute
return null;
}
/**
* Should skip false boolean attributes.
*/
function shouldSkip(name, value) {
var attrType = properties[name];
return value == null ||
(attrType === types.BOOLEAN && !value) ||
(attrType === types.OVERLOADED_BOOLEAN && value === false);
}
/**
* Memoizes the return value of a function that accepts one string argument.
*
* @param {function} callback
* @return {function}
*/
function memoizeString(callback) {
var cache = {};
return function(string) {
if (cache.hasOwnProperty(string)) {
return cache[string];
} else {
return cache[string] = callback.call(this, string);
}
};
}
},{"./property-config":73,"escape-html":65}],64:[function(require,module,exports){
var escape = require('escape-html');
var extend = require('xtend');
var isVNode = require('virtual-dom/vnode/is-vnode');
var isVText = require('virtual-dom/vnode/is-vtext');
var isThunk = require('virtual-dom/vnode/is-thunk');
var isWidget = require('virtual-dom/vnode/is-widget');
var softHook = require('virtual-dom/virtual-hyperscript/hooks/soft-set-hook');
var attrHook = require('virtual-dom/virtual-hyperscript/hooks/attribute-hook');
var paramCase = require('param-case');
var createAttribute = require('./create-attribute');
var voidElements = require('./void-elements');
module.exports = toHTML;
function toHTML(node, parent) {
if (!node) return '';
if (isThunk(node)) {
node = node.render();
}
if (isWidget(node) && node.render) {
node = node.render();
}
if (isVNode(node)) {
return openTag(node) + tagContent(node) + closeTag(node);
} else if (isVText(node)) {
if (parent && parent.tagName.toLowerCase() === 'script') return String(node.text);
return escape(String(node.text));
}
return '';
}
function openTag(node) {
var props = node.properties;
var ret = '<' + node.tagName.toLowerCase();
for (var name in props) {
var value = props[name];
if (value == null) continue;
if (name == 'attributes') {
value = extend({}, value);
for (var attrProp in value) {
ret += ' ' + createAttribute(attrProp, value[attrProp], true);
}
continue;
}
if (name == 'style') {
var css = '';
value = extend({}, value);
for (var styleProp in value) {
css += paramCase(styleProp) + ': ' + value[styleProp] + '; ';
}
value = css.trim();
}
if (value instanceof softHook || value instanceof attrHook) {
ret += ' ' + createAttribute(name, value.value, true);
continue;
}
var attr = createAttribute(name, value);
if (attr) ret += ' ' + attr;
}
return ret + '>';
}
function tagContent(node) {
var innerHTML = node.properties.innerHTML;
if (innerHTML != null) return innerHTML;
else {
var ret = '';
if (node.children && node.children.length) {
for (var i = 0, l = node.children.length; i<l; i++) {
var child = node.children[i];
ret += toHTML(child, node);
}
}
return ret;
}
}
function closeTag(node) {
var tag = node.tagName.toLowerCase();
return voidElements[tag] ? '' : '</' + tag + '>';
}
},{"./create-attribute":63,"./void-elements":74,"escape-html":65,"param-case":71,"virtual-dom/virtual-hyperscript/hooks/attribute-hook":93,"virtual-dom/virtual-hyperscript/hooks/soft-set-hook":95,"virtual-dom/vnode/is-thunk":101,"virtual-dom/vnode/is-vnode":103,"virtual-dom/vnode/is-vtext":104,"virtual-dom/vnode/is-widget":105,"xtend":72}],65:[function(require,module,exports){
/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* MIT Licensed
*/
/**
* Module exports.
* @public
*/
module.exports = escapeHtml;
/**
* Escape special characters in the given string of html.
*
* @param {string} str The string to escape for inserting into HTML
* @return {string}
* @public
*/
function escapeHtml(html) {
return String(html)
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '<')
.replace(/>/g, '>');
}
},{}],66:[function(require,module,exports){
/**
* Special language-specific overrides.
*
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*
* @type {Object}
*/
var LANGUAGES = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
'\u0130': '\u0069',
'\u0049': '\u0131',
'\u0049\u0307': '\u0069'
}
},
az: {
regexp: /[\u0130]/g,
map: {
'\u0130': '\u0069',
'\u0049': '\u0131',
'\u0049\u0307': '\u0069'
}
},
lt: {
regexp: /[\u0049\u004A\u012E\u00CC\u00CD\u0128]/g,
map: {
'\u0049': '\u0069\u0307',
'\u004A': '\u006A\u0307',
'\u012E': '\u012F\u0307',
'\u00CC': '\u0069\u0307\u0300',
'\u00CD': '\u0069\u0307\u0301',
'\u0128': '\u0069\u0307\u0303'
}
}
}
/**
* Lowercase a string.
*
* @param {String} str
* @return {String}
*/
module.exports = function (str, locale) {
var lang = LANGUAGES[locale]
str = str == null ? '' : String(str)
if (lang) {
str = str.replace(lang.regexp, function (m) { return lang.map[m] })
}
return str.toLowerCase()
}
},{}],67:[function(require,module,exports){
var lowerCase = require('lower-case')
var NON_WORD_REGEXP = require('./vendor/non-word-regexp')
var CAMEL_CASE_REGEXP = require('./vendor/camel-case-regexp')
var TRAILING_DIGIT_REGEXP = require('./vendor/trailing-digit-regexp')
/**
* Sentence case a string.
*
* @param {String} str
* @param {String} locale
* @param {String} replacement
* @return {String}
*/
module.exports = function (str, locale, replacement) {
if (str == null) {
return ''
}
replacement = replacement || ' '
function replace (match, index, string) {
if (index === 0 || index === (string.length - match.length)) {
return ''
}
return replacement
}
str = String(str)
// Support camel case ("camelCase" -> "camel Case").
.replace(CAMEL_CASE_REGEXP, '$1 $2')
// Support digit groups ("test2012" -> "test 2012").
.replace(TRAILING_DIGIT_REGEXP, '$1 $2')
// Remove all non-word characters and replace with a single space.
.replace(NON_WORD_REGEXP, replace)
// Lower case the entire string.
return lowerCase(str, locale)
}
},{"./vendor/camel-case-regexp":68,"./vendor/non-word-regexp":69,"./vendor/trailing-digit-regexp":70,"lower-case":66}],68:[function(require,module,exports){
module.exports = /([\u0061-\u007A\u00B5\u00DF-\u00F6\u00F8-\u00FF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A])([\u0041-\u005A\u00C0-\u00D6\u00D8-\u00DE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])/g
},{}],69:[function(require,module,exports){
module.exports = /[^\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]+/g
},{}],70:[function(require,module,exports){
module.exports = /([\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])([^\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])/g
},{}],71:[function(require,module,exports){
var sentenceCase = require('sentence-case');
/**
* Param case a string.
*
* @param {String} string
* @param {String} [locale]
* @return {String}
*/
module.exports = function (string, locale) {
return sentenceCase(string, locale, '-');
};
},{"sentence-case":67}],72:[function(require,module,exports){
module.exports = extend
function extend() {
var target = {}
for (var i = 0; i < arguments.length; i++) {
var source = arguments[i]
for (var key in source) {
if (source.hasOwnProperty(key)) {
target[key] = source[key]
}
}
}
return target
}
},{}],73:[function(require,module,exports){
/**
* Attribute types.
*/
var types = {
BOOLEAN: 1,
OVERLOADED_BOOLEAN: 2
};
/**
* Properties.
*
* Taken from https://github.com/facebook/react/blob/847357e42e5267b04dd6e297219eaa125ab2f9f4/src/browser/ui/dom/HTMLDOMPropertyConfig.js
*
*/
var properties = {
/**
* Standard Properties
*/
accept: true,
acceptCharset: true,
accessKey: true,
action: true,
allowFullScreen: types.BOOLEAN,
allowTransparency: true,
alt: true,
async: types.BOOLEAN,
autocomplete: true,
autofocus: types.BOOLEAN,
autoplay: types.BOOLEAN,
cellPadding: true,
cellSpacing: true,
charset: true,
checked: types.BOOLEAN,
classID: true,
className: true,
cols: true,
colSpan: true,
content: true,
contentEditable: true,
contextMenu: true,
controls: types.BOOLEAN,
coords: true,
crossOrigin: true,
data: true, // For `<object />` acts as `src`.
dateTime: true,
defer: types.BOOLEAN,
dir: true,
disabled: types.BOOLEAN,
download: types.OVERLOADED_BOOLEAN,
draggable: true,
enctype: true,
form: true,
formAction: true,
formEncType: true,
formMethod: true,
formNoValidate: types.BOOLEAN,
formTarget: true,
frameBorder: true,
headers: true,
height: true,
hidden: types.BOOLEAN,
href: true,
hreflang: true,
htmlFor: true,
httpEquiv: true,
icon: true,
id: true,
label: true,
lang: true,
list: true,
loop: types.BOOLEAN,
manifest: true,
marginHeight: true,
marginWidth: true,
max: true,
maxLength: true,
media: true,
mediaGroup: true,
method: true,
min: true,
multiple: types.BOOLEAN,
muted: types.BOOLEAN,
name: true,
noValidate: types.BOOLEAN,
open: true,
pattern: true,
placeholder: true,
poster: true,
preload: true,
radiogroup: true,
readOnly: types.BOOLEAN,
rel: true,
required: types.BOOLEAN,
role: true,
rows: true,
rowSpan: true,
sandbox: true,
scope: true,
scrolling: true,
seamless: types.BOOLEAN,
selected: types.BOOLEAN,
shape: true,
size: true,
sizes: true,
span: true,
spellcheck: true,
src: true,
srcdoc: true,
srcset: true,
start: true,
step: true,
style: true,
tabIndex: true,
target: true,
title: true,
type: true,
useMap: true,
value: true,
width: true,
wmode: true,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autocapitalize: true,
autocorrect: true,
// itemProp, itemScope, itemType are for Microdata support. See
// http://schema.org/docs/gs.html
itemProp: true,
itemScope: types.BOOLEAN,
itemType: true,
// property is supported for OpenGraph in meta tags.
property: true
};
/**
* Properties to attributes mapping.
*
* The ones not here are simply converted to lower case.
*/
var attributeNames = {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv'
};
/**
* Exports.
*/
module.exports = {
attributeTypes: types,
properties: properties,
attributeNames: attributeNames
};
},{}],74:[function(require,module,exports){
/**
* Void elements.
*
* https://github.com/facebook/react/blob/v0.12.0/src/browser/ui/ReactDOMComponent.js#L99
*/
module.exports = {
'area': true,
'base': true,
'br': true,
'col': true,
'embed': true,
'hr': true,
'img': true,
'input': true,
'keygen': true,
'link': true,
'meta': true,
'param': true,
'source': true,
'track': true,
'wbr': true
};
},{}],75:[function(require,module,exports){
var createElement = require("./vdom/create-element.js")
module.exports = createElement
},{"./vdom/create-element.js":88}],76:[function(require,module,exports){
var diff = require("./vtree/diff.js")
module.exports = diff
},{"./vtree/diff.js":111}],77:[function(require,module,exports){
var h = require("./virtual-hyperscript/index.js")
module.exports = h
},{"./virtual-hyperscript/index.js":96}],78:[function(require,module,exports){
var diff = require("./diff.js")
var patch = require("./patch.js")
var h = require("./h.js")
var create = require("./create-element.js")
var VNode = require('./vnode/vnode.js')
var VText = require('./vnode/vtext.js')
module.exports = {
diff: diff,
patch: patch,
h: h,
create: create,
VNode: VNode,
VText: VText
}
},{"./create-element.js":75,"./diff.js":76,"./h.js":77,"./patch.js":86,"./vnode/vnode.js":107,"./vnode/vtext.js":109}],79:[function(require,module,exports){
/*!
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
* Available under the MIT License
* ECMAScript compliant, uniform cross-browser split method
*/
/**
* Splits a string into an array of strings using a regex or string separator. Matches of the
* separator are not included in the result array. However, if `separator` is a regex that contains
* capturing groups, backreferences are spliced into the result each time `separator` is matched.
* Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably
* cross-browser.
* @param {String} str String to split.
* @param {RegExp|String} separator Regex or string to use for separating the string.
* @param {Number} [limit] Maximum number of items to include in the result array.
* @returns {Array} Array of substrings.
* @example
*
* // Basic use
* split('a b c d', ' ');
* // -> ['a', 'b', 'c', 'd']
*
* // With limit
* split('a b c d', ' ', 2);
* // -> ['a', 'b']
*
* // Backreferences in result array
* split('..word1 word2..', /([a-z]+)(\d+)/i);
* // -> ['..', 'word', '1', ' ', 'word', '2', '..']
*/
module.exports = (function split(undef) {
var nativeSplit = String.prototype.split,
compliantExecNpcg = /()??/.exec("")[1] === undef,
// NPCG: nonparticipating capturing group
self;
self = function(str, separator, limit) {
// If `separator` is not a regex, use `nativeSplit`
if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
return nativeSplit.call(str, separator, limit);
}
var output = [],
flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6
(separator.sticky ? "y" : ""),
// Firefox 3+
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator = new RegExp(separator.source, flags + "g"),
separator2, match, lastIndex, lastLength;
str += ""; // Type-convert
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // Math.pow(2, 32) - 1
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1
limit >>> 0; // ToUint32(limit)
while (match = separator.exec(str)) {
// `separator.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
output.push(str.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
match[0].replace(separator2, function() {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undef) {
match[i] = undef;
}
}
});
}
if (match.length > 1 && match.index < str.length) {
Array.prototype.push.apply(output, match.slice(1));
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= limit) {
break;
}
}
if (separator.lastIndex === match.index) {
separator.lastIndex++; // Avoid an infinite loop
}
}
if (lastLastIndex === str.length) {
if (lastLength || !separator.test("")) {
output.push("");
}
} else {
output.push(str.slice(lastLastIndex));
}
return output.length > limit ? output.slice(0, limit) : output;
};
return self;
})();
},{}],80:[function(require,module,exports){
'use strict';
var OneVersionConstraint = require('individual/one-version');
var MY_VERSION = '7';
OneVersionConstraint('ev-store', MY_VERSION);
var hashKey = '__EV_STORE_KEY@' + MY_VERSION;
module.exports = EvStore;
function EvStore(elem) {
var hash = elem[hashKey];
if (!hash) {
hash = elem[hashKey] = {};
}
return hash;
}
},{"individual/one-version":82}],81:[function(require,module,exports){
(function (global){
'use strict';
/*global window, global*/
var root = typeof window !== 'undefined' ?
window : typeof global !== 'undefined' ?
global : {};
module.exports = Individual;
function Individual(key, value) {
if (key in root) {
return root[key];
}
root[key] = value;
return value;
}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],82:[function(require,module,exports){
'use strict';
var Individual = require('./index.js');
module.exports = OneVersion;
function OneVersion(moduleName, version, defaultValue) {
var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName;
var enforceKey = key + '_ENFORCE_SINGLETON';
var versionValue = Individual(enforceKey, version);
if (versionValue !== version) {
throw new Error('Can only have one copy of ' +
moduleName + '.\n' +
'You already have version ' + versionValue +
' installed.\n' +
'This means you cannot install version ' + version);
}
return Individual(key, defaultValue);
}
},{"./index.js":81}],83:[function(require,module,exports){
(function (global){
var topLevel = typeof global !== 'undefined' ? global :
typeof window !== 'undefined' ? window : {}
var minDoc = require('min-document');
if (typeof document !== 'undefined') {
module.exports = document;
} else {
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
if (!doccy) {
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
}
module.exports = doccy;
}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"min-document":2}],84:[function(require,module,exports){
"use strict";
module.exports = function isObject(x) {
return typeof x === "object" && x !== null;
};
},{}],85:[function(require,module,exports){
var nativeIsArray = Array.isArray
var toString = Object.prototype.toString
module.exports = nativeIsArray || isArray
function isArray(obj) {
return toString.call(obj) === "[object Array]"
}
},{}],86:[function(require,module,exports){
var patch = require("./vdom/patch.js")
module.exports = patch
},{"./vdom/patch.js":91}],87:[function(require,module,exports){
var isObject = require("is-object")
var isHook = require("../vnode/is-vhook.js")
module.exports = applyProperties
function applyProperties(node, props, previous) {
for (var propName in props) {
var propValue = props[propName]
if (propValue === undefined) {
removeProperty(node, propName, propValue, previous);
} else if (isHook(propValue)) {
removeProperty(node, propName, propValue, previous)
if (propValue.hook) {
propValue.hook(node,
propName,
previous ? previous[propName] : undefined)
}
} else {
if (isObject(propValue)) {
patchObject(node, props, previous, propName, propValue);
} else {
node[propName] = propValue
}
}
}
}
function removeProperty(node, propName, propValue, previous) {
if (previous) {
var previousValue = previous[propName]
if (!isHook(previousValue)) {
if (propName === "attributes") {
for (var attrName in previousValue) {
node.removeAttribute(attrName)
}
} else if (propName === "style") {
for (var i in previousValue) {
node.style[i] = ""
}
} else if (typeof previousValue === "string") {
node[propName] = ""
} else {
node[propName] = null
}
} else if (previousValue.unhook) {
previousValue.unhook(node, propName, propValue)
}
}
}
function patchObject(node, props, previous, propName, propValue) {
var previousValue = previous ? previous[propName] : undefined
// Set attributes
if (propName === "attributes") {
for (var attrName in propValue) {
var attrValue = propValue[attrName]
if (attrValue === undefined) {
node.removeAttribute(attrName)
} else {
node.setAttribute(attrName, attrValue)
}
}
return
}
if(previousValue && isObject(previousValue) &&
getPrototype(previousValue) !== getPrototype(propValue)) {
node[propName] = propValue
return
}
if (!isObject(node[propName])) {
node[propName] = {}
}
var replacer = propName === "style" ? "" : undefined
for (var k in propValue) {
var value = propValue[k]
node[propName][k] = (value === undefined) ? replacer : value
}
}
function getPrototype(value) {
if (Object.getPrototypeOf) {
return Object.getPrototypeOf(value)
} else if (value.__proto__) {
return value.__proto__
} else if (value.constructor) {
return value.constructor.prototype
}
}
},{"../vnode/is-vhook.js":102,"is-object":84}],88:[function(require,module,exports){
var document = require("global/document")
var applyProperties = require("./apply-properties")
var isVNode = require("../vnode/is-vnode.js")
var isVText = require("../vnode/is-vtext.js")
var isWidget = require("../vnode/is-widget.js")
var handleThunk = require("../vnode/handle-thunk.js")
module.exports = createElement
function createElement(vnode, opts) {
var doc = opts ? opts.document || document : document
var warn = opts ? opts.warn : null
vnode = handleThunk(vnode).a
if (isWidget(vnode)) {
return vnode.init()
} else if (isVText(vnode)) {
return doc.createTextNode(vnode.text)
} else if (!isVNode(vnode)) {
if (warn) {
warn("Item is not a valid virtual dom node", vnode)
}
return null
}
var node = (vnode.namespace === null) ?
doc.createElement(vnode.tagName) :
doc.createElementNS(vnode.namespace, vnode.tagName)
var props = vnode.properties
applyProperties(node, props)
var children = vnode.children
for (var i = 0; i < children.length; i++) {
var childNode = createElement(children[i], opts)
if (childNode) {
node.appendChild(childNode)
}
}
return node
}
},{"../vnode/handle-thunk.js":100,"../vnode/is-vnode.js":103,"../vnode/is-vtext.js":104,"../vnode/is-widget.js":105,"./apply-properties":87,"global/document":83}],89:[function(require,module,exports){
// Maps a virtual DOM tree onto a real DOM tree in an efficient manner.
// We don't want to read all of the DOM nodes in the tree so we use
// the in-order tree indexing to eliminate recursion down certain branches.
// We only recurse into a DOM node if we know that it contains a child of
// interest.
var noChild = {}
module.exports = domIndex
function domIndex(rootNode, tree, indices, nodes) {
if (!indices || indices.length === 0) {
return {}
} else {
indices.sort(ascending)
return recurse(rootNode, tree, indices, nodes, 0)
}
}
function recurse(rootNode, tree, indices, nodes, rootIndex) {
nodes = nodes || {}
if (rootNode) {
if (indexInRange(indices, rootIndex, rootIndex)) {
nodes[rootIndex] = rootNode
}
var vChildren = tree.children
if (vChildren) {
var childNodes = rootNode.childNodes
for (var i = 0; i < tree.children.length; i++) {
rootIndex += 1
var vChild = vChildren[i] || noChild
var nextIndex = rootIndex + (vChild.count || 0)
// skip recursion down the tree if there are no nodes down here
if (indexInRange(indices, rootIndex, nextIndex)) {
recurse(childNodes[i], vChild, indices, nodes, rootIndex)
}
rootIndex = nextIndex
}
}
}
return nodes
}
// Binary search for an index in the interval [left, right]
function indexInRange(indices, left, right) {
if (indices.length === 0) {
return false
}
var minIndex = 0
var maxIndex = indices.length - 1
var currentIndex
var currentItem
while (minIndex <= maxIndex) {
currentIndex = ((maxIndex + minIndex) / 2) >> 0
currentItem = indices[currentIndex]
if (minIndex === maxIndex) {
return currentItem >= left && currentItem <= right
} else if (currentItem < left) {
minIndex = currentIndex + 1
} else if (currentItem > right) {
maxIndex = currentIndex - 1
} else {
return true
}
}
return false;
}
function ascending(a, b) {
return a > b ? 1 : -1
}
},{}],90:[function(require,module,exports){
var applyProperties = require("./apply-properties")
var isWidget = require("../vnode/is-widget.js")
var VPatch = require("../vnode/vpatch.js")
var updateWidget = require("./update-widget")
module.exports = applyPatch
function applyPatch(vpatch, domNode, renderOptions) {
var type = vpatch.type
var vNode = vpatch.vNode
var patch = vpatch.patch
switch (type) {
case VPatch.REMOVE:
return removeNode(domNode, vNode)
case VPatch.INSERT:
return insertNode(domNode, patch, renderOptions)
case VPatch.VTEXT:
return stringPatch(domNode, vNode, patch, renderOptions)
case VPatch.WIDGET:
return widgetPatch(domNode, vNode, patch, renderOptions)
case VPatch.VNODE:
return vNodePatch(domNode, vNode, patch, renderOptions)
case VPatch.ORDER:
reorderChildren(domNode, patch)
return domNode
case VPatch.PROPS:
applyProperties(domNode, patch, vNode.properties)
return domNode
case VPatch.THUNK:
return replaceRoot(domNode,
renderOptions.patch(domNode, patch, renderOptions))
default:
return domNode
}
}
function removeNode(domNode, vNode) {
var parentNode = domNode.parentNode
if (parentNode) {
parentNode.removeChild(domNode)
}
destroyWidget(domNode, vNode);
return null
}
function insertNode(parentNode, vNode, renderOptions) {
var newNode = renderOptions.render(vNode, renderOptions)
if (parentNode) {
parentNode.appendChild(newNode)
}
return parentNode
}
function stringPatch(domNode, leftVNode, vText, renderOptions) {
var newNode
if (domNode.nodeType === 3) {
domNode.replaceData(0, domNode.length, vText.text)
newNode = domNode
} else {
var parentNode = domNode.parentNode
newNode = renderOptions.render(vText, renderOptions)
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
}
return newNode
}
function widgetPatch(domNode, leftVNode, widget, renderOptions) {
var updating = updateWidget(leftVNode, widget)
var newNode
if (updating) {
newNode = widget.update(leftVNode, domNode) || domNode
} else {
newNode = renderOptions.render(widget, renderOptions)
}
var parentNode = domNode.parentNode
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
if (!updating) {
destroyWidget(domNode, leftVNode)
}
return newNode
}
function vNodePatch(domNode, leftVNode, vNode, renderOptions) {
var parentNode = domNode.parentNode
var newNode = renderOptions.render(vNode, renderOptions)
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
return newNode
}
function destroyWidget(domNode, w) {
if (typeof w.destroy === "function" && isWidget(w)) {
w.destroy(domNode)
}
}
function reorderChildren(domNode, moves) {
var childNodes = domNode.childNodes
var keyMap = {}
var node
var remove
var insert
for (var i = 0; i < moves.removes.length; i++) {
remove = moves.removes[i]
node = childNodes[remove.from]
if (remove.key) {
keyMap[remove.key] = node
}
domNode.removeChild(node)
}
var length = childNodes.length
for (var j = 0; j < moves.inserts.length; j++) {
insert = moves.inserts[j]
node = keyMap[insert.key]
// this is the weirdest bug i've ever seen in webkit
domNode.insertBefore(node, insert.to >= length++ ? null : childNodes[insert.to])
}
}
function replaceRoot(oldRoot, newRoot) {
if (oldRoot && newRoot && oldRoot !== newRoot && oldRoot.parentNode) {
oldRoot.parentNode.replaceChild(newRoot, oldRoot)
}
return newRoot;
}
},{"../vnode/is-widget.js":105,"../vnode/vpatch.js":108,"./apply-properties":87,"./update-widget":92}],91:[function(require,module,exports){
var document = require("global/document")
var isArray = require("x-is-array")
var render = require("./create-element")
var domIndex = require("./dom-index")
var patchOp = require("./patch-op")
module.exports = patch
function patch(rootNode, patches, renderOptions) {
renderOptions = renderOptions || {}
renderOptions.patch = renderOptions.patch || patchRecursive
renderOptions.render = renderOptions.render || render
return renderOptions.patch(rootNode, patches, renderOptions)
}
function patchRecursive(rootNode, patches, renderOptions) {
var indices = patchIndices(patches)
if (indices.length === 0) {
return rootNode
}
var index = domIndex(rootNode, patches.a, indices)
var ownerDocument = rootNode.ownerDocument
if (!renderOptions.document && ownerDocument !== document) {
renderOptions.document = ownerDocument
}
for (var i = 0; i < indices.length; i++) {
var nodeIndex = indices[i]
rootNode = applyPatch(rootNode,
index[nodeIndex],
patches[nodeIndex],
renderOptions)
}
return rootNode
}
function applyPatch(rootNode, domNode, patchList, renderOptions) {
if (!domNode) {
return rootNode
}
var newNode
if (isArray(patchList)) {
for (var i = 0; i < patchList.length; i++) {
newNode = patchOp(patchList[i], domNode, renderOptions)
if (domNode === rootNode) {
rootNode = newNode
}
}
} else {
newNode = patchOp(patchList, domNode, renderOptions)
if (domNode === rootNode) {
rootNode = newNode
}
}
return rootNode
}
function patchIndices(patches) {
var indices = []
for (var key in patches) {
if (key !== "a") {
indices.push(Number(key))
}
}
return indices
}
},{"./create-element":88,"./dom-index":89,"./patch-op":90,"global/document":83,"x-is-array":85}],92:[function(require,module,exports){
var isWidget = require("../vnode/is-widget.js")
module.exports = updateWidget
function updateWidget(a, b) {
if (isWidget(a) && isWidget(b)) {
if ("name" in a && "name" in b) {
return a.id === b.id
} else {
return a.init === b.init
}
}
return false
}
},{"../vnode/is-widget.js":105}],93:[function(require,module,exports){
'use strict';
module.exports = AttributeHook;
function AttributeHook(namespace, value) {
if (!(this instanceof AttributeHook)) {
return new AttributeHook(namespace, value);
}
this.namespace = namespace;
this.value = value;
}
AttributeHook.prototype.hook = function (node, prop, prev) {
if (prev && prev.type === 'AttributeHook' &&
prev.value === this.value &&
prev.namespace === this.namespace) {
return;
}
node.setAttributeNS(this.namespace, prop, this.value);
};
AttributeHook.prototype.unhook = function (node, prop, next) {
if (next && next.type === 'AttributeHook' &&
next.namespace === this.namespace) {
return;
}
var colonPosition = prop.indexOf(':');
var localName = colonPosition > -1 ? prop.substr(colonPosition + 1) : prop;
node.removeAttributeNS(this.namespace, localName);
};
AttributeHook.prototype.type = 'AttributeHook';
},{}],94:[function(require,module,exports){
'use strict';
var EvStore = require('ev-store');
module.exports = EvHook;
function EvHook(value) {
if (!(this instanceof EvHook)) {
return new EvHook(value);
}
this.value = value;
}
EvHook.prototype.hook = function (node, propertyName) {
var es = EvStore(node);
var propName = propertyName.substr(3);
es[propName] = this.value;
};
EvHook.prototype.unhook = function(node, propertyName) {
var es = EvStore(node);
var propName = propertyName.substr(3);
es[propName] = undefined;
};
},{"ev-store":80}],95:[function(require,module,exports){
'use strict';
module.exports = SoftSetHook;
function SoftSetHook(value) {
if (!(this instanceof SoftSetHook)) {
return new SoftSetHook(value);
}
this.value = value;
}
SoftSetHook.prototype.hook = function (node, propertyName) {
if (node[propertyName] !== this.value) {
node[propertyName] = this.value;
}
};
},{}],96:[function(require,module,exports){
'use strict';
var isArray = require('x-is-array');
var VNode = require('../vnode/vnode.js');
var VText = require('../vnode/vtext.js');
var isVNode = require('../vnode/is-vnode');
var isVText = require('../vnode/is-vtext');
var isWidget = require('../vnode/is-widget');
var isHook = require('../vnode/is-vhook');
var isVThunk = require('../vnode/is-thunk');
var parseTag = require('./parse-tag.js');
var softSetHook = require('./hooks/soft-set-hook.js');
var evHook = require('./hooks/ev-hook.js');
module.exports = h;
function h(tagName, properties, children) {
var childNodes = [];
var tag, props, key, namespace;
if (!children && isChildren(properties)) {
children = properties;
props = {};
}
props = props || properties || {};
tag = parseTag(tagName, props);
// support keys
if (props.hasOwnProperty('key')) {
key = props.key;
props.key = undefined;
}
// support namespace
if (props.hasOwnProperty('namespace')) {
namespace = props.namespace;
props.namespace = undefined;
}
// fix cursor bug
if (tag === 'INPUT' &&
!namespace &&
props.hasOwnProperty('value') &&
props.value !== undefined &&
!isHook(props.value)
) {
props.value = softSetHook(props.value);
}
transformProperties(props);
if (children !== undefined && children !== null) {
addChild(children, childNodes, tag, props);
}
return new VNode(tag, props, childNodes, key, namespace);
}
function addChild(c, childNodes, tag, props) {
if (typeof c === 'string') {
childNodes.push(new VText(c));
} else if (typeof c === 'number') {
childNodes.push(new VText(String(c)));
} else if (isChild(c)) {
childNodes.push(c);
} else if (isArray(c)) {
for (var i = 0; i < c.length; i++) {
addChild(c[i], childNodes, tag, props);
}
} else if (c === null || c === undefined) {
return;
} else {
throw UnexpectedVirtualElement({
foreignObject: c,
parentVnode: {
tagName: tag,
properties: props
}
});
}
}
function transformProperties(props) {
for (var propName in props) {
if (props.hasOwnProperty(propName)) {
var value = props[propName];
if (isHook(value)) {
continue;
}
if (propName.substr(0, 3) === 'ev-') {
// add ev-foo support
props[propName] = evHook(value);
}
}
}
}
function isChild(x) {
return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x);
}
function isChildren(x) {
return typeof x === 'string' || isArray(x) || isChild(x);
}
function UnexpectedVirtualElement(data) {
var err = new Error();
err.type = 'virtual-hyperscript.unexpected.virtual-element';
err.message = 'Unexpected virtual child passed to h().\n' +
'Expected a VNode / Vthunk / VWidget / string but:\n' +
'got:\n' +
errorString(data.foreignObject) +
'.\n' +
'The parent vnode is:\n' +
errorString(data.parentVnode)
'\n' +
'Suggested fix: change your `h(..., [ ... ])` callsite.';
err.foreignObject = data.foreignObject;
err.parentVnode = data.parentVnode;
return err;
}
function errorString(obj) {
try {
return JSON.stringify(obj, null, ' ');
} catch (e) {
return String(obj);
}
}
},{"../vnode/is-thunk":101,"../vnode/is-vhook":102,"../vnode/is-vnode":103,"../vnode/is-vtext":104,"../vnode/is-widget":105,"../vnode/vnode.js":107,"../vnode/vtext.js":109,"./hooks/ev-hook.js":94,"./hooks/soft-set-hook.js":95,"./parse-tag.js":97,"x-is-array":85}],97:[function(require,module,exports){
'use strict';
var split = require('browser-split');
var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/;
var notClassId = /^\.|#/;
module.exports = parseTag;
function parseTag(tag, props) {
if (!tag) {
return 'DIV';
}
var noId = !(props.hasOwnProperty('id'));
var tagParts = split(tag, classIdSplit);
var tagName = null;
if (notClassId.test(tagParts[1])) {
tagName = 'DIV';
}
var classes, part, type, i;
for (i = 0; i < tagParts.length; i++) {
part = tagParts[i];
if (!part) {
continue;
}
type = part.charAt(0);
if (!tagName) {
tagName = part;
} else if (type === '.') {
classes = classes || [];
classes.push(part.substring(1, part.length));
} else if (type === '#' && noId) {
props.id = part.substring(1, part.length);
}
}
if (classes) {
if (props.className) {
classes.push(props.className);
}
props.className = classes.join(' ');
}
return props.namespace ? tagName : tagName.toUpperCase();
}
},{"browser-split":79}],98:[function(require,module,exports){
'use strict';
var DEFAULT_NAMESPACE = null;
var EV_NAMESPACE = 'http://www.w3.org/2001/xml-events';
var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
// http://www.w3.org/TR/SVGTiny12/attributeTable.html
// http://www.w3.org/TR/SVG/attindex.html
var SVG_PROPERTIES = {
'about': DEFAULT_NAMESPACE,
'accent-height': DEFAULT_NAMESPACE,
'accumulate': DEFAULT_NAMESPACE,
'additive': DEFAULT_NAMESPACE,
'alignment-baseline': DEFAULT_NAMESPACE,
'alphabetic': DEFAULT_NAMESPACE,
'amplitude': DEFAULT_NAMESPACE,
'arabic-form': DEFAULT_NAMESPACE,
'ascent': DEFAULT_NAMESPACE,
'attributeName': DEFAULT_NAMESPACE,
'attributeType': DEFAULT_NAMESPACE,
'azimuth': DEFAULT_NAMESPACE,
'bandwidth': DEFAULT_NAMESPACE,
'baseFrequency': DEFAULT_NAMESPACE,
'baseProfile': DEFAULT_NAMESPACE,
'baseline-shift': DEFAULT_NAMESPACE,
'bbox': DEFAULT_NAMESPACE,
'begin': DEFAULT_NAMESPACE,
'bias': DEFAULT_NAMESPACE,
'by': DEFAULT_NAMESPACE,
'calcMode': DEFAULT_NAMESPACE,
'cap-height': DEFAULT_NAMESPACE,
'class': DEFAULT_NAMESPACE,
'clip': DEFAULT_NAMESPACE,
'clip-path': DEFAULT_NAMESPACE,
'clip-rule': DEFAULT_NAMESPACE,
'clipPathUnits': DEFAULT_NAMESPACE,
'color': DEFAULT_NAMESPACE,
'color-interpolation': DEFAULT_NAMESPACE,
'color-interpolation-filters': DEFAULT_NAMESPACE,
'color-profile': DEFAULT_NAMESPACE,
'color-rendering': DEFAULT_NAMESPACE,
'content': DEFAULT_NAMESPACE,
'contentScriptType': DEFAULT_NAMESPACE,
'contentStyleType': DEFAULT_NAMESPACE,
'cursor': DEFAULT_NAMESPACE,
'cx': DEFAULT_NAMESPACE,
'cy': DEFAULT_NAMESPACE,
'd': DEFAULT_NAMESPACE,
'datatype': DEFAULT_NAMESPACE,
'defaultAction': DEFAULT_NAMESPACE,
'descent': DEFAULT_NAMESPACE,
'diffuseConstant': DEFAULT_NAMESPACE,
'direction': DEFAULT_NAMESPACE,
'display': DEFAULT_NAMESPACE,
'divisor': DEFAULT_NAMESPACE,
'dominant-baseline': DEFAULT_NAMESPACE,
'dur': DEFAULT_NAMESPACE,
'dx': DEFAULT_NAMESPACE,
'dy': DEFAULT_NAMESPACE,
'edgeMode': DEFAULT_NAMESPACE,
'editable': DEFAULT_NAMESPACE,
'elevation': DEFAULT_NAMESPACE,
'enable-background': DEFAULT_NAMESPACE,
'end': DEFAULT_NAMESPACE,
'ev:event': EV_NAMESPACE,
'event': DEFAULT_NAMESPACE,
'exponent': DEFAULT_NAMESPACE,
'externalResourcesRequired': DEFAULT_NAMESPACE,
'fill': DEFAULT_NAMESPACE,
'fill-opacity': DEFAULT_NAMESPACE,
'fill-rule': DEFAULT_NAMESPACE,
'filter': DEFAULT_NAMESPACE,
'filterRes': DEFAULT_NAMESPACE,
'filterUnits': DEFAULT_NAMESPACE,
'flood-color': DEFAULT_NAMESPACE,
'flood-opacity': DEFAULT_NAMESPACE,
'focusHighlight': DEFAULT_NAMESPACE,
'focusable': DEFAULT_NAMESPACE,
'font-family': DEFAULT_NAMESPACE,
'font-size': DEFAULT_NAMESPACE,
'font-size-adjust': DEFAULT_NAMESPACE,
'font-stretch': DEFAULT_NAMESPACE,
'font-style': DEFAULT_NAMESPACE,
'font-variant': DEFAULT_NAMESPACE,
'font-weight': DEFAULT_NAMESPACE,
'format': DEFAULT_NAMESPACE,
'from': DEFAULT_NAMESPACE,
'fx': DEFAULT_NAMESPACE,
'fy': DEFAULT_NAMESPACE,
'g1': DEFAULT_NAMESPACE,
'g2': DEFAULT_NAMESPACE,
'glyph-name': DEFAULT_NAMESPACE,
'glyph-orientation-horizontal': DEFAULT_NAMESPACE,
'glyph-orientation-vertical': DEFAULT_NAMESPACE,
'glyphRef': DEFAULT_NAMESPACE,
'gradientTransform': DEFAULT_NAMESPACE,
'gradientUnits': DEFAULT_NAMESPACE,
'handler': DEFAULT_NAMESPACE,
'hanging': DEFAULT_NAMESPACE,
'height': DEFAULT_NAMESPACE,
'horiz-adv-x': DEFAULT_NAMESPACE,
'horiz-origin-x': DEFAULT_NAMESPACE,
'horiz-origin-y': DEFAULT_NAMESPACE,
'id': DEFAULT_NAMESPACE,
'ideographic': DEFAULT_NAMESPACE,
'image-rendering': DEFAULT_NAMESPACE,
'in': DEFAULT_NAMESPACE,
'in2': DEFAULT_NAMESPACE,
'initialVisibility': DEFAULT_NAMESPACE,
'intercept': DEFAULT_NAMESPACE,
'k': DEFAULT_NAMESPACE,
'k1': DEFAULT_NAMESPACE,
'k2': DEFAULT_NAMESPACE,
'k3': DEFAULT_NAMESPACE,
'k4': DEFAULT_NAMESPACE,
'kernelMatrix': DEFAULT_NAMESPACE,
'kernelUnitLength': DEFAULT_NAMESPACE,
'kerning': DEFAULT_NAMESPACE,
'keyPoints': DEFAULT_NAMESPACE,
'keySplines': DEFAULT_NAMESPACE,
'keyTimes': DEFAULT_NAMESPACE,
'lang': DEFAULT_NAMESPACE,
'lengthAdjust': DEFAULT_NAMESPACE,
'letter-spacing': DEFAULT_NAMESPACE,
'lighting-color': DEFAULT_NAMESPACE,
'limitingConeAngle': DEFAULT_NAMESPACE,
'local': DEFAULT_NAMESPACE,
'marker-end': DEFAULT_NAMESPACE,
'marker-mid': DEFAULT_NAMESPACE,
'marker-start': DEFAULT_NAMESPACE,
'markerHeight': DEFAULT_NAMESPACE,
'markerUnits': DEFAULT_NAMESPACE,
'markerWidth': DEFAULT_NAMESPACE,
'mask': DEFAULT_NAMESPACE,
'maskContentUnits': DEFAULT_NAMESPACE,
'maskUnits': DEFAULT_NAMESPACE,
'mathematical': DEFAULT_NAMESPACE,
'max': DEFAULT_NAMESPACE,
'media': DEFAULT_NAMESPACE,
'mediaCharacterEncoding': DEFAULT_NAMESPACE,
'mediaContentEncodings': DEFAULT_NAMESPACE,
'mediaSize': DEFAULT_NAMESPACE,
'mediaTime': DEFAULT_NAMESPACE,
'method': DEFAULT_NAMESPACE,
'min': DEFAULT_NAMESPACE,
'mode': DEFAULT_NAMESPACE,
'name': DEFAULT_NAMESPACE,
'nav-down': DEFAULT_NAMESPACE,
'nav-down-left': DEFAULT_NAMESPACE,
'nav-down-right': DEFAULT_NAMESPACE,
'nav-left': DEFAULT_NAMESPACE,
'nav-next': DEFAULT_NAMESPACE,
'nav-prev': DEFAULT_NAMESPACE,
'nav-right': DEFAULT_NAMESPACE,
'nav-up': DEFAULT_NAMESPACE,
'nav-up-left': DEFAULT_NAMESPACE,
'nav-up-right': DEFAULT_NAMESPACE,
'numOctaves': DEFAULT_NAMESPACE,
'observer': DEFAULT_NAMESPACE,
'offset': DEFAULT_NAMESPACE,
'opacity': DEFAULT_NAMESPACE,
'operator': DEFAULT_NAMESPACE,
'order': DEFAULT_NAMESPACE,
'orient': DEFAULT_NAMESPACE,
'orientation': DEFAULT_NAMESPACE,
'origin': DEFAULT_NAMESPACE,
'overflow': DEFAULT_NAMESPACE,
'overlay': DEFAULT_NAMESPACE,
'overline-position': DEFAULT_NAMESPACE,
'overline-thickness': DEFAULT_NAMESPACE,
'panose-1': DEFAULT_NAMESPACE,
'path': DEFAULT_NAMESPACE,
'pathLength': DEFAULT_NAMESPACE,
'patternContentUnits': DEFAULT_NAMESPACE,
'patternTransform': DEFAULT_NAMESPACE,
'patternUnits': DEFAULT_NAMESPACE,
'phase': DEFAULT_NAMESPACE,
'playbackOrder': DEFAULT_NAMESPACE,
'pointer-events': DEFAULT_NAMESPACE,
'points': DEFAULT_NAMESPACE,
'pointsAtX': DEFAULT_NAMESPACE,
'pointsAtY': DEFAULT_NAMESPACE,
'pointsAtZ': DEFAULT_NAMESPACE,
'preserveAlpha': DEFAULT_NAMESPACE,
'preserveAspectRatio': DEFAULT_NAMESPACE,
'primitiveUnits': DEFAULT_NAMESPACE,
'propagate': DEFAULT_NAMESPACE,
'property': DEFAULT_NAMESPACE,
'r': DEFAULT_NAMESPACE,
'radius': DEFAULT_NAMESPACE,
'refX': DEFAULT_NAMESPACE,
'refY': DEFAULT_NAMESPACE,
'rel': DEFAULT_NAMESPACE,
'rendering-intent': DEFAULT_NAMESPACE,
'repeatCount': DEFAULT_NAMESPACE,
'repeatDur': DEFAULT_NAMESPACE,
'requiredExtensions': DEFAULT_NAMESPACE,
'requiredFeatures': DEFAULT_NAMESPACE,
'requiredFonts': DEFAULT_NAMESPACE,
'requiredFormats': DEFAULT_NAMESPACE,
'resource': DEFAULT_NAMESPACE,
'restart': DEFAULT_NAMESPACE,
'result': DEFAULT_NAMESPACE,
'rev': DEFAULT_NAMESPACE,
'role': DEFAULT_NAMESPACE,
'rotate': DEFAULT_NAMESPACE,
'rx': DEFAULT_NAMESPACE,
'ry': DEFAULT_NAMESPACE,
'scale': DEFAULT_NAMESPACE,
'seed': DEFAULT_NAMESPACE,
'shape-rendering': DEFAULT_NAMESPACE,
'slope': DEFAULT_NAMESPACE,
'snapshotTime': DEFAULT_NAMESPACE,
'spacing': DEFAULT_NAMESPACE,
'specularConstant': DEFAULT_NAMESPACE,
'specularExponent': DEFAULT_NAMESPACE,
'spreadMethod': DEFAULT_NAMESPACE,
'startOffset': DEFAULT_NAMESPACE,
'stdDeviation': DEFAULT_NAMESPACE,
'stemh': DEFAULT_NAMESPACE,
'stemv': DEFAULT_NAMESPACE,
'stitchTiles': DEFAULT_NAMESPACE,
'stop-color': DEFAULT_NAMESPACE,
'stop-opacity': DEFAULT_NAMESPACE,
'strikethrough-position': DEFAULT_NAMESPACE,
'strikethrough-thickness': DEFAULT_NAMESPACE,
'string': DEFAULT_NAMESPACE,
'stroke': DEFAULT_NAMESPACE,
'stroke-dasharray': DEFAULT_NAMESPACE,
'stroke-dashoffset': DEFAULT_NAMESPACE,
'stroke-linecap': DEFAULT_NAMESPACE,
'stroke-linejoin': DEFAULT_NAMESPACE,
'stroke-miterlimit': DEFAULT_NAMESPACE,
'stroke-opacity': DEFAULT_NAMESPACE,
'stroke-width': DEFAULT_NAMESPACE,
'surfaceScale': DEFAULT_NAMESPACE,
'syncBehavior': DEFAULT_NAMESPACE,
'syncBehaviorDefault': DEFAULT_NAMESPACE,
'syncMaster': DEFAULT_NAMESPACE,
'syncTolerance': DEFAULT_NAMESPACE,
'syncToleranceDefault': DEFAULT_NAMESPACE,
'systemLanguage': DEFAULT_NAMESPACE,
'tableValues': DEFAULT_NAMESPACE,
'target': DEFAULT_NAMESPACE,
'targetX': DEFAULT_NAMESPACE,
'targetY': DEFAULT_NAMESPACE,
'text-anchor': DEFAULT_NAMESPACE,
'text-decoration': DEFAULT_NAMESPACE,
'text-rendering': DEFAULT_NAMESPACE,
'textLength': DEFAULT_NAMESPACE,
'timelineBegin': DEFAULT_NAMESPACE,
'title': DEFAULT_NAMESPACE,
'to': DEFAULT_NAMESPACE,
'transform': DEFAULT_NAMESPACE,
'transformBehavior': DEFAULT_NAMESPACE,
'type': DEFAULT_NAMESPACE,
'typeof': DEFAULT_NAMESPACE,
'u1': DEFAULT_NAMESPACE,
'u2': DEFAULT_NAMESPACE,
'underline-position': DEFAULT_NAMESPACE,
'underline-thickness': DEFAULT_NAMESPACE,
'unicode': DEFAULT_NAMESPACE,
'unicode-bidi': DEFAULT_NAMESPACE,
'unicode-range': DEFAULT_NAMESPACE,
'units-per-em': DEFAULT_NAMESPACE,
'v-alphabetic': DEFAULT_NAMESPACE,
'v-hanging': DEFAULT_NAMESPACE,
'v-ideographic': DEFAULT_NAMESPACE,
'v-mathematical': DEFAULT_NAMESPACE,
'values': DEFAULT_NAMESPACE,
'version': DEFAULT_NAMESPACE,
'vert-adv-y': DEFAULT_NAMESPACE,
'vert-origin-x': DEFAULT_NAMESPACE,
'vert-origin-y': DEFAULT_NAMESPACE,
'viewBox': DEFAULT_NAMESPACE,
'viewTarget': DEFAULT_NAMESPACE,
'visibility': DEFAULT_NAMESPACE,
'width': DEFAULT_NAMESPACE,
'widths': DEFAULT_NAMESPACE,
'word-spacing': DEFAULT_NAMESPACE,
'writing-mode': DEFAULT_NAMESPACE,
'x': DEFAULT_NAMESPACE,
'x-height': DEFAULT_NAMESPACE,
'x1': DEFAULT_NAMESPACE,
'x2': DEFAULT_NAMESPACE,
'xChannelSelector': DEFAULT_NAMESPACE,
'xlink:actuate': XLINK_NAMESPACE,
'xlink:arcrole': XLINK_NAMESPACE,
'xlink:href': XLINK_NAMESPACE,
'xlink:role': XLINK_NAMESPACE,
'xlink:show': XLINK_NAMESPACE,
'xlink:title': XLINK_NAMESPACE,
'xlink:type': XLINK_NAMESPACE,
'xml:base': XML_NAMESPACE,
'xml:id': XML_NAMESPACE,
'xml:lang': XML_NAMESPACE,
'xml:space': XML_NAMESPACE,
'y': DEFAULT_NAMESPACE,
'y1': DEFAULT_NAMESPACE,
'y2': DEFAULT_NAMESPACE,
'yChannelSelector': DEFAULT_NAMESPACE,
'z': DEFAULT_NAMESPACE,
'zoomAndPan': DEFAULT_NAMESPACE
};
module.exports = SVGAttributeNamespace;
function SVGAttributeNamespace(value) {
if (SVG_PROPERTIES.hasOwnProperty(value)) {
return SVG_PROPERTIES[value];
}
}
},{}],99:[function(require,module,exports){
'use strict';
var isArray = require('x-is-array');
var h = require('./index.js');
var SVGAttributeNamespace = require('./svg-attribute-namespace');
var attributeHook = require('./hooks/attribute-hook');
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
module.exports = svg;
function svg(tagName, properties, children) {
if (!children && isChildren(properties)) {
children = properties;
properties = {};
}
properties = properties || {};
// set namespace for svg
properties.namespace = SVG_NAMESPACE;
var attributes = properties.attributes || (properties.attributes = {});
for (var key in properties) {
if (!properties.hasOwnProperty(key)) {
continue;
}
var namespace = SVGAttributeNamespace(key);
if (namespace === undefined) { // not a svg attribute
continue;
}
var value = properties[key];
if (typeof value !== 'string' &&
typeof value !== 'number' &&
typeof value !== 'boolean'
) {
continue;
}
if (namespace !== null) { // namespaced attribute
properties[key] = attributeHook(namespace, value);
continue;
}
attributes[key] = value
properties[key] = undefined
}
return h(tagName, properties, children);
}
function isChildren(x) {
return typeof x === 'string' || isArray(x);
}
},{"./hooks/attribute-hook":93,"./index.js":96,"./svg-attribute-namespace":98,"x-is-array":85}],100:[function(require,module,exports){
var isVNode = require("./is-vnode")
var isVText = require("./is-vtext")
var isWidget = require("./is-widget")
var isThunk = require("./is-thunk")
module.exports = handleThunk
function handleThunk(a, b) {
var renderedA = a
var renderedB = b
if (isThunk(b)) {
renderedB = renderThunk(b, a)
}
if (isThunk(a)) {
renderedA = renderThunk(a, null)
}
return {
a: renderedA,
b: renderedB
}
}
function renderThunk(thunk, previous) {
var renderedThunk = thunk.vnode
if (!renderedThunk) {
renderedThunk = thunk.vnode = thunk.render(previous)
}
if (!(isVNode(renderedThunk) ||
isVText(renderedThunk) ||
isWidget(renderedThunk))) {
throw new Error("thunk did not return a valid node");
}
return renderedThunk
}
},{"./is-thunk":101,"./is-vnode":103,"./is-vtext":104,"./is-widget":105}],101:[function(require,module,exports){
module.exports = isThunk
function isThunk(t) {
return t && t.type === "Thunk"
}
},{}],102:[function(require,module,exports){
module.exports = isHook
function isHook(hook) {
return hook &&
(typeof hook.hook === "function" && !hook.hasOwnProperty("hook") ||
typeof hook.unhook === "function" && !hook.hasOwnProperty("unhook"))
}
},{}],103:[function(require,module,exports){
var version = require("./version")
module.exports = isVirtualNode
function isVirtualNode(x) {
return x && x.type === "VirtualNode" && x.version === version
}
},{"./version":106}],104:[function(require,module,exports){
var version = require("./version")
module.exports = isVirtualText
function isVirtualText(x) {
return x && x.type === "VirtualText" && x.version === version
}
},{"./version":106}],105:[function(require,module,exports){
module.exports = isWidget
function isWidget(w) {
return w && w.type === "Widget"
}
},{}],106:[function(require,module,exports){
module.exports = "2"
},{}],107:[function(require,module,exports){
var version = require("./version")
var isVNode = require("./is-vnode")
var isWidget = require("./is-widget")
var isThunk = require("./is-thunk")
var isVHook = require("./is-vhook")
module.exports = VirtualNode
var noProperties = {}
var noChildren = []
function VirtualNode(tagName, properties, children, key, namespace) {
this.tagName = tagName
this.properties = properties || noProperties
this.children = children || noChildren
this.key = key != null ? String(key) : undefined
this.namespace = (typeof namespace === "string") ? namespace : null
var count = (children && children.length) || 0
var descendants = 0
var hasWidgets = false
var hasThunks = false
var descendantHooks = false
var hooks
for (var propName in properties) {
if (properties.hasOwnProperty(propName)) {
var property = properties[propName]
if (isVHook(property) && property.unhook) {
if (!hooks) {
hooks = {}
}
hooks[propName] = property
}
}
}
for (var i = 0; i < count; i++) {
var child = children[i]
if (isVNode(child)) {
descendants += child.count || 0
if (!hasWidgets && child.hasWidgets) {
hasWidgets = true
}
if (!hasThunks && child.hasThunks) {
hasThunks = true
}
if (!descendantHooks && (child.hooks || child.descendantHooks)) {
descendantHooks = true
}
} else if (!hasWidgets && isWidget(child)) {
if (typeof child.destroy === "function") {
hasWidgets = true
}
} else if (!hasThunks && isThunk(child)) {
hasThunks = true;
}
}
this.count = count + descendants
this.hasWidgets = hasWidgets
this.hasThunks = hasThunks
this.hooks = hooks
this.descendantHooks = descendantHooks
}
VirtualNode.prototype.version = version
VirtualNode.prototype.type = "VirtualNode"
},{"./is-thunk":101,"./is-vhook":102,"./is-vnode":103,"./is-widget":105,"./version":106}],108:[function(require,module,exports){
var version = require("./version")
VirtualPatch.NONE = 0
VirtualPatch.VTEXT = 1
VirtualPatch.VNODE = 2
VirtualPatch.WIDGET = 3
VirtualPatch.PROPS = 4
VirtualPatch.ORDER = 5
VirtualPatch.INSERT = 6
VirtualPatch.REMOVE = 7
VirtualPatch.THUNK = 8
module.exports = VirtualPatch
function VirtualPatch(type, vNode, patch) {
this.type = Number(type)
this.vNode = vNode
this.patch = patch
}
VirtualPatch.prototype.version = version
VirtualPatch.prototype.type = "VirtualPatch"
},{"./version":106}],109:[function(require,module,exports){
var version = require("./version")
module.exports = VirtualText
function VirtualText(text) {
this.text = String(text)
}
VirtualText.prototype.version = version
VirtualText.prototype.type = "VirtualText"
},{"./version":106}],110:[function(require,module,exports){
var isObject = require("is-object")
var isHook = require("../vnode/is-vhook")
module.exports = diffProps
function diffProps(a, b) {
var diff
for (var aKey in a) {
if (!(aKey in b)) {
diff = diff || {}
diff[aKey] = undefined
}
var aValue = a[aKey]
var bValue = b[aKey]
if (aValue === bValue) {
continue
} else if (isObject(aValue) && isObject(bValue)) {
if (getPrototype(bValue) !== getPrototype(aValue)) {
diff = diff || {}
diff[aKey] = bValue
} else if (isHook(bValue)) {
diff = diff || {}
diff[aKey] = bValue
} else {
var objectDiff = diffProps(aValue, bValue)
if (objectDiff) {
diff = diff || {}
diff[aKey] = objectDiff
}
}
} else {
diff = diff || {}
diff[aKey] = bValue
}
}
for (var bKey in b) {
if (!(bKey in a)) {
diff = diff || {}
diff[bKey] = b[bKey]
}
}
return diff
}
function getPrototype(value) {
if (Object.getPrototypeOf) {
return Object.getPrototypeOf(value)
} else if (value.__proto__) {
return value.__proto__
} else if (value.constructor) {
return value.constructor.prototype
}
}
},{"../vnode/is-vhook":102,"is-object":84}],111:[function(require,module,exports){
var isArray = require("x-is-array")
var VPatch = require("../vnode/vpatch")
var isVNode = require("../vnode/is-vnode")
var isVText = require("../vnode/is-vtext")
var isWidget = require("../vnode/is-widget")
var isThunk = require("../vnode/is-thunk")
var handleThunk = require("../vnode/handle-thunk")
var diffProps = require("./diff-props")
module.exports = diff
function diff(a, b) {
var patch = { a: a }
walk(a, b, patch, 0)
return patch
}
function walk(a, b, patch, index) {
if (a === b) {
return
}
var apply = patch[index]
var applyClear = false
if (isThunk(a) || isThunk(b)) {
thunks(a, b, patch, index)
} else if (b == null) {
// If a is a widget we will add a remove patch for it
// Otherwise any child widgets/hooks must be destroyed.
// This prevents adding two remove patches for a widget.
if (!isWidget(a)) {
clearState(a, patch, index)
apply = patch[index]
}
apply = appendPatch(apply, new VPatch(VPatch.REMOVE, a, b))
} else if (isVNode(b)) {
if (isVNode(a)) {
if (a.tagName === b.tagName &&
a.namespace === b.namespace &&
a.key === b.key) {
var propsPatch = diffProps(a.properties, b.properties)
if (propsPatch) {
apply = appendPatch(apply,
new VPatch(VPatch.PROPS, a, propsPatch))
}
apply = diffChildren(a, b, patch, apply, index)
} else {
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))
applyClear = true
}
} else {
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))
applyClear = true
}
} else if (isVText(b)) {
if (!isVText(a)) {
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))
applyClear = true
} else if (a.text !== b.text) {
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))
}
} else if (isWidget(b)) {
if (!isWidget(a)) {
applyClear = true
}
apply = appendPatch(apply, new VPatch(VPatch.WIDGET, a, b))
}
if (apply) {
patch[index] = apply
}
if (applyClear) {
clearState(a, patch, index)
}
}
function diffChildren(a, b, patch, apply, index) {
var aChildren = a.children
var orderedSet = reorder(aChildren, b.children)
var bChildren = orderedSet.children
var aLen = aChildren.length
var bLen = bChildren.length
var len = aLen > bLen ? aLen : bLen
for (var i = 0; i < len; i++) {
var leftNode = aChildren[i]
var rightNode = bChildren[i]
index += 1
if (!leftNode) {
if (rightNode) {
// Excess nodes in b need to be added
apply = appendPatch(apply,
new VPatch(VPatch.INSERT, null, rightNode))
}
} else {
walk(leftNode, rightNode, patch, index)
}
if (isVNode(leftNode) && leftNode.count) {
index += leftNode.count
}
}
if (orderedSet.moves) {
// Reorder nodes last
apply = appendPatch(apply, new VPatch(
VPatch.ORDER,
a,
orderedSet.moves
))
}
return apply
}
function clearState(vNode, patch, index) {
// TODO: Make this a single walk, not two
unhook(vNode, patch, index)
destroyWidgets(vNode, patch, index)
}
// Patch records for all destroyed widgets must be added because we need
// a DOM node reference for the destroy function
function destroyWidgets(vNode, patch, index) {
if (isWidget(vNode)) {
if (typeof vNode.destroy === "function") {
patch[index] = appendPatch(
patch[index],
new VPatch(VPatch.REMOVE, vNode, null)
)
}
} else if (isVNode(vNode) && (vNode.hasWidgets || vNode.hasThunks)) {
var children = vNode.children
var len = children.length
for (var i = 0; i < len; i++) {
var child = children[i]
index += 1
destroyWidgets(child, patch, index)
if (isVNode(child) && child.count) {
index += child.count
}
}
} else if (isThunk(vNode)) {
thunks(vNode, null, patch, index)
}
}
// Create a sub-patch for thunks
function thunks(a, b, patch, index) {
var nodes = handleThunk(a, b)
var thunkPatch = diff(nodes.a, nodes.b)
if (hasPatches(thunkPatch)) {
patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch)
}
}
function hasPatches(patch) {
for (var index in patch) {
if (index !== "a") {
return true
}
}
return false
}
// Execute hooks when two nodes are identical
function unhook(vNode, patch, index) {
if (isVNode(vNode)) {
if (vNode.hooks) {
patch[index] = appendPatch(
patch[index],
new VPatch(
VPatch.PROPS,
vNode,
undefinedKeys(vNode.hooks)
)
)
}
if (vNode.descendantHooks || vNode.hasThunks) {
var children = vNode.children
var len = children.length
for (var i = 0; i < len; i++) {
var child = children[i]
index += 1
unhook(child, patch, index)
if (isVNode(child) && child.count) {
index += child.count
}
}
}
} else if (isThunk(vNode)) {
thunks(vNode, null, patch, index)
}
}
function undefinedKeys(obj) {
var result = {}
for (var key in obj) {
result[key] = undefined
}
return result
}
// List diff, naive left to right reordering
function reorder(aChildren, bChildren) {
// O(M) time, O(M) memory
var bChildIndex = keyIndex(bChildren)
var bKeys = bChildIndex.keys
var bFree = bChildIndex.free
if (bFree.length === bChildren.length) {
return {
children: bChildren,
moves: null
}
}
// O(N) time, O(N) memory
var aChildIndex = keyIndex(aChildren)
var aKeys = aChildIndex.keys
var aFree = aChildIndex.free
if (aFree.length === aChildren.length) {
return {
children: bChildren,
moves: null
}
}
// O(MAX(N, M)) memory
var newChildren = []
var freeIndex = 0
var freeCount = bFree.length
var deletedItems = 0
// Iterate through a and match a node in b
// O(N) time,
for (var i = 0 ; i < aChildren.length; i++) {
var aItem = aChildren[i]
var itemIndex
if (aItem.key) {
if (bKeys.hasOwnProperty(aItem.key)) {
// Match up the old keys
itemIndex = bKeys[aItem.key]
newChildren.push(bChildren[itemIndex])
} else {
// Remove old keyed items
itemIndex = i - deletedItems++
newChildren.push(null)
}
} else {
// Match the item in a with the next free item in b
if (freeIndex < freeCount) {
itemIndex = bFree[freeIndex++]
newChildren.push(bChildren[itemIndex])
} else {
// There are no free items in b to match with
// the free items in a, so the extra free nodes
// are deleted.
itemIndex = i - deletedItems++
newChildren.push(null)
}
}
}
var lastFreeIndex = freeIndex >= bFree.length ?
bChildren.length :
bFree[freeIndex]
// Iterate through b and append any new keys
// O(M) time
for (var j = 0; j < bChildren.length; j++) {
var newItem = bChildren[j]
if (newItem.key) {
if (!aKeys.hasOwnProperty(newItem.key)) {
// Add any new keyed items
// We are adding new items to the end and then sorting them
// in place. In future we should insert new items in place.
newChildren.push(newItem)
}
} else if (j >= lastFreeIndex) {
// Add any leftover non-keyed items
newChildren.push(newItem)
}
}
var simulate = newChildren.slice()
var simulateIndex = 0
var removes = []
var inserts = []
var simulateItem
for (var k = 0; k < bChildren.length;) {
var wantedItem = bChildren[k]
simulateItem = simulate[simulateIndex]
// remove items
while (simulateItem === null && simulate.length) {
removes.push(remove(simulate, simulateIndex, null))
simulateItem = simulate[simulateIndex]
}
if (!simulateItem || simulateItem.key !== wantedItem.key) {
// if we need a key in this position...
if (wantedItem.key) {
if (simulateItem && simulateItem.key) {
// if an insert doesn't put this key in place, it needs to move
if (bKeys[simulateItem.key] !== k + 1) {
removes.push(remove(simulate, simulateIndex, simulateItem.key))
simulateItem = simulate[simulateIndex]
// if the remove didn't put the wanted item in place, we need to insert it
if (!simulateItem || simulateItem.key !== wantedItem.key) {
inserts.push({key: wantedItem.key, to: k})
}
// items are matching, so skip ahead
else {
simulateIndex++
}
}
else {
inserts.push({key: wantedItem.key, to: k})
}
}
else {
inserts.push({key: wantedItem.key, to: k})
}
k++
}
// a key in simulate has no matching wanted key, remove it
else if (simulateItem && simulateItem.key) {
removes.push(remove(simulate, simulateIndex, simulateItem.key))
}
}
else {
simulateIndex++
k++
}
}
// remove all the remaining nodes from simulate
while(simulateIndex < simulate.length) {
simulateItem = simulate[simulateIndex]
removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))
}
// If the only moves we have are deletes then we can just
// let the delete patch remove these items.
if (removes.length === deletedItems && !inserts.length) {
return {
children: newChildren,
moves: null
}
}
return {
children: newChildren,
moves: {
removes: removes,
inserts: inserts
}
}
}
function remove(arr, index, key) {
arr.splice(index, 1)
return {
from: index,
key: key
}
}
function keyIndex(children) {
var keys = {}
var free = []
var length = children.length
for (var i = 0; i < length; i++) {
var child = children[i]
if (child.key) {
keys[child.key] = i
} else {
free.push(i)
}
}
return {
keys: keys, // A hash of key name to index
free: free // An array of unkeyed item indices
}
}
function appendPatch(apply, patch) {
if (apply) {
if (isArray(apply)) {
apply.push(patch)
} else {
apply = [apply, patch]
}
return apply
} else {
return patch
}
}
},{"../vnode/handle-thunk":100,"../vnode/is-thunk":101,"../vnode/is-vnode":103,"../vnode/is-vtext":104,"../vnode/is-widget":105,"../vnode/vpatch":108,"./diff-props":110,"x-is-array":85}],112:[function(require,module,exports){
'use strict';
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var _require = require('@cycle/core');
var Rx = _require.Rx;
var ALL_PROPS = '*';
var PROPS_DRIVER_NAME = 'props';
var EVENTS_SINK_NAME = 'events';
function makeDispatchFunction(element, eventName) {
return function dispatchCustomEvent(evData) {
//console.log('%cdispatchCustomEvent ' + eventName,
// 'background-color: #CCCCFF; color: black');
var event = undefined;
try {
event = new Event(eventName);
} catch (err) {
event = document.createEvent('Event');
event.initEvent(eventName, true, true);
}
event.detail = evData;
element.dispatchEvent(event);
};
}
function subscribeDispatchers(element) {
var customEvents = element.cycleCustomElementMetadata.customEvents;
var disposables = new Rx.CompositeDisposable();
for (var _name in customEvents) {
if (customEvents.hasOwnProperty(_name)) {
if (typeof customEvents[_name].subscribe === 'function') {
var disposable = customEvents[_name].subscribe(makeDispatchFunction(element, _name));
disposables.add(disposable);
}
}
}
return disposables;
}
function subscribeDispatchersWhenRootChanges(metadata) {
return metadata.rootElem$.distinctUntilChanged(Rx.helpers.identity, function (x, y) {
return x && y && x.isEqualNode && x.isEqualNode(y);
}).subscribe(function resubscribeDispatchers(rootElem) {
if (metadata.eventDispatchingSubscription) {
metadata.eventDispatchingSubscription.dispose();
}
metadata.eventDispatchingSubscription = subscribeDispatchers(rootElem);
});
}
function subscribeEventDispatchingSink(element, widget) {
element.cycleCustomElementMetadata.eventDispatchingSubscription = subscribeDispatchers(element);
widget.disposables.add(element.cycleCustomElementMetadata.eventDispatchingSubscription);
widget.disposables.add(subscribeDispatchersWhenRootChanges(element.cycleCustomElementMetadata));
}
function makePropertiesDriver() {
var propertiesDriver = {};
var defaultComparer = Rx.helpers.defaultComparer;
Object.defineProperty(propertiesDriver, 'type', {
enumerable: false,
value: 'PropertiesDriver'
});
Object.defineProperty(propertiesDriver, 'get', {
enumerable: false,
value: function get(streamKey) {
var comparer = arguments.length <= 1 || arguments[1] === undefined ? defaultComparer : arguments[1];
if (typeof streamKey === 'undefined') {
throw new Error('Custom element driver `props.get()` expects an ' + 'argument in the getter.');
}
if (typeof this[streamKey] === 'undefined') {
this[streamKey] = new Rx.ReplaySubject(1);
}
return this[streamKey].distinctUntilChanged(Rx.helpers.identity, comparer);
}
});
Object.defineProperty(propertiesDriver, 'getAll', {
enumerable: false,
value: function getAll() {
return this.get(ALL_PROPS);
}
});
return propertiesDriver;
}
function createContainerElement(tagName, vtreeProperties) {
var element = document.createElement('div');
element.id = vtreeProperties.id || '';
element.className = vtreeProperties.className || '';
element.className += ' cycleCustomElement-' + tagName.toUpperCase();
element.cycleCustomElementMetadata = {
propertiesDriver: null,
rootElem$: null,
customEvents: null,
eventDispatchingSubscription: false
};
return element;
}
function throwIfVTreeHasPropertyChildren(vtree) {
if (typeof vtree.properties.children !== 'undefined') {
throw new Error('Custom element should not have property `children`. ' + 'It is reserved for children elements nested into this custom element.');
}
}
function makeCustomElementInput(domOutput, propertiesDriver, domDriverName) {
var _ref;
return (_ref = {}, _defineProperty(_ref, domDriverName, domOutput), _defineProperty(_ref, PROPS_DRIVER_NAME, propertiesDriver), _ref);
}
function makeConstructor() {
return function customElementConstructor(vtree, CERegistry, driverName) {
//console.log('%cnew (constructor) custom element ' + vtree.tagName,
// 'color: #880088');
throwIfVTreeHasPropertyChildren(vtree);
this.type = 'Widget';
this.properties = vtree.properties;
this.properties.children = vtree.children;
this.key = vtree.key;
this.isCustomElementWidget = true;
this.customElementsRegistry = CERegistry;
this.driverName = driverName;
this.firstRootElem$ = new Rx.ReplaySubject(1);
this.disposables = new Rx.CompositeDisposable();
};
}
function validateDefFnOutput(defFnOutput, domDriverName, tagName) {
if (typeof defFnOutput !== 'object') {
throw new Error('Custom element definition function for \'' + tagName + '\' ' + ' should output an object.');
}
if (typeof defFnOutput[domDriverName] === 'undefined') {
throw new Error('Custom element definition function for \'' + tagName + '\' ' + ('should output an object containing \'' + domDriverName + '\'.'));
}
if (typeof defFnOutput[domDriverName].subscribe !== 'function') {
throw new Error('Custom element definition function for \'' + tagName + '\' ' + 'should output an object containing an Observable of VTree, named ' + ('\'' + domDriverName + '\'.'));
}
for (var _name2 in defFnOutput) {
if (defFnOutput.hasOwnProperty(_name2)) {
if (_name2 !== domDriverName && _name2 !== EVENTS_SINK_NAME) {
throw new Error('Unknown \'' + _name2 + '\' found on custom element ' + ('\'' + tagName + '\'s definition function\'s output.'));
}
}
}
}
function makeInit(tagName, definitionFn) {
var _require2 = require('./render-dom');
var makeDOMDriverWithRegistry = _require2.makeDOMDriverWithRegistry;
return function initCustomElement() {
//console.log('%cInit() custom element ' + tagName, 'color: #880088');
var widget = this;
var driverName = widget.driverName;
var registry = widget.customElementsRegistry;
var element = createContainerElement(tagName, widget.properties);
var proxyVTree$ = new Rx.ReplaySubject(1);
var domDriver = makeDOMDriverWithRegistry(element, registry);
var propertiesDriver = makePropertiesDriver();
var domResponse = domDriver(proxyVTree$, driverName);
var rootElem$ = domResponse.get(':root');
rootElem$.subscribe(function (rootElem) {
// This is expected to happen before initCustomElement() returns `element`
element = rootElem;
});
var defFnInput = makeCustomElementInput(domResponse, propertiesDriver, driverName);
var requests = definitionFn(defFnInput);
validateDefFnOutput(requests, driverName, tagName);
widget.disposables.add(requests[driverName].subscribe(proxyVTree$.asObserver()));
widget.disposables.add(rootElem$.subscribe(widget.firstRootElem$.asObserver()));
element.cycleCustomElementMetadata = {
propertiesDriver: propertiesDriver,
rootElem$: rootElem$,
customEvents: requests.events,
eventDispatchingSubscription: false
};
subscribeEventDispatchingSink(element, widget);
widget.disposables.add(widget.firstRootElem$);
widget.disposables.add(proxyVTree$);
widget.disposables.add(domResponse);
widget.update(null, element);
return element;
};
}
function validatePropertiesDriverInMetadata(element, fnName) {
if (!element) {
throw new Error('Missing DOM element when calling ' + fnName + ' on custom ' + 'element Widget.');
}
if (!element.cycleCustomElementMetadata) {
throw new Error('Missing custom element metadata on DOM element when ' + 'calling ' + fnName + ' on custom element Widget.');
}
var metadata = element.cycleCustomElementMetadata;
if (metadata.propertiesDriver.type !== 'PropertiesDriver') {
throw new Error('Custom element metadata\'s propertiesDriver type is ' + 'invalid: ' + metadata.propertiesDriver.type + '.');
}
}
function updateCustomElement(previous, element) {
if (previous) {
this.disposables = previous.disposables;
this.firstRootElem$.onNext(0);
this.firstRootElem$.onCompleted();
}
validatePropertiesDriverInMetadata(element, 'update()');
//console.log(`%cupdate() ${element.className}`, 'color: #880088');
var propsDriver = element.cycleCustomElementMetadata.propertiesDriver;
if (propsDriver.hasOwnProperty(ALL_PROPS)) {
propsDriver[ALL_PROPS].onNext(this.properties);
}
for (var prop in propsDriver) {
if (propsDriver.hasOwnProperty(prop)) {
if (this.properties.hasOwnProperty(prop)) {
propsDriver[prop].onNext(this.properties[prop]);
}
}
}
}
function destroyCustomElement(element) {
//console.log(`%cdestroy() custom el ${element.className}`, 'color: #808');
// Dispose propertiesDriver
var propsDriver = element.cycleCustomElementMetadata.propertiesDriver;
for (var prop in propsDriver) {
if (propsDriver.hasOwnProperty(prop)) {
this.disposables.add(propsDriver[prop]);
}
}
if (element.cycleCustomElementMetadata.eventDispatchingSubscription) {
// This subscription has to be disposed.
// Because disposing subscribeDispatchersWhenRootChanges only
// is not enough.
this.disposables.add(element.cycleCustomElementMetadata.eventDispatchingSubscription);
}
this.disposables.dispose();
}
function makeWidgetClass(tagName, definitionFn) {
if (typeof definitionFn !== 'function') {
throw new Error('A custom element definition given to the DOM driver ' + 'should be a function.');
}
var WidgetClass = makeConstructor();
WidgetClass.definitionFn = definitionFn; // needed by renderAsHTML
WidgetClass.prototype.init = makeInit(tagName, definitionFn);
WidgetClass.prototype.update = updateCustomElement;
WidgetClass.prototype.destroy = destroyCustomElement;
return WidgetClass;
}
module.exports = {
makeDispatchFunction: makeDispatchFunction,
subscribeDispatchers: subscribeDispatchers,
subscribeDispatchersWhenRootChanges: subscribeDispatchersWhenRootChanges,
makePropertiesDriver: makePropertiesDriver,
createContainerElement: createContainerElement,
throwIfVTreeHasPropertyChildren: throwIfVTreeHasPropertyChildren,
makeConstructor: makeConstructor,
makeInit: makeInit,
updateCustomElement: updateCustomElement,
destroyCustomElement: destroyCustomElement,
ALL_PROPS: ALL_PROPS,
makeCustomElementInput: makeCustomElementInput,
makeWidgetClass: makeWidgetClass
};
},{"./render-dom":115,"@cycle/core":1}],113:[function(require,module,exports){
'use strict';
var _require = require('./custom-element-widget');
var makeWidgetClass = _require.makeWidgetClass;
var Map = Map || require('es6-map'); // eslint-disable-line no-native-reassign
function replaceCustomElementsWithSomething(vtree, registry, toSomethingFn) {
// Silently ignore corner cases
if (!vtree) {
return vtree;
}
var tagName = (vtree.tagName || '').toUpperCase();
// Replace vtree itself
if (tagName && registry.has(tagName)) {
var WidgetClass = registry.get(tagName);
return toSomethingFn(vtree, WidgetClass);
}
// Or replace children recursively
if (Array.isArray(vtree.children)) {
for (var i = vtree.children.length - 1; i >= 0; i--) {
vtree.children[i] = replaceCustomElementsWithSomething(vtree.children[i], registry, toSomethingFn);
}
}
return vtree;
}
function makeCustomElementsRegistry(definitions) {
var registry = new Map();
for (var tagName in definitions) {
if (definitions.hasOwnProperty(tagName)) {
registry.set(tagName.toUpperCase(), makeWidgetClass(tagName, definitions[tagName]));
}
}
return registry;
}
module.exports = {
replaceCustomElementsWithSomething: replaceCustomElementsWithSomething,
makeCustomElementsRegistry: makeCustomElementsRegistry
};
},{"./custom-element-widget":112,"es6-map":4}],114:[function(require,module,exports){
'use strict';
var VirtualDOM = require('virtual-dom');
var svg = require('virtual-dom/virtual-hyperscript/svg');
var _require = require('./render-dom');
var makeDOMDriver = _require.makeDOMDriver;
var _require2 = require('./render-html');
var makeHTMLDriver = _require2.makeHTMLDriver;
var CycleDOM = {
/**
* A factory for the DOM driver function. Takes a `container` to define the
* target on the existing DOM which this driver will operate on. All custom
* elements which this driver can detect should be given as the second
* parameter. The output of this driver is a collection of Observables queried
* by a getter function: `domDriverOutput.get(selector, eventType)` returns an
* Observable of events of `eventType` happening on the element determined by
* `selector`. Also, `domDriverOutput.get(':root')` returns an Observable of
* DOM element corresponding to the root (or container) of the app on the DOM.
*
* @param {(String|HTMLElement)} container the DOM selector for the element
* (or the element itself) to contain the rendering of the VTrees.
* @param {Object} customElements a collection of custom element definitions.
* The key of each property should be the tag name of the custom element, and
* the value should be a function defining the implementation of the custom
* element. This function follows the same contract as the top-most `main`
* function: input are driver responses, output are requests to drivers.
* @return {Function} the DOM driver function. The function expects an
* Observable of VTree as input, and outputs the response object for this
* driver, containing functions `get()` and `dispose()` that can be used for
* debugging and testing.
* @function makeDOMDriver
*/
makeDOMDriver: makeDOMDriver,
/**
* A factory for the HTML driver function. Takes the registry object of all
* custom elements as the only parameter. The HTML driver function will use
* the custom element registry to detect custom element on the VTree and apply
* their implementations.
*
* @param {Object} customElements a collection of custom element definitions.
* The key of each property should be the tag name of the custom element, and
* the value should be a function defining the implementation of the custom
* element. This function follows the same contract as the top-most `main`
* function: input are driver responses, output are requests to drivers.
* @return {Function} the HTML driver function. The function expects an
* Observable of Virtual DOM elements as input, and outputs an Observable of
* strings as the HTML renderization of the virtual DOM elements.
* @function makeHTMLDriver
*/
makeHTMLDriver: makeHTMLDriver,
/**
* A shortcut to [virtual-hyperscript](
* https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript).
* This is a helper for creating VTrees in Views.
* @name h
*/
h: VirtualDOM.h,
/**
* An adapter around virtual-hyperscript `h()` to allow JSX to be used easily
* with Babel. Place the [Babel configuration comment](
* http://babeljs.io/docs/advanced/transformers/other/react/) `@jsx hJSX` at
* the top of the ES6 file, make sure you import `hJSX` with
* `import {hJSX} from '@cycle/dom'`, and then you can use JSX to create
* VTrees.
* @name hJSX
*/
hJSX: function hJSX(tag, attrs) {
for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
children[_key - 2] = arguments[_key];
}
return VirtualDOM.h(tag, attrs, children);
},
/**
* A shortcut to the svg hyperscript function.
* @name svg
*/
svg: svg
};
module.exports = CycleDOM;
},{"./render-dom":115,"./render-html":116,"virtual-dom":78,"virtual-dom/virtual-hyperscript/svg":99}],115:[function(require,module,exports){
'use strict';
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
var _require = require('@cycle/core');
var Rx = _require.Rx;
var VDOM = {
h: require('virtual-dom').h,
diff: require('virtual-dom/diff'),
patch: require('virtual-dom/patch'),
parse: typeof window !== 'undefined' ? require('vdom-parser') : function () {}
};
var _require2 = require('./custom-elements');
var replaceCustomElementsWithSomething = _require2.replaceCustomElementsWithSomething;
var makeCustomElementsRegistry = _require2.makeCustomElementsRegistry;
function isElement(obj) {
return typeof HTMLElement === 'object' ? obj instanceof HTMLElement || obj instanceof DocumentFragment : //DOM2
obj && typeof obj === 'object' && obj !== null && (obj.nodeType === 1 || obj.nodeType === 11) && typeof obj.nodeName === 'string';
}
function fixRootElem$(rawRootElem$, domContainer) {
// Create rootElem stream and automatic className correction
var originalClasses = (domContainer.className || '').trim().split(/\s+/);
var originalId = domContainer.id;
//console.log('%coriginalClasses: ' + originalClasses, 'color: lightgray');
return rawRootElem$.map(function fixRootElemClassNameAndId(rootElem) {
var previousClasses = rootElem.className.trim().split(/\s+/);
var missingClasses = originalClasses.filter(function (clss) {
return previousClasses.indexOf(clss) < 0;
});
//console.log('%cfixRootElemClassName(), missingClasses: ' +
// missingClasses, 'color: lightgray');
rootElem.className = previousClasses.concat(missingClasses).join(' ');
rootElem.id = originalId;
//console.log('%c result: ' + rootElem.className, 'color: lightgray');
//console.log('%cEmit rootElem$ ' + rootElem.tagName + '.' +
// rootElem.className, 'color: #009988');
return rootElem;
}).replay(null, 1);
}
function isVTreeCustomElement(vtree) {
return vtree.type === 'Widget' && vtree.isCustomElementWidget;
}
function makeReplaceCustomElementsWithWidgets(CERegistry, driverName) {
return function replaceCustomElementsWithWidgets(vtree) {
return replaceCustomElementsWithSomething(vtree, CERegistry, function (_vtree, WidgetClass) {
return new WidgetClass(_vtree, CERegistry, driverName);
});
};
}
function getArrayOfAllWidgetFirstRootElem$(vtree) {
if (vtree.type === 'Widget' && vtree.firstRootElem$) {
return [vtree.firstRootElem$];
}
// Or replace children recursively
var array = [];
if (Array.isArray(vtree.children)) {
for (var i = vtree.children.length - 1; i >= 0; i--) {
array = array.concat(getArrayOfAllWidgetFirstRootElem$(vtree.children[i]));
}
}
return array;
}
function checkRootVTreeNotCustomElement(vtree) {
if (isVTreeCustomElement(vtree)) {
throw new Error('Illegal to use a Cycle custom element as the root of ' + 'a View.');
}
}
function isRootForCustomElement(rootElem) {
return !!rootElem.cycleCustomElementMetadata;
}
function wrapTopLevelVTree(vtree, rootElem) {
if (isRootForCustomElement(rootElem)) {
return vtree;
}
var _vtree$properties$id = vtree.properties.id;
var vtreeId = _vtree$properties$id === undefined ? '' : _vtree$properties$id;
var _vtree$properties$className = vtree.properties.className;
var vtreeClass = _vtree$properties$className === undefined ? '' : _vtree$properties$className;
var sameId = vtreeId === rootElem.id;
var sameClass = vtreeClass === rootElem.className;
var sameTagName = vtree.tagName.toUpperCase() === rootElem.tagName;
if (sameId && sameClass && sameTagName) {
return vtree;
} else {
return VDOM.h(rootElem.tagName, { id: rootElem.id, className: rootElem.className }, [vtree]);
}
}
function makeDiffAndPatchToElement$(rootElem) {
return function diffAndPatchToElement$(_ref) {
var _ref2 = _slicedToArray(_ref, 2);
var oldVTree = _ref2[0];
var newVTree = _ref2[1];
if (typeof newVTree === 'undefined') {
return Rx.Observable.empty();
}
//let isCustomElement = isRootForCustomElement(rootElem);
//let k = isCustomElement ? ' is custom element ' : ' is top level';
var prevVTree = wrapTopLevelVTree(oldVTree, rootElem);
var nextVTree = wrapTopLevelVTree(newVTree, rootElem);
var waitForChildrenStreams = getArrayOfAllWidgetFirstRootElem$(nextVTree);
var rootElemAfterChildrenFirstRootElem$ = Rx.Observable.combineLatest(waitForChildrenStreams, function () {
//console.log('%crawRootElem$ emits. (1)' + k, 'color: #008800');
return rootElem;
});
var cycleCustomElementMetadata = rootElem.cycleCustomElementMetadata;
//console.log('%cVDOM diff and patch START' + k, 'color: #636300');
/* eslint-disable */
rootElem = VDOM.patch(rootElem, VDOM.diff(prevVTree, nextVTree));
/* eslint-enable */
//console.log('%cVDOM diff and patch END' + k, 'color: #636300');
if (cycleCustomElementMetadata) {
rootElem.cycleCustomElementMetadata = cycleCustomElementMetadata;
}
if (waitForChildrenStreams.length === 0) {
//console.log('%crawRootElem$ emits. (2)' + k, 'color: #008800');
return Rx.Observable.just(rootElem);
} else {
//console.log('%crawRootElem$ waiting children.' + k, 'color: #008800');
return rootElemAfterChildrenFirstRootElem$;
}
};
}
function renderRawRootElem$(vtree$, domContainer, CERegistry, driverName) {
var diffAndPatchToElement$ = makeDiffAndPatchToElement$(domContainer);
return vtree$.startWith(VDOM.parse(domContainer)).map(makeReplaceCustomElementsWithWidgets(CERegistry, driverName)).doOnNext(checkRootVTreeNotCustomElement).pairwise().flatMap(diffAndPatchToElement$);
}
function makeRootElemToEvent$(selector, eventName) {
return function rootElemToEvent$(rootElem) {
if (!rootElem) {
return Rx.Observable.empty();
}
//let isCustomElement = !!rootElem.cycleCustomElementMetadata;
//console.log(`%cget('${selector}', '${eventName}') flatMapper` +
// (isCustomElement ? ' for a custom element' : ' for top-level View'),
// 'color: #0000BB');
var klass = selector.replace('.', '');
if (rootElem.className.search(new RegExp('\\b' + klass + '\\b')) >= 0) {
//console.log('%c Good return. (A)', 'color:#0000BB');
//console.log(rootElem);
return Rx.Observable.fromEvent(rootElem, eventName);
}
var targetElements = rootElem.querySelectorAll(selector);
if (targetElements && targetElements.length > 0) {
//console.log('%c Good return. (B)', 'color:#0000BB');
//console.log(targetElements);
return Rx.Observable.fromEvent(targetElements, eventName);
} else {
//console.log('%c returning empty!', 'color: #0000BB');
return Rx.Observable.empty();
}
};
}
function makeResponseGetter(rootElem$) {
return function get(selector, eventName) {
if (typeof selector !== 'string') {
throw new Error('DOM driver\'s get() expects first argument to be a ' + 'string as a CSS selector');
}
if (selector.trim() === ':root') {
return rootElem$;
}
if (typeof eventName !== 'string') {
throw new Error('DOM driver\'s get() expects second argument to be a ' + 'string representing the event type to listen for.');
}
//console.log(`%cget("${selector}", "${eventName}")`, 'color: #0000BB');
return rootElem$.flatMapLatest(makeRootElemToEvent$(selector, eventName)).share();
};
}
function validateDOMDriverInput(vtree$) {
if (!vtree$ || typeof vtree$.subscribe !== 'function') {
throw new Error('The DOM driver function expects as input an ' + 'Observable of virtual DOM elements');
}
}
function makeDOMDriverWithRegistry(container, CERegistry) {
return function domDriver(vtree$, driverName) {
validateDOMDriverInput(vtree$);
var rawRootElem$ = renderRawRootElem$(vtree$, container, CERegistry, driverName);
if (!isRootForCustomElement(container)) {
rawRootElem$ = rawRootElem$.startWith(container);
}
var rootElem$ = fixRootElem$(rawRootElem$, container);
var disposable = rootElem$.connect();
return {
get: makeResponseGetter(rootElem$),
dispose: disposable.dispose.bind(disposable)
};
};
}
function makeDOMDriver(container) {
var customElementDefinitions = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
// Find and prepare the container
var domContainer = typeof container === 'string' ? document.querySelector(container) : container;
// Check pre-conditions
if (typeof container === 'string' && domContainer === null) {
throw new Error('Cannot render into unknown element \'' + container + '\'');
} else if (!isElement(domContainer)) {
throw new Error('Given container is not a DOM element neither a selector ' + 'string.');
}
var registry = makeCustomElementsRegistry(customElementDefinitions);
return makeDOMDriverWithRegistry(domContainer, registry);
}
module.exports = {
isElement: isElement,
fixRootElem$: fixRootElem$,
isVTreeCustomElement: isVTreeCustomElement,
makeReplaceCustomElementsWithWidgets: makeReplaceCustomElementsWithWidgets,
getArrayOfAllWidgetFirstRootElem$: getArrayOfAllWidgetFirstRootElem$,
isRootForCustomElement: isRootForCustomElement,
wrapTopLevelVTree: wrapTopLevelVTree,
checkRootVTreeNotCustomElement: checkRootVTreeNotCustomElement,
makeDiffAndPatchToElement$: makeDiffAndPatchToElement$,
renderRawRootElem$: renderRawRootElem$,
makeResponseGetter: makeResponseGetter,
validateDOMDriverInput: validateDOMDriverInput,
makeDOMDriverWithRegistry: makeDOMDriverWithRegistry,
makeDOMDriver: makeDOMDriver
};
},{"./custom-elements":113,"@cycle/core":1,"vdom-parser":60,"virtual-dom":78,"virtual-dom/diff":76,"virtual-dom/patch":86}],116:[function(require,module,exports){
'use strict';
var _require = require('@cycle/core');
var Rx = _require.Rx;
var toHTML = require('vdom-to-html');
var _require2 = require('./custom-elements');
var replaceCustomElementsWithSomething = _require2.replaceCustomElementsWithSomething;
var makeCustomElementsRegistry = _require2.makeCustomElementsRegistry;
var _require3 = require('./custom-element-widget');
var makeCustomElementInput = _require3.makeCustomElementInput;
var ALL_PROPS = _require3.ALL_PROPS;
function makePropertiesDriverFromVTree(vtree) {
return {
get: function get(propertyName) {
if (propertyName === ALL_PROPS) {
return Rx.Observable.just(vtree.properties);
} else {
return Rx.Observable.just(vtree.properties[propertyName]);
}
}
};
}
/**
* Converts a tree of VirtualNode|Observable<VirtualNode> into
* Observable<VirtualNode>.
*/
function transposeVTree(vtree) {
if (typeof vtree.subscribe === 'function') {
return vtree;
} else if (vtree.type === 'VirtualText') {
return Rx.Observable.just(vtree);
} else if (vtree.type === 'VirtualNode' && Array.isArray(vtree.children) && vtree.children.length > 0) {
return Rx.Observable.combineLatest(vtree.children.map(transposeVTree), function () {
for (var _len = arguments.length, arr = Array(_len), _key = 0; _key < _len; _key++) {
arr[_key] = arguments[_key];
}
vtree.children = arr;
return vtree;
});
} else if (vtree.type === 'VirtualNode') {
return Rx.Observable.just(vtree);
} else {
throw new Error('Unhandled case in transposeVTree()');
}
}
function makeReplaceCustomElementsWithVTree$(CERegistry, driverName) {
return function replaceCustomElementsWithVTree$(vtree) {
return replaceCustomElementsWithSomething(vtree, CERegistry, function toVTree$(_vtree, WidgetClass) {
var interactions = { get: function get() {
return Rx.Observable.empty();
} };
var props = makePropertiesDriverFromVTree(_vtree);
var input = makeCustomElementInput(interactions, props);
var output = WidgetClass.definitionFn(input);
var vtree$ = output[driverName].last();
/*eslint-disable no-use-before-define */
return convertCustomElementsToVTree(vtree$, CERegistry, driverName);
/*eslint-enable no-use-before-define */
});
};
}
function convertCustomElementsToVTree(vtree$, CERegistry, driverName) {
return vtree$.map(makeReplaceCustomElementsWithVTree$(CERegistry, driverName)).flatMap(transposeVTree);
}
function makeResponseGetter() {
return function get(selector) {
if (selector === ':root') {
return this;
} else {
return Rx.Observable.empty();
}
};
}
function makeHTMLDriver() {
var customElementDefinitions = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var registry = makeCustomElementsRegistry(customElementDefinitions);
return function htmlDriver(vtree$, driverName) {
var vtreeLast$ = vtree$.last();
var output$ = convertCustomElementsToVTree(vtreeLast$, registry, driverName).map(function (vtree) {
return toHTML(vtree);
});
output$.get = makeResponseGetter();
return output$;
};
}
module.exports = {
makePropertiesDriverFromVTree: makePropertiesDriverFromVTree,
makeReplaceCustomElementsWithVTree$: makeReplaceCustomElementsWithVTree$,
convertCustomElementsToVTree: convertCustomElementsToVTree,
makeHTMLDriver: makeHTMLDriver
};
},{"./custom-element-widget":112,"./custom-elements":113,"@cycle/core":1,"vdom-to-html":64}]},{},[114])(114)
}); |
statics/js/dan.js | austin880625/ceremonyDanmaku | var user_id="";
var ws;
var waiting=0;
var is_lock=0;
var inter_ping,inter_clearq;
var input_msg="寫下你的祝福或讚賞(or吐槽";
var danmaku_queue=Array();
//var gettime=0;
function checkAvailability(){
if(waiting<=1){
waiting=0;
is_lock=0;
$("#danmaku_content").removeAttr("disabled");
$("#danmaku_content").attr("placeholder",input_msg);
$("#send").removeAttr("disabled");
}
else{
waiting--;
setTimeout(checkAvailability,1000);
$("#danmaku_content").attr("placeholder","請再等待"+waiting.toString()+"秒");
}
}
function react(d){
if(d=="L"){
console.log("not logged in");
}else if(d=="R"){
console.log("not rigistered");
}else if(d=="N"){
$("#danmaku_content").attr("disabled","disabled");
$("#send").attr("disabled","disabled");
$("#danmaku_content").attr("placeholder","彈幕未開放");
}else if(d<=0){
$("#danmaku_content").removeAttr("disabled");
$("#danmaku_content").attr("placeholder",input_msg);
$("#send").removeAttr("disabled");
}else {
$("#danmaku_content").attr("disabled","disabled");
$("#send").attr("disabled","disabled");
waiting=d;
if(is_lock==0){is_lock=1;setTimeout(checkAvailability,1000);}
$("#danmaku_content").attr("placeholder","請再等待"+waiting+"秒");
}
}
function ping_server(){
ws.send("ping");
}
function start_ws(server_url){
ws = new WebSocket("ws://"+server_url+"/Pusheen");
ws.onopen = function(){
}
clearInterval(inter_ping);
inter_ping=setInterval(ping_server,40000);
ws.onmessage = function(e){
var data=JSON.parse(e.data);
if(data.state=="connection established."){
console.log("connection established.");
}else if(data.state=="pong"){
return ;
}else if(data.state=="dan"){
var len=0,i;
for(i=0;i<data.content.length;i++){
x=data.content.charCodeAt(i);
if(x<=0x7f){
len++;
}else{
len+=2;
}
if(len>=50)break;
}
var line=document.createElement("div");
var text=document.createTextNode(data.user+":"+data.content.slice(0,i));
line.appendChild(text);
danmaku_queue.push(line);
var ele=document.getElementById("recent_danmaku");
ele.appendChild(line);
$("#recent_danmaku").animate({scrollTop:ele.scrollHeight},150);
}else if(data.state=="upd"){
if(data.dan!=null){
if(data.dan==0){
$("#danmaku_content").val("");
$("#danmaku_content").attr("disabled","disabled");
$("#send").attr("disabled","disabled");
$("#danmaku_content").attr("placeholder","彈幕未開放");
}
else{
$("#danmaku_content").removeAttr("disabled");
$("#danmaku_content").attr("placeholder",input_msg);
$("#send").removeAttr("disabled");
waiting=0;
}
}
if(data.program!=null){
$("#current_program").text(data.program);
}
//alert(data.state);
//responded=1;
}else{
react(data.state);
}
}
ws.onclose = function(){
setTimeout(function(){start_ws(server_url);},5000);
}
}
function checkLoginState(){
FB.getLoginStatus(function(response) {
if(response.status=='connected'){
console.log('logged in.');
var accessToken=response.authResponse.accessToken;
user_id=response.authResponse.userID;
$.ajax({
type:"post",
url:"/register",
async:false,
data:{'user_fb_token':accessToken,'user_id':user_id},
success:function(d){
//alert(d);
if(d=="success"){
$("#danmaku_content").text("");
}else{
console.log("error");
}
},
error:function(data){},
});
$("#send_form").show();
$("#danmaku_content").attr("placeholder",input_msg);
$(".fb-login-button").hide();
var server_url=window.location.hostname+":"+window.location.port;
if("WebSocket" in window && ws==null){
start_ws(server_url);
}
}
});
}
function logout(){
FB.logout(function(){console.log("logged out.")});
}
function clearq(){
while(danmaku_queue.length>10){
var ele=document.getElementById("recent_danmaku");
ele.removeChild(danmaku_queue[0]);
danmaku_queue.shift();
}
}
$(document).ready(function(){
inter_clearq=setInterval(clearq,5000);
$("#send").click(function(){
if($("#danmaku_content").val()==""){
alert("請輸入內容");
return ;
}
var len=0,i;
var content=$("#danmaku_content").val();
for(i=0;i<content.length;i++){
x=content.charCodeAt(i);
if(x<=0x7f){
len++;
}else{
len+=2;
}
if(len>=50)break;
}
danmaku_content={
//"user_id":user_id,
"content":content.slice(0,i),
};
$("#danmaku_content").val("");
if("WebSocket" in window){
if(ws==null){var server_url=window.location.hostname+":"+window.location.port;start_ws(server_url);}
ws.send(JSON.stringify(danmaku_content));
}else{
$.ajax({
type:"post",
url:"/senddanmaku",
data:danmaku_content,
success:function(d){
react(d);
},
error:function(data){},
});
}
});
$("#danmaku_content").keypress(function(e){
if(e.keyCode==13)
$("#send").click();
});
$("#danmaku_content").focus(function(){
window.scrollTo(0,document.body.scrollHeight);
});
$(window).focus(function(){
if(user_id!=""&&user_id!=null){
if(ws==null){
$.ajax({
type:"get",
url:"/senddanmaku",
success:function(d){
waiting=d;
$("#danmaku_content").attr("disabled","disabled");
$("#send").attr("disabled","disabled");
checkAvailability();
//console.log("YEE");
},
});
}else{
ws.send(JSON.stringify({"content":""}))
}
}
});
});
|
src/containers/PostList.js | caesai/medialeaks | import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import {parseJSON} from '../utils';
const actions = {
initPage: (page) => ({
type: 'PAGE_INIT',
payload: {
initedPage: page
}
}),
initialize: (type) => (dispatch) => {
dispatch(actions.initPage(type));
}
}
const mapStateToProps = (state) => ({
isAuthenticating : state.auth.isAuthenticating,
statusText : state.auth.statusText,
location: state.router.location
});
const DEV_SITE = 'http://medialeaks.ru';
class PostList extends React.Component {
constructor(props){
super(props);
this.state = {
posts: []
}
}
componentDidMount() {
this.props.dispatch(actions.initialize('list'));
}
componentWillMount () {
return fetch(DEV_SITE + '/wp-json/wp/v2/posts?_embed',{
method: 'get',
credentials: 'include',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.then(parseJSON)
.then(posts => {
this.setState({
posts: posts
});
})
.catch((error) => console.log(error));
}
render(){
let posts = this.state.posts || [];
let postsRow = posts.map(function(item){
return (
<div className="post-news" key={item.id}>
<Link to={`/${item.id}`}>
<div className="post-news_image">
{item._embedded['wp:featuredmedia'].map((media, key) => {
return <img src={media.source_url} alt="" key={key} />
})}
</div>
<div className="post-news_caption">
<p>{item.title.rendered}</p>
</div>
</Link>
<div className="post-news_credentials">
<p>{item.date}</p>
<p>
<a href="#">Видео</a>
</p>
</div>
</div>
)
}).reduce(function(r, element, index){
index % 3 === 0 && r.push([]);
r[r.length - 1].push(element);
return r;
}, []).map(function(rowContent, key) {
return <div className="list-row" key={key}>{rowContent}</div>;
});
return(
<div className="posts-list">
<h2>самое интересное в интернете сегодня</h2>
{postsRow}
<div className="more-posts_btn">
<span className="h3">загрузить еще</span>
</div>
</div>
)
}
}
PostList = connect(mapStateToProps)(PostList);
export default PostList;
|
blueocean-material-icons/src/js/components/svg-icons/hardware/laptop-chromebook.js | jenkinsci/blueocean-plugin | import React from 'react';
import SvgIcon from '../../SvgIcon';
const HardwareLaptopChromebook = (props) => (
<SvgIcon {...props}>
<path d="M22 18V3H2v15H0v2h24v-2h-2zm-8 0h-4v-1h4v1zm6-3H4V5h16v10z"/>
</SvgIcon>
);
HardwareLaptopChromebook.displayName = 'HardwareLaptopChromebook';
HardwareLaptopChromebook.muiName = 'SvgIcon';
export default HardwareLaptopChromebook;
|
docs/src/pages/components/breadcrumbs/CollapsedBreadcrumbs.js | allanalexandre/material-ui | /* eslint-disable jsx-a11y/anchor-is-valid */
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
import Breadcrumbs from '@material-ui/core/Breadcrumbs';
import Typography from '@material-ui/core/Typography';
import Link from '@material-ui/core/Link';
const useStyles = makeStyles(theme => ({
root: {
justifyContent: 'center',
flexWrap: 'wrap',
},
paper: {
padding: theme.spacing(1, 2),
},
}));
function handleClick(event) {
event.preventDefault();
alert('You clicked a breadcrumb.');
}
function CollapsedBreadcrumbs() {
const classes = useStyles();
return (
<Paper elevation={0} className={classes.paper}>
<Breadcrumbs maxItems={2} aria-label="Breadcrumb">
<Link color="inherit" href="#" onClick={handleClick}>
Home
</Link>
<Link color="inherit" href="#" onClick={handleClick}>
Catalog
</Link>
<Link color="inherit" href="#" onClick={handleClick}>
Accessories
</Link>
<Link color="inherit" href="#" onClick={handleClick}>
New Collection
</Link>
<Typography color="textPrimary">Belts</Typography>
</Breadcrumbs>
</Paper>
);
}
export default CollapsedBreadcrumbs;
|
packages/arwes/src/Footer/Footer.js | romelperez/prhone-ui | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import AnimationComponent from '../Animation';
export default class Footer extends Component {
static propTypes = {
Animation: PropTypes.any.isRequired,
theme: PropTypes.any.isRequired,
classes: PropTypes.any.isRequired,
animate: PropTypes.bool,
show: PropTypes.bool,
animation: PropTypes.object,
/**
* It uses the `deploy` player.
*/
sounds: PropTypes.object,
/**
* If function, receives the animation status object.
*/
children: PropTypes.any
};
static defaultProps = {
Animation: AnimationComponent,
sounds: {},
show: true
};
componentDidMount() {
const { animate, show, sounds } = this.props;
if (animate && show) {
sounds.deploy && sounds.deploy.play();
}
}
componentDidUpdate(prevProps) {
const { animate, show, sounds } = this.props;
if (animate && prevProps.show !== show) {
sounds.deploy && sounds.deploy.play();
}
}
componentWillUnmount() {
const { animate, sounds } = this.props;
if (animate) {
sounds.deploy && sounds.deploy.stop();
}
}
render() {
const {
theme,
classes,
Animation,
animation,
sounds,
animate,
show,
className,
children,
...etc
} = this.props;
const cls = cx(classes.root, className);
return (
<Animation
animate={animate}
show={show}
timeout={theme.animTime}
{...animation}
>
{anim => (
<footer className={cx(cls, classes[anim.status])} {...etc}>
<div className={classes.separator} />
<div className={classes.children}>
{typeof children === 'function' ? children(anim) : children}
</div>
</footer>
)}
</Animation>
);
}
}
|
ajax/libs/ag-grid/5.0.0-alpha.4/ag-grid.js | extend1994/cdnjs | // ag-grid v5.0.0-alpha.4
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["agGrid"] = factory();
else
root["agGrid"] = factory();
})(this, function() {
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__) {
// same as main.js, except also includes the styles, so webpack includes the css in the bundle
var populateClientExports = __webpack_require__(1).populateClientExports;
populateClientExports(exports);
__webpack_require__(94);
__webpack_require__(98);
__webpack_require__(100);
__webpack_require__(102);
__webpack_require__(104);
__webpack_require__(106);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var grid_1 = __webpack_require__(2);
var gridApi_1 = __webpack_require__(11);
var events_1 = __webpack_require__(10);
var componentUtil_1 = __webpack_require__(9);
var columnController_1 = __webpack_require__(13);
var agGridNg1_1 = __webpack_require__(88);
var agGridWebComponent_1 = __webpack_require__(89);
var gridCell_1 = __webpack_require__(33);
var rowNode_1 = __webpack_require__(27);
var originalColumnGroup_1 = __webpack_require__(17);
var columnGroup_1 = __webpack_require__(14);
var column_1 = __webpack_require__(15);
var focusedCellController_1 = __webpack_require__(35);
var functions_1 = __webpack_require__(67);
var gridOptionsWrapper_1 = __webpack_require__(3);
var balancedColumnTreeBuilder_1 = __webpack_require__(19);
var columnKeyCreator_1 = __webpack_require__(20);
var columnUtils_1 = __webpack_require__(16);
var displayedGroupCreator_1 = __webpack_require__(21);
var groupInstanceIdCreator_1 = __webpack_require__(66);
var context_1 = __webpack_require__(6);
var dragAndDropService_1 = __webpack_require__(70);
var dragService_1 = __webpack_require__(31);
var filterManager_1 = __webpack_require__(43);
var numberFilter_1 = __webpack_require__(46);
var textFilter_1 = __webpack_require__(45);
var gridPanel_1 = __webpack_require__(24);
var mouseEventService_1 = __webpack_require__(32);
var cssClassApplier_1 = __webpack_require__(75);
var headerContainer_1 = __webpack_require__(69);
var headerRenderer_1 = __webpack_require__(68);
var headerTemplateLoader_1 = __webpack_require__(77);
var horizontalDragService_1 = __webpack_require__(74);
var moveColumnController_1 = __webpack_require__(71);
var renderedHeaderCell_1 = __webpack_require__(76);
var renderedHeaderGroupCell_1 = __webpack_require__(73);
var standardMenu_1 = __webpack_require__(79);
var borderLayout_1 = __webpack_require__(30);
var tabbedLayout_1 = __webpack_require__(90);
var verticalStack_1 = __webpack_require__(91);
var autoWidthCalculator_1 = __webpack_require__(22);
var renderedRow_1 = __webpack_require__(37);
var rowRenderer_1 = __webpack_require__(23);
var filterStage_1 = __webpack_require__(80);
var flattenStage_1 = __webpack_require__(82);
var sortStage_1 = __webpack_require__(81);
var floatingRowModel_1 = __webpack_require__(26);
var paginationController_1 = __webpack_require__(41);
var component_1 = __webpack_require__(47);
var menuList_1 = __webpack_require__(92);
var cellNavigationService_1 = __webpack_require__(64);
var columnChangeEvent_1 = __webpack_require__(65);
var constants_1 = __webpack_require__(8);
var csvCreator_1 = __webpack_require__(12);
var eventService_1 = __webpack_require__(4);
var expressionService_1 = __webpack_require__(18);
var gridCore_1 = __webpack_require__(40);
var logger_1 = __webpack_require__(5);
var masterSlaveService_1 = __webpack_require__(25);
var selectionController_1 = __webpack_require__(28);
var sortController_1 = __webpack_require__(42);
var svgFactory_1 = __webpack_require__(59);
var templateService_1 = __webpack_require__(36);
var utils_1 = __webpack_require__(7);
var valueService_1 = __webpack_require__(29);
var popupService_1 = __webpack_require__(44);
var gridRow_1 = __webpack_require__(34);
var inMemoryRowModel_1 = __webpack_require__(84);
var virtualPageRowModel_1 = __webpack_require__(83);
var menuItemComponent_1 = __webpack_require__(93);
var animateSlideCellRenderer_1 = __webpack_require__(56);
var cellEditorFactory_1 = __webpack_require__(48);
var popupEditorWrapper_1 = __webpack_require__(51);
var popupSelectCellEditor_1 = __webpack_require__(53);
var popupTextCellEditor_1 = __webpack_require__(52);
var selectCellEditor_1 = __webpack_require__(50);
var textCellEditor_1 = __webpack_require__(49);
var largeTextCellEditor_1 = __webpack_require__(87);
var cellRendererFactory_1 = __webpack_require__(55);
var groupCellRenderer_1 = __webpack_require__(58);
var cellRendererService_1 = __webpack_require__(60);
var valueFormatterService_1 = __webpack_require__(61);
var dateCellEditor_1 = __webpack_require__(54);
var checkboxSelectionComponent_1 = __webpack_require__(62);
var componentAnnotations_1 = __webpack_require__(86);
var agCheckbox_1 = __webpack_require__(85);
function populateClientExports(exports) {
// columnController
exports.BalancedColumnTreeBuilder = balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder;
exports.ColumnController = columnController_1.ColumnController;
exports.ColumnKeyCreator = columnKeyCreator_1.ColumnKeyCreator;
exports.ColumnUtils = columnUtils_1.ColumnUtils;
exports.DisplayedGroupCreator = displayedGroupCreator_1.DisplayedGroupCreator;
exports.GroupInstanceIdCreator = groupInstanceIdCreator_1.GroupInstanceIdCreator;
// components
exports.ComponentUtil = componentUtil_1.ComponentUtil;
exports.initialiseAgGridWithAngular1 = agGridNg1_1.initialiseAgGridWithAngular1;
exports.initialiseAgGridWithWebComponents = agGridWebComponent_1.initialiseAgGridWithWebComponents;
// context
exports.Context = context_1.Context;
exports.Autowired = context_1.Autowired;
exports.PostConstruct = context_1.PostConstruct;
exports.PreDestroy = context_1.PreDestroy;
exports.Optional = context_1.Optional;
exports.Bean = context_1.Bean;
exports.Qualifier = context_1.Qualifier;
exports.Listener = componentAnnotations_1.Listener;
exports.QuerySelector = componentAnnotations_1.QuerySelector;
// dragAndDrop
exports.DragAndDropService = dragAndDropService_1.DragAndDropService;
exports.DragService = dragService_1.DragService;
// entities
exports.Column = column_1.Column;
exports.ColumnGroup = columnGroup_1.ColumnGroup;
exports.GridCell = gridCell_1.GridCell;
exports.GridRow = gridRow_1.GridRow;
exports.OriginalColumnGroup = originalColumnGroup_1.OriginalColumnGroup;
exports.RowNode = rowNode_1.RowNode;
// filter
exports.FilterManager = filterManager_1.FilterManager;
exports.NumberFilter = numberFilter_1.NumberFilter;
exports.TextFilter = textFilter_1.TextFilter;
// gridPanel
exports.GridPanel = gridPanel_1.GridPanel;
exports.MouseEventService = mouseEventService_1.MouseEventService;
// headerRendering
exports.CssClassApplier = cssClassApplier_1.CssClassApplier;
exports.HeaderContainer = headerContainer_1.HeaderContainer;
exports.HeaderRenderer = headerRenderer_1.HeaderRenderer;
exports.HeaderTemplateLoader = headerTemplateLoader_1.HeaderTemplateLoader;
exports.HorizontalDragService = horizontalDragService_1.HorizontalDragService;
exports.MoveColumnController = moveColumnController_1.MoveColumnController;
exports.RenderedHeaderCell = renderedHeaderCell_1.RenderedHeaderCell;
exports.RenderedHeaderGroupCell = renderedHeaderGroupCell_1.RenderedHeaderGroupCell;
exports.StandardMenuFactory = standardMenu_1.StandardMenuFactory;
// layout
exports.BorderLayout = borderLayout_1.BorderLayout;
exports.TabbedLayout = tabbedLayout_1.TabbedLayout;
exports.VerticalStack = verticalStack_1.VerticalStack;
// rendering / cellEditors
exports.DateCellEditor = dateCellEditor_1.DateCellEditor;
exports.PopupEditorWrapper = popupEditorWrapper_1.PopupEditorWrapper;
exports.PopupSelectCellEditor = popupSelectCellEditor_1.PopupSelectCellEditor;
exports.PopupTextCellEditor = popupTextCellEditor_1.PopupTextCellEditor;
exports.SelectCellEditor = selectCellEditor_1.SelectCellEditor;
exports.TextCellEditor = textCellEditor_1.TextCellEditor;
exports.LargeTextCellEditor = largeTextCellEditor_1.LargeTextCellEditor;
// rendering / cellRenderers
exports.AnimateSlideCellRenderer = animateSlideCellRenderer_1.AnimateSlideCellRenderer;
exports.GroupCellRenderer = groupCellRenderer_1.GroupCellRenderer;
// rendering
exports.AutoWidthCalculator = autoWidthCalculator_1.AutoWidthCalculator;
exports.CellEditorFactory = cellEditorFactory_1.CellEditorFactory;
exports.RenderedHeaderCell = renderedHeaderCell_1.RenderedHeaderCell;
exports.CellRendererFactory = cellRendererFactory_1.CellRendererFactory;
exports.CellRendererService = cellRendererService_1.CellRendererService;
exports.RenderedRow = renderedRow_1.RenderedRow;
exports.RowRenderer = rowRenderer_1.RowRenderer;
exports.ValueFormatterService = valueFormatterService_1.ValueFormatterService;
// rowControllers/inMemory
exports.FilterStage = filterStage_1.FilterStage;
exports.FlattenStage = flattenStage_1.FlattenStage;
exports.InMemoryRowModel = inMemoryRowModel_1.InMemoryRowModel;
exports.SortStage = sortStage_1.SortStage;
// rowControllers
exports.FloatingRowModel = floatingRowModel_1.FloatingRowModel;
exports.PaginationController = paginationController_1.PaginationController;
exports.VirtualPageRowModel = virtualPageRowModel_1.VirtualPageRowModel;
// widgets
exports.PopupService = popupService_1.PopupService;
exports.MenuItemComponent = menuItemComponent_1.MenuItemComponent;
exports.Component = component_1.Component;
exports.MenuList = menuList_1.MenuList;
exports.AgCheckbox = agCheckbox_1.AgCheckbox;
// root
exports.CellNavigationService = cellNavigationService_1.CellNavigationService;
exports.ColumnChangeEvent = columnChangeEvent_1.ColumnChangeEvent;
exports.Constants = constants_1.Constants;
exports.CsvCreator = csvCreator_1.CsvCreator;
exports.Events = events_1.Events;
exports.EventService = eventService_1.EventService;
exports.ExpressionService = expressionService_1.ExpressionService;
exports.FocusedCellController = focusedCellController_1.FocusedCellController;
exports.defaultGroupComparator = functions_1.defaultGroupComparator;
exports.Grid = grid_1.Grid;
exports.GridApi = gridApi_1.GridApi;
exports.GridCore = gridCore_1.GridCore;
exports.GridOptionsWrapper = gridOptionsWrapper_1.GridOptionsWrapper;
exports.Logger = logger_1.Logger;
exports.MasterSlaveService = masterSlaveService_1.MasterSlaveService;
exports.SelectionController = selectionController_1.SelectionController;
exports.CheckboxSelectionComponent = checkboxSelectionComponent_1.CheckboxSelectionComponent;
exports.SortController = sortController_1.SortController;
exports.SvgFactory = svgFactory_1.SvgFactory;
exports.TemplateService = templateService_1.TemplateService;
exports.Utils = utils_1.Utils;
exports.NumberSequence = utils_1.NumberSequence;
exports.ValueService = valueService_1.ValueService;
}
exports.populateClientExports = populateClientExports;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var gridOptionsWrapper_1 = __webpack_require__(3);
var paginationController_1 = __webpack_require__(41);
var floatingRowModel_1 = __webpack_require__(26);
var selectionController_1 = __webpack_require__(28);
var columnController_1 = __webpack_require__(13);
var rowRenderer_1 = __webpack_require__(23);
var headerRenderer_1 = __webpack_require__(68);
var filterManager_1 = __webpack_require__(43);
var valueService_1 = __webpack_require__(29);
var masterSlaveService_1 = __webpack_require__(25);
var eventService_1 = __webpack_require__(4);
var oldToolPanelDragAndDropService_1 = __webpack_require__(78);
var gridPanel_1 = __webpack_require__(24);
var gridApi_1 = __webpack_require__(11);
var headerTemplateLoader_1 = __webpack_require__(77);
var balancedColumnTreeBuilder_1 = __webpack_require__(19);
var displayedGroupCreator_1 = __webpack_require__(21);
var expressionService_1 = __webpack_require__(18);
var templateService_1 = __webpack_require__(36);
var popupService_1 = __webpack_require__(44);
var logger_1 = __webpack_require__(5);
var columnUtils_1 = __webpack_require__(16);
var autoWidthCalculator_1 = __webpack_require__(22);
var horizontalDragService_1 = __webpack_require__(74);
var context_1 = __webpack_require__(6);
var csvCreator_1 = __webpack_require__(12);
var gridCore_1 = __webpack_require__(40);
var standardMenu_1 = __webpack_require__(79);
var dragAndDropService_1 = __webpack_require__(70);
var dragService_1 = __webpack_require__(31);
var sortController_1 = __webpack_require__(42);
var focusedCellController_1 = __webpack_require__(35);
var mouseEventService_1 = __webpack_require__(32);
var cellNavigationService_1 = __webpack_require__(64);
var utils_1 = __webpack_require__(7);
var filterStage_1 = __webpack_require__(80);
var sortStage_1 = __webpack_require__(81);
var flattenStage_1 = __webpack_require__(82);
var focusService_1 = __webpack_require__(39);
var cellEditorFactory_1 = __webpack_require__(48);
var events_1 = __webpack_require__(10);
var virtualPageRowModel_1 = __webpack_require__(83);
var inMemoryRowModel_1 = __webpack_require__(84);
var cellRendererFactory_1 = __webpack_require__(55);
var cellRendererService_1 = __webpack_require__(60);
var valueFormatterService_1 = __webpack_require__(61);
var agCheckbox_1 = __webpack_require__(85);
var largeTextCellEditor_1 = __webpack_require__(87);
var Grid = (function () {
function Grid(eGridDiv, gridOptions, globalEventListener, $scope, $compile, quickFilterOnScope) {
if (globalEventListener === void 0) { globalEventListener = null; }
if ($scope === void 0) { $scope = null; }
if ($compile === void 0) { $compile = null; }
if (quickFilterOnScope === void 0) { quickFilterOnScope = null; }
if (!eGridDiv) {
console.error('ag-Grid: no div element provided to the grid');
}
if (!gridOptions) {
console.error('ag-Grid: no gridOptions provided to the grid');
}
var rowModelClass = this.getRowModelClass(gridOptions);
var enterprise = utils_1.Utils.exists(Grid.enterpriseBeans);
this.context = new context_1.Context({
overrideBeans: Grid.enterpriseBeans,
seed: {
enterprise: enterprise,
gridOptions: gridOptions,
eGridDiv: eGridDiv,
$scope: $scope,
$compile: $compile,
quickFilterOnScope: quickFilterOnScope,
globalEventListener: globalEventListener
},
beans: [rowModelClass, cellRendererFactory_1.CellRendererFactory, horizontalDragService_1.HorizontalDragService, headerTemplateLoader_1.HeaderTemplateLoader, floatingRowModel_1.FloatingRowModel, dragService_1.DragService,
displayedGroupCreator_1.DisplayedGroupCreator, eventService_1.EventService, gridOptionsWrapper_1.GridOptionsWrapper, selectionController_1.SelectionController,
filterManager_1.FilterManager, columnController_1.ColumnController, rowRenderer_1.RowRenderer,
headerRenderer_1.HeaderRenderer, expressionService_1.ExpressionService, balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder, csvCreator_1.CsvCreator,
templateService_1.TemplateService, gridPanel_1.GridPanel, popupService_1.PopupService, valueService_1.ValueService, masterSlaveService_1.MasterSlaveService,
logger_1.LoggerFactory, oldToolPanelDragAndDropService_1.OldToolPanelDragAndDropService, columnUtils_1.ColumnUtils, autoWidthCalculator_1.AutoWidthCalculator, gridApi_1.GridApi,
paginationController_1.PaginationController, popupService_1.PopupService, gridCore_1.GridCore, standardMenu_1.StandardMenuFactory,
dragAndDropService_1.DragAndDropService, sortController_1.SortController, columnController_1.ColumnApi, focusedCellController_1.FocusedCellController, mouseEventService_1.MouseEventService,
cellNavigationService_1.CellNavigationService, filterStage_1.FilterStage, sortStage_1.SortStage, flattenStage_1.FlattenStage, focusService_1.FocusService,
cellEditorFactory_1.CellEditorFactory, cellRendererService_1.CellRendererService, valueFormatterService_1.ValueFormatterService],
components: [agCheckbox_1.AgCheckbox],
debug: !!gridOptions.debug
});
this.context.getBean('cellEditorFactory').addCellEditor(Grid.LARGE_TEXT, largeTextCellEditor_1.LargeTextCellEditor);
var eventService = this.context.getBean('eventService');
var readyEvent = {
api: gridOptions.api,
columnApi: gridOptions.columnApi
};
eventService.dispatchEvent(events_1.Events.EVENT_GRID_READY, readyEvent);
}
Grid.setEnterpriseBeans = function (enterpriseBeans, rowModelClasses) {
this.enterpriseBeans = enterpriseBeans;
// the enterprise can inject additional row models. this is how it injects the viewportRowModel
utils_1.Utils.iterateObject(rowModelClasses, function (key, value) { return Grid.RowModelClasses[key] = value; });
};
Grid.prototype.getRowModelClass = function (gridOptions) {
var rowModelType = gridOptions.rowModelType;
if (utils_1.Utils.exists(rowModelType)) {
var rowModelClass = Grid.RowModelClasses[rowModelType];
if (utils_1.Utils.exists(rowModelClass)) {
return rowModelClass;
}
else {
console.error('ag-Grid: count not find matching row model for rowModelType ' + rowModelType);
if (rowModelType === 'viewport') {
console.error('ag-Grid: rowModelType viewport is only available in ag-Grid Enterprise');
}
}
}
return inMemoryRowModel_1.InMemoryRowModel;
};
;
Grid.prototype.destroy = function () {
this.context.destroy();
};
Grid.LARGE_TEXT = 'largeText';
// the default is InMemoryRowModel, which is also used for pagination.
// the enterprise adds viewport to this list.
Grid.RowModelClasses = {
virtual: virtualPageRowModel_1.VirtualPageRowModel,
pagination: inMemoryRowModel_1.InMemoryRowModel
};
return Grid;
})();
exports.Grid = Grid;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var eventService_1 = __webpack_require__(4);
var constants_1 = __webpack_require__(8);
var componentUtil_1 = __webpack_require__(9);
var gridApi_1 = __webpack_require__(11);
var context_1 = __webpack_require__(6);
var columnController_1 = __webpack_require__(13);
var events_1 = __webpack_require__(10);
var utils_1 = __webpack_require__(7);
var DEFAULT_ROW_HEIGHT = 25;
var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5;
var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5;
function isTrue(value) {
return value === true || value === 'true';
}
function positiveNumberOrZero(value, defaultValue) {
if (value > 0) {
return value;
}
else {
// zero gets returned if number is missing or the wrong type
return defaultValue;
}
}
var GridOptionsWrapper = (function () {
function GridOptionsWrapper() {
}
GridOptionsWrapper.prototype.agWire = function (gridApi, columnApi) {
this.headerHeight = this.gridOptions.headerHeight;
this.gridOptions.api = gridApi;
this.gridOptions.columnApi = columnApi;
this.checkForDeprecated();
};
GridOptionsWrapper.prototype.init = function () {
this.eventService.addGlobalListener(this.globalEventHandler.bind(this));
if (this.isGroupSelectsChildren() && this.isSuppressParentsInRowNodes()) {
console.warn('ag-Grid: groupSelectsChildren does not work wth suppressParentsInRowNodes, this selection method needs the part in rowNode to work');
}
if (this.isGroupSelectsChildren() && !this.isRowSelectionMulti()) {
console.warn('ag-Grid: rowSelectionMulti must be true for groupSelectsChildren to make sense');
}
};
GridOptionsWrapper.prototype.isEnterprise = function () { return this.enterprise; };
GridOptionsWrapper.prototype.isRowSelection = function () { return this.gridOptions.rowSelection === "single" || this.gridOptions.rowSelection === "multiple"; };
GridOptionsWrapper.prototype.isRowDeselection = function () { return isTrue(this.gridOptions.rowDeselection); };
GridOptionsWrapper.prototype.isRowSelectionMulti = function () { return this.gridOptions.rowSelection === 'multiple'; };
GridOptionsWrapper.prototype.getContext = function () { return this.gridOptions.context; };
GridOptionsWrapper.prototype.isPivotMode = function () { return isTrue(this.gridOptions.pivotMode); };
GridOptionsWrapper.prototype.isRowModelPagination = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_PAGINATION; };
GridOptionsWrapper.prototype.isRowModelVirtual = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_VIRTUAL; };
GridOptionsWrapper.prototype.isRowModelViewport = function () { return this.gridOptions.rowModelType === constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT; };
GridOptionsWrapper.prototype.isRowModelDefault = function () { return !(this.isRowModelPagination() || this.isRowModelVirtual() || this.isRowModelViewport()); };
GridOptionsWrapper.prototype.isShowToolPanel = function () { return isTrue(this.gridOptions.showToolPanel); };
GridOptionsWrapper.prototype.isToolPanelSuppressGroups = function () { return isTrue(this.gridOptions.toolPanelSuppressGroups); };
GridOptionsWrapper.prototype.isToolPanelSuppressValues = function () { return isTrue(this.gridOptions.toolPanelSuppressValues); };
GridOptionsWrapper.prototype.isEnableCellChangeFlash = function () { return isTrue(this.gridOptions.enableCellChangeFlash); };
GridOptionsWrapper.prototype.isGroupSelectsChildren = function () { return isTrue(this.gridOptions.groupSelectsChildren); };
GridOptionsWrapper.prototype.isGroupIncludeFooter = function () { return isTrue(this.gridOptions.groupIncludeFooter); };
GridOptionsWrapper.prototype.isGroupSuppressBlankHeader = function () { return isTrue(this.gridOptions.groupSuppressBlankHeader); };
GridOptionsWrapper.prototype.isSuppressRowClickSelection = function () { return isTrue(this.gridOptions.suppressRowClickSelection); };
GridOptionsWrapper.prototype.isSuppressCellSelection = function () { return isTrue(this.gridOptions.suppressCellSelection); };
GridOptionsWrapper.prototype.isSuppressMultiSort = function () { return isTrue(this.gridOptions.suppressMultiSort); };
GridOptionsWrapper.prototype.isGroupSuppressAutoColumn = function () { return isTrue(this.gridOptions.groupSuppressAutoColumn); };
GridOptionsWrapper.prototype.isSuppressDragLeaveHidesColumns = function () { return isTrue(this.gridOptions.suppressDragLeaveHidesColumns); };
GridOptionsWrapper.prototype.isForPrint = function () { return isTrue(this.gridOptions.forPrint); };
GridOptionsWrapper.prototype.isSuppressHorizontalScroll = function () { return isTrue(this.gridOptions.suppressHorizontalScroll); };
GridOptionsWrapper.prototype.isSuppressLoadingOverlay = function () { return isTrue(this.gridOptions.suppressLoadingOverlay); };
GridOptionsWrapper.prototype.isSuppressNoRowsOverlay = function () { return isTrue(this.gridOptions.suppressNoRowsOverlay); };
GridOptionsWrapper.prototype.isSuppressFieldDotNotation = function () { return isTrue(this.gridOptions.suppressFieldDotNotation); };
GridOptionsWrapper.prototype.getFloatingTopRowData = function () { return this.gridOptions.floatingTopRowData; };
GridOptionsWrapper.prototype.getFloatingBottomRowData = function () { return this.gridOptions.floatingBottomRowData; };
GridOptionsWrapper.prototype.getQuickFilterText = function () { return this.gridOptions.quickFilterText; };
GridOptionsWrapper.prototype.isUnSortIcon = function () { return isTrue(this.gridOptions.unSortIcon); };
GridOptionsWrapper.prototype.isSuppressMenuHide = function () { return isTrue(this.gridOptions.suppressMenuHide); };
GridOptionsWrapper.prototype.getRowStyle = function () { return this.gridOptions.rowStyle; };
GridOptionsWrapper.prototype.getRowClass = function () { return this.gridOptions.rowClass; };
GridOptionsWrapper.prototype.getRowStyleFunc = function () { return this.gridOptions.getRowStyle; };
GridOptionsWrapper.prototype.getRowClassFunc = function () { return this.gridOptions.getRowClass; };
GridOptionsWrapper.prototype.getBusinessKeyForNodeFunc = function () { return this.gridOptions.getBusinessKeyForNode; };
GridOptionsWrapper.prototype.getHeaderCellRenderer = function () { return this.gridOptions.headerCellRenderer; };
GridOptionsWrapper.prototype.getApi = function () { return this.gridOptions.api; };
GridOptionsWrapper.prototype.getColumnApi = function () { return this.gridOptions.columnApi; };
GridOptionsWrapper.prototype.isEnableColResize = function () { return isTrue(this.gridOptions.enableColResize); };
GridOptionsWrapper.prototype.isSingleClickEdit = function () { return isTrue(this.gridOptions.singleClickEdit); };
GridOptionsWrapper.prototype.getGroupDefaultExpanded = function () { return this.gridOptions.groupDefaultExpanded; };
GridOptionsWrapper.prototype.getRowData = function () { return this.gridOptions.rowData; };
GridOptionsWrapper.prototype.isGroupUseEntireRow = function () { return isTrue(this.gridOptions.groupUseEntireRow); };
GridOptionsWrapper.prototype.getGroupColumnDef = function () { return this.gridOptions.groupColumnDef; };
GridOptionsWrapper.prototype.isGroupSuppressRow = function () { return isTrue(this.gridOptions.groupSuppressRow); };
GridOptionsWrapper.prototype.getRowGroupPanelShow = function () { return this.gridOptions.rowGroupPanelShow; };
GridOptionsWrapper.prototype.isAngularCompileRows = function () { return isTrue(this.gridOptions.angularCompileRows); };
GridOptionsWrapper.prototype.isAngularCompileFilters = function () { return isTrue(this.gridOptions.angularCompileFilters); };
GridOptionsWrapper.prototype.isAngularCompileHeaders = function () { return isTrue(this.gridOptions.angularCompileHeaders); };
GridOptionsWrapper.prototype.isDebug = function () { return isTrue(this.gridOptions.debug); };
GridOptionsWrapper.prototype.getColumnDefs = function () { return this.gridOptions.columnDefs; };
GridOptionsWrapper.prototype.getDatasource = function () { return this.gridOptions.datasource; };
GridOptionsWrapper.prototype.getViewportDatasource = function () { return this.gridOptions.viewportDatasource; };
GridOptionsWrapper.prototype.isEnableSorting = function () { return isTrue(this.gridOptions.enableSorting) || isTrue(this.gridOptions.enableServerSideSorting); };
GridOptionsWrapper.prototype.isEnableCellExpressions = function () { return isTrue(this.gridOptions.enableCellExpressions); };
GridOptionsWrapper.prototype.isSuppressMiddleClickScrolls = function () { return isTrue(this.gridOptions.suppressMiddleClickScrolls); };
GridOptionsWrapper.prototype.isSuppressPreventDefaultOnMouseWheel = function () { return isTrue(this.gridOptions.suppressPreventDefaultOnMouseWheel); };
GridOptionsWrapper.prototype.isEnableServerSideSorting = function () { return isTrue(this.gridOptions.enableServerSideSorting); };
GridOptionsWrapper.prototype.isSuppressColumnVirtualisation = function () { return isTrue(this.gridOptions.suppressColumnVirtualisation); };
GridOptionsWrapper.prototype.isSuppressContextMenu = function () { return isTrue(this.gridOptions.suppressContextMenu); };
GridOptionsWrapper.prototype.isSuppressCopyRowsToClipboard = function () { return isTrue(this.gridOptions.suppressCopyRowsToClipboard); };
GridOptionsWrapper.prototype.isEnableFilter = function () { return isTrue(this.gridOptions.enableFilter) || isTrue(this.gridOptions.enableServerSideFilter); };
GridOptionsWrapper.prototype.isEnableServerSideFilter = function () { return this.gridOptions.enableServerSideFilter; };
GridOptionsWrapper.prototype.isSuppressScrollLag = function () { return isTrue(this.gridOptions.suppressScrollLag); };
GridOptionsWrapper.prototype.isSuppressMovableColumns = function () { return isTrue(this.gridOptions.suppressMovableColumns); };
GridOptionsWrapper.prototype.isSuppressColumnMoveAnimation = function () { return isTrue(this.gridOptions.suppressColumnMoveAnimation); };
GridOptionsWrapper.prototype.isSuppressMenuColumnPanel = function () { return isTrue(this.gridOptions.suppressMenuColumnPanel); };
GridOptionsWrapper.prototype.isSuppressMenuFilterPanel = function () { return isTrue(this.gridOptions.suppressMenuFilterPanel); };
GridOptionsWrapper.prototype.isSuppressUseColIdForGroups = function () { return isTrue(this.gridOptions.suppressUseColIdForGroups); };
GridOptionsWrapper.prototype.isSuppressAggFuncInHeader = function () { return isTrue(this.gridOptions.suppressAggFuncInHeader); };
GridOptionsWrapper.prototype.isSuppressMenuMainPanel = function () { return isTrue(this.gridOptions.suppressMenuMainPanel); };
GridOptionsWrapper.prototype.isEnableRangeSelection = function () { return isTrue(this.gridOptions.enableRangeSelection); };
GridOptionsWrapper.prototype.isRememberGroupStateWhenNewData = function () { return isTrue(this.gridOptions.rememberGroupStateWhenNewData); };
GridOptionsWrapper.prototype.getIcons = function () { return this.gridOptions.icons; };
GridOptionsWrapper.prototype.getAggFuncs = function () { return this.gridOptions.aggFuncs; };
GridOptionsWrapper.prototype.getIsScrollLag = function () { return this.gridOptions.isScrollLag; };
GridOptionsWrapper.prototype.getSortingOrder = function () { return this.gridOptions.sortingOrder; };
GridOptionsWrapper.prototype.getSlaveGrids = function () { return this.gridOptions.slaveGrids; };
GridOptionsWrapper.prototype.getGroupRowRenderer = function () { return this.gridOptions.groupRowRenderer; };
GridOptionsWrapper.prototype.getGroupRowRendererParams = function () { return this.gridOptions.groupRowRendererParams; };
GridOptionsWrapper.prototype.getGroupRowInnerRenderer = function () { return this.gridOptions.groupRowInnerRenderer; };
GridOptionsWrapper.prototype.getOverlayLoadingTemplate = function () { return this.gridOptions.overlayLoadingTemplate; };
GridOptionsWrapper.prototype.getOverlayNoRowsTemplate = function () { return this.gridOptions.overlayNoRowsTemplate; };
GridOptionsWrapper.prototype.getCheckboxSelection = function () { return this.gridOptions.checkboxSelection; };
GridOptionsWrapper.prototype.isSuppressAutoSize = function () { return isTrue(this.gridOptions.suppressAutoSize); };
GridOptionsWrapper.prototype.isSuppressParentsInRowNodes = function () { return isTrue(this.gridOptions.suppressParentsInRowNodes); };
GridOptionsWrapper.prototype.isEnableStatusBar = function () { return isTrue(this.gridOptions.enableStatusBar); };
GridOptionsWrapper.prototype.getHeaderCellTemplate = function () { return this.gridOptions.headerCellTemplate; };
GridOptionsWrapper.prototype.getHeaderCellTemplateFunc = function () { return this.gridOptions.getHeaderCellTemplate; };
GridOptionsWrapper.prototype.getNodeChildDetailsFunc = function () { return this.gridOptions.getNodeChildDetails; };
GridOptionsWrapper.prototype.getGroupRowAggNodesFunc = function () { return this.gridOptions.groupRowAggNodes; };
GridOptionsWrapper.prototype.getContextMenuItemsFunc = function () { return this.gridOptions.getContextMenuItems; };
GridOptionsWrapper.prototype.getMainMenuItemsFunc = function () { return this.gridOptions.getMainMenuItems; };
GridOptionsWrapper.prototype.getProcessCellForClipboardFunc = function () { return this.gridOptions.processCellForClipboard; };
GridOptionsWrapper.prototype.getViewportRowModelPageSize = function () { return positiveNumberOrZero(this.gridOptions.viewportRowModelPageSize, DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE); };
GridOptionsWrapper.prototype.getViewportRowModelBufferSize = function () { return positiveNumberOrZero(this.gridOptions.viewportRowModelBufferSize, DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE); };
// public getCellRenderers(): {[key: string]: {new(): ICellRenderer} | ICellRendererFunc} { return this.gridOptions.cellRenderers; }
// public getCellEditors(): {[key: string]: {new(): ICellEditor}} { return this.gridOptions.cellEditors; }
GridOptionsWrapper.prototype.executeProcessRowPostCreateFunc = function (params) {
if (this.gridOptions.processRowPostCreate) {
this.gridOptions.processRowPostCreate(params);
}
};
// properties
GridOptionsWrapper.prototype.getHeaderHeight = function () {
if (typeof this.headerHeight === 'number') {
return this.headerHeight;
}
else {
return 25;
}
};
GridOptionsWrapper.prototype.setHeaderHeight = function (headerHeight) {
this.headerHeight = headerHeight;
this.eventService.dispatchEvent(events_1.Events.EVENT_HEADER_HEIGHT_CHANGED);
};
GridOptionsWrapper.prototype.isExternalFilterPresent = function () {
if (typeof this.gridOptions.isExternalFilterPresent === 'function') {
return this.gridOptions.isExternalFilterPresent();
}
else {
return false;
}
};
GridOptionsWrapper.prototype.doesExternalFilterPass = function (node) {
if (typeof this.gridOptions.doesExternalFilterPass === 'function') {
return this.gridOptions.doesExternalFilterPass(node);
}
else {
return false;
}
};
GridOptionsWrapper.prototype.getLayoutInterval = function () {
if (typeof this.gridOptions.layoutInterval === 'number') {
return this.gridOptions.layoutInterval;
}
else {
return constants_1.Constants.LAYOUT_INTERVAL;
}
};
GridOptionsWrapper.prototype.getMinColWidth = function () {
if (this.gridOptions.minColWidth > GridOptionsWrapper.MIN_COL_WIDTH) {
return this.gridOptions.minColWidth;
}
else {
return GridOptionsWrapper.MIN_COL_WIDTH;
}
};
GridOptionsWrapper.prototype.getMaxColWidth = function () {
if (this.gridOptions.maxColWidth > GridOptionsWrapper.MIN_COL_WIDTH) {
return this.gridOptions.maxColWidth;
}
else {
return null;
}
};
GridOptionsWrapper.prototype.getColWidth = function () {
if (typeof this.gridOptions.colWidth !== 'number' || this.gridOptions.colWidth < GridOptionsWrapper.MIN_COL_WIDTH) {
return 200;
}
else {
return this.gridOptions.colWidth;
}
};
GridOptionsWrapper.prototype.getRowBuffer = function () {
if (typeof this.gridOptions.rowBuffer === 'number') {
if (this.gridOptions.rowBuffer < 0) {
console.warn('ag-Grid: rowBuffer should not be negative');
}
return this.gridOptions.rowBuffer;
}
else {
return constants_1.Constants.ROW_BUFFER_SIZE;
}
};
GridOptionsWrapper.prototype.checkForDeprecated = function () {
// casting to generic object, so typescript compiles even though
// we are looking for attributes that don't exist
var options = this.gridOptions;
if (options.suppressUnSort) {
console.warn('ag-grid: as of v1.12.4 suppressUnSort is not used. Please use sortOrder instead.');
}
if (options.suppressDescSort) {
console.warn('ag-grid: as of v1.12.4 suppressDescSort is not used. Please use sortOrder instead.');
}
if (options.groupAggFields) {
console.warn('ag-grid: as of v3 groupAggFields is not used. Please add appropriate agg fields to your columns.');
}
if (options.groupHidePivotColumns) {
console.warn('ag-grid: as of v3 groupHidePivotColumns is not used as pivot columns are now called rowGroup columns. Please refer to the documentation');
}
if (options.groupKeys) {
console.warn('ag-grid: as of v3 groupKeys is not used. You need to set rowGroupIndex on the columns to group. Please refer to the documentation');
}
if (options.ready || options.onReady) {
console.warn('ag-grid: as of v3.3 ready event is now called gridReady, so the callback should be onGridReady');
}
if (typeof options.groupDefaultExpanded === 'boolean') {
console.warn('ag-grid: groupDefaultExpanded can no longer be boolean. for groupDefaultExpanded=true, use groupDefaultExpanded=9999 instead, to expand all the groups');
}
if (options.onRowDeselected || options.rowDeselected) {
console.warn('ag-grid: since version 3.4 event rowDeselected no longer exists, please check the docs');
}
if (options.rowsAlreadyGrouped) {
console.warn('ag-grid: since version 3.4 rowsAlreadyGrouped no longer exists, please use getNodeChildDetails() instead');
}
if (options.groupAggFunction) {
console.warn('ag-grid: since version 4.3.x groupAggFunction is now called groupRowAggNodes');
}
};
GridOptionsWrapper.prototype.getLocaleTextFunc = function () {
if (this.gridOptions.localeTextFunc) {
return this.gridOptions.localeTextFunc;
}
var that = this;
return function (key, defaultValue) {
var localeText = that.gridOptions.localeText;
if (localeText && localeText[key]) {
return localeText[key];
}
else {
return defaultValue;
}
};
};
// responsible for calling the onXXX functions on gridOptions
GridOptionsWrapper.prototype.globalEventHandler = function (eventName, event) {
var callbackMethodName = componentUtil_1.ComponentUtil.getCallbackForEvent(eventName);
if (typeof this.gridOptions[callbackMethodName] === 'function') {
this.gridOptions[callbackMethodName](event);
}
};
// we don't allow dynamic row height for virtual paging
GridOptionsWrapper.prototype.getRowHeightAsNumber = function () {
var rowHeight = this.gridOptions.rowHeight;
if (utils_1.Utils.missing(rowHeight)) {
return DEFAULT_ROW_HEIGHT;
}
else if (typeof this.gridOptions.rowHeight === 'number') {
return this.gridOptions.rowHeight;
}
else {
console.warn('ag-Grid row height must be a number if not using standard row model');
return DEFAULT_ROW_HEIGHT;
}
};
GridOptionsWrapper.prototype.getRowHeightForNode = function (rowNode) {
if (typeof this.gridOptions.rowHeight === 'number') {
return this.gridOptions.rowHeight;
}
else if (typeof this.gridOptions.getRowHeight === 'function') {
var params = {
node: rowNode,
data: rowNode.data,
api: this.gridOptions.api,
context: this.gridOptions.context
};
return this.gridOptions.getRowHeight(params);
}
else {
return DEFAULT_ROW_HEIGHT;
}
};
GridOptionsWrapper.MIN_COL_WIDTH = 10;
__decorate([
context_1.Autowired('gridOptions'),
__metadata('design:type', Object)
], GridOptionsWrapper.prototype, "gridOptions", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], GridOptionsWrapper.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], GridOptionsWrapper.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('enterprise'),
__metadata('design:type', Boolean)
], GridOptionsWrapper.prototype, "enterprise", void 0);
__decorate([
__param(0, context_1.Qualifier('gridApi')),
__param(1, context_1.Qualifier('columnApi')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [gridApi_1.GridApi, columnController_1.ColumnApi]),
__metadata('design:returntype', void 0)
], GridOptionsWrapper.prototype, "agWire", null);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridOptionsWrapper.prototype, "init", null);
GridOptionsWrapper = __decorate([
context_1.Bean('gridOptionsWrapper'),
__metadata('design:paramtypes', [])
], GridOptionsWrapper);
return GridOptionsWrapper;
})();
exports.GridOptionsWrapper = GridOptionsWrapper;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var logger_1 = __webpack_require__(5);
var utils_1 = __webpack_require__(7);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var EventService = (function () {
function EventService() {
this.allListeners = {};
this.globalListeners = [];
}
EventService.prototype.agWire = function (loggerFactory, globalEventListener) {
if (globalEventListener === void 0) { globalEventListener = null; }
this.logger = loggerFactory.create('EventService');
if (globalEventListener) {
this.addGlobalListener(globalEventListener);
}
};
EventService.prototype.getListenerList = function (eventType) {
var listenerList = this.allListeners[eventType];
if (!listenerList) {
listenerList = [];
this.allListeners[eventType] = listenerList;
}
return listenerList;
};
EventService.prototype.addEventListener = function (eventType, listener) {
var listenerList = this.getListenerList(eventType);
if (listenerList.indexOf(listener) < 0) {
listenerList.push(listener);
}
};
// for some events, it's important that the model gets to hear about them before the view,
// as the model may need to update before the view works on the info. if you register
// via this method, you get notified before the view parts
EventService.prototype.addModalPriorityEventListener = function (eventType, listener) {
this.addEventListener(eventType + EventService.PRIORITY, listener);
};
EventService.prototype.addGlobalListener = function (listener) {
this.globalListeners.push(listener);
};
EventService.prototype.removeEventListener = function (eventType, listener) {
var listenerList = this.getListenerList(eventType);
utils_1.Utils.removeFromArray(listenerList, listener);
};
EventService.prototype.removeGlobalListener = function (listener) {
utils_1.Utils.removeFromArray(this.globalListeners, listener);
};
// why do we pass the type here? the type is in ColumnChangeEvent, so unless the
// type is not in other types of events???
EventService.prototype.dispatchEvent = function (eventType, event) {
if (!event) {
event = {};
}
//this.logger.log('dispatching: ' + event);
// this allows the columnController to get events before anyone else
var p1ListenerList = this.getListenerList(eventType + EventService.PRIORITY);
p1ListenerList.forEach(function (listener) {
listener(event);
});
var listenerList = this.getListenerList(eventType);
listenerList.forEach(function (listener) {
listener(event);
});
this.globalListeners.forEach(function (listener) {
listener(eventType, event);
});
};
EventService.PRIORITY = '-P1';
__decorate([
__param(0, context_2.Qualifier('loggerFactory')),
__param(1, context_2.Qualifier('globalEventListener')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory, Function]),
__metadata('design:returntype', void 0)
], EventService.prototype, "agWire", null);
EventService = __decorate([
context_1.Bean('eventService'),
__metadata('design:paramtypes', [])
], EventService);
return EventService;
})();
exports.EventService = EventService;
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var LoggerFactory = (function () {
function LoggerFactory() {
}
LoggerFactory.prototype.setBeans = function (gridOptionsWrapper) {
this.logging = gridOptionsWrapper.isDebug();
};
LoggerFactory.prototype.create = function (name) {
return new Logger(name, this.logging);
};
__decorate([
__param(0, context_2.Qualifier('gridOptionsWrapper')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [gridOptionsWrapper_1.GridOptionsWrapper]),
__metadata('design:returntype', void 0)
], LoggerFactory.prototype, "setBeans", null);
LoggerFactory = __decorate([
context_1.Bean('loggerFactory'),
__metadata('design:paramtypes', [])
], LoggerFactory);
return LoggerFactory;
})();
exports.LoggerFactory = LoggerFactory;
var Logger = (function () {
function Logger(name, logging) {
this.name = name;
this.logging = logging;
}
Logger.prototype.log = function (message) {
if (this.logging) {
console.log('ag-Grid.' + this.name + ': ' + message);
}
};
return Logger;
})();
exports.Logger = Logger;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var logger_1 = __webpack_require__(5);
var Context = (function () {
function Context(params) {
this.beans = {};
this.componentsMappedByName = {};
this.destroyed = false;
if (!params || !params.beans) {
return;
}
this.contextParams = params;
this.logger = new logger_1.Logger('Context', this.contextParams.debug);
this.logger.log('>> creating ag-Application Context');
this.setupComponents();
this.createBeans();
var beans = utils_1.Utils.mapObject(this.beans, function (beanEntry) { return beanEntry.beanInstance; });
this.wireBeans(beans);
this.logger.log('>> ag-Application Context ready - component is alive');
}
Context.prototype.setupComponents = function () {
var _this = this;
if (this.contextParams.components) {
this.contextParams.components.forEach(function (ComponentClass) { return _this.addComponent(ComponentClass); });
}
};
Context.prototype.addComponent = function (ComponentClass) {
// get name of the class as a string
var className = utils_1.Utils.getNameOfClass(ComponentClass);
// insert a dash after every capital letter
// var classEscaped = className.replace(/([A-Z])/g, "-$1").toLowerCase();
var classEscaped = className.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
// put all to upper case
var classUpperCase = classEscaped.toUpperCase();
// finally store
this.componentsMappedByName[classUpperCase] = ComponentClass;
};
Context.prototype.createComponent = function (element) {
var key = element.nodeName;
if (this.componentsMappedByName && this.componentsMappedByName[key]) {
var newComponent = new this.componentsMappedByName[key];
this.copyAttributesFromNode(element, newComponent.getGui());
this.wireBean(newComponent);
return newComponent;
}
else {
return null;
}
};
Context.prototype.copyAttributesFromNode = function (fromNode, toNode) {
if (fromNode.attributes) {
var count = fromNode.attributes.length;
for (var i = 0; i < count; i++) {
var attr = fromNode.attributes[i];
toNode.setAttribute(attr.name, attr.value);
}
}
};
Context.prototype.wireBean = function (bean) {
this.wireBeans([bean]);
};
Context.prototype.wireBeans = function (beans) {
this.autoWireBeans(beans);
this.methodWireBeans(beans);
this.postConstruct(beans);
};
Context.prototype.createBeans = function () {
var _this = this;
// register all normal beans
this.contextParams.beans.forEach(this.createBeanEntry.bind(this));
// register override beans, these will overwrite beans above of same name
if (this.contextParams.overrideBeans) {
this.contextParams.overrideBeans.forEach(this.createBeanEntry.bind(this));
}
// instantiate all beans - overridden beans will be left out
utils_1.Utils.iterateObject(this.beans, function (key, beanEntry) {
var constructorParamsMeta;
if (beanEntry.bean.prototype.__agBeanMetaData
&& beanEntry.bean.prototype.__agBeanMetaData.autowireMethods
&& beanEntry.bean.prototype.__agBeanMetaData.autowireMethods.agConstructor) {
constructorParamsMeta = beanEntry.bean.prototype.__agBeanMetaData.autowireMethods.agConstructor;
}
var constructorParams = _this.getBeansForParameters(constructorParamsMeta, beanEntry.beanName);
var newInstance = applyToConstructor(beanEntry.bean, constructorParams);
beanEntry.beanInstance = newInstance;
_this.logger.log('bean ' + _this.getBeanName(newInstance) + ' created');
});
};
Context.prototype.createBeanEntry = function (Bean) {
var metaData = Bean.prototype.__agBeanMetaData;
if (!metaData) {
var beanName;
if (Bean.prototype.constructor) {
beanName = Bean.prototype.constructor.name;
}
else {
beanName = '' + Bean;
}
console.error('context item ' + beanName + ' is not a bean');
return;
}
var beanEntry = {
bean: Bean,
beanInstance: null,
beanName: metaData.beanName
};
this.beans[metaData.beanName] = beanEntry;
};
Context.prototype.autoWireBeans = function (beans) {
var _this = this;
beans.forEach(function (bean) { return _this.autoWireBean(bean); });
};
Context.prototype.methodWireBeans = function (beans) {
var _this = this;
beans.forEach(function (bean) { return _this.methodWireBean(bean); });
};
Context.prototype.autoWireBean = function (bean) {
var _this = this;
if (!bean
|| !bean.__agBeanMetaData
|| !bean.__agBeanMetaData.agClassAttributes) {
return;
}
var attributes = bean.__agBeanMetaData.agClassAttributes;
if (!attributes) {
return;
}
var beanName = this.getBeanName(bean);
attributes.forEach(function (attribute) {
var otherBean = _this.lookupBeanInstance(beanName, attribute.beanName, attribute.optional);
bean[attribute.attributeName] = otherBean;
});
};
Context.prototype.getBeanName = function (bean) {
var constructorString = bean.constructor.toString();
var beanName = constructorString.substring(9, constructorString.indexOf('('));
return beanName;
};
Context.prototype.methodWireBean = function (bean) {
var _this = this;
var autowiredMethods;
if (bean.__agBeanMetaData) {
autowiredMethods = bean.__agBeanMetaData.autowireMethods;
}
utils_1.Utils.iterateObject(autowiredMethods, function (methodName, wireParams) {
// skip constructor, as this is dealt with elsewhere
if (methodName === 'agConstructor') {
return;
}
var beanName = _this.getBeanName(bean);
var initParams = _this.getBeansForParameters(wireParams, beanName);
bean[methodName].apply(bean, initParams);
});
};
Context.prototype.getBeansForParameters = function (parameters, beanName) {
var _this = this;
var beansList = [];
if (parameters) {
utils_1.Utils.iterateObject(parameters, function (paramIndex, otherBeanName) {
var otherBean = _this.lookupBeanInstance(beanName, otherBeanName);
beansList[Number(paramIndex)] = otherBean;
});
}
return beansList;
};
Context.prototype.lookupBeanInstance = function (wiringBean, beanName, optional) {
if (optional === void 0) { optional = false; }
if (beanName === 'context') {
return this;
}
else if (this.contextParams.seed && this.contextParams.seed.hasOwnProperty(beanName)) {
return this.contextParams.seed[beanName];
}
else {
var beanEntry = this.beans[beanName];
if (beanEntry) {
return beanEntry.beanInstance;
}
if (!optional) {
console.error('ag-Grid: unable to find bean reference ' + beanName + ' while initialising ' + wiringBean);
}
return null;
}
};
Context.prototype.postConstruct = function (beans) {
beans.forEach(function (bean) {
// try calling init methods
if (bean.__agBeanMetaData && bean.__agBeanMetaData.postConstructMethods) {
bean.__agBeanMetaData.postConstructMethods.forEach(function (methodName) { return bean[methodName](); });
}
});
};
Context.prototype.getBean = function (name) {
return this.lookupBeanInstance('getBean', name, true);
};
Context.prototype.destroy = function () {
// should only be able to destroy once
if (this.destroyed) {
return;
}
this.logger.log('>> Shutting down ag-Application Context');
// try calling destroy methods
utils_1.Utils.iterateObject(this.beans, function (key, beanEntry) {
var bean = beanEntry.beanInstance;
if (bean.__agBeanMetaData && bean.__agBeanMetaData.preDestroyMethods) {
bean.__agBeanMetaData.preDestroyMethods.forEach(function (methodName) { return bean[methodName](); });
}
});
this.destroyed = true;
this.logger.log('>> ag-Application Context shut down - component is dead');
};
return Context;
})();
exports.Context = Context;
// taken from: http://stackoverflow.com/questions/3362471/how-can-i-call-a-javascript-constructor-using-call-or-apply
// allows calling 'apply' on a constructor
function applyToConstructor(constructor, argArray) {
var args = [null].concat(argArray);
var factoryFunction = constructor.bind.apply(constructor, args);
return new factoryFunction();
}
function PostConstruct(target, methodName, descriptor) {
var props = getOrCreateProps(target);
if (!props.postConstructMethods) {
props.postConstructMethods = [];
}
props.postConstructMethods.push(methodName);
}
exports.PostConstruct = PostConstruct;
function PreDestroy(target, methodName, descriptor) {
var props = getOrCreateProps(target);
if (!props.preDestroyMethods) {
props.preDestroyMethods = [];
}
props.preDestroyMethods.push(methodName);
}
exports.PreDestroy = PreDestroy;
function Bean(beanName) {
return function (classConstructor) {
var props = getOrCreateProps(classConstructor.prototype);
props.beanName = beanName;
};
}
exports.Bean = Bean;
function Autowired(name) {
return autowiredFunc.bind(this, name, false);
}
exports.Autowired = Autowired;
function Optional(name) {
return autowiredFunc.bind(this, name, true);
}
exports.Optional = Optional;
function autowiredFunc(name, optional, classPrototype, methodOrAttributeName, index) {
if (name === null) {
console.error('ag-Grid: Autowired name should not be null');
return;
}
if (typeof index === 'number') {
console.error('ag-Grid: Autowired should be on an attribute');
return;
}
// it's an attribute on the class
var props = getOrCreateProps(classPrototype);
if (!props.agClassAttributes) {
props.agClassAttributes = [];
}
props.agClassAttributes.push({
attributeName: methodOrAttributeName,
beanName: name,
optional: optional
});
}
function Qualifier(name) {
return function (classPrototype, methodOrAttributeName, index) {
var props;
if (typeof index === 'number') {
// it's a parameter on a method
var methodName;
if (methodOrAttributeName) {
props = getOrCreateProps(classPrototype);
methodName = methodOrAttributeName;
}
else {
props = getOrCreateProps(classPrototype.prototype);
methodName = 'agConstructor';
}
if (!props.autowireMethods) {
props.autowireMethods = {};
}
if (!props.autowireMethods[methodName]) {
props.autowireMethods[methodName] = {};
}
props.autowireMethods[methodName][index] = name;
}
};
}
exports.Qualifier = Qualifier;
function getOrCreateProps(target) {
var props = target.__agBeanMetaData;
if (!props) {
props = {};
target.__agBeanMetaData = props;
}
return props;
}
/***/ },
/* 7 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var FUNCTION_STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var FUNCTION_ARGUMENT_NAMES = /([^\s,]+)/g;
// util class, only used when debugging, for printing time to console
var Timer = (function () {
function Timer() {
this.timestamp = new Date().getTime();
}
Timer.prototype.print = function (msg) {
var duration = (new Date().getTime()) - this.timestamp;
console.log(msg + " = " + duration);
this.timestamp = new Date().getTime();
};
return Timer;
})();
exports.Timer = Timer;
var Utils = (function () {
function Utils() {
}
Utils.getNameOfClass = function (TheClass) {
var funcNameRegex = /function (.{1,})\(/;
var funcAsString = TheClass.toString();
var results = (funcNameRegex).exec(funcAsString);
return (results && results.length > 1) ? results[1] : "";
};
Utils.iterateObject = function (object, callback) {
if (this.missing(object)) {
return;
}
var keys = Object.keys(object);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = object[key];
callback(key, value);
}
};
Utils.cloneObject = function (object) {
var copy = {};
var keys = Object.keys(object);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = object[key];
copy[key] = value;
}
return copy;
};
Utils.map = function (array, callback) {
var result = [];
for (var i = 0; i < array.length; i++) {
var item = array[i];
var mappedItem = callback(item);
result.push(mappedItem);
}
return result;
};
Utils.mapObject = function (object, callback) {
var result = [];
Utils.iterateObject(object, function (key, value) {
result.push(callback(value));
});
return result;
};
Utils.forEach = function (array, callback) {
if (!array) {
return;
}
for (var i = 0; i < array.length; i++) {
var value = array[i];
callback(value, i);
}
};
Utils.filter = function (array, callback) {
var result = [];
array.forEach(function (item) {
if (callback(item)) {
result.push(item);
}
});
return result;
};
Utils.assign = function (object, source) {
if (this.exists(source)) {
this.iterateObject(source, function (key, value) {
object[key] = value;
});
}
};
Utils.getFunctionParameters = function (func) {
var fnStr = func.toString().replace(FUNCTION_STRIP_COMMENTS, '');
var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(FUNCTION_ARGUMENT_NAMES);
if (result === null) {
return [];
}
else {
return result;
}
};
Utils.find = function (collection, predicate, value) {
if (collection === null || collection === undefined) {
return null;
}
var firstMatchingItem;
for (var i = 0; i < collection.length; i++) {
var item = collection[i];
if (typeof predicate === 'string') {
if (item[predicate] === value) {
firstMatchingItem = item;
break;
}
}
else {
var callback = predicate;
if (callback(item)) {
firstMatchingItem = item;
break;
}
}
}
return firstMatchingItem;
};
Utils.toStrings = function (array) {
return this.map(array, function (item) {
if (item === undefined || item === null || !item.toString) {
return null;
}
else {
return item.toString();
}
});
};
Utils.iterateArray = function (array, callback) {
for (var index = 0; index < array.length; index++) {
var value = array[index];
callback(value, index);
}
};
//Returns true if it is a DOM node
//taken from: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
Utils.isNode = function (o) {
return (typeof Node === "function" ? o instanceof Node :
o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
};
//Returns true if it is a DOM element
//taken from: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
Utils.isElement = function (o) {
return (typeof HTMLElement === "function" ? o instanceof HTMLElement :
o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName === "string");
};
Utils.isNodeOrElement = function (o) {
return this.isNode(o) || this.isElement(o);
};
//adds all type of change listeners to an element, intended to be a text field
Utils.addChangeListener = function (element, listener) {
element.addEventListener("changed", listener);
element.addEventListener("paste", listener);
element.addEventListener("input", listener);
// IE doesn't fire changed for special keys (eg delete, backspace), so need to
// listen for this further ones
element.addEventListener("keydown", listener);
element.addEventListener("keyup", listener);
};
//if value is undefined, null or blank, returns null, otherwise returns the value
Utils.makeNull = function (value) {
if (value === null || value === undefined || value === "") {
return null;
}
else {
return value;
}
};
Utils.missing = function (value) {
return !this.exists(value);
};
Utils.missingOrEmpty = function (value) {
return this.missing(value) || value.length === 0;
};
Utils.exists = function (value) {
if (value === null || value === undefined || value === '') {
return false;
}
else {
return true;
}
};
Utils.existsAndNotEmpty = function (value) {
return this.exists(value) && value.length > 0;
};
Utils.removeAllChildren = function (node) {
if (node) {
while (node.hasChildNodes()) {
node.removeChild(node.lastChild);
}
}
};
Utils.removeElement = function (parent, cssSelector) {
this.removeFromParent(parent.querySelector(cssSelector));
};
Utils.removeFromParent = function (node) {
if (node && node.parentNode) {
node.parentNode.removeChild(node);
}
};
Utils.isVisible = function (element) {
return (element.offsetParent !== null);
};
/**
* loads the template and returns it as an element. makes up for no simple way in
* the dom api to load html directly, eg we cannot do this: document.createElement(template)
*/
Utils.loadTemplate = function (template) {
var tempDiv = document.createElement("div");
tempDiv.innerHTML = template;
return tempDiv.firstChild;
};
Utils.addOrRemoveCssClass = function (element, className, addOrRemove) {
if (addOrRemove) {
this.addCssClass(element, className);
}
else {
this.removeCssClass(element, className);
}
};
Utils.callIfPresent = function (func) {
if (func) {
func();
}
};
Utils.addCssClass = function (element, className) {
var _this = this;
if (!className || className.length === 0) {
return;
}
if (className.indexOf(' ') >= 0) {
className.split(' ').forEach(function (value) { return _this.addCssClass(element, value); });
return;
}
if (element.classList) {
element.classList.add(className);
}
else {
if (element.className && element.className.length > 0) {
var cssClasses = element.className.split(' ');
if (cssClasses.indexOf(className) < 0) {
cssClasses.push(className);
element.className = cssClasses.join(' ');
}
}
else {
element.className = className;
}
}
};
Utils.containsClass = function (element, className) {
if (element.classList) {
// for modern browsers
return element.classList.contains(className);
}
else if (element.className) {
// for older browsers, check against the string of class names
// if only one class, can check for exact match
var onlyClass = element.className === className;
// if many classes, check for class name, we have to pad with ' ' to stop other
// class names that are a substring of this class
var contains = element.className.indexOf(' ' + className + ' ') >= 0;
// the padding above then breaks when it's the first or last class names
var startsWithClass = element.className.indexOf(className + ' ') === 0;
var endsWithClass = element.className.lastIndexOf(' ' + className) === (element.className.length - className.length - 1);
return onlyClass || contains || startsWithClass || endsWithClass;
}
else {
// if item is not a node
return false;
}
};
Utils.getElementAttribute = function (element, attributeName) {
if (element.attributes) {
if (element.attributes[attributeName]) {
var attribute = element.attributes[attributeName];
return attribute.value;
}
else {
return null;
}
}
else {
return null;
}
};
Utils.offsetHeight = function (element) {
return element && element.clientHeight ? element.clientHeight : 0;
};
Utils.offsetWidth = function (element) {
return element && element.clientWidth ? element.clientWidth : 0;
};
Utils.removeCssClass = function (element, className) {
if (element.className && element.className.length > 0) {
var cssClasses = element.className.split(' ');
var index = cssClasses.indexOf(className);
if (index >= 0) {
cssClasses.splice(index, 1);
element.className = cssClasses.join(' ');
}
}
};
Utils.removeRepeatsFromArray = function (array, object) {
if (!array) {
return;
}
for (var index = array.length - 2; index >= 0; index--) {
var thisOneMatches = array[index] === object;
var nextOneMatches = array[index + 1] === object;
if (thisOneMatches && nextOneMatches) {
array.splice(index + 1, 1);
}
}
};
Utils.removeFromArray = function (array, object) {
if (array.indexOf(object) >= 0) {
array.splice(array.indexOf(object), 1);
}
};
Utils.insertIntoArray = function (array, object, toIndex) {
array.splice(toIndex, 0, object);
};
Utils.moveInArray = function (array, objectsToMove, toIndex) {
var _this = this;
// first take out it items from the array
objectsToMove.forEach(function (obj) {
_this.removeFromArray(array, obj);
});
// now add the objects, in same order as provided to us, that means we start at the end
// as the objects will be pushed to the right as they are inserted
objectsToMove.slice().reverse().forEach(function (obj) {
_this.insertIntoArray(array, obj, toIndex);
});
};
Utils.defaultComparator = function (valueA, valueB) {
var valueAMissing = valueA === null || valueA === undefined;
var valueBMissing = valueB === null || valueB === undefined;
if (valueAMissing && valueBMissing) {
return 0;
}
if (valueAMissing) {
return -1;
}
if (valueBMissing) {
return 1;
}
if (valueA < valueB) {
return -1;
}
else if (valueA > valueB) {
return 1;
}
else {
return 0;
}
};
Utils.compareArrays = function (array1, array2) {
if (this.missing(array1) && this.missing(array2)) {
return true;
}
if (this.missing(array1) || this.missing(array2)) {
return false;
}
if (array1.length !== array2.length) {
return false;
}
for (var i = 0; i < array1.length; i++) {
if (array1[i] !== array2[i]) {
return false;
}
}
return true;
};
Utils.formatWidth = function (width) {
if (typeof width === "number") {
return width + "px";
}
else {
return width;
}
};
Utils.formatNumberTwoDecimalPlacesAndCommas = function (value) {
// took this from: http://blog.tompawlak.org/number-currency-formatting-javascript
if (typeof value === 'number') {
return (Math.round(value * 100) / 100).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
}
else {
return '';
}
};
/**
* If icon provided, use this (either a string, or a function callback).
* if not, then use the second parameter, which is the svgFactory function
*/
Utils.createIcon = function (iconName, gridOptionsWrapper, column, svgFactoryFunc) {
var eResult = document.createElement('span');
eResult.appendChild(this.createIconNoSpan(iconName, gridOptionsWrapper, column, svgFactoryFunc));
return eResult;
};
Utils.createIconNoSpan = function (iconName, gridOptionsWrapper, colDefWrapper, svgFactoryFunc) {
var userProvidedIcon;
// check col for icon first
if (colDefWrapper && colDefWrapper.getColDef().icons) {
userProvidedIcon = colDefWrapper.getColDef().icons[iconName];
}
// it not in col, try grid options
if (!userProvidedIcon && gridOptionsWrapper.getIcons()) {
userProvidedIcon = gridOptionsWrapper.getIcons()[iconName];
}
// now if user provided, use it
if (userProvidedIcon) {
var rendererResult;
if (typeof userProvidedIcon === 'function') {
rendererResult = userProvidedIcon();
}
else if (typeof userProvidedIcon === 'string') {
rendererResult = userProvidedIcon;
}
else {
throw 'icon from grid options needs to be a string or a function';
}
if (typeof rendererResult === 'string') {
return this.loadTemplate(rendererResult);
}
else if (this.isNodeOrElement(rendererResult)) {
return rendererResult;
}
else {
throw 'iconRenderer should return back a string or a dom object';
}
}
else {
// otherwise we use the built in icon
if (svgFactoryFunc) {
return svgFactoryFunc();
}
else {
return null;
}
}
};
Utils.addStylesToElement = function (eElement, styles) {
if (!styles) {
return;
}
Object.keys(styles).forEach(function (key) {
eElement.style[key] = styles[key];
});
};
Utils.getScrollbarWidth = function () {
var outer = document.createElement("div");
outer.style.visibility = "hidden";
outer.style.width = "100px";
outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
document.body.appendChild(outer);
var widthNoScroll = outer.offsetWidth;
// force scrollbars
outer.style.overflow = "scroll";
// add innerdiv
var inner = document.createElement("div");
inner.style.width = "100%";
outer.appendChild(inner);
var widthWithScroll = inner.offsetWidth;
// remove divs
outer.parentNode.removeChild(outer);
return widthNoScroll - widthWithScroll;
};
Utils.isKeyPressed = function (event, keyToCheck) {
var pressedKey = event.which || event.keyCode;
return pressedKey === keyToCheck;
};
Utils.setVisible = function (element, visible, visibleStyle) {
if (visible) {
if (this.exists(visibleStyle)) {
element.style.display = visibleStyle;
}
else {
element.style.display = 'inline';
}
}
else {
element.style.display = 'none';
}
};
Utils.isBrowserIE = function () {
if (this.isIE === undefined) {
this.isIE = false || !!document.documentMode; // At least IE6
}
return this.isIE;
};
Utils.isBrowserSafari = function () {
if (this.isSafari === undefined) {
this.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
}
return this.isSafari;
};
// taken from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code
Utils.getBodyWidth = function () {
if (document.body) {
return document.body.clientWidth;
}
if (window.innerHeight) {
return window.innerWidth;
}
if (document.documentElement && document.documentElement.clientWidth) {
return document.documentElement.clientWidth;
}
return -1;
};
// taken from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code
Utils.getBodyHeight = function () {
if (document.body) {
return document.body.clientHeight;
}
if (window.innerHeight) {
return window.innerHeight;
}
if (document.documentElement && document.documentElement.clientHeight) {
return document.documentElement.clientHeight;
}
return -1;
};
Utils.setCheckboxState = function (eCheckbox, state) {
if (typeof state === 'boolean') {
eCheckbox.checked = state;
eCheckbox.indeterminate = false;
}
else {
// isNodeSelected returns back undefined if it's a group and the children
// are a mix of selected and unselected
eCheckbox.indeterminate = true;
}
};
Utils.traverseNodesWithKey = function (nodes, callback) {
var keyParts = [];
recursiveSearchNodes(nodes);
function recursiveSearchNodes(nodes) {
nodes.forEach(function (node) {
if (node.group) {
keyParts.push(node.key);
var key = keyParts.join('|');
callback(node, key);
recursiveSearchNodes(node.childrenAfterGroup);
keyParts.pop();
}
});
}
};
// Taken from here: https://github.com/facebook/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
/**
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
* complicated, thus this doc is long and (hopefully) detailed enough to answer
* your questions.
*
* If you need to react to the mouse wheel in a predictable way, this code is
* like your bestest friend. * hugs *
*
* As of today, there are 4 DOM event types you can listen to:
*
* 'wheel' -- Chrome(31+), FF(17+), IE(9+)
* 'mousewheel' -- Chrome, IE(6+), Opera, Safari
* 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
* 'DOMMouseScroll' -- FF(0.9.7+) since 2003
*
* So what to do? The is the best:
*
* normalizeWheel.getEventType();
*
* In your event callback, use this code to get sane interpretation of the
* deltas. This code will return an object with properties:
*
* spinX -- normalized spin speed (use for zoom) - x plane
* spinY -- " - y plane
* pixelX -- normalized distance (to pixels) - x plane
* pixelY -- " - y plane
*
* Wheel values are provided by the browser assuming you are using the wheel to
* scroll a web page by a number of lines or pixels (or pages). Values can vary
* significantly on different platforms and browsers, forgetting that you can
* scroll at different speeds. Some devices (like trackpads) emit more events
* at smaller increments with fine granularity, and some emit massive jumps with
* linear speed or acceleration.
*
* This code does its best to normalize the deltas for you:
*
* - spin is trying to normalize how far the wheel was spun (or trackpad
* dragged). This is super useful for zoom support where you want to
* throw away the chunky scroll steps on the PC and make those equal to
* the slow and smooth tiny steps on the Mac. Key data: This code tries to
* resolve a single slow step on a wheel to 1.
*
* - pixel is normalizing the desired scroll delta in pixel units. You'll
* get the crazy differences between browsers, but at least it'll be in
* pixels!
*
* - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
* should translate to positive value zooming IN, negative zooming OUT.
* This matches the newer 'wheel' event.
*
* Why are there spinX, spinY (or pixels)?
*
* - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
* with a mouse. It results in side-scrolling in the browser by default.
*
* - spinY is what you expect -- it's the classic axis of a mouse wheel.
*
* - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
* probably is by browsers in conjunction with fancy 3D controllers .. but
* you know.
*
* Implementation info:
*
* Examples of 'wheel' event if you scroll slowly (down) by one step with an
* average mouse:
*
* OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
* OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
* OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
* Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
* Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
*
* On the trackpad:
*
* OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
* OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
*
* On other/older browsers.. it's more complicated as there can be multiple and
* also missing delta values.
*
* The 'wheel' event is more standard:
*
* http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
*
* The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
* deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
* backward compatibility with older events. Those other values help us
* better normalize spin speed. Example of what the browsers provide:
*
* | event.wheelDelta | event.detail
* ------------------+------------------+--------------
* Safari v5/OS X | -120 | 0
* Safari v5/Win7 | -120 | 0
* Chrome v17/OS X | -120 | 0
* Chrome v17/Win7 | -120 | 0
* IE9/Win7 | -120 | undefined
* Firefox v4/OS X | undefined | 1
* Firefox v4/Win7 | undefined | 3
*
*/
Utils.normalizeWheel = function (event) {
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
// spinX, spinY
var sX = 0;
var sY = 0;
// pixelX, pixelY
var pX = 0;
var pY = 0;
// Legacy
if ('detail' in event) {
sY = event.detail;
}
if ('wheelDelta' in event) {
sY = -event.wheelDelta / 120;
}
if ('wheelDeltaY' in event) {
sY = -event.wheelDeltaY / 120;
}
if ('wheelDeltaX' in event) {
sX = -event.wheelDeltaX / 120;
}
// side scrolling on FF with DOMMouseScroll
if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
sX = sY;
sY = 0;
}
pX = sX * PIXEL_STEP;
pY = sY * PIXEL_STEP;
if ('deltaY' in event) {
pY = event.deltaY;
}
if ('deltaX' in event) {
pX = event.deltaX;
}
if ((pX || pY) && event.deltaMode) {
if (event.deltaMode == 1) {
pX *= LINE_HEIGHT;
pY *= LINE_HEIGHT;
}
else {
pX *= PAGE_HEIGHT;
pY *= PAGE_HEIGHT;
}
}
// Fall-back if spin cannot be determined
if (pX && !sX) {
sX = (pX < 1) ? -1 : 1;
}
if (pY && !sY) {
sY = (pY < 1) ? -1 : 1;
}
return { spinX: sX,
spinY: sY,
pixelX: pX,
pixelY: pY };
};
return Utils;
})();
exports.Utils = Utils;
var NumberSequence = (function () {
function NumberSequence() {
this.nextValue = 0;
}
NumberSequence.prototype.next = function () {
var valToReturn = this.nextValue;
this.nextValue++;
return valToReturn;
};
return NumberSequence;
})();
exports.NumberSequence = NumberSequence;
/***/ },
/* 8 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var Constants = (function () {
function Constants() {
}
Constants.STEP_EVERYTHING = 0;
Constants.STEP_FILTER = 1;
Constants.STEP_SORT = 2;
Constants.STEP_MAP = 3;
Constants.STEP_AGGREGATE = 4;
Constants.STEP_PIVOT = 5;
Constants.ROW_BUFFER_SIZE = 10;
Constants.LAYOUT_INTERVAL = 500;
Constants.KEY_BACKSPACE = 8;
Constants.KEY_TAB = 9;
Constants.KEY_ENTER = 13;
Constants.KEY_SHIFT = 16;
Constants.KEY_ESCAPE = 27;
Constants.KEY_SPACE = 32;
Constants.KEY_LEFT = 37;
Constants.KEY_UP = 38;
Constants.KEY_RIGHT = 39;
Constants.KEY_DOWN = 40;
Constants.KEY_DELETE = 46;
Constants.KEY_A = 65;
Constants.KEY_C = 67;
Constants.KEY_V = 86;
Constants.KEY_D = 68;
Constants.KEY_F2 = 113;
Constants.ROW_MODEL_TYPE_PAGINATION = 'pagination';
Constants.ROW_MODEL_TYPE_VIRTUAL = 'virtual';
Constants.ROW_MODEL_TYPE_VIEWPORT = 'viewport';
Constants.ROW_MODEL_TYPE_NORMAL = 'normal';
Constants.ALWAYS = 'always';
Constants.ONLY_WHEN_GROUPING = 'onlyWhenGrouping';
Constants.FLOATING_TOP = 'top';
Constants.FLOATING_BOTTOM = 'bottom';
return Constants;
})();
exports.Constants = Constants;
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var events_1 = __webpack_require__(10);
var utils_1 = __webpack_require__(7);
var ComponentUtil = (function () {
function ComponentUtil() {
}
ComponentUtil.getEventCallbacks = function () {
if (!ComponentUtil.EVENT_CALLBACKS) {
ComponentUtil.EVENT_CALLBACKS = [];
ComponentUtil.EVENTS.forEach(function (eventName) {
ComponentUtil.EVENT_CALLBACKS.push(ComponentUtil.getCallbackForEvent(eventName));
});
}
return ComponentUtil.EVENT_CALLBACKS;
};
ComponentUtil.copyAttributesToGridOptions = function (gridOptions, component) {
checkForDeprecated(component);
// create empty grid options if none were passed
if (typeof gridOptions !== 'object') {
gridOptions = {};
}
// to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'
var pGridOptions = gridOptions;
// add in all the simple properties
ComponentUtil.ARRAY_PROPERTIES
.concat(ComponentUtil.STRING_PROPERTIES)
.concat(ComponentUtil.OBJECT_PROPERTIES)
.concat(ComponentUtil.FUNCTION_PROPERTIES)
.forEach(function (key) {
if (typeof (component)[key] !== 'undefined') {
pGridOptions[key] = component[key];
}
});
ComponentUtil.BOOLEAN_PROPERTIES.forEach(function (key) {
if (typeof (component)[key] !== 'undefined') {
pGridOptions[key] = ComponentUtil.toBoolean(component[key]);
}
});
ComponentUtil.NUMBER_PROPERTIES.forEach(function (key) {
if (typeof (component)[key] !== 'undefined') {
pGridOptions[key] = ComponentUtil.toNumber(component[key]);
}
});
ComponentUtil.getEventCallbacks().forEach(function (funcName) {
if (typeof (component)[funcName] !== 'undefined') {
pGridOptions[funcName] = component[funcName];
}
});
return gridOptions;
};
ComponentUtil.getCallbackForEvent = function (eventName) {
if (!eventName || eventName.length < 2) {
return eventName;
}
else {
return 'on' + eventName[0].toUpperCase() + eventName.substr(1);
}
};
// change this method, the caller should know if it's initialised or not, plus 'initialised'
// is not relevant for all component types.
// maybe pass in the api and columnApi instead???
ComponentUtil.processOnChange = function (changes, gridOptions, api, columnApi) {
//if (!component._initialised || !changes) { return; }
if (!changes) {
return;
}
checkForDeprecated(changes);
// to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'
var pGridOptions = gridOptions;
// check if any change for the simple types, and if so, then just copy in the new value
ComponentUtil.ARRAY_PROPERTIES
.concat(ComponentUtil.OBJECT_PROPERTIES)
.concat(ComponentUtil.STRING_PROPERTIES)
.forEach(function (key) {
if (changes[key]) {
pGridOptions[key] = changes[key].currentValue;
}
});
ComponentUtil.BOOLEAN_PROPERTIES.forEach(function (key) {
if (changes[key]) {
pGridOptions[key] = ComponentUtil.toBoolean(changes[key].currentValue);
}
});
ComponentUtil.NUMBER_PROPERTIES.forEach(function (key) {
if (changes[key]) {
pGridOptions[key] = ComponentUtil.toNumber(changes[key].currentValue);
}
});
ComponentUtil.getEventCallbacks().forEach(function (funcName) {
if (changes[funcName]) {
pGridOptions[funcName] = changes[funcName].currentValue;
}
});
if (changes.showToolPanel) {
api.showToolPanel(ComponentUtil.toBoolean(changes.showToolPanel.currentValue));
}
if (changes.quickFilterText) {
api.setQuickFilter(changes.quickFilterText.currentValue);
}
if (changes.rowData) {
api.setRowData(changes.rowData.currentValue);
}
if (changes.floatingTopRowData) {
api.setFloatingTopRowData(changes.floatingTopRowData.currentValue);
}
if (changes.floatingBottomRowData) {
api.setFloatingBottomRowData(changes.floatingBottomRowData.currentValue);
}
if (changes.columnDefs) {
api.setColumnDefs(changes.columnDefs.currentValue);
}
if (changes.datasource) {
api.setDatasource(changes.datasource.currentValue);
}
if (changes.headerHeight) {
api.setHeaderHeight(ComponentUtil.toNumber(changes.headerHeight.currentValue));
}
if (changes.pivotMode) {
columnApi.setPivotMode(ComponentUtil.toBoolean(changes.pivotMode.currentValue));
}
};
ComponentUtil.toBoolean = function (value) {
if (typeof value === 'boolean') {
return value;
}
else if (typeof value === 'string') {
// for boolean, compare to empty String to allow attributes appearing with
// not value to be treated as 'true'
return value.toUpperCase() === 'TRUE' || value == '';
}
else {
return false;
}
};
ComponentUtil.toNumber = function (value) {
if (typeof value === 'number') {
return value;
}
else if (typeof value === 'string') {
return Number(value);
}
else {
return undefined;
}
};
// all the events are populated in here AFTER this class (at the bottom of the file).
ComponentUtil.EVENTS = [];
ComponentUtil.STRING_PROPERTIES = [
'sortingOrder', 'rowClass', 'rowSelection', 'overlayLoadingTemplate',
'overlayNoRowsTemplate', 'headerCellTemplate', 'quickFilterText', 'rowModelType'];
ComponentUtil.OBJECT_PROPERTIES = [
'rowStyle', 'context', 'groupColumnDef', 'localeText', 'icons', 'datasource', 'viewportDatasource',
'groupRowRendererParams', 'aggFuncs'
];
ComponentUtil.ARRAY_PROPERTIES = [
'slaveGrids', 'rowData', 'floatingTopRowData', 'floatingBottomRowData', 'columnDefs'
];
ComponentUtil.NUMBER_PROPERTIES = [
'rowHeight', 'rowBuffer', 'colWidth', 'headerHeight', 'groupDefaultExpanded',
'minColWidth', 'maxColWidth', 'viewportRowModelPageSize', 'viewportRowModelBufferSize',
'layoutInterval'
];
ComponentUtil.BOOLEAN_PROPERTIES = [
'toolPanelSuppressGroups', 'toolPanelSuppressValues',
'suppressRowClickSelection', 'suppressCellSelection', 'suppressHorizontalScroll', 'debug',
'enableColResize', 'enableCellExpressions', 'enableSorting', 'enableServerSideSorting',
'enableFilter', 'enableServerSideFilter', 'angularCompileRows', 'angularCompileFilters',
'angularCompileHeaders', 'groupSuppressAutoColumn', 'groupSelectsChildren',
'groupIncludeFooter', 'groupUseEntireRow', 'groupSuppressRow', 'groupSuppressBlankHeader', 'forPrint',
'suppressMenuHide', 'rowDeselection', 'unSortIcon', 'suppressMultiSort', 'suppressScrollLag',
'singleClickEdit', 'suppressLoadingOverlay', 'suppressNoRowsOverlay', 'suppressAutoSize',
'suppressParentsInRowNodes', 'showToolPanel', 'suppressColumnMoveAnimation', 'suppressMovableColumns',
'suppressFieldDotNotation', 'enableRangeSelection', 'suppressEnterprise', 'rowGroupPanelShow',
'suppressContextMenu', 'suppressMenuFilterPanel', 'suppressMenuMainPanel', 'suppressMenuColumnPanel',
'enableStatusBar', 'rememberGroupStateWhenNewData', 'enableCellChangeFlash', 'suppressDragLeaveHidesColumns',
'suppressMiddleClickScrolls', 'suppressPreventDefaultOnMouseWheel', 'suppressUseColIdForGroups',
'suppressCopyRowsToClipboard', 'pivotMode', 'suppressAggFuncInHeader', 'suppressColumnVirtualisation'
];
ComponentUtil.FUNCTION_PROPERTIES = ['headerCellRenderer', 'localeTextFunc', 'groupRowInnerRenderer',
'groupRowRenderer', 'isScrollLag', 'isExternalFilterPresent', 'getRowHeight',
'doesExternalFilterPass', 'getRowClass', 'getRowStyle', 'getHeaderCellTemplate', 'traverseNode',
'getContextMenuItems', 'getMainMenuItems', 'processRowPostCreate', 'processCellForClipboard',
'getNodeChildDetails', 'groupRowAggNodes'];
ComponentUtil.ALL_PROPERTIES = ComponentUtil.ARRAY_PROPERTIES
.concat(ComponentUtil.OBJECT_PROPERTIES)
.concat(ComponentUtil.STRING_PROPERTIES)
.concat(ComponentUtil.NUMBER_PROPERTIES)
.concat(ComponentUtil.FUNCTION_PROPERTIES)
.concat(ComponentUtil.BOOLEAN_PROPERTIES);
return ComponentUtil;
})();
exports.ComponentUtil = ComponentUtil;
utils_1.Utils.iterateObject(events_1.Events, function (key, value) {
ComponentUtil.EVENTS.push(value);
});
function checkForDeprecated(changes) {
if (changes.ready || changes.onReady) {
console.warn('ag-grid: as of v3.3 ready event is now called gridReady, so the callback should be onGridReady');
}
if (changes.rowDeselected || changes.onRowDeselected) {
console.warn('ag-grid: as of v3.4 rowDeselected no longer exists. Please check the docs.');
}
}
/***/ },
/* 10 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var Events = (function () {
function Events() {
}
/** A new set of columns has been entered, everything has potentially changed. */
Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged';
Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded';
/** The reduce flag was changed */
Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged';
/** A row group column was added, removed or order changed. */
Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
/** A pivot column was added, removed or order changed. */
Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged';
/** A pivot column was added, removed or order changed. */
Events.EVENT_PIVOT_VALUE_CHANGED = 'pivotValueChanged';
/** The list of grid columns has changed. */
Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged';
/** A value column was added, removed or agg function was changed. */
Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged';
/** A column was moved */
Events.EVENT_COLUMN_MOVED = 'columnMoved';
/** One or more columns was shown / hidden */
Events.EVENT_COLUMN_VISIBLE = 'columnVisible';
/** One or more columns was pinned / unpinned*/
Events.EVENT_COLUMN_PINNED = 'columnPinned';
/** A column group was opened / closed */
Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened';
/** One or more columns was resized. If just one, the column in the event is set. */
Events.EVENT_COLUMN_RESIZED = 'columnResized';
/** The list of displayed columns has changed, can result from columns open / close, column move, pivot, group, etc */
Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged';
/** The list of virtual columns has changed, results from viewport changing */
Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged';
/** A row group was opened / closed */
Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened';
Events.EVENT_ROW_DATA_CHANGED = 'rowDataChanged';
Events.EVENT_FLOATING_ROW_DATA_CHANGED = 'floatingRowDataChanged';
Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged';
Events.EVENT_FLASH_CELLS = 'clipboardPaste';
Events.EVENT_HEADER_HEIGHT_CHANGED = 'headerHeightChanged';
Events.EVENT_MODEL_UPDATED = 'modelUpdated';
Events.EVENT_CELL_CLICKED = 'cellClicked';
Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked';
Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu';
Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged';
Events.EVENT_CELL_FOCUSED = 'cellFocused';
Events.EVENT_ROW_SELECTED = 'rowSelected';
Events.EVENT_SELECTION_CHANGED = 'selectionChanged';
Events.EVENT_BEFORE_FILTER_CHANGED = 'beforeFilterChanged';
Events.EVENT_FILTER_CHANGED = 'filterChanged';
Events.EVENT_AFTER_FILTER_CHANGED = 'afterFilterChanged';
Events.EVENT_FILTER_MODIFIED = 'filterModified';
Events.EVENT_BEFORE_SORT_CHANGED = 'beforeSortChanged';
Events.EVENT_SORT_CHANGED = 'sortChanged';
Events.EVENT_AFTER_SORT_CHANGED = 'afterSortChanged';
Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved';
Events.EVENT_ROW_CLICKED = 'rowClicked';
Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked';
Events.EVENT_GRID_READY = 'gridReady';
Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged';
Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged';
Events.EVENT_DRAG_STARTED = 'dragStarted';
Events.EVENT_DRAG_STOPPED = 'dragStopped';
return Events;
})();
exports.Events = Events;
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var csvCreator_1 = __webpack_require__(12);
var rowRenderer_1 = __webpack_require__(23);
var headerRenderer_1 = __webpack_require__(68);
var filterManager_1 = __webpack_require__(43);
var columnController_1 = __webpack_require__(13);
var selectionController_1 = __webpack_require__(28);
var gridOptionsWrapper_1 = __webpack_require__(3);
var gridPanel_1 = __webpack_require__(24);
var valueService_1 = __webpack_require__(29);
var masterSlaveService_1 = __webpack_require__(25);
var eventService_1 = __webpack_require__(4);
var floatingRowModel_1 = __webpack_require__(26);
var constants_1 = __webpack_require__(8);
var context_1 = __webpack_require__(6);
var gridCore_1 = __webpack_require__(40);
var sortController_1 = __webpack_require__(42);
var paginationController_1 = __webpack_require__(41);
var focusedCellController_1 = __webpack_require__(35);
var utils_1 = __webpack_require__(7);
var cellRendererFactory_1 = __webpack_require__(55);
var cellEditorFactory_1 = __webpack_require__(48);
var GridApi = (function () {
function GridApi() {
}
GridApi.prototype.init = function () {
if (this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_NORMAL) {
this.inMemoryRowModel = this.rowModel;
}
};
/** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */
GridApi.prototype.__getMasterSlaveService = function () {
return this.masterSlaveService;
};
GridApi.prototype.getFirstRenderedRow = function () {
return this.rowRenderer.getFirstVirtualRenderedRow();
};
GridApi.prototype.getLastRenderedRow = function () {
return this.rowRenderer.getLastVirtualRenderedRow();
};
GridApi.prototype.getDataAsCsv = function (params) {
return this.csvCreator.getDataAsCsv(params);
};
GridApi.prototype.exportDataAsCsv = function (params) {
this.csvCreator.exportDataAsCsv(params);
};
GridApi.prototype.setDatasource = function (datasource) {
if (this.gridOptionsWrapper.isRowModelPagination()) {
this.paginationController.setDatasource(datasource);
}
else if (this.gridOptionsWrapper.isRowModelVirtual()) {
this.rowModel.setDatasource(datasource);
}
else {
console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_VIRTUAL + "' or '" + constants_1.Constants.ROW_MODEL_TYPE_PAGINATION + "'");
}
};
GridApi.prototype.setViewportDatasource = function (viewportDatasource) {
if (this.gridOptionsWrapper.isRowModelViewport()) {
// this is bad coding, because it's using an interface that's exposed in the enterprise.
// really we should create an interface in the core for viewportDatasource and let
// the enterprise implement it, rather than casting to 'any' here
this.rowModel.setViewportDatasource(viewportDatasource);
}
else {
console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + constants_1.Constants.ROW_MODEL_TYPE_VIEWPORT + "'");
}
};
GridApi.prototype.setRowData = function (rowData) {
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.inMemoryRowModel.setRowData(rowData, true);
}
else {
console.log('cannot call setRowData unless using normal row model');
}
};
GridApi.prototype.setFloatingTopRowData = function (rows) {
this.floatingRowModel.setFloatingTopRowData(rows);
};
GridApi.prototype.setFloatingBottomRowData = function (rows) {
this.floatingRowModel.setFloatingBottomRowData(rows);
};
GridApi.prototype.setColumnDefs = function (colDefs) {
this.columnController.setColumnDefs(colDefs);
};
GridApi.prototype.refreshRows = function (rowNodes) {
this.rowRenderer.refreshRows(rowNodes);
};
GridApi.prototype.refreshCells = function (rowNodes, colIds, animate) {
if (animate === void 0) { animate = false; }
this.rowRenderer.refreshCells(rowNodes, colIds, animate);
};
GridApi.prototype.rowDataChanged = function (rows) {
this.rowRenderer.rowDataChanged(rows);
};
GridApi.prototype.refreshView = function () {
this.rowRenderer.refreshView();
};
GridApi.prototype.softRefreshView = function () {
this.rowRenderer.softRefreshView();
};
GridApi.prototype.refreshGroupRows = function () {
this.rowRenderer.refreshGroupRows();
};
GridApi.prototype.refreshHeader = function () {
// need to review this - the refreshHeader should also refresh all icons in the header
this.headerRenderer.refreshHeader();
};
GridApi.prototype.isAnyFilterPresent = function () {
return this.filterManager.isAnyFilterPresent();
};
GridApi.prototype.isAdvancedFilterPresent = function () {
return this.filterManager.isAdvancedFilterPresent();
};
GridApi.prototype.isQuickFilterPresent = function () {
return this.filterManager.isQuickFilterPresent();
};
GridApi.prototype.getModel = function () {
return this.rowModel;
};
GridApi.prototype.onGroupExpandedOrCollapsed = function (refreshFromIndex) {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call onGroupExpandedOrCollapsed unless using normal row model');
}
this.inMemoryRowModel.refreshModel(constants_1.Constants.STEP_MAP, refreshFromIndex);
};
GridApi.prototype.refreshInMemoryRowModel = function () {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call refreshInMemoryRowModel unless using normal row model');
}
this.inMemoryRowModel.refreshModel(constants_1.Constants.STEP_EVERYTHING);
};
GridApi.prototype.expandAll = function () {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call expandAll unless using normal row model');
}
this.inMemoryRowModel.expandOrCollapseAll(true);
};
GridApi.prototype.collapseAll = function () {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call collapseAll unless using normal row model');
}
this.inMemoryRowModel.expandOrCollapseAll(false);
};
GridApi.prototype.addVirtualRowListener = function (eventName, rowIndex, callback) {
if (typeof eventName !== 'string') {
console.log('ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.');
}
this.addRenderedRowListener(eventName, rowIndex, callback);
};
GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
if (eventName === 'virtualRowRemoved') {
console.log('ag-Grid: event virtualRowRemoved is deprecated, now called renderedRowRemoved');
eventName = '' +
'';
}
if (eventName === 'virtualRowSelected') {
console.log('ag-Grid: event virtualRowSelected is deprecated, to register for individual row ' +
'selection events, add a listener directly to the row node.');
}
this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);
};
GridApi.prototype.setQuickFilter = function (newFilter) {
this.filterManager.setQuickFilter(newFilter);
};
GridApi.prototype.selectIndex = function (index, tryMulti, suppressEvents) {
console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
if (suppressEvents) {
console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
}
this.selectionController.selectIndex(index, tryMulti);
};
GridApi.prototype.deselectIndex = function (index, suppressEvents) {
if (suppressEvents === void 0) { suppressEvents = false; }
console.log('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
if (suppressEvents) {
console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
}
this.selectionController.deselectIndex(index);
};
GridApi.prototype.selectNode = function (node, tryMulti, suppressEvents) {
if (tryMulti === void 0) { tryMulti = false; }
if (suppressEvents === void 0) { suppressEvents = false; }
console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
if (suppressEvents) {
console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
}
node.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
};
GridApi.prototype.deselectNode = function (node, suppressEvents) {
if (suppressEvents === void 0) { suppressEvents = false; }
console.log('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
if (suppressEvents) {
console.log('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
}
node.setSelectedParams({ newValue: false });
};
GridApi.prototype.selectAll = function () {
this.selectionController.selectAllRowNodes();
};
GridApi.prototype.deselectAll = function () {
this.selectionController.deselectAllRowNodes();
};
GridApi.prototype.recomputeAggregates = function () {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call recomputeAggregates unless using normal row model');
}
this.inMemoryRowModel.refreshModel(constants_1.Constants.STEP_AGGREGATE);
};
GridApi.prototype.sizeColumnsToFit = function () {
if (this.gridOptionsWrapper.isForPrint()) {
console.warn('ag-grid: sizeColumnsToFit does not work when forPrint=true');
return;
}
this.gridPanel.sizeColumnsToFit();
};
GridApi.prototype.showLoadingOverlay = function () {
this.gridPanel.showLoadingOverlay();
};
GridApi.prototype.showNoRowsOverlay = function () {
this.gridPanel.showNoRowsOverlay();
};
GridApi.prototype.hideOverlay = function () {
this.gridPanel.hideOverlay();
};
GridApi.prototype.isNodeSelected = function (node) {
console.log('ag-Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead');
return node.isSelected();
};
GridApi.prototype.getSelectedNodesById = function () {
console.error('ag-Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead');
return null;
};
GridApi.prototype.getSelectedNodes = function () {
return this.selectionController.getSelectedNodes();
};
GridApi.prototype.getSelectedRows = function () {
return this.selectionController.getSelectedRows();
};
GridApi.prototype.getBestCostNodeSelection = function () {
return this.selectionController.getBestCostNodeSelection();
};
GridApi.prototype.getRenderedNodes = function () {
return this.rowRenderer.getRenderedNodes();
};
GridApi.prototype.ensureColIndexVisible = function (index) {
console.warn('ag-Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.');
};
GridApi.prototype.ensureColumnVisible = function (key) {
this.gridPanel.ensureColumnVisible(key);
};
GridApi.prototype.ensureIndexVisible = function (index) {
this.gridPanel.ensureIndexVisible(index);
};
GridApi.prototype.ensureNodeVisible = function (comparator) {
this.gridCore.ensureNodeVisible(comparator);
};
GridApi.prototype.forEachLeafNode = function (callback) {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call forEachNodeAfterFilter unless using normal row model');
}
this.inMemoryRowModel.forEachLeafNode(callback);
};
GridApi.prototype.forEachNode = function (callback) {
this.rowModel.forEachNode(callback);
};
GridApi.prototype.forEachNodeAfterFilter = function (callback) {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call forEachNodeAfterFilter unless using normal row model');
}
this.inMemoryRowModel.forEachNodeAfterFilter(callback);
};
GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) {
if (utils_1.Utils.missing(this.inMemoryRowModel)) {
console.log('cannot call forEachNodeAfterFilterAndSort unless using normal row model');
}
this.inMemoryRowModel.forEachNodeAfterFilterAndSort(callback);
};
GridApi.prototype.getFilterApiForColDef = function (colDef) {
console.warn('ag-grid API method getFilterApiForColDef deprecated, use getFilterApi instead');
return this.getFilterApi(colDef);
};
GridApi.prototype.getFilterApi = function (key) {
var column = this.columnController.getPrimaryColumn(key);
if (column) {
return this.filterManager.getFilterApi(column);
}
};
GridApi.prototype.destroyFilter = function (key) {
var column = this.columnController.getPrimaryColumn(key);
if (column) {
return this.filterManager.destroyFilter(column);
}
};
GridApi.prototype.getColumnDef = function (key) {
var column = this.columnController.getPrimaryColumn(key);
if (column) {
return column.getColDef();
}
else {
return null;
}
};
GridApi.prototype.onFilterChanged = function () {
this.filterManager.onFilterChanged();
};
GridApi.prototype.setSortModel = function (sortModel) {
this.sortController.setSortModel(sortModel);
};
GridApi.prototype.getSortModel = function () {
return this.sortController.getSortModel();
};
GridApi.prototype.setFilterModel = function (model) {
this.filterManager.setFilterModel(model);
};
GridApi.prototype.getFilterModel = function () {
return this.filterManager.getFilterModel();
};
GridApi.prototype.getFocusedCell = function () {
return this.focusedCellController.getFocusedCell();
};
GridApi.prototype.setFocusedCell = function (rowIndex, colKey, floating) {
this.focusedCellController.setFocusedCell(rowIndex, colKey, floating, true);
};
GridApi.prototype.setHeaderHeight = function (headerHeight) {
this.gridOptionsWrapper.setHeaderHeight(headerHeight);
};
GridApi.prototype.showToolPanel = function (show) {
this.gridCore.showToolPanel(show);
};
GridApi.prototype.isToolPanelShowing = function () {
return this.gridCore.isToolPanelShowing();
};
GridApi.prototype.doLayout = function () {
this.gridCore.doLayout();
};
GridApi.prototype.getValue = function (colKey, rowNode) {
var column = this.columnController.getPrimaryColumn(colKey);
return this.valueService.getValue(column, rowNode);
};
GridApi.prototype.addEventListener = function (eventType, listener) {
this.eventService.addEventListener(eventType, listener);
};
GridApi.prototype.addGlobalListener = function (listener) {
this.eventService.addGlobalListener(listener);
};
GridApi.prototype.removeEventListener = function (eventType, listener) {
this.eventService.removeEventListener(eventType, listener);
};
GridApi.prototype.removeGlobalListener = function (listener) {
this.eventService.removeGlobalListener(listener);
};
GridApi.prototype.dispatchEvent = function (eventType, event) {
this.eventService.dispatchEvent(eventType, event);
};
GridApi.prototype.destroy = function () {
this.context.destroy();
};
GridApi.prototype.resetQuickFilter = function () {
this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; });
};
GridApi.prototype.getRangeSelections = function () {
if (this.rangeController) {
return this.rangeController.getCellRanges();
}
else {
console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
return null;
}
};
GridApi.prototype.addRangeSelection = function (rangeSelection) {
if (!this.rangeController) {
console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
}
this.rangeController.addRange(rangeSelection);
};
GridApi.prototype.clearRangeSelection = function () {
if (!this.rangeController) {
console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
}
this.rangeController.clearSelection();
};
GridApi.prototype.copySelectedRowsToClipboard = function () {
if (!this.clipboardService) {
console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
}
this.clipboardService.copySelectedRowsToClipboard();
};
GridApi.prototype.copySelectedRangeToClipboard = function () {
if (!this.clipboardService) {
console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
}
this.clipboardService.copySelectedRangeToClipboard();
};
GridApi.prototype.copySelectedRangeDown = function () {
if (!this.clipboardService) {
console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
}
this.clipboardService.copyRangeDown();
};
GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) {
var column = this.columnController.getPrimaryColumn(colKey);
this.menuFactory.showMenuAfterButtonClick(column, buttonElement);
};
GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) {
var column = this.columnController.getPrimaryColumn(colKey);
this.menuFactory.showMenuAfterMouseEvent(column, mouseEvent);
};
GridApi.prototype.stopEditing = function (cancel) {
if (cancel === void 0) { cancel = false; }
this.rowRenderer.stopEditing(cancel);
};
GridApi.prototype.addAggFunc = function (key, aggFunc) {
if (this.aggFuncService) {
this.aggFuncService.addAggFunc(key, aggFunc);
}
};
GridApi.prototype.addAggFuncs = function (aggFuncs) {
if (this.aggFuncService) {
this.aggFuncService.addAggFuncs(aggFuncs);
}
};
GridApi.prototype.clearAggFuncs = function () {
if (this.aggFuncService) {
this.aggFuncService.clear();
}
};
__decorate([
context_1.Autowired('csvCreator'),
__metadata('design:type', csvCreator_1.CsvCreator)
], GridApi.prototype, "csvCreator", void 0);
__decorate([
context_1.Autowired('gridCore'),
__metadata('design:type', gridCore_1.GridCore)
], GridApi.prototype, "gridCore", void 0);
__decorate([
context_1.Autowired('rowRenderer'),
__metadata('design:type', rowRenderer_1.RowRenderer)
], GridApi.prototype, "rowRenderer", void 0);
__decorate([
context_1.Autowired('headerRenderer'),
__metadata('design:type', headerRenderer_1.HeaderRenderer)
], GridApi.prototype, "headerRenderer", void 0);
__decorate([
context_1.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], GridApi.prototype, "filterManager", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], GridApi.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], GridApi.prototype, "selectionController", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], GridApi.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], GridApi.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], GridApi.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('masterSlaveService'),
__metadata('design:type', masterSlaveService_1.MasterSlaveService)
], GridApi.prototype, "masterSlaveService", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], GridApi.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('floatingRowModel'),
__metadata('design:type', floatingRowModel_1.FloatingRowModel)
], GridApi.prototype, "floatingRowModel", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], GridApi.prototype, "context", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], GridApi.prototype, "rowModel", void 0);
__decorate([
context_1.Autowired('sortController'),
__metadata('design:type', sortController_1.SortController)
], GridApi.prototype, "sortController", void 0);
__decorate([
context_1.Autowired('paginationController'),
__metadata('design:type', paginationController_1.PaginationController)
], GridApi.prototype, "paginationController", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], GridApi.prototype, "focusedCellController", void 0);
__decorate([
context_1.Optional('rangeController'),
__metadata('design:type', Object)
], GridApi.prototype, "rangeController", void 0);
__decorate([
context_1.Optional('clipboardService'),
__metadata('design:type', Object)
], GridApi.prototype, "clipboardService", void 0);
__decorate([
context_1.Optional('aggFuncService'),
__metadata('design:type', Object)
], GridApi.prototype, "aggFuncService", void 0);
__decorate([
context_1.Autowired('menuFactory'),
__metadata('design:type', Object)
], GridApi.prototype, "menuFactory", void 0);
__decorate([
context_1.Autowired('cellRendererFactory'),
__metadata('design:type', cellRendererFactory_1.CellRendererFactory)
], GridApi.prototype, "cellRendererFactory", void 0);
__decorate([
context_1.Autowired('cellEditorFactory'),
__metadata('design:type', cellEditorFactory_1.CellEditorFactory)
], GridApi.prototype, "cellEditorFactory", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridApi.prototype, "init", null);
GridApi = __decorate([
context_1.Bean('gridApi'),
__metadata('design:paramtypes', [])
], GridApi);
return GridApi;
})();
exports.GridApi = GridApi;
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var columnController_1 = __webpack_require__(13);
var valueService_1 = __webpack_require__(29);
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var constants_1 = __webpack_require__(8);
var LINE_SEPARATOR = '\r\n';
var CsvCreator = (function () {
function CsvCreator() {
}
CsvCreator.prototype.exportDataAsCsv = function (params) {
var csvString = this.getDataAsCsv(params);
var fileNamePresent = params && params.fileName && params.fileName.length !== 0;
var fileName = fileNamePresent ? params.fileName : 'export.csv';
// for Excel, we need \ufeff at the start
// http://stackoverflow.com/questions/17879198/adding-utf-8-bom-to-string-blob
var blobObject = new Blob(["\ufeff", csvString], {
type: "text/csv;charset=utf-8;"
});
// Internet Explorer
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(blobObject, fileName);
}
else {
// Chrome
var downloadLink = document.createElement("a");
downloadLink.href = window.URL.createObjectURL(blobObject);
downloadLink.download = fileName;
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
}
};
CsvCreator.prototype.getDataAsCsv = function (params) {
if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_NORMAL) {
console.log('ag-Grid: getDataAsCsv is only available for standard row model');
return '';
}
var inMemoryRowModel = this.rowModel;
var that = this;
var result = '';
var skipGroups = params && params.skipGroups;
var skipHeader = params && params.skipHeader;
var skipFooters = params && params.skipFooters;
var includeCustomHeader = params && params.customHeader;
var includeCustomFooter = params && params.customFooter;
var allColumns = params && params.allColumns;
var onlySelected = params && params.onlySelected;
var columnSeparator = (params && params.columnSeparator) || ',';
var suppressQuotes = params && params.suppressQuotes;
var processCellCallback = params && params.processCellCallback;
var processHeaderCallback = params && params.processHeaderCallback;
// when in pivot mode, we always render cols on screen, never 'all columns'
var isPivotMode = this.columnController.isPivotMode();
var isRowGrouping = this.columnController.getRowGroupColumns().length > 0;
var columnsToExport;
if (allColumns && !isPivotMode) {
columnsToExport = this.columnController.getAllPrimaryColumns();
}
else {
columnsToExport = this.columnController.getAllDisplayedColumns();
}
if (!columnsToExport || columnsToExport.length === 0) {
return '';
}
if (includeCustomHeader) {
result += params.customHeader;
}
// first pass, put in the header names of the cols
if (!skipHeader) {
columnsToExport.forEach(processHeaderColumn);
result += LINE_SEPARATOR;
}
if (isPivotMode) {
inMemoryRowModel.forEachPivotNode(processRow);
}
else {
inMemoryRowModel.forEachNodeAfterFilterAndSort(processRow);
}
if (includeCustomFooter) {
result += params.customFooter;
}
function processRow(node) {
if (skipGroups && node.group) {
return;
}
if (skipFooters && node.footer) {
return;
}
if (onlySelected && !node.isSelected()) {
return;
}
// if we are in pivotMode, then the grid will show the root node only
// if it's not a leaf group
var nodeIsRootNode = node.level === -1;
if (nodeIsRootNode && !node.leafGroup) {
return;
}
columnsToExport.forEach(function (column, index) {
var valueForCell;
if (node.group && isRowGrouping && index === 0) {
valueForCell = that.createValueForGroupNode(node);
}
else {
valueForCell = that.valueService.getValue(column, node);
}
valueForCell = that.processCell(node, column, valueForCell, processCellCallback);
if (valueForCell === null || valueForCell === undefined) {
valueForCell = '';
}
if (index != 0) {
result += columnSeparator;
}
result += that.putInQuotes(valueForCell, suppressQuotes);
});
result += LINE_SEPARATOR;
}
function processHeaderColumn(column, index) {
var nameForCol = that.getHeaderName(processHeaderCallback, column);
if (nameForCol === null || nameForCol === undefined) {
nameForCol = '';
}
if (index != 0) {
result += columnSeparator;
}
result += that.putInQuotes(nameForCol, suppressQuotes);
}
return result;
};
CsvCreator.prototype.getHeaderName = function (callback, column) {
if (callback) {
return callback({
column: column,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext()
});
}
else {
return this.columnController.getDisplayNameForCol(column, true);
}
};
CsvCreator.prototype.processCell = function (rowNode, column, value, processCellCallback) {
if (processCellCallback) {
return processCellCallback({
column: column,
node: rowNode,
value: value,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext()
});
}
else {
return value;
}
};
CsvCreator.prototype.createValueForGroupNode = function (node) {
var keys = [node.key];
while (node.parent) {
node = node.parent;
keys.push(node.key);
}
return keys.reverse().join(' -> ');
};
CsvCreator.prototype.putInQuotes = function (value, suppressQuotes) {
if (suppressQuotes) {
return value;
}
if (value === null || value === undefined) {
return '""';
}
var stringValue;
if (typeof value === 'string') {
stringValue = value;
}
else if (typeof value.toString === 'function') {
stringValue = value.toString();
}
else {
console.warn('unknown value type during csv conversion');
stringValue = '';
}
// replace each " with "" (ie two sets of double quotes is how to do double quotes in csv)
var valueEscaped = stringValue.replace(/"/g, "\"\"");
return '"' + valueEscaped + '"';
};
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], CsvCreator.prototype, "rowModel", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], CsvCreator.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], CsvCreator.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], CsvCreator.prototype, "gridOptionsWrapper", void 0);
CsvCreator = __decorate([
context_1.Bean('csvCreator'),
__metadata('design:paramtypes', [])
], CsvCreator);
return CsvCreator;
})();
exports.CsvCreator = CsvCreator;
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = __webpack_require__(7);
var columnGroup_1 = __webpack_require__(14);
var column_1 = __webpack_require__(15);
var gridOptionsWrapper_1 = __webpack_require__(3);
var expressionService_1 = __webpack_require__(18);
var balancedColumnTreeBuilder_1 = __webpack_require__(19);
var displayedGroupCreator_1 = __webpack_require__(21);
var autoWidthCalculator_1 = __webpack_require__(22);
var eventService_1 = __webpack_require__(4);
var columnUtils_1 = __webpack_require__(16);
var logger_1 = __webpack_require__(5);
var events_1 = __webpack_require__(10);
var columnChangeEvent_1 = __webpack_require__(65);
var originalColumnGroup_1 = __webpack_require__(17);
var groupInstanceIdCreator_1 = __webpack_require__(66);
var functions_1 = __webpack_require__(67);
var context_1 = __webpack_require__(6);
var gridPanel_1 = __webpack_require__(24);
var ColumnApi = (function () {
function ColumnApi() {
}
ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) { this._columnController.sizeColumnsToFit(gridWidth); };
ColumnApi.prototype.setColumnGroupOpened = function (group, newValue, instanceId) { this._columnController.setColumnGroupOpened(group, newValue, instanceId); };
ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this._columnController.getColumnGroup(name, instanceId); };
ColumnApi.prototype.getDisplayNameForCol = function (column) { return this._columnController.getDisplayNameForCol(column); };
ColumnApi.prototype.getColumn = function (key) { return this._columnController.getPrimaryColumn(key); };
ColumnApi.prototype.setColumnState = function (columnState) { return this._columnController.setColumnState(columnState); };
ColumnApi.prototype.getColumnState = function () { return this._columnController.getColumnState(); };
ColumnApi.prototype.resetColumnState = function () { this._columnController.resetColumnState(); };
ColumnApi.prototype.isPinning = function () { return this._columnController.isPinningLeft() || this._columnController.isPinningRight(); };
ColumnApi.prototype.isPinningLeft = function () { return this._columnController.isPinningLeft(); };
ColumnApi.prototype.isPinningRight = function () { return this._columnController.isPinningRight(); };
ColumnApi.prototype.getDisplayedColAfter = function (col) { return this._columnController.getDisplayedColAfter(col); };
ColumnApi.prototype.getDisplayedColBefore = function (col) { return this._columnController.getDisplayedColBefore(col); };
ColumnApi.prototype.setColumnVisible = function (key, visible) { this._columnController.setColumnVisible(key, visible); };
ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this._columnController.setColumnsVisible(keys, visible); };
ColumnApi.prototype.setColumnPinned = function (key, pinned) { this._columnController.setColumnPinned(key, pinned); };
ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this._columnController.setColumnsPinned(keys, pinned); };
ColumnApi.prototype.getAllColumns = function () { return this._columnController.getAllPrimaryColumns(); };
ColumnApi.prototype.getAllGridColumns = function () { return this._columnController.getAllGridColumns(); };
ColumnApi.prototype.getDisplayedLeftColumns = function () { return this._columnController.getDisplayedLeftColumns(); };
ColumnApi.prototype.getDisplayedCenterColumns = function () { return this._columnController.getDisplayedCenterColumns(); };
ColumnApi.prototype.getDisplayedRightColumns = function () { return this._columnController.getDisplayedRightColumns(); };
ColumnApi.prototype.getAllDisplayedColumns = function () { return this._columnController.getAllDisplayedColumns(); };
ColumnApi.prototype.getRowGroupColumns = function () { return this._columnController.getRowGroupColumns(); };
ColumnApi.prototype.moveColumn = function (fromIndex, toIndex) { this._columnController.moveColumnByIndex(fromIndex, toIndex); };
ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this._columnController.moveRowGroupColumn(fromIndex, toIndex); };
ColumnApi.prototype.setColumnAggFunct = function (column, aggFunc) { this._columnController.setColumnAggFunc(column, aggFunc); };
ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished) {
if (finished === void 0) { finished = true; }
this._columnController.setColumnWidth(key, newWidth, finished);
};
ColumnApi.prototype.setPivotMode = function (pivotMode) { this._columnController.setPivotMode(pivotMode); };
ColumnApi.prototype.isPivotMode = function () { return this._columnController.isPivotMode(); };
ColumnApi.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { return this._columnController.getSecondaryPivotColumn(pivotKeys, valueColKey); };
ColumnApi.prototype.getAggregationColumns = function () { return this._columnController.getAggregationColumns(); };
ColumnApi.prototype.removeAggregationColumn = function (colKey) { this._columnController.removeValueColumn(colKey); };
ColumnApi.prototype.removeAggregationColumns = function (colKeys) { this._columnController.removeValueColumns(colKeys); };
ColumnApi.prototype.addAggregationColumn = function (colKey) { this._columnController.addValueColumn(colKey); };
ColumnApi.prototype.addAggregationColumns = function (colKeys) { this._columnController.addValueColumns(colKeys); };
ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this._columnController.setRowGroupColumns(colKeys); };
ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this._columnController.removeRowGroupColumn(colKey); };
ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this._columnController.removeRowGroupColumns(colKeys); };
ColumnApi.prototype.addRowGroupColumn = function (colKey) { this._columnController.addRowGroupColumn(colKey); };
ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this._columnController.addRowGroupColumns(colKeys); };
ColumnApi.prototype.setPivotColumns = function (colKeys) { this._columnController.setPivotColumns(colKeys); };
ColumnApi.prototype.removePivotColumn = function (colKey) { this._columnController.removePivotColumn(colKey); };
ColumnApi.prototype.removePivotColumns = function (colKeys) { this._columnController.removePivotColumns(colKeys); };
ColumnApi.prototype.addPivotColumn = function (colKey) { this._columnController.addPivotColumn(colKey); };
ColumnApi.prototype.addPivotColumns = function (colKeys) { this._columnController.addPivotColumns(colKeys); };
ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this._columnController.getLeftDisplayedColumnGroups(); };
ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this._columnController.getCenterDisplayedColumnGroups(); };
ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this._columnController.getRightDisplayedColumnGroups(); };
ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this._columnController.getAllDisplayedColumnGroups(); };
ColumnApi.prototype.autoSizeColumn = function (key) { return this._columnController.autoSizeColumn(key); };
ColumnApi.prototype.autoSizeColumns = function (keys) { return this._columnController.autoSizeColumns(keys); };
// below goes through deprecated items, prints message to user, then calls the new version of the same method
ColumnApi.prototype.columnGroupOpened = function (group, newValue) {
console.error('ag-Grid: columnGroupOpened no longer exists, use setColumnGroupOpened');
this.setColumnGroupOpened(group, newValue);
};
ColumnApi.prototype.hideColumns = function (colIds, hide) {
console.error('ag-Grid: hideColumns is deprecated, use setColumnsVisible');
this._columnController.setColumnsVisible(colIds, !hide);
};
ColumnApi.prototype.hideColumn = function (colId, hide) {
console.error('ag-Grid: hideColumn is deprecated, use setColumnVisible');
this._columnController.setColumnVisible(colId, !hide);
};
ColumnApi.prototype.setState = function (columnState) {
console.error('ag-Grid: setState is deprecated, use setColumnState');
return this.setColumnState(columnState);
};
ColumnApi.prototype.getState = function () {
console.error('ag-Grid: getState is deprecated, use getColumnState');
return this.getColumnState();
};
ColumnApi.prototype.resetState = function () {
console.error('ag-Grid: resetState is deprecated, use resetColumnState');
this.resetColumnState();
};
ColumnApi.prototype.getValueColumns = function () {
console.error('ag-Grid: getValueColumns is deprecated, use getAggregationColumns');
return this._columnController.getAggregationColumns();
};
ColumnApi.prototype.removeValueColumn = function (column) {
console.error('ag-Grid: removeValueColumn is deprecated, use removeValueColumn');
this._columnController.removeValueColumn(column);
};
ColumnApi.prototype.addValueColumn = function (column) {
console.error('ag-Grid: addValueColumn is deprecated, use addValueColumn');
this._columnController.addValueColumn(column);
};
ColumnApi.prototype.setColumnAggFunction = function (column, aggFunc) {
console.error('ag-Grid: setColumnAggFunction is deprecated, use setColumnAggFunc');
this._columnController.setColumnAggFunc(column, aggFunc);
};
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', ColumnController)
], ColumnApi.prototype, "_columnController", void 0);
ColumnApi = __decorate([
context_1.Bean('columnApi'),
__metadata('design:paramtypes', [])
], ColumnApi);
return ColumnApi;
})();
exports.ColumnApi = ColumnApi;
var ColumnController = (function () {
function ColumnController() {
// header row count, based on user provided columns
this.primaryHeaderRowCount = 0;
this.secondaryHeaderRowCount = 0;
this.secondaryColumnsPresent = false;
// header row count, either above, or based on pivoting if we are pivoting
this.gridHeaderRowCount = 0;
// these are the lists used by the rowRenderer to render nodes. almost the leaf nodes of the above
// displayed trees, however it also takes into account if the groups are open or not.
this.displayedLeftColumns = [];
this.displayedRightColumns = [];
this.displayedCenterColumns = [];
// all three lists above combined
this.allDisplayedColumns = [];
// same as above, except trimmed down to only columns within the viewport
this.allDisplayedVirtualColumns = [];
this.rowGroupColumns = [];
this.valueColumns = [];
this.pivotColumns = [];
this.ready = false;
this.pivotMode = false;
}
ColumnController.prototype.init = function () {
this.pivotMode = this.gridOptionsWrapper.isPivotMode();
if (this.gridOptionsWrapper.getColumnDefs()) {
this.setColumnDefs(this.gridOptionsWrapper.getColumnDefs());
}
};
ColumnController.prototype.setViewportLeftAndRight = function () {
this.viewportLeft = this.scrollPosition;
this.viewportRight = this.totalWidth + this.scrollPosition;
};
ColumnController.prototype.checkDisplayedCenterColumns = function () {
// check displayCenterColumnTree exists first, as it won't exist when grid is initialising
if (utils_1.Utils.exists(this.displayedCenterColumns)) {
var hashBefore = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#');
this.updateVirtualSets();
var hashAfter = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#');
if (hashBefore !== hashAfter) {
this.eventService.dispatchEvent(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED);
}
}
};
ColumnController.prototype.setWidthAndScrollPosition = function (totalWidth, scrollPosition) {
if (totalWidth !== this.totalWidth || scrollPosition !== this.scrollPosition) {
this.totalWidth = totalWidth;
this.scrollPosition = scrollPosition;
this.setViewportLeftAndRight();
if (this.ready) {
this.checkDisplayedCenterColumns();
}
}
};
ColumnController.prototype.isPivotMode = function () {
return this.pivotMode;
};
// public getVirtualRowGroup(dept: number): ColumnGroup[] {
// var columnGroups = [];
//
// var groupsAtDept: ColumnGroupChild[] = [];
// var cellTree = this.columnController.getDisplayedColumnGroups(this.pinned);
// this.addTreeNodesAtDept(cellTree, this.dept, nodesAtDept);
//
//
// return columnGroups;
//
// }
//
// private addTreeNodesAtDept(cellTree: ColumnGroupChild[], dept: number, result: ColumnGroupChild[]): void {
// cellTree.forEach( (abstractColumn) => {
// if (dept===0) {
// result.push(abstractColumn);
// } else if (abstractColumn instanceof ColumnGroup) {
// var columnGroup = <ColumnGroup> abstractColumn;
// this.addTreeNodesAtDept(columnGroup.getDisplayedChildren(), dept-1, result);
// } else {
// // we are looking for children past a column, so have come to the end,
// // do nothing, and because the tree is balanced, the result of this recursion
// // will be an empty list.
// }
// });
// }
ColumnController.prototype.setPivotMode = function (pivotMode) {
if (pivotMode === this.pivotMode) {
return;
}
this.pivotMode = pivotMode;
this.updateDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, event);
};
ColumnController.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) {
if (!this.secondaryColumnsPresent) {
return null;
}
var valueColumnToFind = this.getPrimaryColumn(valueColKey);
var foundColumn = null;
this.secondaryColumns.forEach(function (column) {
var thisPivotKeys = column.getColDef().pivotKeys;
var pivotValueColumn = column.getColDef().pivotValueColumn;
var pivotKeyMatches = utils_1.Utils.compareArrays(thisPivotKeys, pivotKeys);
var pivotValueMatches = pivotValueColumn === valueColumnToFind;
if (pivotKeyMatches && pivotValueMatches) {
foundColumn = column;
}
});
return foundColumn;
};
ColumnController.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('ColumnController');
};
ColumnController.prototype.setFirstRightAndLastLeftPinned = function () {
var lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[this.displayedLeftColumns.length - 1] : null;
var firstRight = this.displayedRightColumns ? this.displayedRightColumns[0] : null;
this.gridColumns.forEach(function (column) {
column.setLastLeftPinned(column === lastLeft);
column.setFirstRightPinned(column === firstRight);
});
};
ColumnController.prototype.autoSizeColumns = function (keys) {
var _this = this;
this.actionOnGridColumns(keys, function (column) {
var requiredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column);
if (requiredWidth > 0) {
var newWidth = _this.normaliseColumnWidth(column, requiredWidth);
column.setActualWidth(newWidth);
}
return true;
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_RESIZED).withFinished(true);
});
};
ColumnController.prototype.autoSizeColumn = function (key) {
this.autoSizeColumns([key]);
};
ColumnController.prototype.autoSizeAllColumns = function () {
var allDisplayedColumns = this.getAllDisplayedColumns();
this.autoSizeColumns(allDisplayedColumns);
};
ColumnController.prototype.getColumnsFromTree = function (rootColumns) {
var result = [];
recursiveFindColumns(rootColumns);
return result;
function recursiveFindColumns(childColumns) {
for (var i = 0; i < childColumns.length; i++) {
var child = childColumns[i];
if (child instanceof column_1.Column) {
result.push(child);
}
else if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
recursiveFindColumns(child.getChildren());
}
}
}
};
ColumnController.prototype.getAllDisplayedColumnGroups = function () {
if (this.displayedLeftColumnTree && this.displayedRightColumnTree && this.displayedCentreColumnTree) {
return this.displayedLeftColumnTree
.concat(this.displayedCentreColumnTree)
.concat(this.displayedRightColumnTree);
}
else {
return null;
}
};
ColumnController.prototype.getPrimaryColumnTree = function () {
return this.primaryBalancedTree;
};
// + gridPanel -> for resizing the body and setting top margin
ColumnController.prototype.getHeaderRowCount = function () {
return this.gridHeaderRowCount;
};
// + headerRenderer -> setting pinned body width
ColumnController.prototype.getLeftDisplayedColumnGroups = function () {
return this.displayedLeftColumnTree;
};
// + headerRenderer -> setting pinned body width
ColumnController.prototype.getRightDisplayedColumnGroups = function () {
return this.displayedRightColumnTree;
};
// + headerRenderer -> setting pinned body width
ColumnController.prototype.getCenterDisplayedColumnGroups = function () {
return this.displayedCentreColumnTree;
};
ColumnController.prototype.getDisplayedColumnGroups = function (type) {
switch (type) {
case column_1.Column.PINNED_LEFT: return this.getLeftDisplayedColumnGroups();
case column_1.Column.PINNED_RIGHT: return this.getRightDisplayedColumnGroups();
default: return this.getCenterDisplayedColumnGroups();
}
};
// gridPanel -> ensureColumnVisible
ColumnController.prototype.isColumnDisplayed = function (column) {
return this.getAllDisplayedColumns().indexOf(column) >= 0;
};
// + csvCreator
ColumnController.prototype.getAllDisplayedColumns = function () {
return this.allDisplayedColumns;
};
// + csvCreator
ColumnController.prototype.getAllDisplayedVirtualColumns = function () {
return this.allDisplayedVirtualColumns;
};
// used by:
// + angularGrid -> setting pinned body width
// todo: this needs to be cached
ColumnController.prototype.getPinnedLeftContainerWidth = function () {
return this.getWidthOfColsInList(this.displayedLeftColumns);
};
// todo: this needs to be cached
ColumnController.prototype.getPinnedRightContainerWidth = function () {
return this.getWidthOfColsInList(this.displayedRightColumns);
};
ColumnController.prototype.addRowGroupColumns = function (keys, columnsToIncludeInEvent) {
var _this = this;
this.actionOnPrimaryColumns(keys, function (column) {
if (!column.isRowGroupActive()) {
_this.rowGroupColumns.push(column);
column.setRowGroupActive(true);
return true;
}
else {
return false;
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED);
}, columnsToIncludeInEvent);
};
ColumnController.prototype.setRowGroupColumns = function (keys) {
var updatedColumns = [];
this.rowGroupColumns.forEach(function (column) {
column.setRowGroupActive(false);
updatedColumns.push(column);
});
this.rowGroupColumns.length = 0;
this.addRowGroupColumns(keys, updatedColumns);
};
ColumnController.prototype.addRowGroupColumn = function (key) {
this.addRowGroupColumns([key]);
};
ColumnController.prototype.removeRowGroupColumns = function (keys) {
var _this = this;
this.actionOnPrimaryColumns(keys, function (column) {
if (column.isRowGroupActive()) {
utils_1.Utils.removeFromArray(_this.rowGroupColumns, column);
column.setRowGroupActive(false);
return true;
}
else {
return false;
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED);
});
};
ColumnController.prototype.removeRowGroupColumn = function (key) {
this.removeRowGroupColumns([key]);
};
ColumnController.prototype.addPivotColumns = function (keys, columnsToIncludeInEvent) {
var _this = this;
this.actionOnPrimaryColumns(keys, function (column) {
if (!column.isPivotActive()) {
_this.pivotColumns.push(column);
column.setPivotActive(true);
return true;
}
else {
return false;
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED);
}, columnsToIncludeInEvent);
};
ColumnController.prototype.setPivotColumns = function (keys) {
var updatedColumns = [];
this.pivotColumns.forEach(function (column) {
column.setPivotActive(false);
updatedColumns.push(column);
});
this.pivotColumns.length = 0;
this.addPivotColumns(keys, updatedColumns);
};
ColumnController.prototype.addPivotColumn = function (key) {
this.addPivotColumns([key]);
};
ColumnController.prototype.removePivotColumns = function (keys) {
var _this = this;
this.actionOnPrimaryColumns(keys, function (column) {
if (column.isPivotActive()) {
utils_1.Utils.removeFromArray(_this.pivotColumns, column);
column.setPivotActive(false);
return true;
}
else {
return false;
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED);
});
};
ColumnController.prototype.removePivotColumn = function (key) {
this.removePivotColumns([key]);
};
ColumnController.prototype.addValueColumns = function (keys) {
var _this = this;
this.actionOnPrimaryColumns(keys, function (column) {
if (!column.isValueActive()) {
if (!column.getAggFunc()) {
var defaultAggFunc = _this.aggFuncService.getDefaultAggFunc();
column.setAggFunc(defaultAggFunc);
}
_this.valueColumns.push(column);
column.setValueActive(true);
return true;
}
else {
return false;
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED);
});
};
ColumnController.prototype.addValueColumn = function (colKey) {
this.addValueColumns([colKey]);
};
ColumnController.prototype.removeValueColumn = function (colKey) {
this.removeValueColumns([colKey]);
};
ColumnController.prototype.removeValueColumns = function (keys) {
var _this = this;
this.actionOnPrimaryColumns(keys, function (column) {
if (column.isValueActive()) {
utils_1.Utils.removeFromArray(_this.valueColumns, column);
column.setValueActive(false);
return true;
}
else {
return false;
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED);
});
};
// returns the width we can set to this col, taking into consideration min and max widths
ColumnController.prototype.normaliseColumnWidth = function (column, newWidth) {
if (newWidth < column.getMinWidth()) {
newWidth = column.getMinWidth();
}
if (column.isGreaterThanMax(newWidth)) {
newWidth = column.getMaxWidth();
}
return newWidth;
};
ColumnController.prototype.getPrimaryOrGridColumn = function (key) {
var column = this.getPrimaryColumn(key);
if (column) {
return column;
}
else {
return this.getGridColumn(key);
}
};
ColumnController.prototype.setColumnWidth = function (key, newWidth, finished) {
var column = this.getPrimaryOrGridColumn(key);
if (!column) {
return;
}
newWidth = this.normaliseColumnWidth(column, newWidth);
var widthChanged = column.getActualWidth() !== newWidth;
if (widthChanged) {
column.setActualWidth(newWidth);
this.setLeftValues();
}
// check for change first, to avoid unnecessary firing of events
// however we always fire 'finished' events. this is important
// when groups are resized, as if the group is changing slowly,
// eg 1 pixel at a time, then each change will fire change events
// in all the columns in the group, but only one with get the pixel.
if (finished || widthChanged) {
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_RESIZED).withColumn(column).withFinished(finished);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_RESIZED, event);
}
this.checkDisplayedCenterColumns();
};
ColumnController.prototype.setColumnAggFunc = function (column, aggFunc) {
column.setAggFunc(aggFunc);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, event);
};
ColumnController.prototype.moveRowGroupColumn = function (fromIndex, toIndex) {
var column = this.rowGroupColumns[fromIndex];
this.rowGroupColumns.splice(fromIndex, 1);
this.rowGroupColumns.splice(toIndex, 0, column);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, event);
};
ColumnController.prototype.moveColumns = function (columnsToMoveKeys, toIndex) {
if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {
console.warn('ag-Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);
console.warn('ag-Grid: remember that you should not count the moving columns when calculating the new index');
return;
}
// we want to pull all the columns out first and put them into an ordered list
var columnsToMove = this.getGridColumns(columnsToMoveKeys);
var failedRules = !this.doesMovePassRules(columnsToMove, toIndex);
if (failedRules) {
return;
}
this.gridPanel.turnOnAnimationForABit();
utils_1.Utils.moveInArray(this.gridColumns, columnsToMove, toIndex);
this.updateDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_MOVED)
.withToIndex(toIndex)
.withColumns(columnsToMove);
if (columnsToMove.length === 1) {
event.withColumn(columnsToMove[0]);
}
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_MOVED, event);
};
ColumnController.prototype.doesMovePassRules = function (columnsToMove, toIndex) {
var allColumnsCopy = this.gridColumns.slice();
utils_1.Utils.moveInArray(allColumnsCopy, columnsToMove, toIndex);
// look for broken groups, ie stray columns from groups that should be married
for (var index = 0; index < (allColumnsCopy.length - 1); index++) {
var thisColumn = allColumnsCopy[index];
var nextColumn = allColumnsCopy[index + 1];
// skip hidden columns
if (!nextColumn.isVisible()) {
continue;
}
var thisPath = this.columnUtils.getOriginalPathForColumn(thisColumn, this.gridBalancedTree);
var nextPath = this.columnUtils.getOriginalPathForColumn(nextColumn, this.gridBalancedTree);
if (!nextPath || !thisPath) {
console.log('next path is missing');
}
// start at the top of the path and work down
for (var dept = 0; dept < thisPath.length; dept++) {
var thisOriginalGroup = thisPath[dept];
var nextOriginalGroup = nextPath[dept];
var lastColInGroup = thisOriginalGroup !== nextOriginalGroup;
// a runaway is a column from this group that left the group, and the group has it's children marked as married
var colGroupDef = thisOriginalGroup.getColGroupDef();
var marryChildren = colGroupDef && colGroupDef.marryChildren;
var needToCheckForRunaways = lastColInGroup && marryChildren;
if (needToCheckForRunaways) {
for (var tailIndex = index + 1; tailIndex < allColumnsCopy.length; tailIndex++) {
var tailColumn = allColumnsCopy[tailIndex];
var tailPath = this.columnUtils.getOriginalPathForColumn(tailColumn, this.gridBalancedTree);
var tailOriginalGroup = tailPath[dept];
if (tailOriginalGroup === thisOriginalGroup) {
return false;
}
}
}
}
}
return true;
};
ColumnController.prototype.moveColumn = function (key, toIndex) {
this.moveColumns([key], toIndex);
};
ColumnController.prototype.moveColumnByIndex = function (fromIndex, toIndex) {
var column = this.gridColumns[fromIndex];
this.moveColumn(column, toIndex);
};
// used by:
// + angularGrid -> for setting body width
// + rowController -> setting main row widths (when inserting and resizing)
// need to cache this
ColumnController.prototype.getBodyContainerWidth = function () {
var result = this.getWidthOfColsInList(this.displayedCenterColumns);
return result;
};
// + rowController
ColumnController.prototype.getAggregationColumns = function () {
return this.valueColumns ? this.valueColumns : [];
};
// + rowController
ColumnController.prototype.getPivotColumns = function () {
return this.pivotColumns ? this.pivotColumns : [];
};
// + inMemoryRowModel
ColumnController.prototype.isPivotActive = function () {
return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode;
};
// + toolPanel
ColumnController.prototype.getRowGroupColumns = function () {
return this.rowGroupColumns ? this.rowGroupColumns : [];
};
// + rowController -> while inserting rows
ColumnController.prototype.getDisplayedCenterColumns = function () {
return this.displayedCenterColumns.slice(0);
};
// + rowController -> while inserting rows
ColumnController.prototype.getDisplayedLeftColumns = function () {
return this.displayedLeftColumns.slice(0);
};
ColumnController.prototype.getDisplayedRightColumns = function () {
return this.displayedRightColumns.slice(0);
};
ColumnController.prototype.getDisplayedColumns = function (type) {
switch (type) {
case column_1.Column.PINNED_LEFT: return this.getDisplayedLeftColumns();
case column_1.Column.PINNED_RIGHT: return this.getDisplayedRightColumns();
default: return this.getDisplayedCenterColumns();
}
};
// used by:
// + inMemoryRowController -> sorting, building quick filter text
// + headerRenderer -> sorting (clearing icon)
ColumnController.prototype.getAllPrimaryColumns = function () {
return this.primaryColumns;
};
// + moveColumnController
ColumnController.prototype.getAllGridColumns = function () {
return this.gridColumns;
};
ColumnController.prototype.isEmpty = function () {
return utils_1.Utils.missingOrEmpty(this.gridColumns);
};
ColumnController.prototype.isRowGroupEmpty = function () {
return utils_1.Utils.missingOrEmpty(this.rowGroupColumns);
};
ColumnController.prototype.setColumnVisible = function (key, visible) {
this.setColumnsVisible([key], visible);
};
ColumnController.prototype.setColumnsVisible = function (keys, visible) {
this.gridPanel.turnOnAnimationForABit();
this.actionOnGridColumns(keys, function (column) {
column.setVisible(visible);
return true;
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VISIBLE).withVisible(visible);
});
};
ColumnController.prototype.setColumnPinned = function (key, pinned) {
this.setColumnsPinned([key], pinned);
};
ColumnController.prototype.setColumnsPinned = function (keys, pinned) {
this.gridPanel.turnOnAnimationForABit();
var actualPinned;
if (pinned === true || pinned === column_1.Column.PINNED_LEFT) {
actualPinned = column_1.Column.PINNED_LEFT;
}
else if (pinned === column_1.Column.PINNED_RIGHT) {
actualPinned = column_1.Column.PINNED_RIGHT;
}
else {
actualPinned = null;
}
this.actionOnGridColumns(keys, function (column) {
column.setPinned(actualPinned);
return true;
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PINNED).withPinned(actualPinned);
});
};
ColumnController.prototype.actionOnGridColumns = function (keys, action, createEvent, columnsToIncludeInEvent) {
this.actionOnColumns(keys, this.getGridColumn.bind(this), action, createEvent, columnsToIncludeInEvent);
};
ColumnController.prototype.actionOnPrimaryColumns = function (keys, action, createEvent, columnsToIncludeInEvent) {
this.actionOnColumns(keys, this.getPrimaryColumn.bind(this), action, createEvent, columnsToIncludeInEvent);
};
// does an action on a set of columns. provides common functionality for looking up the
// columns based on key, getting a list of effected columns, and then updated the event
// with either one column (if it was just one col) or a list of columns
// used by: autoResize, setVisible, setPinned
ColumnController.prototype.actionOnColumns = function (// the column keys this action will be on
keys, columnLookup,
// the action to do - if this returns false, the column was skipped
// and won't be included in the event
action,
// should return back a column event of the right type
createEvent, columnsToIncludeInEvent) {
if (utils_1.Utils.missingOrEmpty(keys) && utils_1.Utils.missingOrEmpty(columnsToIncludeInEvent)) {
return;
}
var updatedColumns = [];
keys.forEach(function (key) {
var column = columnLookup(key);
if (!column) {
return;
}
// need to check for false with type (ie !== instead of !=)
// as not returning anything (undefined) would also be false
var resultOfAction = action(column);
if (resultOfAction !== false) {
updatedColumns.push(column);
}
});
if (updatedColumns.length === 0 && utils_1.Utils.missingOrEmpty(columnsToIncludeInEvent)) {
return;
}
if (utils_1.Utils.existsAndNotEmpty(columnsToIncludeInEvent)) {
columnsToIncludeInEvent.forEach(function (column) {
if (updatedColumns.indexOf(column) < 0) {
updatedColumns.push(column);
}
});
}
this.updateDisplayedColumns();
var event = createEvent();
event.withColumns(updatedColumns);
if (updatedColumns.length === 1) {
event.withColumn(updatedColumns[0]);
}
this.eventService.dispatchEvent(event.getType(), event);
};
ColumnController.prototype.getDisplayedColBefore = function (col) {
var allDisplayedColumns = this.getAllDisplayedColumns();
var oldIndex = allDisplayedColumns.indexOf(col);
if (oldIndex > 0) {
return allDisplayedColumns[oldIndex - 1];
}
else {
return null;
}
};
// used by:
// + rowRenderer -> for navigation
ColumnController.prototype.getDisplayedColAfter = function (col) {
var allDisplayedColumns = this.getAllDisplayedColumns();
var oldIndex = allDisplayedColumns.indexOf(col);
if (oldIndex < (allDisplayedColumns.length - 1)) {
return allDisplayedColumns[oldIndex + 1];
}
else {
return null;
}
};
ColumnController.prototype.isPinningLeft = function () {
return this.displayedLeftColumns.length > 0;
};
ColumnController.prototype.isPinningRight = function () {
return this.displayedRightColumns.length > 0;
};
ColumnController.prototype.getPrimaryAndSecondaryAndAutoColumns = function () {
var result = this.primaryColumns.slice(0);
if (this.groupAutoColumnActive) {
result.push(this.groupAutoColumn);
}
if (this.secondaryColumnsPresent) {
this.secondaryColumns.forEach(function (column) { return result.push(column); });
}
return result;
};
ColumnController.prototype.createStateItemFromColumn = function (column) {
var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null;
var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null;
var resultItem = {
colId: column.getColId(),
hide: !column.isVisible(),
aggFunc: column.getAggFunc() ? column.getAggFunc() : null,
width: column.getActualWidth(),
pivotIndex: pivotIndex,
pinned: column.getPinned(),
rowGroupIndex: rowGroupIndex
};
return resultItem;
};
ColumnController.prototype.getColumnState = function () {
if (utils_1.Utils.missing(this.primaryColumns)) {
return [];
}
var columnStateList = this.primaryColumns.map(this.createStateItemFromColumn.bind(this));
if (!this.pivotMode) {
this.orderColumnStateList(columnStateList);
}
return columnStateList;
};
ColumnController.prototype.orderColumnStateList = function (columnStateList) {
var gridColumnIds = this.gridColumns.map(function (column) { return column.getColId(); });
columnStateList.sort(function (itemA, itemB) {
var posA = gridColumnIds.indexOf(itemA.colId);
var posB = gridColumnIds.indexOf(itemB.colId);
return posA - posB;
});
};
ColumnController.prototype.resetColumnState = function () {
// we can't use 'allColumns' as the order might of messed up, so get the primary ordered list
var primaryColumns = this.getColumnsFromTree(this.primaryBalancedTree);
var state = [];
if (primaryColumns) {
primaryColumns.forEach(function (column) {
state.push({
colId: column.getColId(),
aggFunc: column.getColDef().aggFunc,
hide: column.getColDef().hide,
pinned: column.getColDef().pinned,
rowGroupIndex: column.getColDef().rowGroupIndex,
pivotIndex: column.getColDef().pivotIndex,
width: column.getColDef().width
});
});
}
this.setColumnState(state);
};
ColumnController.prototype.setColumnState = function (columnState) {
var _this = this;
if (utils_1.Utils.missingOrEmpty(this.primaryColumns)) {
return false;
}
// at the end below, this list will have all columns we got no state for
var columnsWithNoState = this.primaryColumns.slice();
this.rowGroupColumns = [];
this.valueColumns = [];
this.pivotColumns = [];
var success = true;
var rowGroupIndexes = {};
var pivotIndexes = {};
if (columnState) {
columnState.forEach(function (stateItem) {
var column = _this.getPrimaryColumn(stateItem.colId);
if (!column) {
console.warn('ag-grid: column ' + stateItem.colId + ' not found');
success = false;
}
else {
_this.syncColumnWithStateItem(column, stateItem, rowGroupIndexes, pivotIndexes);
utils_1.Utils.removeFromArray(columnsWithNoState, column);
}
});
}
// anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden
columnsWithNoState.forEach(this.syncColumnWithNoState.bind(this));
// sort the lists according to the indexes that were provided
this.rowGroupColumns.sort(this.sortColumnListUsingIndexes.bind(this, rowGroupIndexes));
this.pivotColumns.sort(this.sortColumnListUsingIndexes.bind(this, pivotIndexes));
this.copyDownGridColumns();
var orderOfColIds = columnState.map(function (stateItem) { return stateItem.colId; });
this.gridColumns.sort(function (colA, colB) {
var indexA = orderOfColIds.indexOf(colA.getId());
var indexB = orderOfColIds.indexOf(colB.getId());
return indexA - indexB;
});
this.updateDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, event);
return success;
};
ColumnController.prototype.sortColumnListUsingIndexes = function (indexes, colA, colB) {
var indexA = indexes[colA.getId()];
var indexB = indexes[colB.getId()];
return indexA - indexB;
};
ColumnController.prototype.syncColumnWithNoState = function (column) {
column.setVisible(false);
column.setAggFunc(null);
column.setPinned(null);
column.setRowGroupActive(false);
column.setPivotActive(false);
column.setValueActive(false);
};
ColumnController.prototype.syncColumnWithStateItem = function (column, stateItem, rowGroupIndexes, pivotIndexes) {
// following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true
column.setVisible(!stateItem.hide);
// sets pinned to 'left' or 'right'
column.setPinned(stateItem.pinned);
// if width provided and valid, use it, otherwise stick with the old width
if (stateItem.width >= this.gridOptionsWrapper.getMinColWidth()) {
column.setActualWidth(stateItem.width);
}
if (typeof stateItem.aggFunc === 'string') {
column.setAggFunc(stateItem.aggFunc);
column.setValueActive(true);
this.valueColumns.push(column);
}
else {
column.setAggFunc(null);
column.setValueActive(false);
}
if (typeof stateItem.rowGroupIndex === 'number') {
this.rowGroupColumns.push(column);
column.setRowGroupActive(true);
rowGroupIndexes[column.getId()] = stateItem.rowGroupIndex;
}
else {
column.setRowGroupActive(false);
}
if (typeof stateItem.pivotIndex === 'number') {
this.pivotColumns.push(column);
column.setPivotActive(true);
pivotIndexes[column.getId()] = stateItem.pivotIndex;
}
else {
column.setPivotActive(false);
}
};
ColumnController.prototype.getGridColumns = function (keys) {
return this.getColumns(keys, this.getGridColumn.bind(this));
};
ColumnController.prototype.getColumns = function (keys, columnLookupCallback) {
var foundColumns = [];
if (keys) {
keys.forEach(function (key) {
var column = columnLookupCallback(key);
if (column) {
foundColumns.push(column);
}
});
}
return foundColumns;
};
// used by growGroupPanel
ColumnController.prototype.getColumnWithValidation = function (key) {
var column = this.getPrimaryColumn(key);
if (!column) {
console.warn('ag-Grid: could not find column ' + column);
}
return column;
};
ColumnController.prototype.getPrimaryColumn = function (key) {
return this.getColumn(key, this.primaryColumns);
};
ColumnController.prototype.getGridColumn = function (key) {
return this.getColumn(key, this.gridColumns);
};
ColumnController.prototype.getColumn = function (key, columnList) {
if (!key) {
return null;
}
for (var i = 0; i < columnList.length; i++) {
if (colMatches(columnList[i])) {
return columnList[i];
}
}
if (this.groupAutoColumnActive && colMatches(this.groupAutoColumn)) {
return this.groupAutoColumn;
}
function colMatches(column) {
var columnMatches = column === key;
var colDefMatches = column.getColDef() === key;
var idMatches = column.getColId() === key;
return columnMatches || colDefMatches || idMatches;
}
return null;
};
ColumnController.prototype.getDisplayNameForCol = function (column, includeAggFunc) {
if (includeAggFunc === void 0) { includeAggFunc = false; }
var headerName = this.getHeaderName(column);
if (includeAggFunc) {
return this.wrapHeaderNameWithAggFunc(column, headerName);
}
else {
return headerName;
}
};
ColumnController.prototype.getHeaderName = function (column) {
var colDef = column.getColDef();
var headerValueGetter = colDef.headerValueGetter;
if (headerValueGetter) {
var params = {
colDef: colDef,
api: this.gridOptionsWrapper.getApi(),
context: this.gridOptionsWrapper.getContext()
};
if (typeof headerValueGetter === 'function') {
// valueGetter is a function, so just call it
return headerValueGetter(params);
}
else if (typeof headerValueGetter === 'string') {
// valueGetter is an expression, so execute the expression
return this.expressionService.evaluate(headerValueGetter, params);
}
else {
console.warn('ag-grid: headerValueGetter must be a function or a string');
return '';
}
}
else {
return colDef.headerName;
}
};
ColumnController.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) {
if (this.gridOptionsWrapper.isSuppressAggFuncInHeader()) {
return headerName;
}
// only columns with aggregation active can have aggregations
var pivotValueColumn = column.getColDef().pivotValueColumn;
var pivotActiveOnThisColumn = utils_1.Utils.exists(pivotValueColumn);
var aggFunc = null;
var aggFuncFound;
// otherwise we have a measure that is active, and we are doing aggregation on it
if (pivotActiveOnThisColumn) {
aggFunc = pivotValueColumn.getAggFunc();
aggFuncFound = true;
}
else {
var measureActive = column.isValueActive();
var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty();
if (measureActive && aggregationPresent) {
aggFunc = column.getAggFunc();
aggFuncFound = true;
}
else {
aggFuncFound = false;
}
}
if (aggFuncFound) {
var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func';
return aggFuncString + "(" + headerName + ")";
}
else {
return headerName;
}
};
// returns the group with matching colId and instanceId. If instanceId is missing,
// matches only on the colId.
ColumnController.prototype.getColumnGroup = function (colId, instanceId) {
if (!colId) {
return null;
}
if (colId instanceof columnGroup_1.ColumnGroup) {
return colId;
}
var allColumnGroups = this.getAllDisplayedColumnGroups();
var checkInstanceId = typeof instanceId === 'number';
var result = null;
this.columnUtils.deptFirstAllColumnTreeSearch(allColumnGroups, function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
var matched;
if (checkInstanceId) {
matched = colId === columnGroup.getGroupId() && instanceId === columnGroup.getInstanceId();
}
else {
matched = colId === columnGroup.getGroupId();
}
if (matched) {
result = columnGroup;
}
}
});
return result;
};
ColumnController.prototype.setColumnDefs = function (columnDefs) {
var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(columnDefs, true);
this.primaryBalancedTree = balancedTreeResult.balancedTree;
this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;
this.primaryColumns = this.getColumnsFromTree(this.primaryBalancedTree);
this.extractRowGroupColumns();
this.extractPivotColumns();
this.createValueColumns();
this.copyDownGridColumns();
this.updateDisplayedColumns();
this.ready = true;
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, event);
this.eventService.dispatchEvent(events_1.Events.EVENT_NEW_COLUMNS_LOADED);
};
ColumnController.prototype.isReady = function () {
return this.ready;
};
ColumnController.prototype.extractRowGroupColumns = function () {
var _this = this;
this.rowGroupColumns.forEach(function (column) { return column.setRowGroupActive(false); });
this.rowGroupColumns = [];
// pull out the columns
this.primaryColumns.forEach(function (column) {
if (typeof column.getColDef().rowGroupIndex === 'number') {
_this.rowGroupColumns.push(column);
column.setRowGroupActive(true);
}
});
// then sort them
this.rowGroupColumns.sort(function (colA, colB) {
return colA.getColDef().rowGroupIndex - colB.getColDef().rowGroupIndex;
});
};
ColumnController.prototype.extractPivotColumns = function () {
var _this = this;
this.pivotColumns.forEach(function (column) { return column.setPivotActive(false); });
this.pivotColumns = [];
// pull out the columns
this.primaryColumns.forEach(function (column) {
if (typeof column.getColDef().pivotIndex === 'number') {
_this.pivotColumns.push(column);
column.setPivotActive(true);
}
});
// then sort them
this.pivotColumns.sort(function (colA, colB) {
return colA.getColDef().pivotIndex - colB.getColDef().pivotIndex;
});
};
// called by headerRenderer - when a header is opened or closed
ColumnController.prototype.setColumnGroupOpened = function (passedGroup, newValue, instanceId) {
var groupToUse = this.getColumnGroup(passedGroup, instanceId);
if (!groupToUse) {
return;
}
this.logger.log('columnGroupOpened(' + groupToUse.getGroupId() + ',' + newValue + ')');
groupToUse.setExpanded(newValue);
this.gridPanel.turnOnAnimationForABit();
this.updateGroupsAndDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_GROUP_OPENED).withColumnGroup(groupToUse);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_GROUP_OPENED, event);
};
// used by updateModel
ColumnController.prototype.getColumnGroupState = function () {
var groupState = {};
this.columnUtils.deptFirstDisplayedColumnTreeSearch(this.getAllDisplayedColumnGroups(), function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
var key = columnGroup.getGroupId();
// if more than one instance of the group, we only record the state of the first item
if (!groupState.hasOwnProperty(key)) {
groupState[key] = columnGroup.isExpanded();
}
}
});
return groupState;
};
// used by updateModel
ColumnController.prototype.setColumnGroupState = function (groupState) {
this.columnUtils.deptFirstDisplayedColumnTreeSearch(this.getAllDisplayedColumnGroups(), function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
var key = columnGroup.getGroupId();
var shouldExpandGroup = groupState[key] === true && columnGroup.isExpandable();
if (shouldExpandGroup) {
columnGroup.setExpanded(true);
}
}
});
};
ColumnController.prototype.calculateColumnsForDisplay = function () {
var columnsForDisplay;
if (this.secondaryColumnsPresent) {
// always use secondary columns if they are there, these can be either in grid
// pivoting, or the user provided alternative columns
columnsForDisplay = this.gridColumns.slice();
}
else if (this.pivotMode) {
// pivot mode is on, but we are not pivoting, so we only
// show columns we are aggregating on
columnsForDisplay = this.valueColumns.slice();
}
else {
// not in pivot mode, so we use the visibility of the column
// to decide what is displayable
columnsForDisplay = utils_1.Utils.filter(this.gridColumns, function (column) { return column.isVisible(); });
}
this.createGroupAutoColumn();
if (this.groupAutoColumnActive) {
columnsForDisplay.unshift(this.groupAutoColumn);
}
return columnsForDisplay;
};
ColumnController.prototype.updateDisplayedColumns = function () {
// save opened / closed state
var oldGroupState = this.getColumnGroupState();
var columnsForDisplay = this.calculateColumnsForDisplay();
this.buildDisplayedTrees(columnsForDisplay);
// restore opened / closed state
this.setColumnGroupState(oldGroupState);
// this is also called when a group is opened or closed
this.updateGroupsAndDisplayedColumns();
this.setFirstRightAndLastLeftPinned();
};
ColumnController.prototype.isSecondaryColumnsPresent = function () {
return this.secondaryColumnsPresent;
};
ColumnController.prototype.setSecondaryColumns = function (colDefs) {
var newColsPresent = colDefs && colDefs.length > 0;
// if not cols passed, and we had to cols anyway, then do nothing
if (!newColsPresent && !this.secondaryColumnsPresent) {
return;
}
if (newColsPresent) {
var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(colDefs, false);
this.secondaryBalancedTree = balancedTreeResult.balancedTree;
this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1;
this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree);
this.secondaryColumnsPresent = true;
}
else {
this.secondaryBalancedTree = null;
this.secondaryHeaderRowCount = -1;
this.secondaryColumns = null;
this.secondaryColumnsPresent = false;
}
this.copyDownGridColumns();
this.updateDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_PIVOT_VALUE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_PIVOT_VALUE_CHANGED, event);
};
// called from: setColumnState, setColumnDefs, setAlternativeColumnDefs
ColumnController.prototype.copyDownGridColumns = function () {
if (this.secondaryColumns) {
this.gridBalancedTree = this.secondaryBalancedTree.slice();
this.gridHeaderRowCount = this.secondaryHeaderRowCount;
this.gridColumns = this.secondaryColumns.slice();
}
else {
this.gridBalancedTree = this.primaryBalancedTree.slice();
this.gridHeaderRowCount = this.primaryHeaderRowCount;
this.gridColumns = this.primaryColumns.slice();
}
this.clearDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_GRID_COLUMNS_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_GRID_COLUMNS_CHANGED, event);
};
// gets called after we copy down grid columns, to make sure any part of the gui
// that tries to draw, eg the header, it will get empty lists of columns rather
// than stale columns. for example, the header will received gridColumnsChanged
// event, so will try and draw, but it will draw successfully when it acts on the
// virtualColumnsChanged event
ColumnController.prototype.clearDisplayedColumns = function () {
this.displayedLeftColumnTree = [];
this.displayedRightColumnTree = [];
this.displayedCentreColumnTree = [];
this.displayedLeftHeaderRows = {};
this.displayedRightHeaderRows = {};
this.displayedCentreHeaderRows = {};
this.displayedLeftColumns = [];
this.displayedRightColumns = [];
this.displayedCenterColumns = [];
this.allDisplayedColumns = [];
this.allDisplayedVirtualColumns = [];
};
ColumnController.prototype.updateGroupsAndDisplayedColumns = function () {
this.updateGroups();
this.updateDisplayedColumnsFromTrees();
this.updateVirtualSets();
// this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display
this.eventService.dispatchEvent(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED);
};
ColumnController.prototype.updateDisplayedColumnsFromTrees = function () {
this.addToDisplayedColumns(this.displayedLeftColumnTree, this.displayedLeftColumns);
this.addToDisplayedColumns(this.displayedCentreColumnTree, this.displayedCenterColumns);
this.addToDisplayedColumns(this.displayedRightColumnTree, this.displayedRightColumns);
// order we add the arrays together is important, so the result
// has the columns left to right, as they appear on the screen.
this.allDisplayedColumns = this.displayedLeftColumns
.concat(this.displayedCenterColumns)
.concat(this.displayedRightColumns);
this.setLeftValues();
};
// sets the left pixel position of each column
ColumnController.prototype.setLeftValues = function () {
this.setLeftValuesOfColumns();
this.setLeftValuesOfGroups();
};
ColumnController.prototype.setLeftValuesOfColumns = function () {
// go through each list of displayed columns
var allColumns = this.primaryColumns.slice(0);
[this.displayedLeftColumns, this.displayedRightColumns, this.displayedCenterColumns].forEach(function (columns) {
var left = 0;
columns.forEach(function (column) {
column.setLeft(left);
left += column.getActualWidth();
utils_1.Utils.removeFromArray(allColumns, column);
});
});
// items left in allColumns are columns not displayed, so remove the left position. this is
// important for the rows, as if a col is made visible, then taken out, then made visible again,
// we don't want the animation of the cell floating in from the old position, whatever that was.
allColumns.forEach(function (column) {
column.setLeft(null);
});
};
ColumnController.prototype.setLeftValuesOfGroups = function () {
// a groups left value is the lest left value of it's children
[this.displayedLeftColumnTree, this.displayedRightColumnTree, this.displayedCentreColumnTree].forEach(function (columns) {
columns.forEach(function (column) {
if (column instanceof columnGroup_1.ColumnGroup) {
var columnGroup = column;
columnGroup.checkLeft();
}
});
});
};
ColumnController.prototype.addToDisplayedColumns = function (displayedColumnTree, displayedColumns) {
displayedColumns.length = 0;
this.columnUtils.deptFirstDisplayedColumnTreeSearch(displayedColumnTree, function (child) {
if (child instanceof column_1.Column) {
displayedColumns.push(child);
}
});
};
ColumnController.prototype.updateDisplayedCenterVirtualColumns = function () {
var filteredCenterColumns;
var skipVirtualisation = this.gridOptionsWrapper.isSuppressColumnVirtualisation() || this.gridOptionsWrapper.isForPrint();
if (skipVirtualisation) {
// no virtualisation, so don't filter
filteredCenterColumns = this.displayedCenterColumns;
}
else {
// filter out what should be visible
filteredCenterColumns = this.filterOutColumnsWithinViewport(this.displayedCenterColumns);
}
this.allDisplayedVirtualColumns = filteredCenterColumns
.concat(this.displayedLeftColumns)
.concat(this.displayedRightColumns);
// return map of virtual col id's, for easy lookup when building the groups.
// the map will be colId=>true, ie col id's mapping to 'true'.
var result = {};
this.allDisplayedVirtualColumns.forEach(function (col) {
result[col.getId()] = true;
});
return result;
};
ColumnController.prototype.getVirtualHeaderGroupRow = function (type, dept) {
var result;
switch (type) {
case column_1.Column.PINNED_LEFT:
result = this.displayedLeftHeaderRows[dept];
break;
case column_1.Column.PINNED_RIGHT:
result = this.displayedRightHeaderRows[dept];
break;
default:
result = this.displayedCentreHeaderRows[dept];
break;
}
if (utils_1.Utils.missing(result)) {
result = [];
}
return result;
};
ColumnController.prototype.updateDisplayedVirtualGroups = function (virtualColIds) {
// go through each group, see if any of it's cols are displayed, and if yes,
// then this group is included
this.displayedLeftHeaderRows = {};
this.displayedRightHeaderRows = {};
this.displayedCentreHeaderRows = {};
testGroup(this.displayedLeftColumnTree, this.displayedLeftHeaderRows, 0);
testGroup(this.displayedRightColumnTree, this.displayedRightHeaderRows, 0);
testGroup(this.displayedCentreColumnTree, this.displayedCentreHeaderRows, 0);
function testGroup(children, result, dept) {
var returnValue = false;
for (var i = 0; i < children.length; i++) {
// see if this item is within viewport
var child = children[i];
var addThisItem;
if (child instanceof column_1.Column) {
// for column, test if column is included
addThisItem = virtualColIds[child.getId()] === true;
}
else {
// if group, base decision on children
var columnGroup = child;
addThisItem = testGroup(columnGroup.getDisplayedChildren(), result, dept + 1);
}
if (addThisItem) {
returnValue = true;
if (!result[dept]) {
result[dept] = [];
}
result[dept].push(child);
}
}
return returnValue;
}
};
ColumnController.prototype.updateVirtualSets = function () {
var virtualColIds = this.updateDisplayedCenterVirtualColumns();
this.updateDisplayedVirtualGroups(virtualColIds);
};
ColumnController.prototype.filterOutColumnsWithinViewport = function (columns) {
var _this = this;
var result = utils_1.Utils.filter(columns, function (column) {
// only out if both sides of columns are to the left or to the right of the boundary
var columnLeft = column.getLeft();
var columnRight = column.getLeft() + column.getActualWidth();
var columnToMuchLeft = columnLeft < _this.viewportLeft && columnRight < _this.viewportLeft;
var columnToMuchRight = columnLeft > _this.viewportRight && columnRight > _this.viewportRight;
var includeThisCol = !columnToMuchLeft && !columnToMuchRight;
return includeThisCol;
});
return result;
};
// called from api
ColumnController.prototype.sizeColumnsToFit = function (gridWidth) {
var _this = this;
// avoid divide by zero
var allDisplayedColumns = this.getAllDisplayedColumns();
if (gridWidth <= 0 || allDisplayedColumns.length === 0) {
return;
}
var colsToNotSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) {
return column.getColDef().suppressSizeToFit === true;
});
var colsToSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) {
return column.getColDef().suppressSizeToFit !== true;
});
// make a copy of the cols that are going to be resized
var colsToFireEventFor = colsToSpread.slice(0);
var finishedResizing = false;
while (!finishedResizing) {
finishedResizing = true;
var availablePixels = gridWidth - getTotalWidth(colsToNotSpread);
if (availablePixels <= 0) {
// no width, set everything to minimum
colsToSpread.forEach(function (column) {
column.setMinimum();
});
}
else {
var scale = availablePixels / getTotalWidth(colsToSpread);
// we set the pixels for the last col based on what's left, as otherwise
// we could be a pixel or two short or extra because of rounding errors.
var pixelsForLastCol = availablePixels;
// backwards through loop, as we are removing items as we go
for (var i = colsToSpread.length - 1; i >= 0; i--) {
var column = colsToSpread[i];
var newWidth = Math.round(column.getActualWidth() * scale);
if (newWidth < column.getMinWidth()) {
column.setMinimum();
moveToNotSpread(column);
finishedResizing = false;
}
else if (column.isGreaterThanMax(newWidth)) {
column.setActualWidth(column.getMaxWidth());
moveToNotSpread(column);
finishedResizing = false;
}
else {
var onLastCol = i === 0;
if (onLastCol) {
column.setActualWidth(pixelsForLastCol);
}
else {
pixelsForLastCol -= newWidth;
column.setActualWidth(newWidth);
}
}
}
}
}
this.setLeftValues();
// widths set, refresh the gui
colsToFireEventFor.forEach(function (column) {
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_RESIZED).withColumn(column);
_this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_RESIZED, event);
});
this.checkDisplayedCenterColumns();
function moveToNotSpread(column) {
utils_1.Utils.removeFromArray(colsToSpread, column);
colsToNotSpread.push(column);
}
function getTotalWidth(columns) {
var result = 0;
for (var i = 0; i < columns.length; i++) {
result += columns[i].getActualWidth();
}
return result;
}
};
ColumnController.prototype.buildDisplayedTrees = function (visibleColumns) {
var leftVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
return column.getPinned() === 'left';
});
var rightVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
return column.getPinned() === 'right';
});
var centerVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
return column.getPinned() !== 'left' && column.getPinned() !== 'right';
});
var groupInstanceIdCreator = new groupInstanceIdCreator_1.GroupInstanceIdCreator();
this.displayedLeftColumnTree = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator);
this.displayedRightColumnTree = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator);
this.displayedCentreColumnTree = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator);
};
ColumnController.prototype.updateGroups = function () {
var allGroups = this.getAllDisplayedColumnGroups();
this.columnUtils.deptFirstAllColumnTreeSearch(allGroups, function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var group = child;
group.calculateDisplayedColumns();
}
});
};
ColumnController.prototype.createGroupAutoColumn = function () {
// see if we need to insert the default grouping column
var needAGroupColumn = this.rowGroupColumns.length > 0
&& !this.gridOptionsWrapper.isGroupSuppressAutoColumn()
&& !this.gridOptionsWrapper.isGroupUseEntireRow()
&& !this.gridOptionsWrapper.isGroupSuppressRow();
this.groupAutoColumnActive = needAGroupColumn;
// lazy create group auto-column
if (needAGroupColumn && !this.groupAutoColumn) {
// if one provided by user, use it, otherwise create one
var autoColDef = this.gridOptionsWrapper.getGroupColumnDef();
if (!autoColDef) {
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
autoColDef = {
headerName: localeTextFunc('group', 'Group'),
comparator: functions_1.defaultGroupComparator,
valueGetter: function (params) {
if (params.node.group) {
return params.node.key;
}
else if (params.data && params.colDef.field) {
return params.data[params.colDef.field];
}
else {
return null;
}
},
cellRenderer: 'group'
};
}
// we never allow moving the group column
autoColDef.suppressMovable = true;
var colId = 'ag-Grid-AutoColumn';
this.groupAutoColumn = new column_1.Column(autoColDef, colId, true);
this.context.wireBean(this.groupAutoColumn);
}
};
ColumnController.prototype.createValueColumns = function () {
this.valueColumns.forEach(function (column) { return column.setValueActive(false); });
this.valueColumns = [];
// override with columns that have the aggFunc specified explicitly
for (var i = 0; i < this.primaryColumns.length; i++) {
var column = this.primaryColumns[i];
if (column.getColDef().aggFunc) {
column.setAggFunc(column.getColDef().aggFunc);
this.valueColumns.push(column);
column.setValueActive(true);
}
}
};
ColumnController.prototype.getWidthOfColsInList = function (columnList) {
var result = 0;
for (var i = 0; i < columnList.length; i++) {
result += columnList[i].getActualWidth();
}
return result;
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], ColumnController.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], ColumnController.prototype, "expressionService", void 0);
__decorate([
context_1.Autowired('balancedColumnTreeBuilder'),
__metadata('design:type', balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder)
], ColumnController.prototype, "balancedColumnTreeBuilder", void 0);
__decorate([
context_1.Autowired('displayedGroupCreator'),
__metadata('design:type', displayedGroupCreator_1.DisplayedGroupCreator)
], ColumnController.prototype, "displayedGroupCreator", void 0);
__decorate([
context_1.Autowired('autoWidthCalculator'),
__metadata('design:type', autoWidthCalculator_1.AutoWidthCalculator)
], ColumnController.prototype, "autoWidthCalculator", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], ColumnController.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('columnUtils'),
__metadata('design:type', columnUtils_1.ColumnUtils)
], ColumnController.prototype, "columnUtils", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], ColumnController.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], ColumnController.prototype, "context", void 0);
__decorate([
context_1.Optional('aggFuncService'),
__metadata('design:type', Object)
], ColumnController.prototype, "aggFuncService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], ColumnController.prototype, "init", null);
__decorate([
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], ColumnController.prototype, "setBeans", null);
ColumnController = __decorate([
context_1.Bean('columnController'),
__metadata('design:paramtypes', [])
], ColumnController);
return ColumnController;
})();
exports.ColumnController = ColumnController;
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var column_1 = __webpack_require__(15);
var eventService_1 = __webpack_require__(4);
var ColumnGroup = (function () {
function ColumnGroup(originalColumnGroup, groupId, instanceId) {
// depends on the open/closed state of the group, only displaying columns are stored here
this.displayedChildren = [];
this.moving = false;
this.eventService = new eventService_1.EventService();
this.groupId = groupId;
this.instanceId = instanceId;
this.originalColumnGroup = originalColumnGroup;
}
ColumnGroup.prototype.getUniqueId = function () {
return this.groupId + '_' + this.instanceId;
};
// returns header name if it exists, otherwise null. if will not exist if
// this group is a padding group, as they don't have colGroupDef's
ColumnGroup.prototype.getHeaderName = function () {
if (this.originalColumnGroup.getColGroupDef()) {
return this.originalColumnGroup.getColGroupDef().headerName;
}
else {
return null;
}
};
ColumnGroup.prototype.checkLeft = function () {
// first get all children to setLeft, as it impacts our decision below
this.displayedChildren.forEach(function (child) {
if (child instanceof ColumnGroup) {
child.checkLeft();
}
});
// set our left based on first displayed column
if (this.displayedChildren.length > 0) {
var firstChildLeft = this.displayedChildren[0].getLeft();
this.setLeft(firstChildLeft);
}
else {
// this should never happen, as if we have no displayed columns, then
// this groups should not even exist.
this.setLeft(null);
}
};
ColumnGroup.prototype.getLeft = function () {
return this.left;
};
ColumnGroup.prototype.setLeft = function (left) {
if (this.left !== left) {
this.left = left;
this.eventService.dispatchEvent(ColumnGroup.EVENT_LEFT_CHANGED);
}
};
ColumnGroup.prototype.addEventListener = function (eventType, listener) {
this.eventService.addEventListener(eventType, listener);
};
ColumnGroup.prototype.removeEventListener = function (eventType, listener) {
this.eventService.removeEventListener(eventType, listener);
};
ColumnGroup.prototype.setMoving = function (moving) {
this.getDisplayedLeafColumns().forEach(function (column) { return column.setMoving(moving); });
};
ColumnGroup.prototype.isMoving = function () {
return this.moving;
};
ColumnGroup.prototype.getGroupId = function () {
return this.groupId;
};
ColumnGroup.prototype.getInstanceId = function () {
return this.instanceId;
};
ColumnGroup.prototype.isChildInThisGroupDeepSearch = function (wantedChild) {
var result = false;
this.children.forEach(function (foundChild) {
if (wantedChild === foundChild) {
result = true;
}
if (foundChild instanceof ColumnGroup) {
if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) {
result = true;
}
}
});
return result;
};
ColumnGroup.prototype.getActualWidth = function () {
var groupActualWidth = 0;
if (this.displayedChildren) {
this.displayedChildren.forEach(function (child) {
groupActualWidth += child.getActualWidth();
});
}
return groupActualWidth;
};
ColumnGroup.prototype.getMinWidth = function () {
var result = 0;
this.displayedChildren.forEach(function (groupChild) {
result += groupChild.getMinWidth();
});
return result;
};
ColumnGroup.prototype.addChild = function (child) {
if (!this.children) {
this.children = [];
}
this.children.push(child);
};
ColumnGroup.prototype.getDisplayedChildren = function () {
return this.displayedChildren;
};
ColumnGroup.prototype.getLeafColumns = function () {
var result = [];
this.addLeafColumns(result);
return result;
};
ColumnGroup.prototype.getDisplayedLeafColumns = function () {
var result = [];
this.addDisplayedLeafColumns(result);
return result;
};
// why two methods here doing the same thing?
ColumnGroup.prototype.getDefinition = function () {
return this.originalColumnGroup.getColGroupDef();
};
ColumnGroup.prototype.getColGroupDef = function () {
return this.originalColumnGroup.getColGroupDef();
};
ColumnGroup.prototype.isExpandable = function () {
return this.originalColumnGroup.isExpandable();
};
ColumnGroup.prototype.isExpanded = function () {
return this.originalColumnGroup.isExpanded();
};
ColumnGroup.prototype.setExpanded = function (expanded) {
this.originalColumnGroup.setExpanded(expanded);
};
ColumnGroup.prototype.addDisplayedLeafColumns = function (leafColumns) {
this.displayedChildren.forEach(function (child) {
if (child instanceof column_1.Column) {
leafColumns.push(child);
}
else if (child instanceof ColumnGroup) {
child.addDisplayedLeafColumns(leafColumns);
}
});
};
ColumnGroup.prototype.addLeafColumns = function (leafColumns) {
this.children.forEach(function (child) {
if (child instanceof column_1.Column) {
leafColumns.push(child);
}
else if (child instanceof ColumnGroup) {
child.addLeafColumns(leafColumns);
}
});
};
ColumnGroup.prototype.getChildren = function () {
return this.children;
};
ColumnGroup.prototype.getColumnGroupShow = function () {
return this.originalColumnGroup.getColumnGroupShow();
};
ColumnGroup.prototype.getOriginalColumnGroup = function () {
return this.originalColumnGroup;
};
ColumnGroup.prototype.calculateDisplayedColumns = function () {
// clear out last time we calculated
this.displayedChildren = [];
// it not expandable, everything is visible
if (!this.originalColumnGroup.isExpandable()) {
this.displayedChildren = this.children;
return;
}
// and calculate again
for (var i = 0, j = this.children.length; i < j; i++) {
var abstractColumn = this.children[i];
var headerGroupShow = abstractColumn.getColumnGroupShow();
switch (headerGroupShow) {
case ColumnGroup.HEADER_GROUP_SHOW_OPEN:
// when set to open, only show col if group is open
if (this.originalColumnGroup.isExpanded()) {
this.displayedChildren.push(abstractColumn);
}
break;
case ColumnGroup.HEADER_GROUP_SHOW_CLOSED:
// when set to open, only show col if group is open
if (!this.originalColumnGroup.isExpanded()) {
this.displayedChildren.push(abstractColumn);
}
break;
default:
// default is always show the column
this.displayedChildren.push(abstractColumn);
break;
}
}
};
ColumnGroup.HEADER_GROUP_SHOW_OPEN = 'open';
ColumnGroup.HEADER_GROUP_SHOW_CLOSED = 'closed';
ColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged';
return ColumnGroup;
})();
exports.ColumnGroup = ColumnGroup;
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var eventService_1 = __webpack_require__(4);
var utils_1 = __webpack_require__(7);
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnUtils_1 = __webpack_require__(16);
// Wrapper around a user provide column definition. The grid treats the column definition as ready only.
// This class contains all the runtime information about a column, plus some logic (the definition has no logic).
// This class implements both interfaces ColumnGroupChild and OriginalColumnGroupChild as the class can
// appear as a child of either the original tree or the displayed tree. However the relevant group classes
// for each type only implements one, as each group can only appear in it's associated tree (eg OriginalColumnGroup
// can only appear in OriginalColumn tree).
var Column = (function () {
function Column(colDef, colId, primary) {
this.moving = false;
this.filterActive = false;
this.eventService = new eventService_1.EventService();
this.rowGroupActive = false;
this.pivotActive = false;
this.aggregationActive = false;
this.colDef = colDef;
this.visible = !colDef.hide;
this.sort = colDef.sort;
this.sortedAt = colDef.sortedAt;
this.colId = colId;
this.primary = primary;
}
// this is done after constructor as it uses gridOptionsWrapper
Column.prototype.initialise = function () {
this.setPinned(this.colDef.pinned);
var minColWidth = this.gridOptionsWrapper.getMinColWidth();
var maxColWidth = this.gridOptionsWrapper.getMaxColWidth();
if (this.colDef.minWidth) {
this.minWidth = this.colDef.minWidth;
}
else {
this.minWidth = minColWidth;
}
if (this.colDef.maxWidth) {
this.maxWidth = this.colDef.maxWidth;
}
else {
this.maxWidth = maxColWidth;
}
this.actualWidth = this.columnUtils.calculateColInitialWidth(this.colDef);
var suppressDotNotation = this.gridOptionsWrapper.isSuppressFieldDotNotation();
this.fieldContainsDots = utils_1.Utils.exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation;
this.validate();
};
Column.prototype.getUniqueId = function () {
return this.getId();
};
Column.prototype.isPrimary = function () {
return this.primary;
};
Column.prototype.isFilterAllowed = function () {
return this.primary;
};
Column.prototype.isFieldContainsDots = function () {
return this.fieldContainsDots;
};
Column.prototype.validate = function () {
if (!this.gridOptionsWrapper.isEnterprise()) {
if (utils_1.Utils.exists(this.colDef.aggFunc)) {
console.warn('ag-Grid: aggFunc is only valid in ag-Grid-Enterprise');
}
if (utils_1.Utils.exists(this.colDef.rowGroupIndex)) {
console.warn('ag-Grid: rowGroupIndex is only valid in ag-Grid-Enterprise');
}
}
};
Column.prototype.addEventListener = function (eventType, listener) {
this.eventService.addEventListener(eventType, listener);
};
Column.prototype.removeEventListener = function (eventType, listener) {
this.eventService.removeEventListener(eventType, listener);
};
Column.prototype.isCellEditable = function (rowNode) {
// if boolean set, then just use it
if (typeof this.colDef.editable === 'boolean') {
return this.colDef.editable;
}
// if function, then call the function to find out
if (typeof this.colDef.editable === 'function') {
var params = {
node: rowNode,
column: this,
colDef: this.colDef,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi()
};
var editableFunc = this.colDef.editable;
return editableFunc(params);
}
return false;
};
Column.prototype.setMoving = function (moving) {
this.moving = moving;
this.eventService.dispatchEvent(Column.EVENT_MOVING_CHANGED);
};
Column.prototype.isMoving = function () {
return this.moving;
};
Column.prototype.getSort = function () {
return this.sort;
};
Column.prototype.setSort = function (sort) {
if (this.sort !== sort) {
this.sort = sort;
this.eventService.dispatchEvent(Column.EVENT_SORT_CHANGED);
}
};
Column.prototype.isSortAscending = function () {
return this.sort === Column.SORT_ASC;
};
Column.prototype.isSortDescending = function () {
return this.sort === Column.SORT_DESC;
};
Column.prototype.isSortNone = function () {
return utils_1.Utils.missing(this.sort);
};
Column.prototype.getSortedAt = function () {
return this.sortedAt;
};
Column.prototype.setSortedAt = function (sortedAt) {
this.sortedAt = sortedAt;
};
Column.prototype.setAggFunc = function (aggFunc) {
this.aggFunc = aggFunc;
};
Column.prototype.getAggFunc = function () {
return this.aggFunc;
};
Column.prototype.getLeft = function () {
return this.left;
};
Column.prototype.getRight = function () {
return this.left + this.actualWidth;
};
Column.prototype.setLeft = function (left) {
if (this.left !== left) {
this.left = left;
this.eventService.dispatchEvent(Column.EVENT_LEFT_CHANGED);
}
};
Column.prototype.isFilterActive = function () {
return this.filterActive;
};
Column.prototype.setFilterActive = function (active) {
if (this.filterActive !== active) {
this.filterActive = active;
this.eventService.dispatchEvent(Column.EVENT_FILTER_ACTIVE_CHANGED);
}
};
Column.prototype.setPinned = function (pinned) {
// pinning is not allowed when doing 'forPrint'
if (this.gridOptionsWrapper.isForPrint()) {
return;
}
if (pinned === true || pinned === Column.PINNED_LEFT) {
this.pinned = Column.PINNED_LEFT;
}
else if (pinned === Column.PINNED_RIGHT) {
this.pinned = Column.PINNED_RIGHT;
}
else {
this.pinned = null;
}
// console.log(`setColumnsPinned ${this.getColId()} ${this.pinned}`);
};
Column.prototype.setFirstRightPinned = function (firstRightPinned) {
if (this.firstRightPinned !== firstRightPinned) {
this.firstRightPinned = firstRightPinned;
this.eventService.dispatchEvent(Column.EVENT_FIRST_RIGHT_PINNED_CHANGED);
}
};
Column.prototype.setLastLeftPinned = function (lastLeftPinned) {
if (this.lastLeftPinned !== lastLeftPinned) {
this.lastLeftPinned = lastLeftPinned;
this.eventService.dispatchEvent(Column.EVENT_LAST_LEFT_PINNED_CHANGED);
}
};
Column.prototype.isFirstRightPinned = function () {
return this.firstRightPinned;
};
Column.prototype.isLastLeftPinned = function () {
return this.lastLeftPinned;
};
Column.prototype.isPinned = function () {
return this.pinned === Column.PINNED_LEFT || this.pinned === Column.PINNED_RIGHT;
};
Column.prototype.isPinnedLeft = function () {
return this.pinned === Column.PINNED_LEFT;
};
Column.prototype.isPinnedRight = function () {
return this.pinned === Column.PINNED_RIGHT;
};
Column.prototype.getPinned = function () {
return this.pinned;
};
Column.prototype.setVisible = function (visible) {
var newValue = visible === true;
if (this.visible !== newValue) {
this.visible = newValue;
this.eventService.dispatchEvent(Column.EVENT_VISIBLE_CHANGED);
}
};
Column.prototype.isVisible = function () {
return this.visible;
};
Column.prototype.getColDef = function () {
return this.colDef;
};
Column.prototype.getColumnGroupShow = function () {
return this.colDef.columnGroupShow;
};
Column.prototype.getColId = function () {
return this.colId;
};
Column.prototype.getId = function () {
return this.getColId();
};
Column.prototype.getDefinition = function () {
return this.colDef;
};
Column.prototype.getActualWidth = function () {
return this.actualWidth;
};
Column.prototype.setActualWidth = function (actualWidth) {
if (this.actualWidth !== actualWidth) {
this.actualWidth = actualWidth;
this.eventService.dispatchEvent(Column.EVENT_WIDTH_CHANGED);
}
};
Column.prototype.isGreaterThanMax = function (width) {
if (this.maxWidth) {
return width > this.maxWidth;
}
else {
return false;
}
};
Column.prototype.getMinWidth = function () {
return this.minWidth;
};
Column.prototype.getMaxWidth = function () {
return this.maxWidth;
};
Column.prototype.setMinimum = function () {
this.setActualWidth(this.minWidth);
};
Column.prototype.setRowGroupActive = function (rowGroup) {
if (this.rowGroupActive !== rowGroup) {
this.rowGroupActive = rowGroup;
this.eventService.dispatchEvent(Column.EVENT_ROW_GROUP_CHANGED, this);
}
};
Column.prototype.isRowGroupActive = function () {
return this.rowGroupActive;
};
Column.prototype.setPivotActive = function (pivot) {
if (this.pivotActive !== pivot) {
this.pivotActive = pivot;
this.eventService.dispatchEvent(Column.EVENT_PIVOT_CHANGED, this);
}
};
Column.prototype.isPivotActive = function () {
return this.pivotActive;
};
Column.prototype.setValueActive = function (value) {
if (this.aggregationActive !== value) {
this.aggregationActive = value;
this.eventService.dispatchEvent(Column.EVENT_VALUE_CHANGED, this);
}
};
Column.prototype.isValueActive = function () {
return this.aggregationActive;
};
Column.prototype.isAllowPivot = function () {
return this.colDef.enablePivot === true;
};
Column.prototype.isAllowValue = function () {
return this.colDef.enableValue === true;
};
Column.prototype.isAllowRowGroup = function () {
return this.colDef.enableRowGroup === true;
};
// + renderedHeaderCell - for making header cell transparent when moving
Column.EVENT_MOVING_CHANGED = 'movingChanged';
// + renderedCell - changing left position
Column.EVENT_LEFT_CHANGED = 'leftChanged';
// + renderedCell - changing width
Column.EVENT_WIDTH_CHANGED = 'widthChanged';
// + renderedCell - for changing pinned classes
Column.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged';
Column.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged';
// + renderedColumn - for changing visibility icon
Column.EVENT_VISIBLE_CHANGED = 'visibleChanged';
// + renderedHeaderCell - marks the header with filter icon
Column.EVENT_FILTER_ACTIVE_CHANGED = 'filterChanged';
// + renderedHeaderCell - marks the header with sort icon
Column.EVENT_SORT_CHANGED = 'filterChanged';
// + toolpanel, for gui updates
Column.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
// + toolpanel, for gui updates
Column.EVENT_PIVOT_CHANGED = 'columnPivotChanged';
// + toolpanel, for gui updates
Column.EVENT_VALUE_CHANGED = 'columnValueChanged';
Column.PINNED_RIGHT = 'right';
Column.PINNED_LEFT = 'left';
Column.SORT_ASC = 'asc';
Column.SORT_DESC = 'desc';
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], Column.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnUtils'),
__metadata('design:type', columnUtils_1.ColumnUtils)
], Column.prototype, "columnUtils", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], Column.prototype, "initialise", null);
return Column;
})();
exports.Column = Column;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnGroup_1 = __webpack_require__(14);
var originalColumnGroup_1 = __webpack_require__(17);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
// takes in a list of columns, as specified by the column definitions, and returns column groups
var ColumnUtils = (function () {
function ColumnUtils() {
}
ColumnUtils.prototype.calculateColInitialWidth = function (colDef) {
if (!colDef.width) {
// if no width defined in colDef, use default
return this.gridOptionsWrapper.getColWidth();
}
else if (colDef.width < this.gridOptionsWrapper.getMinColWidth()) {
// if width in col def to small, set to min width
return this.gridOptionsWrapper.getMinColWidth();
}
else {
// otherwise use the provided width
return colDef.width;
}
};
ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) {
var result = [];
var found = false;
recursePath(originalBalancedTree, 0);
// we should always find the path, but in case there is a bug somewhere, returning null
// will make it fail rather than provide a 'hard to track down' bug
if (found) {
return result;
}
else {
return null;
}
function recursePath(balancedColumnTree, dept) {
for (var i = 0; i < balancedColumnTree.length; i++) {
if (found) {
// quit the search, so 'result' is kept with the found result
return;
}
var node = balancedColumnTree[i];
if (node instanceof originalColumnGroup_1.OriginalColumnGroup) {
var nextNode = node;
recursePath(nextNode.getChildren(), dept + 1);
result[dept] = node;
}
else {
if (node === column) {
found = true;
}
}
}
}
};
/* public getPathForColumn(column: Column, allDisplayedColumnGroups: ColumnGroupChild[]): ColumnGroup[] {
var result: ColumnGroup[] = [];
var found = false;
recursePath(allDisplayedColumnGroups, 0);
// we should always find the path, but in case there is a bug somewhere, returning null
// will make it fail rather than provide a 'hard to track down' bug
if (found) {
return result;
} else {
return null;
}
function recursePath(balancedColumnTree: ColumnGroupChild[], dept: number): void {
for (var i = 0; i<balancedColumnTree.length; i++) {
if (found) {
// quit the search, so 'result' is kept with the found result
return;
}
var node = balancedColumnTree[i];
if (node instanceof ColumnGroup) {
var nextNode = <ColumnGroup> node;
recursePath(nextNode.getChildren(), dept+1);
result[dept] = node;
} else {
if (node === column) {
found = true;
}
}
}
}
}*/
ColumnUtils.prototype.deptFirstOriginalTreeSearch = function (tree, callback) {
var _this = this;
if (!tree) {
return;
}
tree.forEach(function (child) {
if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
_this.deptFirstOriginalTreeSearch(child.getChildren(), callback);
}
callback(child);
});
};
ColumnUtils.prototype.deptFirstAllColumnTreeSearch = function (tree, callback) {
var _this = this;
if (!tree) {
return;
}
tree.forEach(function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
_this.deptFirstAllColumnTreeSearch(child.getChildren(), callback);
}
callback(child);
});
};
ColumnUtils.prototype.deptFirstDisplayedColumnTreeSearch = function (tree, callback) {
var _this = this;
if (!tree) {
return;
}
tree.forEach(function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
_this.deptFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);
}
callback(child);
});
};
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], ColumnUtils.prototype, "gridOptionsWrapper", void 0);
ColumnUtils = __decorate([
context_1.Bean('columnUtils'),
__metadata('design:paramtypes', [])
], ColumnUtils);
return ColumnUtils;
})();
exports.ColumnUtils = ColumnUtils;
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var columnGroup_1 = __webpack_require__(14);
var column_1 = __webpack_require__(15);
var OriginalColumnGroup = (function () {
function OriginalColumnGroup(colGroupDef, groupId) {
this.expandable = false;
this.expanded = false;
this.colGroupDef = colGroupDef;
this.groupId = groupId;
}
OriginalColumnGroup.prototype.setExpanded = function (expanded) {
this.expanded = expanded;
};
OriginalColumnGroup.prototype.isExpandable = function () {
return this.expandable;
};
OriginalColumnGroup.prototype.isExpanded = function () {
return this.expanded;
};
OriginalColumnGroup.prototype.getGroupId = function () {
return this.groupId;
};
OriginalColumnGroup.prototype.getId = function () {
return this.getGroupId();
};
OriginalColumnGroup.prototype.setChildren = function (children) {
this.children = children;
};
OriginalColumnGroup.prototype.getChildren = function () {
return this.children;
};
OriginalColumnGroup.prototype.getColGroupDef = function () {
return this.colGroupDef;
};
OriginalColumnGroup.prototype.getLeafColumns = function () {
var result = [];
this.addLeafColumns(result);
return result;
};
OriginalColumnGroup.prototype.addLeafColumns = function (leafColumns) {
this.children.forEach(function (child) {
if (child instanceof column_1.Column) {
leafColumns.push(child);
}
else if (child instanceof OriginalColumnGroup) {
child.addLeafColumns(leafColumns);
}
});
};
OriginalColumnGroup.prototype.getColumnGroupShow = function () {
if (this.colGroupDef) {
return this.colGroupDef.columnGroupShow;
}
else {
// if there is no col def, then this must be a padding
// group, which means we have exactly only child. we then
// take the value from the child and push it up, making
// this group 'invisible'.
return this.children[0].getColumnGroupShow();
}
};
// need to check that this group has at least one col showing when both expanded and contracted.
// if not, then we don't allow expanding and contracting on this group
OriginalColumnGroup.prototype.calculateExpandable = function () {
// want to make sure the group doesn't disappear when it's open
var atLeastOneShowingWhenOpen = false;
// want to make sure the group doesn't disappear when it's closed
var atLeastOneShowingWhenClosed = false;
// want to make sure the group has something to show / hide
var atLeastOneChangeable = false;
for (var i = 0, j = this.children.length; i < j; i++) {
var abstractColumn = this.children[i];
// if the abstractColumn is a grid generated group, there will be no colDef
var headerGroupShow = abstractColumn.getColumnGroupShow();
if (headerGroupShow === columnGroup_1.ColumnGroup.HEADER_GROUP_SHOW_OPEN) {
atLeastOneShowingWhenOpen = true;
atLeastOneChangeable = true;
}
else if (headerGroupShow === columnGroup_1.ColumnGroup.HEADER_GROUP_SHOW_CLOSED) {
atLeastOneShowingWhenClosed = true;
atLeastOneChangeable = true;
}
else {
atLeastOneShowingWhenOpen = true;
atLeastOneShowingWhenClosed = true;
}
}
this.expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;
};
return OriginalColumnGroup;
})();
exports.OriginalColumnGroup = OriginalColumnGroup;
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var logger_1 = __webpack_require__(5);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var ExpressionService = (function () {
function ExpressionService() {
this.expressionToFunctionCache = {};
}
ExpressionService.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('ExpressionService');
};
ExpressionService.prototype.evaluate = function (expression, params) {
try {
var javaScriptFunction = this.createExpressionFunction(expression);
var result = javaScriptFunction(params.value, params.context, params.node, params.data, params.colDef, params.rowIndex, params.api, params.getValue);
return result;
}
catch (e) {
// the expression failed, which can happen, as it's the client that
// provides the expression. so print a nice message
this.logger.log('Processing of the expression failed');
this.logger.log('Expression = ' + expression);
this.logger.log('Exception = ' + e);
return null;
}
};
ExpressionService.prototype.createExpressionFunction = function (expression) {
// check cache first
if (this.expressionToFunctionCache[expression]) {
return this.expressionToFunctionCache[expression];
}
// if not found in cache, return the function
var functionBody = this.createFunctionBody(expression);
var theFunction = new Function('x, ctx, node, data, colDef, rowIndex, api, getValue', functionBody);
// store in cache
this.expressionToFunctionCache[expression] = theFunction;
return theFunction;
};
ExpressionService.prototype.createFunctionBody = function (expression) {
// if the expression has the 'return' word in it, then use as is,
// if not, then wrap it with return and ';' to make a function
if (expression.indexOf('return') >= 0) {
return expression;
}
else {
return 'return ' + expression + ';';
}
};
__decorate([
__param(0, context_2.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], ExpressionService.prototype, "setBeans", null);
ExpressionService = __decorate([
context_1.Bean('expressionService'),
__metadata('design:paramtypes', [])
], ExpressionService);
return ExpressionService;
})();
exports.ExpressionService = ExpressionService;
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var logger_1 = __webpack_require__(5);
var columnUtils_1 = __webpack_require__(16);
var columnKeyCreator_1 = __webpack_require__(20);
var originalColumnGroup_1 = __webpack_require__(17);
var column_1 = __webpack_require__(15);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var context_3 = __webpack_require__(6);
var context_4 = __webpack_require__(6);
// takes in a list of columns, as specified by the column definitions, and returns column groups
var BalancedColumnTreeBuilder = (function () {
function BalancedColumnTreeBuilder() {
}
BalancedColumnTreeBuilder.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('BalancedColumnTreeBuilder');
};
BalancedColumnTreeBuilder.prototype.createBalancedColumnGroups = function (abstractColDefs, primaryColumns) {
// column key creator dishes out unique column id's in a deterministic way,
// so if we have two grids (that cold be master/slave) with same column definitions,
// then this ensures the two grids use identical id's.
var columnKeyCreator = new columnKeyCreator_1.ColumnKeyCreator();
// create am unbalanced tree that maps the provided definitions
var unbalancedTree = this.recursivelyCreateColumns(abstractColDefs, 0, columnKeyCreator, primaryColumns);
var treeDept = this.findMaxDept(unbalancedTree, 0);
this.logger.log('Number of levels for grouped columns is ' + treeDept);
var balancedTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);
this.columnUtils.deptFirstOriginalTreeSearch(balancedTree, function (child) {
if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
child.calculateExpandable();
}
});
return {
balancedTree: balancedTree,
treeDept: treeDept
};
};
BalancedColumnTreeBuilder.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) {
var _this = this;
var result = [];
// go through each child, for groups, recurse a level deeper,
// for columns we need to pad
unbalancedTree.forEach(function (child) {
if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
var originalGroup = child;
var newChildren = _this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);
originalGroup.setChildren(newChildren);
result.push(originalGroup);
}
else {
var newChild = child;
for (var i = columnDept - 1; i >= currentDept; i--) {
var newColId = columnKeyCreator.getUniqueKey(null, null);
var paddedGroup = new originalColumnGroup_1.OriginalColumnGroup(null, newColId);
paddedGroup.setChildren([newChild]);
newChild = paddedGroup;
}
result.push(newChild);
}
});
return result;
};
BalancedColumnTreeBuilder.prototype.findMaxDept = function (treeChildren, dept) {
var maxDeptThisLevel = dept;
for (var i = 0; i < treeChildren.length; i++) {
var abstractColumn = treeChildren[i];
if (abstractColumn instanceof originalColumnGroup_1.OriginalColumnGroup) {
var originalGroup = abstractColumn;
var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);
if (maxDeptThisLevel < newDept) {
maxDeptThisLevel = newDept;
}
}
}
return maxDeptThisLevel;
};
BalancedColumnTreeBuilder.prototype.recursivelyCreateColumns = function (abstractColDefs, level, columnKeyCreator, primaryColumns) {
var _this = this;
var result = [];
if (!abstractColDefs) {
return result;
}
abstractColDefs.forEach(function (abstractColDef) {
_this.checkForDeprecatedItems(abstractColDef);
if (_this.isColumnGroup(abstractColDef)) {
var groupColDef = abstractColDef;
var groupId = columnKeyCreator.getUniqueKey(groupColDef.groupId, null);
var originalGroup = new originalColumnGroup_1.OriginalColumnGroup(groupColDef, groupId);
var children = _this.recursivelyCreateColumns(groupColDef.children, level + 1, columnKeyCreator, primaryColumns);
originalGroup.setChildren(children);
result.push(originalGroup);
}
else {
var colDef = abstractColDef;
var colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field);
var column = new column_1.Column(colDef, colId, primaryColumns);
_this.context.wireBean(column);
result.push(column);
}
});
return result;
};
BalancedColumnTreeBuilder.prototype.checkForDeprecatedItems = function (colDef) {
if (colDef) {
var colDefNoType = colDef; // take out the type, so we can access attributes not defined in the type
if (colDefNoType.group !== undefined) {
console.warn('ag-grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3');
}
if (colDefNoType.headerGroup !== undefined) {
console.warn('ag-grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3');
}
if (colDefNoType.headerGroupShow !== undefined) {
console.warn('ag-grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3');
}
if (colDefNoType.suppressRowGroup !== undefined) {
console.warn('ag-grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead');
}
if (colDefNoType.suppressAggregation !== undefined) {
console.warn('ag-grid: colDef.suppressAggregation is deprecated, please use colDef.type instead');
}
if (colDefNoType.suppressRowGroup || colDefNoType.suppressAggregation) {
console.warn('ag-grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead');
}
if (colDefNoType.displayName) {
console.warn("ag-grid: Found displayName " + colDefNoType.displayName + ", please use headerName instead, displayName is deprecated.");
colDefNoType.headerName = colDefNoType.displayName;
}
}
};
// if object has children, we assume it's a group
BalancedColumnTreeBuilder.prototype.isColumnGroup = function (abstractColDef) {
return abstractColDef.children !== undefined;
};
__decorate([
context_3.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], BalancedColumnTreeBuilder.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_3.Autowired('columnUtils'),
__metadata('design:type', columnUtils_1.ColumnUtils)
], BalancedColumnTreeBuilder.prototype, "columnUtils", void 0);
__decorate([
context_3.Autowired('context'),
__metadata('design:type', context_4.Context)
], BalancedColumnTreeBuilder.prototype, "context", void 0);
__decorate([
__param(0, context_2.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], BalancedColumnTreeBuilder.prototype, "setBeans", null);
BalancedColumnTreeBuilder = __decorate([
context_1.Bean('balancedColumnTreeBuilder'),
__metadata('design:paramtypes', [])
], BalancedColumnTreeBuilder);
return BalancedColumnTreeBuilder;
})();
exports.BalancedColumnTreeBuilder = BalancedColumnTreeBuilder;
/***/ },
/* 20 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
// class returns a unique id to use for the column. it checks the existing columns, and if the requested
// id is already taken, it will start appending numbers until it gets a unique id.
// eg, if the col field is 'name', it will try ids: {name, name_1, name_2...}
// if no field or id provided in the col, it will try the ids of natural numbers
var ColumnKeyCreator = (function () {
function ColumnKeyCreator() {
this.existingKeys = [];
}
ColumnKeyCreator.prototype.getUniqueKey = function (colId, colField) {
var count = 0;
while (true) {
var idToTry;
if (colId) {
idToTry = colId;
if (count !== 0) {
idToTry += '_' + count;
}
}
else if (colField) {
idToTry = colField;
if (count !== 0) {
idToTry += '_' + count;
}
}
else {
idToTry = '' + count;
}
if (this.existingKeys.indexOf(idToTry) < 0) {
this.existingKeys.push(idToTry);
return idToTry;
}
count++;
}
};
return ColumnKeyCreator;
})();
exports.ColumnKeyCreator = ColumnKeyCreator;
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var columnUtils_1 = __webpack_require__(16);
var columnGroup_1 = __webpack_require__(14);
var originalColumnGroup_1 = __webpack_require__(17);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
// takes in a list of columns, as specified by the column definitions, and returns column groups
var DisplayedGroupCreator = (function () {
function DisplayedGroupCreator() {
}
DisplayedGroupCreator.prototype.createDisplayedGroups = function (sortedVisibleColumns, balancedColumnTree, groupInstanceIdCreator) {
var _this = this;
var result = [];
var previousRealPath;
var previousOriginalPath;
// go through each column, then do a bottom up comparison to the previous column, and start
// to share groups if they converge at any point.
sortedVisibleColumns.forEach(function (currentColumn) {
var currentOriginalPath = _this.getOriginalPathForColumn(balancedColumnTree, currentColumn);
var currentRealPath = [];
var firstColumn = !previousOriginalPath;
for (var i = 0; i < currentOriginalPath.length; i++) {
if (firstColumn || currentOriginalPath[i] !== previousOriginalPath[i]) {
// new group needed
var originalGroup = currentOriginalPath[i];
var groupId = originalGroup.getGroupId();
var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);
var newGroup = new columnGroup_1.ColumnGroup(originalGroup, groupId, instanceId);
currentRealPath[i] = newGroup;
// if top level, add to result, otherwise add to parent
if (i == 0) {
result.push(newGroup);
}
else {
currentRealPath[i - 1].addChild(newGroup);
}
}
else {
// reuse old group
currentRealPath[i] = previousRealPath[i];
}
}
var noColumnGroups = currentRealPath.length === 0;
if (noColumnGroups) {
// if we are not grouping, then the result of the above is an empty
// path (no groups), and we just add the column to the root list.
result.push(currentColumn);
}
else {
var leafGroup = currentRealPath[currentRealPath.length - 1];
leafGroup.addChild(currentColumn);
}
previousRealPath = currentRealPath;
previousOriginalPath = currentOriginalPath;
});
return result;
};
DisplayedGroupCreator.prototype.createFakePath = function (balancedColumnTree) {
var result = [];
var currentChildren = balancedColumnTree;
// this while look does search on the balanced tree, so our result is the right length
var index = 0;
while (currentChildren && currentChildren[0] && currentChildren[0] instanceof originalColumnGroup_1.OriginalColumnGroup) {
// putting in a deterministic fake id, in case the API in the future needs to reference the col
result.push(new originalColumnGroup_1.OriginalColumnGroup(null, 'FAKE_PATH_' + index));
currentChildren = currentChildren[0].getChildren();
index++;
}
return result;
};
DisplayedGroupCreator.prototype.getOriginalPathForColumn = function (balancedColumnTree, column) {
var result = [];
var found = false;
recursePath(balancedColumnTree, 0);
// it's possible we didn't find a path. this happens if the column is generated
// by the grid, in that the definition didn't come from the client. in this case,
// we create a fake original path.
if (found) {
return result;
}
else {
return this.createFakePath(balancedColumnTree);
}
function recursePath(balancedColumnTree, dept) {
for (var i = 0; i < balancedColumnTree.length; i++) {
if (found) {
// quit the search, so 'result' is kept with the found result
return;
}
var node = balancedColumnTree[i];
if (node instanceof originalColumnGroup_1.OriginalColumnGroup) {
var nextNode = node;
recursePath(nextNode.getChildren(), dept + 1);
result[dept] = node;
}
else {
if (node === column) {
found = true;
}
}
}
}
};
__decorate([
context_2.Autowired('columnUtils'),
__metadata('design:type', columnUtils_1.ColumnUtils)
], DisplayedGroupCreator.prototype, "columnUtils", void 0);
DisplayedGroupCreator = __decorate([
context_1.Bean('displayedGroupCreator'),
__metadata('design:paramtypes', [])
], DisplayedGroupCreator);
return DisplayedGroupCreator;
})();
exports.DisplayedGroupCreator = DisplayedGroupCreator;
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var rowRenderer_1 = __webpack_require__(23);
var gridPanel_1 = __webpack_require__(24);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var AutoWidthCalculator = (function () {
function AutoWidthCalculator() {
}
// this is the trick: we create a dummy container and clone all the cells
// into the dummy, then check the dummy's width. then destroy the dummy
// as we don't need it any more.
// drawback: only the cells visible on the screen are considered
AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column) {
var eDummyContainer = document.createElement('span');
// position fixed, so it isn't restricted to the boundaries of the parent
eDummyContainer.style.position = 'fixed';
// we put the dummy into the body container, so it will inherit all the
// css styles that the real cells are inheriting
var eBodyContainer = this.gridPanel.getBodyContainer();
eBodyContainer.appendChild(eDummyContainer);
// get all the cells that are currently displayed (this only brings back
// rendered cells, rows not rendered due to row visualisation will not be here)
var eOriginalCells = this.rowRenderer.getAllCellsForColumn(column);
eOriginalCells.forEach(function (eCell, index) {
// make a deep clone of the cell
var eCellClone = eCell.cloneNode(true);
// the original has a fixed width, we remove this to allow the natural width based on content
eCellClone.style.width = '';
// the original has position = absolute, we need to remove this so it's positioned normally
eCellClone.style.position = 'static';
eCellClone.style.left = '';
// we put the cell into a containing div, as otherwise the cells would just line up
// on the same line, standard flow layout, by putting them into divs, they are laid
// out one per line
var eCloneParent = document.createElement('div');
// table-row, so that each cell is on a row. i also tried display='block', but this
// didn't work in IE
eCloneParent.style.display = 'table-row';
// the twig on the branch, the branch on the tree, the tree in the hole,
// the hole in the bog, the bog in the clone, the clone in the parent,
// the parent in the dummy, and the dummy down in the vall-e-ooo, OOOOOOOOO! Oh row the rattling bog....
eCloneParent.appendChild(eCellClone);
eDummyContainer.appendChild(eCloneParent);
});
// at this point, all the clones are lined up vertically with natural widths. the dummy
// container will have a width wide enough just to fit the largest.
var dummyContainerWidth = eDummyContainer.offsetWidth;
// we are finished with the dummy container, so get rid of it
eBodyContainer.removeChild(eDummyContainer);
// we add 4 as I found without it, the gui still put '...' after some of the texts
return dummyContainerWidth + 4;
};
__decorate([
context_2.Autowired('rowRenderer'),
__metadata('design:type', rowRenderer_1.RowRenderer)
], AutoWidthCalculator.prototype, "rowRenderer", void 0);
__decorate([
context_2.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], AutoWidthCalculator.prototype, "gridPanel", void 0);
AutoWidthCalculator = __decorate([
context_1.Bean('autoWidthCalculator'),
__metadata('design:paramtypes', [])
], AutoWidthCalculator);
return AutoWidthCalculator;
})();
exports.AutoWidthCalculator = AutoWidthCalculator;
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var gridPanel_1 = __webpack_require__(24);
var expressionService_1 = __webpack_require__(18);
var templateService_1 = __webpack_require__(36);
var valueService_1 = __webpack_require__(29);
var eventService_1 = __webpack_require__(4);
var floatingRowModel_1 = __webpack_require__(26);
var renderedRow_1 = __webpack_require__(37);
var events_1 = __webpack_require__(10);
var constants_1 = __webpack_require__(8);
var context_1 = __webpack_require__(6);
var gridCore_1 = __webpack_require__(40);
var columnController_1 = __webpack_require__(13);
var logger_1 = __webpack_require__(5);
var focusedCellController_1 = __webpack_require__(35);
var cellNavigationService_1 = __webpack_require__(64);
var gridCell_1 = __webpack_require__(33);
var RowRenderer = (function () {
function RowRenderer() {
// map of row ids to row objects. keeps track of which elements
// are rendered for which rows in the dom.
this.renderedRows = {};
this.renderedTopFloatingRows = [];
this.renderedBottomFloatingRows = [];
this.destroyFunctions = [];
}
RowRenderer.prototype.agWire = function (loggerFactory) {
this.logger = this.loggerFactory.create('RowRenderer');
this.logger = loggerFactory.create('BalancedColumnTreeBuilder');
};
RowRenderer.prototype.init = function () {
var _this = this;
this.getContainersFromGridPanel();
var columnListener = this.onColumnEvent.bind(this);
var refreshViewListener = this.refreshView.bind(this);
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, columnListener);
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, columnListener);
this.eventService.addEventListener(events_1.Events.EVENT_MODEL_UPDATED, refreshViewListener);
this.eventService.addEventListener(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED, refreshViewListener);
this.destroyFunctions.push(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, columnListener);
_this.eventService.removeEventListener(events_1.Events.EVENT_COLUMN_RESIZED, columnListener);
_this.eventService.removeEventListener(events_1.Events.EVENT_MODEL_UPDATED, refreshViewListener);
_this.eventService.removeEventListener(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED, refreshViewListener);
});
this.refreshView();
};
RowRenderer.prototype.onColumnEvent = function (event) {
this.setMainRowWidths();
};
RowRenderer.prototype.getContainersFromGridPanel = function () {
this.eBodyContainer = this.gridPanel.getBodyContainer();
this.ePinnedLeftColsContainer = this.gridPanel.getPinnedLeftColsContainer();
this.ePinnedRightColsContainer = this.gridPanel.getPinnedRightColsContainer();
this.eFloatingTopContainer = this.gridPanel.getFloatingTopContainer();
this.eFloatingTopPinnedLeftContainer = this.gridPanel.getPinnedLeftFloatingTop();
this.eFloatingTopPinnedRightContainer = this.gridPanel.getPinnedRightFloatingTop();
this.eFloatingBottomContainer = this.gridPanel.getFloatingBottomContainer();
this.eFloatingBottomPinnedLeftContainer = this.gridPanel.getPinnedLeftFloatingBottom();
this.eFloatingBottomPinnedRightContainer = this.gridPanel.getPinnedRightFloatingBottom();
this.eBodyViewport = this.gridPanel.getBodyViewport();
this.eAllBodyContainers = [this.eBodyContainer, this.eFloatingBottomContainer,
this.eFloatingTopContainer];
this.eAllPinnedLeftContainers = [
this.ePinnedLeftColsContainer,
this.eFloatingBottomPinnedLeftContainer,
this.eFloatingTopPinnedLeftContainer];
this.eAllPinnedRightContainers = [
this.ePinnedRightColsContainer,
this.eFloatingBottomPinnedRightContainer,
this.eFloatingTopPinnedRightContainer];
};
RowRenderer.prototype.setRowModel = function (rowModel) {
this.rowModel = rowModel;
};
RowRenderer.prototype.getAllCellsForColumn = function (column) {
var eCells = [];
utils_1.Utils.iterateObject(this.renderedRows, callback);
utils_1.Utils.iterateObject(this.renderedBottomFloatingRows, callback);
utils_1.Utils.iterateObject(this.renderedBottomFloatingRows, callback);
function callback(key, renderedRow) {
var eCell = renderedRow.getCellForCol(column);
if (eCell) {
eCells.push(eCell);
}
}
return eCells;
};
RowRenderer.prototype.setMainRowWidths = function () {
var mainRowWidth = this.columnController.getBodyContainerWidth() + "px";
this.eAllBodyContainers.forEach(function (container) {
var unpinnedRows = container.querySelectorAll(".ag-row");
for (var i = 0; i < unpinnedRows.length; i++) {
unpinnedRows[i].style.width = mainRowWidth;
}
});
};
RowRenderer.prototype.refreshAllFloatingRows = function () {
this.refreshFloatingRows(this.renderedTopFloatingRows, this.floatingRowModel.getFloatingTopRowData(), this.eFloatingTopPinnedLeftContainer, this.eFloatingTopPinnedRightContainer, this.eFloatingTopContainer);
this.refreshFloatingRows(this.renderedBottomFloatingRows, this.floatingRowModel.getFloatingBottomRowData(), this.eFloatingBottomPinnedLeftContainer, this.eFloatingBottomPinnedRightContainer, this.eFloatingBottomContainer);
};
RowRenderer.prototype.refreshFloatingRows = function (renderedRows, rowNodes, pinnedLeftContainer, pinnedRightContainer, bodyContainer) {
var _this = this;
renderedRows.forEach(function (row) {
row.destroy();
});
renderedRows.length = 0;
// if no cols, don't draw row - can we get rid of this???
var columns = this.columnController.getAllDisplayedColumns();
if (utils_1.Utils.missingOrEmpty(columns)) {
return;
}
if (rowNodes) {
rowNodes.forEach(function (node, rowIndex) {
var renderedRow = new renderedRow_1.RenderedRow(_this.$scope, _this, bodyContainer, pinnedLeftContainer, pinnedRightContainer, node, rowIndex);
_this.context.wireBean(renderedRow);
renderedRows.push(renderedRow);
});
}
};
RowRenderer.prototype.refreshView = function (refreshEvent) {
this.logger.log('refreshView');
var focusedCell = this.focusedCellController.getFocusCellIfBrowserFocused();
this.focusedCellController.getFocusedCell();
var refreshFromIndex = refreshEvent ? refreshEvent.fromIndex : null;
if (!this.gridOptionsWrapper.isForPrint()) {
var containerHeight = this.rowModel.getRowCombinedHeight();
this.eBodyContainer.style.height = containerHeight + "px";
this.ePinnedLeftColsContainer.style.height = containerHeight + "px";
this.ePinnedRightColsContainer.style.height = containerHeight + "px";
}
this.refreshAllVirtualRows(refreshFromIndex);
this.refreshAllFloatingRows();
this.restoreFocusedCell(focusedCell);
};
// sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without
// worry about the focus been lost. this is important when the user is using keyboard navigation to do edits
// and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the
// edited cell).
RowRenderer.prototype.restoreFocusedCell = function (gridCell) {
if (gridCell) {
this.focusedCellController.setFocusedCell(gridCell.rowIndex, gridCell.column, gridCell.floating, true);
}
};
RowRenderer.prototype.softRefreshView = function () {
var focusedCell = this.focusedCellController.getFocusCellIfBrowserFocused();
this.forEachRenderedCell(function (renderedCell) {
if (renderedCell.isVolatile()) {
renderedCell.refreshCell();
}
});
this.restoreFocusedCell(focusedCell);
};
RowRenderer.prototype.stopEditing = function (cancel) {
if (cancel === void 0) { cancel = false; }
this.forEachRenderedCell(function (renderedCell) {
renderedCell.stopEditing(cancel);
});
};
RowRenderer.prototype.forEachRenderedCell = function (callback) {
utils_1.Utils.iterateObject(this.renderedRows, function (key, renderedRow) {
renderedRow.forEachRenderedCell(callback);
});
};
RowRenderer.prototype.forEachRenderedRow = function (callback) {
utils_1.Utils.iterateObject(this.renderedRows, callback);
utils_1.Utils.iterateObject(this.renderedTopFloatingRows, callback);
utils_1.Utils.iterateObject(this.renderedBottomFloatingRows, callback);
};
RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
var renderedRow = this.renderedRows[rowIndex];
renderedRow.addEventListener(eventName, callback);
};
RowRenderer.prototype.refreshRows = function (rowNodes) {
if (!rowNodes || rowNodes.length == 0) {
return;
}
var focusedCell = this.focusedCellController.getFocusCellIfBrowserFocused();
// we only need to be worried about rendered rows, as this method is
// called to whats rendered. if the row isn't rendered, we don't care
var indexesToRemove = [];
utils_1.Utils.iterateObject(this.renderedRows, function (key, renderedRow) {
var rowNode = renderedRow.getRowNode();
if (rowNodes.indexOf(rowNode) >= 0) {
indexesToRemove.push(key);
}
});
// remove the rows
this.removeVirtualRow(indexesToRemove);
// add draw them again
this.drawVirtualRows();
this.restoreFocusedCell(focusedCell);
};
RowRenderer.prototype.refreshCells = function (rowNodes, colIds, animate) {
if (animate === void 0) { animate = false; }
if (!rowNodes || rowNodes.length == 0) {
return;
}
// we only need to be worried about rendered rows, as this method is
// called to whats rendered. if the row isn't rendered, we don't care
utils_1.Utils.iterateObject(this.renderedRows, function (key, renderedRow) {
var rowNode = renderedRow.getRowNode();
if (rowNodes.indexOf(rowNode) >= 0) {
renderedRow.refreshCells(colIds, animate);
}
});
};
RowRenderer.prototype.rowDataChanged = function (rows) {
// we only need to be worried about rendered rows, as this method is
// called to whats rendered. if the row isn't rendered, we don't care
var indexesToRemove = [];
var renderedRows = this.renderedRows;
Object.keys(renderedRows).forEach(function (key) {
var renderedRow = renderedRows[key];
// see if the rendered row is in the list of rows we have to update
if (renderedRow.isDataInList(rows)) {
indexesToRemove.push(key);
}
});
// remove the rows
this.removeVirtualRow(indexesToRemove);
// add draw them again
this.drawVirtualRows();
};
RowRenderer.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) { return func(); });
var rowsToRemove = Object.keys(this.renderedRows);
this.removeVirtualRow(rowsToRemove);
};
RowRenderer.prototype.refreshAllVirtualRows = function (fromIndex) {
// remove all current virtual rows, as they have old data
var rowsToRemove = Object.keys(this.renderedRows);
this.removeVirtualRow(rowsToRemove, fromIndex);
// add in new rows
this.drawVirtualRows();
};
// public - removes the group rows and then redraws them again
RowRenderer.prototype.refreshGroupRows = function () {
// find all the group rows
var rowsToRemove = [];
var that = this;
Object.keys(this.renderedRows).forEach(function (key) {
var renderedRow = that.renderedRows[key];
if (renderedRow.isGroup()) {
rowsToRemove.push(key);
}
});
// remove the rows
this.removeVirtualRow(rowsToRemove);
// and draw them back again
this.ensureRowsRendered();
};
// takes array of row indexes
RowRenderer.prototype.removeVirtualRow = function (rowsToRemove, fromIndex) {
var that = this;
// if no fromIndex then set to -1, which will refresh everything
var realFromIndex = (typeof fromIndex === 'number') ? fromIndex : -1;
rowsToRemove.forEach(function (indexToRemove) {
if (indexToRemove >= realFromIndex) {
that.unbindVirtualRow(indexToRemove);
}
});
};
RowRenderer.prototype.unbindVirtualRow = function (indexToRemove) {
var renderedRow = this.renderedRows[indexToRemove];
renderedRow.destroy();
var event = { node: renderedRow.getRowNode(), rowIndex: indexToRemove };
this.eventService.dispatchEvent(events_1.Events.EVENT_VIRTUAL_ROW_REMOVED, event);
delete this.renderedRows[indexToRemove];
};
RowRenderer.prototype.drawVirtualRows = function () {
this.workOutFirstAndLastRowsToRender();
this.ensureRowsRendered();
};
RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () {
var newFirst;
var newLast;
if (!this.rowModel.isRowsToRender()) {
newFirst = 0;
newLast = -1; // setting to -1 means nothing in range
}
else {
var rowCount = this.rowModel.getRowCount();
if (this.gridOptionsWrapper.isForPrint()) {
newFirst = 0;
newLast = rowCount;
}
else {
var topPixel = this.eBodyViewport.scrollTop;
var bottomPixel = topPixel + this.eBodyViewport.offsetHeight;
var first = this.rowModel.getRowIndexAtPixel(topPixel);
var last = this.rowModel.getRowIndexAtPixel(bottomPixel);
//add in buffer
var buffer = this.gridOptionsWrapper.getRowBuffer();
first = first - buffer;
last = last + buffer;
// adjust, in case buffer extended actual size
if (first < 0) {
first = 0;
}
if (last > rowCount - 1) {
last = rowCount - 1;
}
newFirst = first;
newLast = last;
}
}
var firstDiffers = newFirst !== this.firstRenderedRow;
var lastDiffers = newLast !== this.lastRenderedRow;
if (firstDiffers || lastDiffers) {
this.firstRenderedRow = newFirst;
this.lastRenderedRow = newLast;
var event = { firstRow: newFirst, lastRow: newLast };
this.eventService.dispatchEvent(events_1.Events.EVENT_VIEWPORT_CHANGED, event);
}
};
RowRenderer.prototype.getFirstVirtualRenderedRow = function () {
return this.firstRenderedRow;
};
RowRenderer.prototype.getLastVirtualRenderedRow = function () {
return this.lastRenderedRow;
};
RowRenderer.prototype.ensureRowsRendered = function () {
//var start = new Date().getTime();
var _this = this;
// at the end, this array will contain the items we need to remove
var rowsToRemove = Object.keys(this.renderedRows);
// add in new rows
for (var rowIndex = this.firstRenderedRow; rowIndex <= this.lastRenderedRow; rowIndex++) {
// see if item already there, and if yes, take it out of the 'to remove' array
if (rowsToRemove.indexOf(rowIndex.toString()) >= 0) {
rowsToRemove.splice(rowsToRemove.indexOf(rowIndex.toString()), 1);
continue;
}
// check this row actually exists (in case overflow buffer window exceeds real data)
var node = this.rowModel.getRow(rowIndex);
if (node) {
this.insertRow(node, rowIndex);
}
}
// at this point, everything in our 'rowsToRemove' . . .
this.removeVirtualRow(rowsToRemove);
// if we are doing angular compiling, then do digest the scope here
if (this.gridOptionsWrapper.isAngularCompileRows()) {
// we do it in a timeout, in case we are already in an apply
setTimeout(function () { _this.$scope.$apply(); }, 0);
}
//var end = new Date().getTime();
//console.log(end-start);
};
RowRenderer.prototype.onMouseEvent = function (eventName, mouseEvent, eventSource, cell) {
var renderedRow;
switch (cell.floating) {
case constants_1.Constants.FLOATING_TOP:
renderedRow = this.renderedTopFloatingRows[cell.rowIndex];
break;
case constants_1.Constants.FLOATING_BOTTOM:
renderedRow = this.renderedBottomFloatingRows[cell.rowIndex];
break;
default:
renderedRow = this.renderedRows[cell.rowIndex];
break;
}
if (renderedRow) {
renderedRow.onMouseEvent(eventName, mouseEvent, eventSource, cell);
}
};
RowRenderer.prototype.insertRow = function (node, rowIndex) {
var columns = this.columnController.getAllDisplayedColumns();
// if no cols, don't draw row
if (utils_1.Utils.missingOrEmpty(columns)) {
return;
}
var renderedRow = new renderedRow_1.RenderedRow(this.$scope, this, this.eBodyContainer, this.ePinnedLeftColsContainer, this.ePinnedRightColsContainer, node, rowIndex);
this.context.wireBean(renderedRow);
this.renderedRows[rowIndex] = renderedRow;
};
RowRenderer.prototype.getRenderedNodes = function () {
var renderedRows = this.renderedRows;
return Object.keys(renderedRows).map(function (key) {
return renderedRows[key].getRowNode();
});
};
// we use index for rows, but column object for columns, as the next column (by index) might not
// be visible (header grouping) so it's not reliable, so using the column object instead.
RowRenderer.prototype.navigateToNextCell = function (key, rowIndex, column, floating) {
var nextCell = new gridCell_1.GridCell(rowIndex, floating, column);
// we keep searching for a next cell until we find one. this is how the group rows get skipped
while (true) {
nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell);
if (utils_1.Utils.missing(nextCell)) {
break;
}
var skipGroupRows = this.gridOptionsWrapper.isGroupUseEntireRow();
if (skipGroupRows) {
var rowNode = this.rowModel.getRow(nextCell.rowIndex);
if (!rowNode.group) {
break;
}
}
else {
break;
}
}
// no next cell means we have reached a grid boundary, eg left, right, top or bottom of grid
if (!nextCell) {
return;
}
// this scrolls the row into view
if (utils_1.Utils.missing(nextCell.floating)) {
this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
}
if (!nextCell.column.isPinned()) {
this.gridPanel.ensureColumnVisible(nextCell.column);
}
// need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
// floating cell, the scrolls get out of sync
this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
this.focusedCellController.setFocusedCell(nextCell.rowIndex, nextCell.column, nextCell.floating, true);
if (this.rangeController) {
this.rangeController.setRangeToCell(new gridCell_1.GridCell(nextCell.rowIndex, nextCell.floating, nextCell.column));
}
};
RowRenderer.prototype.getComponentForCell = function (gridCell) {
var rowComponent;
switch (gridCell.floating) {
case constants_1.Constants.FLOATING_TOP:
rowComponent = this.renderedTopFloatingRows[gridCell.rowIndex];
break;
case constants_1.Constants.FLOATING_BOTTOM:
rowComponent = this.renderedBottomFloatingRows[gridCell.rowIndex];
break;
default:
rowComponent = this.renderedRows[gridCell.rowIndex];
break;
}
if (!rowComponent) {
return null;
}
var cellComponent = rowComponent.getRenderedCellForColumn(gridCell.column);
return cellComponent;
};
// called by the cell, when tab is pressed while editing.
// @return: true when navigation successful, otherwise false
RowRenderer.prototype.moveFocusToNextCell = function (rowIndex, column, floating, shiftKey, startEditing) {
var nextCell = new gridCell_1.GridCell(rowIndex, floating, column);
while (true) {
nextCell = this.cellNavigationService.getNextTabbedCell(nextCell, shiftKey);
// if no 'next cell', means we have got to last cell of grid, so nothing to move to,
// so bottom right cell going forwards, or top left going backwards
if (!nextCell) {
return false;
}
var nextRenderedCell = this.getComponentForCell(nextCell);
// if editing, but cell not editable, skip cell
if (startEditing && !nextRenderedCell.isCellEditable()) {
continue;
}
// this scrolls the row into view
var cellIsNotFloating = utils_1.Utils.missing(nextCell.floating);
if (cellIsNotFloating) {
this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
}
this.gridPanel.ensureColumnVisible(nextCell.column);
// need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
// floating cell, the scrolls get out of sync
this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
if (startEditing) {
nextRenderedCell.startEditingIfEnabled();
nextRenderedCell.focusCell(false);
}
else {
nextRenderedCell.focusCell(true);
}
// by default, when we click a cell, it gets selected into a range, so to keep keyboard navigation
// consistent, we set into range here also.
if (this.rangeController) {
this.rangeController.setRangeToCell(new gridCell_1.GridCell(nextCell.rowIndex, nextCell.floating, nextCell.column));
}
// we successfully tabbed onto a grid cell, so return true
return true;
}
};
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], RowRenderer.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], RowRenderer.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('gridCore'),
__metadata('design:type', gridCore_1.GridCore)
], RowRenderer.prototype, "gridCore", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], RowRenderer.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('$compile'),
__metadata('design:type', Object)
], RowRenderer.prototype, "$compile", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], RowRenderer.prototype, "$scope", void 0);
__decorate([
context_1.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], RowRenderer.prototype, "expressionService", void 0);
__decorate([
context_1.Autowired('templateService'),
__metadata('design:type', templateService_1.TemplateService)
], RowRenderer.prototype, "templateService", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], RowRenderer.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], RowRenderer.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('floatingRowModel'),
__metadata('design:type', floatingRowModel_1.FloatingRowModel)
], RowRenderer.prototype, "floatingRowModel", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], RowRenderer.prototype, "context", void 0);
__decorate([
context_1.Autowired('loggerFactory'),
__metadata('design:type', logger_1.LoggerFactory)
], RowRenderer.prototype, "loggerFactory", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], RowRenderer.prototype, "rowModel", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], RowRenderer.prototype, "focusedCellController", void 0);
__decorate([
context_1.Optional('rangeController'),
__metadata('design:type', Object)
], RowRenderer.prototype, "rangeController", void 0);
__decorate([
context_1.Autowired('cellNavigationService'),
__metadata('design:type', cellNavigationService_1.CellNavigationService)
], RowRenderer.prototype, "cellNavigationService", void 0);
__decorate([
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], RowRenderer.prototype, "agWire", null);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], RowRenderer.prototype, "init", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], RowRenderer.prototype, "destroy", null);
RowRenderer = __decorate([
context_1.Bean('rowRenderer'),
__metadata('design:paramtypes', [])
], RowRenderer);
return RowRenderer;
})();
exports.RowRenderer = RowRenderer;
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = __webpack_require__(7);
var masterSlaveService_1 = __webpack_require__(25);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var rowRenderer_1 = __webpack_require__(23);
var floatingRowModel_1 = __webpack_require__(26);
var borderLayout_1 = __webpack_require__(30);
var logger_1 = __webpack_require__(5);
var context_1 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var dragService_1 = __webpack_require__(31);
var constants_1 = __webpack_require__(8);
var selectionController_1 = __webpack_require__(28);
var csvCreator_1 = __webpack_require__(12);
var mouseEventService_1 = __webpack_require__(32);
var focusedCellController_1 = __webpack_require__(35);
// in the html below, it is important that there are no white space between some of the divs, as if there is white space,
// it won't render correctly in safari, as safari renders white space as a gap
var gridHtml = '<div>' +
// header
'<div class="ag-header">' +
'<div class="ag-pinned-left-header"></div>' +
'<div class="ag-pinned-right-header"></div>' +
'<div class="ag-header-viewport">' +
'<div class="ag-header-container"></div>' +
'</div>' +
'<div class="ag-header-overlay"></div>' +
'</div>' +
// floating top
'<div class="ag-floating-top">' +
'<div class="ag-pinned-left-floating-top"></div>' +
'<div class="ag-pinned-right-floating-top"></div>' +
'<div class="ag-floating-top-viewport">' +
'<div class="ag-floating-top-container"></div>' +
'</div>' +
'</div>' +
// floating bottom
'<div class="ag-floating-bottom">' +
'<div class="ag-pinned-left-floating-bottom"></div>' +
'<div class="ag-pinned-right-floating-bottom"></div>' +
'<div class="ag-floating-bottom-viewport">' +
'<div class="ag-floating-bottom-container"></div>' +
'</div>' +
'</div>' +
// body
'<div class="ag-body">' +
'<div class="ag-pinned-left-cols-viewport">' +
'<div class="ag-pinned-left-cols-container"></div>' +
'</div>' +
'<div class="ag-pinned-right-cols-viewport">' +
'<div class="ag-pinned-right-cols-container"></div>' +
'</div>' +
'<div class="ag-body-viewport-wrapper">' +
'<div class="ag-body-viewport">' +
'<div class="ag-body-container"></div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var gridForPrintHtml = '<div>' +
// header
'<div class="ag-header-container"></div>' +
// floating
'<div class="ag-floating-top-container"></div>' +
// body
'<div class="ag-body-container"></div>' +
// floating bottom
'<div class="ag-floating-bottom-container"></div>' +
'</div>';
// wrapping in outer div, and wrapper, is needed to center the loading icon
// The idea for centering came from here: http://www.vanseodesign.com/css/vertical-centering/
var mainOverlayTemplate = '<div class="ag-overlay-panel">' +
'<div class="ag-overlay-wrapper ag-overlay-[OVERLAY_NAME]-wrapper">[OVERLAY_TEMPLATE]</div>' +
'</div>';
var defaultLoadingOverlayTemplate = '<span class="ag-overlay-loading-center">[LOADING...]</span>';
var defaultNoRowsOverlayTemplate = '<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';
var GridPanel = (function () {
function GridPanel() {
this.requestAnimationFrameExists = typeof requestAnimationFrame === 'function';
this.scrollLagCounter = 0;
this.scrollLagTicking = false;
this.lastLeftPosition = -1;
this.lastTopPosition = -1;
this.animationThreadCount = 0;
this.destroyFunctions = [];
}
GridPanel.prototype.agWire = function (loggerFactory) {
// makes code below more readable if we pull 'forPrint' out
this.forPrint = this.gridOptionsWrapper.isForPrint();
this.scrollWidth = utils_1.Utils.getScrollbarWidth();
this.logger = loggerFactory.create('GridPanel');
this.findElements();
};
GridPanel.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) { return func(); });
};
GridPanel.prototype.onRowDataChanged = function () {
if (this.rowModel.isEmpty() && !this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
this.showNoRowsOverlay();
}
else {
this.hideOverlay();
}
};
GridPanel.prototype.getLayout = function () {
return this.layout;
};
GridPanel.prototype.init = function () {
this.addEventListeners();
this.addDragListeners();
this.useScrollLag = this.isUseScrollLag();
this.layout = new borderLayout_1.BorderLayout({
overlays: {
loading: utils_1.Utils.loadTemplate(this.createLoadingOverlayTemplate()),
noRows: utils_1.Utils.loadTemplate(this.createNoRowsOverlayTemplate())
},
center: this.eRoot,
dontFill: this.forPrint,
name: 'eGridPanel'
});
this.layout.addSizeChangeListener(this.sizeHeaderAndBody.bind(this));
this.addScrollListener();
this.setLeftAndRightBounds();
if (this.gridOptionsWrapper.isSuppressHorizontalScroll()) {
this.eBodyViewport.style.overflowX = 'hidden';
}
if (this.gridOptionsWrapper.isRowModelDefault() && !this.gridOptionsWrapper.getRowData()) {
this.showLoadingOverlay();
}
this.setWidthsOfContainers();
this.showPinnedColContainersIfNeeded();
this.sizeHeaderAndBody();
this.disableBrowserDragging();
this.addShortcutKeyListeners();
this.addCellListeners();
if (this.$scope) {
this.addAngularApplyCheck();
}
};
GridPanel.prototype.addAngularApplyCheck = function () {
var _this = this;
// this makes sure if we queue up requests, we only execute oe
var applyTriggered = false;
var listener = function () {
// only need to do one apply at a time
if (applyTriggered) {
return;
}
applyTriggered = true; // mark 'need apply' to true
setTimeout(function () {
applyTriggered = false;
_this.$scope.$apply();
}, 0);
};
// these are the events we need to do an apply after - these are the ones that can end up
// with columns added or removed
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
this.eventService.addEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
this.destroyFunctions.push(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
_this.eventService.removeEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
});
};
// if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
// and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
GridPanel.prototype.disableBrowserDragging = function () {
this.eRoot.addEventListener('dragstart', function (event) {
if (event.target instanceof HTMLImageElement) {
event.preventDefault();
return false;
}
});
};
GridPanel.prototype.addEventListeners = function () {
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED, this.sizeHeaderAndBody.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_HEADER_HEIGHT_CHANGED, this.sizeHeaderAndBody.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_ROW_DATA_CHANGED, this.onRowDataChanged.bind(this));
};
GridPanel.prototype.addDragListeners = function () {
var _this = this;
if (this.forPrint // no range select when doing 'for print'
|| !this.gridOptionsWrapper.isEnableRangeSelection() // no range selection if no property
|| utils_1.Utils.missing(this.rangeController)) {
return;
}
var containers = [this.ePinnedLeftColsContainer, this.ePinnedRightColsContainer, this.eBodyContainer,
this.eFloatingTop, this.eFloatingBottom];
containers.forEach(function (container) {
_this.dragService.addDragSource({
dragStartPixels: 0,
eElement: container,
onDragStart: _this.rangeController.onDragStart.bind(_this.rangeController),
onDragStop: _this.rangeController.onDragStop.bind(_this.rangeController),
onDragging: _this.rangeController.onDragging.bind(_this.rangeController)
});
});
};
GridPanel.prototype.addCellListeners = function () {
var _this = this;
var eventNames = ['click', 'mousedown', 'dblclick', 'contextmenu'];
var that = this;
eventNames.forEach(function (eventName) {
_this.eAllCellContainers.forEach(function (container) {
return container.addEventListener(eventName, function (mouseEvent) {
var eventSource = this;
that.processMouseEvent(eventName, mouseEvent, eventSource);
});
});
});
};
GridPanel.prototype.processMouseEvent = function (eventName, mouseEvent, eventSource) {
var cell = this.mouseEventService.getCellForMouseEvent(mouseEvent);
if (utils_1.Utils.exists(cell)) {
//console.log(`row = ${cell.rowIndex}, floating = ${floating}`);
this.rowRenderer.onMouseEvent(eventName, mouseEvent, eventSource, cell);
}
// if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'
// will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse
// button in the browser). so this property allows the user to receive middle button clicks if
// they want.
if (this.gridOptionsWrapper.isSuppressMiddleClickScrolls() && mouseEvent.which === 2) {
mouseEvent.preventDefault();
}
};
GridPanel.prototype.addShortcutKeyListeners = function () {
var _this = this;
this.eAllCellContainers.forEach(function (container) {
container.addEventListener('keydown', function (event) {
if (event.ctrlKey || event.metaKey) {
switch (event.which) {
case constants_1.Constants.KEY_A: return _this.onCtrlAndA(event);
case constants_1.Constants.KEY_C: return _this.onCtrlAndC(event);
case constants_1.Constants.KEY_V: return _this.onCtrlAndV(event);
case constants_1.Constants.KEY_D: return _this.onCtrlAndD(event);
}
}
});
});
};
GridPanel.prototype.onCtrlAndA = function (event) {
if (this.rangeController && this.rowModel.isRowsToRender()) {
var rowEnd;
var floatingStart;
var floatingEnd;
if (this.floatingRowModel.isEmpty(constants_1.Constants.FLOATING_TOP)) {
floatingStart = null;
}
else {
floatingStart = constants_1.Constants.FLOATING_TOP;
}
if (this.floatingRowModel.isEmpty(constants_1.Constants.FLOATING_BOTTOM)) {
floatingEnd = null;
rowEnd = this.rowModel.getRowCount() - 1;
}
else {
floatingEnd = constants_1.Constants.FLOATING_BOTTOM;
rowEnd = this.floatingRowModel.getFloatingBottomRowData().length = 1;
}
var allDisplayedColumns = this.columnController.getAllDisplayedColumns();
if (utils_1.Utils.missingOrEmpty(allDisplayedColumns)) {
return;
}
this.rangeController.setRange({
rowStart: 0,
floatingStart: floatingStart,
rowEnd: rowEnd,
floatingEnd: floatingEnd,
columnStart: allDisplayedColumns[0],
columnEnd: allDisplayedColumns[allDisplayedColumns.length - 1]
});
}
event.preventDefault();
return false;
};
GridPanel.prototype.onCtrlAndC = function (event) {
if (!this.clipboardService) {
return;
}
var focusedCell = this.focusedCellController.getFocusedCell();
this.clipboardService.copyToClipboard();
event.preventDefault();
// the copy operation results in loosing focus on the cell,
// because of the trickery the copy logic uses with a temporary
// widget. so we set it back again.
if (focusedCell) {
this.focusedCellController.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.floating, true);
}
return false;
};
GridPanel.prototype.onCtrlAndV = function (event) {
if (!this.rangeController) {
return;
}
this.clipboardService.pasteFromClipboard();
return false;
};
GridPanel.prototype.onCtrlAndD = function (event) {
if (!this.clipboardService) {
return;
}
this.clipboardService.copyRangeDown();
event.preventDefault();
return false;
};
GridPanel.prototype.getPinnedLeftFloatingTop = function () {
return this.ePinnedLeftFloatingTop;
};
GridPanel.prototype.getPinnedRightFloatingTop = function () {
return this.ePinnedRightFloatingTop;
};
GridPanel.prototype.getFloatingTopContainer = function () {
return this.eFloatingTopContainer;
};
GridPanel.prototype.getPinnedLeftFloatingBottom = function () {
return this.ePinnedLeftFloatingBottom;
};
GridPanel.prototype.getPinnedRightFloatingBottom = function () {
return this.ePinnedRightFloatingBottom;
};
GridPanel.prototype.getFloatingBottomContainer = function () {
return this.eFloatingBottomContainer;
};
GridPanel.prototype.createOverlayTemplate = function (name, defaultTemplate, userProvidedTemplate) {
var template = mainOverlayTemplate
.replace('[OVERLAY_NAME]', name);
if (userProvidedTemplate) {
template = template.replace('[OVERLAY_TEMPLATE]', userProvidedTemplate);
}
else {
template = template.replace('[OVERLAY_TEMPLATE]', defaultTemplate);
}
return template;
};
GridPanel.prototype.createLoadingOverlayTemplate = function () {
var userProvidedTemplate = this.gridOptionsWrapper.getOverlayLoadingTemplate();
var templateNotLocalised = this.createOverlayTemplate('loading', defaultLoadingOverlayTemplate, userProvidedTemplate);
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var templateLocalised = templateNotLocalised.replace('[LOADING...]', localeTextFunc('loadingOoo', 'Loading...'));
return templateLocalised;
};
GridPanel.prototype.createNoRowsOverlayTemplate = function () {
var userProvidedTemplate = this.gridOptionsWrapper.getOverlayNoRowsTemplate();
var templateNotLocalised = this.createOverlayTemplate('no-rows', defaultNoRowsOverlayTemplate, userProvidedTemplate);
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var templateLocalised = templateNotLocalised.replace('[NO_ROWS_TO_SHOW]', localeTextFunc('noRowsToShow', 'No Rows To Show'));
return templateLocalised;
};
GridPanel.prototype.ensureIndexVisible = function (index) {
this.logger.log('ensureIndexVisible: ' + index);
var lastRow = this.rowModel.getRowCount();
if (typeof index !== 'number' || index < 0 || index >= lastRow) {
console.warn('invalid row index for ensureIndexVisible: ' + index);
return;
}
var nodeAtIndex = this.rowModel.getRow(index);
var rowTopPixel = nodeAtIndex.rowTop;
var rowBottomPixel = rowTopPixel + nodeAtIndex.rowHeight;
var viewportTopPixel = this.eBodyViewport.scrollTop;
var viewportHeight = this.eBodyViewport.offsetHeight;
var scrollShowing = this.isHorizontalScrollShowing();
if (scrollShowing) {
viewportHeight -= this.scrollWidth;
}
var viewportBottomPixel = viewportTopPixel + viewportHeight;
var viewportScrolledPastRow = viewportTopPixel > rowTopPixel;
var viewportScrolledBeforeRow = viewportBottomPixel < rowBottomPixel;
var eViewportToScroll = this.columnController.isPinningRight() ? this.ePinnedRightColsViewport : this.eBodyViewport;
if (viewportScrolledPastRow) {
// if row is before, scroll up with row at top
eViewportToScroll.scrollTop = rowTopPixel;
}
else if (viewportScrolledBeforeRow) {
// if row is below, scroll down with row at bottom
var newScrollPosition = rowBottomPixel - viewportHeight;
eViewportToScroll.scrollTop = newScrollPosition;
}
// otherwise, row is already in view, so do nothing
};
// + moveColumnController
GridPanel.prototype.getCenterWidth = function () {
return this.eBodyViewport.clientWidth;
};
GridPanel.prototype.isHorizontalScrollShowing = function () {
var result = this.eBodyViewport.clientWidth < this.eBodyViewport.scrollWidth;
return result;
};
GridPanel.prototype.isVerticalScrollShowing = function () {
if (this.columnController.isPinningRight()) {
// if pinning right, then the scroll bar can show, however for some reason
// it overlays the grid and doesn't take space.
return false;
}
else {
return this.eBodyViewport.clientHeight < this.eBodyViewport.scrollHeight;
}
};
// gets called every 500 ms. we use this to set padding on right pinned column
GridPanel.prototype.periodicallyCheck = function () {
if (this.columnController.isPinningRight()) {
var bodyHorizontalScrollShowing = this.eBodyViewport.clientWidth < this.eBodyViewport.scrollWidth;
if (bodyHorizontalScrollShowing) {
this.ePinnedRightColsContainer.style.marginBottom = this.scrollWidth + 'px';
}
else {
this.ePinnedRightColsContainer.style.marginBottom = '';
}
}
};
GridPanel.prototype.ensureColumnVisible = function (key) {
var column = this.columnController.getGridColumn(key);
if (!column) {
return;
}
if (column.isPinned()) {
console.warn('calling ensureIndexVisible on a ' + column.getPinned() + ' pinned column doesn\'t make sense for column ' + column.getColId());
return;
}
if (!this.columnController.isColumnDisplayed(column)) {
console.warn('column is not currently visible');
return;
}
var colLeftPixel = column.getLeft();
var colRightPixel = colLeftPixel + column.getActualWidth();
var viewportLeftPixel = this.eBodyViewport.scrollLeft;
var viewportWidth = this.eBodyViewport.offsetWidth;
var scrollShowing = this.eBodyViewport.clientHeight < this.eBodyViewport.scrollHeight;
if (scrollShowing) {
viewportWidth -= this.scrollWidth;
}
var viewportRightPixel = viewportLeftPixel + viewportWidth;
var viewportScrolledPastCol = viewportLeftPixel > colLeftPixel;
var viewportScrolledBeforeCol = viewportRightPixel < colRightPixel;
if (viewportScrolledPastCol) {
// if viewport's left side is after col's left side, scroll right to pull col into viewport at left
this.eBodyViewport.scrollLeft = colLeftPixel;
}
else if (viewportScrolledBeforeCol) {
// if viewport's right side is before col's right side, scroll left to pull col into viewport at right
var newScrollPosition = colRightPixel - viewportWidth;
this.eBodyViewport.scrollLeft = newScrollPosition;
}
// otherwise, col is already in view, so do nothing
};
GridPanel.prototype.showLoadingOverlay = function () {
if (!this.gridOptionsWrapper.isSuppressLoadingOverlay()) {
this.layout.showOverlay('loading');
}
};
GridPanel.prototype.showNoRowsOverlay = function () {
if (!this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
this.layout.showOverlay('noRows');
}
};
GridPanel.prototype.hideOverlay = function () {
this.layout.hideOverlay();
};
GridPanel.prototype.getWidthForSizeColsToFit = function () {
var availableWidth = this.eBody.clientWidth;
var scrollShowing = this.isVerticalScrollShowing();
if (scrollShowing) {
availableWidth -= this.scrollWidth;
}
return availableWidth;
};
// method will call itself if no available width. this covers if the grid
// isn't visible, but is just about to be visible.
GridPanel.prototype.sizeColumnsToFit = function (nextTimeout) {
var _this = this;
var availableWidth = this.getWidthForSizeColsToFit();
if (availableWidth > 0) {
this.columnController.sizeColumnsToFit(availableWidth);
}
else {
if (nextTimeout === undefined) {
setTimeout(function () {
_this.sizeColumnsToFit(100);
}, 0);
}
else if (nextTimeout === 100) {
setTimeout(function () {
_this.sizeColumnsToFit(-1);
}, 100);
}
else {
console.log('ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +
'zero width, maybe the grid is not visible yet on the screen?');
}
}
};
GridPanel.prototype.getBodyContainer = function () {
return this.eBodyContainer;
};
GridPanel.prototype.getDropTargetBodyContainers = function () {
if (this.forPrint) {
return [this.eBodyContainer, this.eFloatingTopContainer, this.eFloatingBottomContainer];
}
else {
return [this.eBodyViewport, this.eFloatingTopViewport, this.eFloatingBottomViewport];
}
};
GridPanel.prototype.getBodyViewport = function () {
return this.eBodyViewport;
};
GridPanel.prototype.getPinnedLeftColsContainer = function () {
return this.ePinnedLeftColsContainer;
};
GridPanel.prototype.getDropTargetLeftContainers = function () {
if (this.forPrint) {
return [];
}
else {
return [this.ePinnedLeftColsViewport, this.ePinnedLeftFloatingBottom, this.ePinnedLeftFloatingTop];
}
};
GridPanel.prototype.getPinnedRightColsContainer = function () {
return this.ePinnedRightColsContainer;
};
GridPanel.prototype.getDropTargetPinnedRightContainers = function () {
if (this.forPrint) {
return [];
}
else {
return [this.ePinnedRightColsViewport, this.ePinnedRightFloatingBottom, this.ePinnedRightFloatingTop];
}
};
GridPanel.prototype.getHeaderContainer = function () {
return this.eHeaderContainer;
};
GridPanel.prototype.getHeaderOverlay = function () {
return this.eHeaderOverlay;
};
GridPanel.prototype.getRoot = function () {
return this.eRoot;
};
GridPanel.prototype.getPinnedLeftHeader = function () {
return this.ePinnedLeftHeader;
};
GridPanel.prototype.getPinnedRightHeader = function () {
return this.ePinnedRightHeader;
};
GridPanel.prototype.queryHtmlElement = function (selector) {
return this.eRoot.querySelector(selector);
};
GridPanel.prototype.findElements = function () {
if (this.forPrint) {
this.eRoot = utils_1.Utils.loadTemplate(gridForPrintHtml);
utils_1.Utils.addCssClass(this.eRoot, 'ag-root');
utils_1.Utils.addCssClass(this.eRoot, 'ag-font-style');
utils_1.Utils.addCssClass(this.eRoot, 'ag-no-scrolls');
}
else {
this.eRoot = utils_1.Utils.loadTemplate(gridHtml);
utils_1.Utils.addCssClass(this.eRoot, 'ag-root');
utils_1.Utils.addCssClass(this.eRoot, 'ag-font-style');
utils_1.Utils.addCssClass(this.eRoot, 'ag-scrolls');
}
if (this.forPrint) {
this.eHeaderContainer = this.queryHtmlElement('.ag-header-container');
this.eBodyContainer = this.queryHtmlElement('.ag-body-container');
this.eFloatingTopContainer = this.queryHtmlElement('.ag-floating-top-container');
this.eFloatingBottomContainer = this.queryHtmlElement('.ag-floating-bottom-container');
this.eAllCellContainers = [this.eBodyContainer, this.eFloatingTopContainer, this.eFloatingBottomContainer];
}
else {
this.eBody = this.queryHtmlElement('.ag-body');
this.eBodyContainer = this.queryHtmlElement('.ag-body-container');
this.eBodyViewport = this.queryHtmlElement('.ag-body-viewport');
this.eBodyViewportWrapper = this.queryHtmlElement('.ag-body-viewport-wrapper');
this.ePinnedLeftColsContainer = this.queryHtmlElement('.ag-pinned-left-cols-container');
this.ePinnedRightColsContainer = this.queryHtmlElement('.ag-pinned-right-cols-container');
this.ePinnedLeftColsViewport = this.queryHtmlElement('.ag-pinned-left-cols-viewport');
this.ePinnedRightColsViewport = this.queryHtmlElement('.ag-pinned-right-cols-viewport');
this.ePinnedLeftHeader = this.queryHtmlElement('.ag-pinned-left-header');
this.ePinnedRightHeader = this.queryHtmlElement('.ag-pinned-right-header');
this.eHeader = this.queryHtmlElement('.ag-header');
this.eHeaderContainer = this.queryHtmlElement('.ag-header-container');
this.eHeaderOverlay = this.queryHtmlElement('.ag-header-overlay');
this.eHeaderViewport = this.queryHtmlElement('.ag-header-viewport');
this.eFloatingTop = this.queryHtmlElement('.ag-floating-top');
this.ePinnedLeftFloatingTop = this.queryHtmlElement('.ag-pinned-left-floating-top');
this.ePinnedRightFloatingTop = this.queryHtmlElement('.ag-pinned-right-floating-top');
this.eFloatingTopContainer = this.queryHtmlElement('.ag-floating-top-container');
this.eFloatingTopViewport = this.queryHtmlElement('.ag-floating-top-viewport');
this.eFloatingBottom = this.queryHtmlElement('.ag-floating-bottom');
this.ePinnedLeftFloatingBottom = this.queryHtmlElement('.ag-pinned-left-floating-bottom');
this.ePinnedRightFloatingBottom = this.queryHtmlElement('.ag-pinned-right-floating-bottom');
this.eFloatingBottomContainer = this.queryHtmlElement('.ag-floating-bottom-container');
this.eFloatingBottomViewport = this.queryHtmlElement('.ag-floating-bottom-viewport');
this.eAllCellContainers = [this.ePinnedLeftColsContainer, this.ePinnedRightColsContainer, this.eBodyContainer,
this.eFloatingTop, this.eFloatingBottom];
// IE9, Chrome, Safari, Opera
this.ePinnedLeftColsViewport.addEventListener('mousewheel', this.pinnedLeftMouseWheelListener.bind(this));
this.eBodyViewport.addEventListener('mousewheel', this.centerMouseWheelListener.bind(this));
// Firefox
this.ePinnedLeftColsViewport.addEventListener('DOMMouseScroll', this.pinnedLeftMouseWheelListener.bind(this));
this.eBodyViewport.addEventListener('DOMMouseScroll', this.centerMouseWheelListener.bind(this));
}
};
GridPanel.prototype.getHeaderViewport = function () {
return this.eHeaderViewport;
};
GridPanel.prototype.centerMouseWheelListener = function (event) {
// we are only interested in mimicking the mouse wheel if we are pinning on the right,
// as if we are not pinning on the right, then we have scrollbars in the center body, and
// as such we just use the default browser wheel behaviour.
if (this.columnController.isPinningRight()) {
return this.generalMouseWheelListener(event, this.ePinnedRightColsViewport);
}
};
GridPanel.prototype.pinnedLeftMouseWheelListener = function (event) {
var targetPanel;
if (this.columnController.isPinningRight()) {
targetPanel = this.ePinnedRightColsViewport;
}
else {
targetPanel = this.eBodyViewport;
}
return this.generalMouseWheelListener(event, targetPanel);
};
GridPanel.prototype.generalMouseWheelListener = function (event, targetPanel) {
var wheelEvent = utils_1.Utils.normalizeWheel(event);
// we need to detect in which direction scroll is happening to allow trackpads scroll horizontally
// horizontal scroll
if (Math.abs(wheelEvent.pixelX) > Math.abs(wheelEvent.pixelY)) {
var newLeftPosition = this.eBodyViewport.scrollLeft + wheelEvent.pixelX;
this.eBodyViewport.scrollLeft = newLeftPosition;
}
else {
var newTopPosition = this.eBodyViewport.scrollTop + wheelEvent.pixelY;
targetPanel.scrollTop = newTopPosition;
}
// allow the option to pass mouse wheel events ot the browser
// https://github.com/ceolter/ag-grid/issues/800
// in the future, this should be tied in with 'forPrint' option, or have an option 'no vertical scrolls'
if (!this.gridOptionsWrapper.isSuppressPreventDefaultOnMouseWheel()) {
// if we don't prevent default, then the whole browser will scroll also as well as the grid
event.preventDefault();
}
return false;
};
GridPanel.prototype.onColumnResized = function () {
this.setWidthsOfContainers();
};
GridPanel.prototype.onDisplayedColumnsChanged = function () {
this.setWidthsOfContainers();
this.showPinnedColContainersIfNeeded();
this.sizeHeaderAndBody();
};
GridPanel.prototype.setWidthsOfContainers = function () {
this.logger.log('setWidthsOfContainers()');
this.showPinnedColContainersIfNeeded();
var mainRowWidth = this.columnController.getBodyContainerWidth() + 'px';
this.eBodyContainer.style.width = mainRowWidth;
if (this.forPrint) {
// pinned col doesn't exist when doing forPrint
return;
}
this.eFloatingBottomContainer.style.width = mainRowWidth;
this.eFloatingTopContainer.style.width = mainRowWidth;
var pinnedLeftWidth = this.columnController.getPinnedLeftContainerWidth() + 'px';
this.ePinnedLeftColsContainer.style.width = pinnedLeftWidth;
this.ePinnedLeftFloatingBottom.style.width = pinnedLeftWidth;
this.ePinnedLeftFloatingTop.style.width = pinnedLeftWidth;
this.eBodyViewportWrapper.style.marginLeft = pinnedLeftWidth;
var pinnedRightWidth = this.columnController.getPinnedRightContainerWidth() + 'px';
this.ePinnedRightColsContainer.style.width = pinnedRightWidth;
this.ePinnedRightFloatingBottom.style.width = pinnedRightWidth;
this.ePinnedRightFloatingTop.style.width = pinnedRightWidth;
this.eBodyViewportWrapper.style.marginRight = pinnedRightWidth;
};
GridPanel.prototype.showPinnedColContainersIfNeeded = function () {
// no need to do this if not using scrolls
if (this.forPrint) {
return;
}
//some browsers had layout issues with the blank divs, so if blank,
//we don't display them
if (this.columnController.isPinningLeft()) {
this.ePinnedLeftHeader.style.display = 'inline-block';
this.ePinnedLeftColsViewport.style.display = 'inline';
}
else {
this.ePinnedLeftHeader.style.display = 'none';
this.ePinnedLeftColsViewport.style.display = 'none';
}
if (this.columnController.isPinningRight()) {
this.ePinnedRightHeader.style.display = 'inline-block';
this.ePinnedRightColsViewport.style.display = 'inline';
this.eBodyViewport.style.overflowY = 'hidden';
}
else {
this.ePinnedRightHeader.style.display = 'none';
this.ePinnedRightColsViewport.style.display = 'none';
this.eBodyViewport.style.overflowY = 'auto';
}
};
GridPanel.prototype.sizeHeaderAndBody = function () {
if (this.forPrint) {
// if doing 'for print', then the header and footers are laid
// out naturally by the browser. it whatever size that's needed to fit.
return;
}
this.setLeftAndRightBounds();
var heightOfContainer = this.layout.getCentreHeight();
if (!heightOfContainer) {
return;
}
var headerHeight = this.gridOptionsWrapper.getHeaderHeight();
var numberOfRowsInHeader = this.columnController.getHeaderRowCount();
var totalHeaderHeight = headerHeight * numberOfRowsInHeader;
this.eHeader.style['height'] = totalHeaderHeight + 'px';
// padding top covers the header and the floating rows on top
var floatingTopHeight = this.floatingRowModel.getFloatingTopTotalHeight();
var paddingTop = totalHeaderHeight + floatingTopHeight;
// bottom is just the bottom floating rows
var floatingBottomHeight = this.floatingRowModel.getFloatingBottomTotalHeight();
var floatingBottomTop = heightOfContainer - floatingBottomHeight;
var heightOfCentreRows = heightOfContainer - totalHeaderHeight - floatingBottomHeight - floatingTopHeight;
this.eBody.style.paddingTop = paddingTop + 'px';
this.eBody.style.paddingBottom = floatingBottomHeight + 'px';
this.eFloatingTop.style.top = totalHeaderHeight + 'px';
this.eFloatingTop.style.height = floatingTopHeight + 'px';
this.eFloatingBottom.style.height = floatingBottomHeight + 'px';
this.eFloatingBottom.style.top = floatingBottomTop + 'px';
this.ePinnedLeftColsViewport.style.height = heightOfCentreRows + 'px';
this.ePinnedRightColsViewport.style.height = heightOfCentreRows + 'px';
};
GridPanel.prototype.setHorizontalScrollPosition = function (hScrollPosition) {
this.eBodyViewport.scrollLeft = hScrollPosition;
};
// tries to scroll by pixels, but returns what the result actually was
GridPanel.prototype.scrollHorizontally = function (pixels) {
var oldScrollPosition = this.eBodyViewport.scrollLeft;
this.setHorizontalScrollPosition(oldScrollPosition + pixels);
var newScrollPosition = this.eBodyViewport.scrollLeft;
return newScrollPosition - oldScrollPosition;
};
GridPanel.prototype.getHorizontalScrollPosition = function () {
if (this.forPrint) {
return 0;
}
else {
return this.eBodyViewport.scrollLeft;
}
};
GridPanel.prototype.turnOnAnimationForABit = function () {
var _this = this;
if (this.gridOptionsWrapper.isSuppressColumnMoveAnimation()) {
return;
}
this.animationThreadCount++;
var animationThreadCountCopy = this.animationThreadCount;
utils_1.Utils.addCssClass(this.eRoot, 'ag-column-moving');
setTimeout(function () {
if (_this.animationThreadCount === animationThreadCountCopy) {
utils_1.Utils.removeCssClass(_this.eRoot, 'ag-column-moving');
}
}, 300);
};
GridPanel.prototype.addScrollListener = function () {
var _this = this;
// if printing, then no scrolling, so no point in listening for scroll events
if (this.forPrint) {
return;
}
var that = this;
function onBodyViewportScroll() {
// we are always interested in horizontal scrolls of the body
var newLeftPosition = that.eBodyViewport.scrollLeft;
if (newLeftPosition !== that.lastLeftPosition) {
that.lastLeftPosition = newLeftPosition;
that.horizontallyScrollHeaderCenterAndFloatingCenter();
that.masterSlaveService.fireHorizontalScrollEvent(newLeftPosition);
that.setLeftAndRightBounds();
}
// if we are pinning to the right, then it's the right pinned container
// that has the scroll.
if (!that.columnController.isPinningRight()) {
var newTopPosition = that.eBodyViewport.scrollTop;
if (newTopPosition !== that.lastTopPosition) {
that.lastTopPosition = newTopPosition;
that.verticallyScrollLeftPinned(newTopPosition);
that.rowRenderer.drawVirtualRows();
}
}
}
function onPinnedRightScroll() {
var newTopPosition = that.ePinnedRightColsViewport.scrollTop;
if (newTopPosition !== that.lastTopPosition) {
that.lastTopPosition = newTopPosition;
that.verticallyScrollLeftPinned(newTopPosition);
that.verticallyScrollBody(newTopPosition);
that.rowRenderer.drawVirtualRows();
}
}
if (this.useScrollLag) {
this.eBodyViewport.addEventListener('scroll', this.debounce.bind(this, onBodyViewportScroll));
this.ePinnedRightColsViewport.addEventListener('scroll', this.debounce.bind(this, onPinnedRightScroll));
}
else {
this.eBodyViewport.addEventListener('scroll', onBodyViewportScroll);
this.ePinnedRightColsViewport.addEventListener('scroll', onPinnedRightScroll);
}
// this means the pinned panel was moved, which can only
// happen when the user is navigating in the pinned container
// as the pinned col should never scroll. so we rollback
// the scroll on the pinned.
this.ePinnedLeftColsViewport.addEventListener('scroll', function () {
_this.ePinnedLeftColsViewport.scrollTop = 0;
});
};
GridPanel.prototype.setLeftAndRightBounds = function () {
if (this.gridOptionsWrapper.isForPrint()) {
return;
}
var scrollPosition = this.eBodyViewport.scrollLeft;
var totalWidth = this.eBody.offsetWidth;
this.columnController.setWidthAndScrollPosition(totalWidth, scrollPosition);
};
GridPanel.prototype.isUseScrollLag = function () {
// if we are in IE or Safari, then we only redraw if there was no scroll event
// in the 50ms following this scroll event. without this, these browsers have
// a bad scrolling feel, where the redraws clog the scroll experience
// (makes the scroll clunky and sticky). this method is like throttling
// the scroll events.
// let the user override scroll lag option
if (this.gridOptionsWrapper.isSuppressScrollLag()) {
return false;
}
else if (this.gridOptionsWrapper.getIsScrollLag()) {
return this.gridOptionsWrapper.getIsScrollLag()();
}
else {
return utils_1.Utils.isBrowserIE() || utils_1.Utils.isBrowserSafari();
}
};
GridPanel.prototype.debounce = function (callback) {
var _this = this;
if (this.requestAnimationFrameExists && utils_1.Utils.isBrowserSafari()) {
if (!this.scrollLagTicking) {
this.scrollLagTicking = true;
requestAnimationFrame(function () {
callback();
_this.scrollLagTicking = false;
});
}
}
else {
this.scrollLagCounter++;
var scrollLagCounterCopy = this.scrollLagCounter;
setTimeout(function () {
if (_this.scrollLagCounter === scrollLagCounterCopy) {
callback();
}
}, 50);
}
};
GridPanel.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function () {
var bodyLeftPosition = this.eBodyViewport.scrollLeft;
this.eHeaderContainer.style.left = -bodyLeftPosition + 'px';
this.eFloatingBottomContainer.style.left = -bodyLeftPosition + 'px';
this.eFloatingTopContainer.style.left = -bodyLeftPosition + 'px';
};
GridPanel.prototype.verticallyScrollLeftPinned = function (bodyTopPosition) {
this.ePinnedLeftColsContainer.style.top = -bodyTopPosition + 'px';
};
GridPanel.prototype.verticallyScrollBody = function (position) {
this.eBodyViewport.scrollTop = position;
};
GridPanel.prototype.getVerticalScrollPosition = function () {
if (this.forPrint) {
return 0;
}
else {
return this.eBodyViewport.scrollTop;
}
};
GridPanel.prototype.getBodyViewportClientRect = function () {
if (this.forPrint) {
return this.eBodyContainer.getBoundingClientRect();
}
else {
return this.eBodyViewport.getBoundingClientRect();
}
};
GridPanel.prototype.getFloatingTopClientRect = function () {
if (this.forPrint) {
return this.eFloatingTopContainer.getBoundingClientRect();
}
else {
return this.eFloatingTop.getBoundingClientRect();
}
};
GridPanel.prototype.getFloatingBottomClientRect = function () {
if (this.forPrint) {
return this.eFloatingBottomContainer.getBoundingClientRect();
}
else {
return this.eFloatingBottom.getBoundingClientRect();
}
};
GridPanel.prototype.getPinnedLeftColsViewportClientRect = function () {
return this.ePinnedLeftColsViewport.getBoundingClientRect();
};
GridPanel.prototype.getPinnedRightColsViewportClientRect = function () {
return this.ePinnedRightColsViewport.getBoundingClientRect();
};
GridPanel.prototype.addScrollEventListener = function (listener) {
this.eBodyViewport.addEventListener('scroll', listener);
};
GridPanel.prototype.removeScrollEventListener = function (listener) {
this.eBodyViewport.removeEventListener('scroll', listener);
};
__decorate([
context_1.Autowired('masterSlaveService'),
__metadata('design:type', masterSlaveService_1.MasterSlaveService)
], GridPanel.prototype, "masterSlaveService", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], GridPanel.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], GridPanel.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('rowRenderer'),
__metadata('design:type', rowRenderer_1.RowRenderer)
], GridPanel.prototype, "rowRenderer", void 0);
__decorate([
context_1.Autowired('floatingRowModel'),
__metadata('design:type', floatingRowModel_1.FloatingRowModel)
], GridPanel.prototype, "floatingRowModel", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], GridPanel.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], GridPanel.prototype, "rowModel", void 0);
__decorate([
context_1.Optional('rangeController'),
__metadata('design:type', Object)
], GridPanel.prototype, "rangeController", void 0);
__decorate([
context_1.Autowired('dragService'),
__metadata('design:type', dragService_1.DragService)
], GridPanel.prototype, "dragService", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], GridPanel.prototype, "selectionController", void 0);
__decorate([
context_1.Optional('clipboardService'),
__metadata('design:type', Object)
], GridPanel.prototype, "clipboardService", void 0);
__decorate([
context_1.Autowired('csvCreator'),
__metadata('design:type', csvCreator_1.CsvCreator)
], GridPanel.prototype, "csvCreator", void 0);
__decorate([
context_1.Autowired('mouseEventService'),
__metadata('design:type', mouseEventService_1.MouseEventService)
], GridPanel.prototype, "mouseEventService", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], GridPanel.prototype, "focusedCellController", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], GridPanel.prototype, "$scope", void 0);
__decorate([
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], GridPanel.prototype, "agWire", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridPanel.prototype, "destroy", null);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridPanel.prototype, "init", null);
GridPanel = __decorate([
context_1.Bean('gridPanel'),
__metadata('design:paramtypes', [])
], GridPanel);
return GridPanel;
})();
exports.GridPanel = GridPanel;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var gridPanel_1 = __webpack_require__(24);
var eventService_1 = __webpack_require__(4);
var logger_1 = __webpack_require__(5);
var events_1 = __webpack_require__(10);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var context_3 = __webpack_require__(6);
var context_4 = __webpack_require__(6);
var MasterSlaveService = (function () {
function MasterSlaveService() {
// flag to mark if we are consuming. to avoid cyclic events (ie slave firing back to master
// while processing a master event) we mark this if consuming an event, and if we are, then
// we don't fire back any events.
this.consuming = false;
}
MasterSlaveService.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('MasterSlaveService');
};
MasterSlaveService.prototype.init = function () {
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_MOVED, this.fireColumnEvent.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VISIBLE, this.fireColumnEvent.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PINNED, this.fireColumnEvent.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_GROUP_OPENED, this.fireColumnEvent.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.fireColumnEvent.bind(this));
};
// common logic across all the fire methods
MasterSlaveService.prototype.fireEvent = function (callback) {
// if we are already consuming, then we are acting on an event from a master,
// so we don't cause a cyclic firing of events
if (this.consuming) {
return;
}
// iterate through the slave grids, and pass each slave service to the callback
var slaveGrids = this.gridOptionsWrapper.getSlaveGrids();
if (slaveGrids) {
slaveGrids.forEach(function (slaveGridOptions) {
if (slaveGridOptions.api) {
var slaveService = slaveGridOptions.api.__getMasterSlaveService();
callback(slaveService);
}
});
}
};
// common logic across all consume methods. very little common logic, however extracting
// guarantees consistency across the methods.
MasterSlaveService.prototype.onEvent = function (callback) {
this.consuming = true;
callback();
this.consuming = false;
};
MasterSlaveService.prototype.fireColumnEvent = function (event) {
this.fireEvent(function (slaveService) {
slaveService.onColumnEvent(event);
});
};
MasterSlaveService.prototype.fireHorizontalScrollEvent = function (horizontalScroll) {
this.fireEvent(function (slaveService) {
slaveService.onScrollEvent(horizontalScroll);
});
};
MasterSlaveService.prototype.onScrollEvent = function (horizontalScroll) {
var _this = this;
this.onEvent(function () {
_this.gridPanel.setHorizontalScrollPosition(horizontalScroll);
});
};
MasterSlaveService.prototype.getMasterColumns = function (event) {
var result = [];
if (event.getColumn()) {
result.push(event.getColumn());
}
if (event.getColumns()) {
event.getColumns().forEach(function (column) {
result.push(column);
});
}
return result;
};
MasterSlaveService.prototype.getColumnIds = function (event) {
var result = [];
if (event.getColumn()) {
result.push(event.getColumn().getColId());
}
else if (event.getColumns()) {
event.getColumns().forEach(function (column) {
result.push(column.getColId());
});
}
return result;
};
MasterSlaveService.prototype.onColumnEvent = function (event) {
var _this = this;
this.onEvent(function () {
// the column in the event is from the master grid. need to
// look up the equivalent from this (slave) grid
var masterColumn = event.getColumn();
var slaveColumn;
if (masterColumn) {
slaveColumn = _this.columnController.getPrimaryColumn(masterColumn.getColId());
}
// if event was with respect to a master column, that is not present in this
// grid, then we ignore the event
if (masterColumn && !slaveColumn) {
return;
}
// likewise for column group
var masterColumnGroup = event.getColumnGroup();
var slaveColumnGroup;
if (masterColumnGroup) {
var colId = masterColumnGroup.getGroupId();
var instanceId = masterColumnGroup.getInstanceId();
slaveColumnGroup = _this.columnController.getColumnGroup(colId, instanceId);
}
if (masterColumnGroup && !slaveColumnGroup) {
return;
}
// in time, all the methods below should use the column ids, it's a more generic way
// of handling columns, and also allows for single or multi column events
var columnIds = _this.getColumnIds(event);
var masterColumns = _this.getMasterColumns(event);
switch (event.getType()) {
case events_1.Events.EVENT_COLUMN_PIVOT_CHANGED:
// we cannot support pivoting with master / slave as the columns will be out of sync as the
// grids will have columns created based on the row data of the grid.
console.warn('ag-Grid: pivoting is not supported with Master / Slave grids. ' +
'You can only use one of these features at a time in a grid.');
break;
case events_1.Events.EVENT_COLUMN_MOVED:
_this.logger.log('onColumnEvent-> processing ' + event + ' toIndex = ' + event.getToIndex());
_this.columnController.moveColumns(columnIds, event.getToIndex());
break;
case events_1.Events.EVENT_COLUMN_VISIBLE:
_this.logger.log('onColumnEvent-> processing ' + event + ' visible = ' + event.isVisible());
_this.columnController.setColumnsVisible(columnIds, event.isVisible());
break;
case events_1.Events.EVENT_COLUMN_PINNED:
_this.logger.log('onColumnEvent-> processing ' + event + ' pinned = ' + event.getPinned());
_this.columnController.setColumnsPinned(columnIds, event.getPinned());
break;
case events_1.Events.EVENT_COLUMN_GROUP_OPENED:
_this.logger.log('onColumnEvent-> processing ' + event + ' expanded = ' + masterColumnGroup.isExpanded());
_this.columnController.setColumnGroupOpened(slaveColumnGroup, masterColumnGroup.isExpanded());
break;
case events_1.Events.EVENT_COLUMN_RESIZED:
masterColumns.forEach(function (masterColumn) {
_this.logger.log('onColumnEvent-> processing ' + event + ' actualWidth = ' + masterColumn.getActualWidth());
_this.columnController.setColumnWidth(masterColumn.getColId(), masterColumn.getActualWidth(), event.isFinished());
});
break;
}
});
};
__decorate([
context_3.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], MasterSlaveService.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_3.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], MasterSlaveService.prototype, "columnController", void 0);
__decorate([
context_3.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], MasterSlaveService.prototype, "gridPanel", void 0);
__decorate([
context_3.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], MasterSlaveService.prototype, "eventService", void 0);
__decorate([
__param(0, context_2.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], MasterSlaveService.prototype, "setBeans", null);
__decorate([
context_4.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], MasterSlaveService.prototype, "init", null);
MasterSlaveService = __decorate([
context_1.Bean('masterSlaveService'),
__metadata('design:paramtypes', [])
], MasterSlaveService);
return MasterSlaveService;
})();
exports.MasterSlaveService = MasterSlaveService;
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var rowNode_1 = __webpack_require__(27);
var context_1 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var context_2 = __webpack_require__(6);
var events_1 = __webpack_require__(10);
var context_3 = __webpack_require__(6);
var constants_1 = __webpack_require__(8);
var utils_1 = __webpack_require__(7);
var FloatingRowModel = (function () {
function FloatingRowModel() {
}
FloatingRowModel.prototype.init = function () {
this.setFloatingTopRowData(this.gridOptionsWrapper.getFloatingTopRowData());
this.setFloatingBottomRowData(this.gridOptionsWrapper.getFloatingBottomRowData());
};
FloatingRowModel.prototype.isEmpty = function (floating) {
var rows = floating === constants_1.Constants.FLOATING_TOP ? this.floatingTopRows : this.floatingBottomRows;
return utils_1.Utils.missingOrEmpty(rows);
};
FloatingRowModel.prototype.isRowsToRender = function (floating) {
return !this.isEmpty(floating);
};
FloatingRowModel.prototype.getRowAtPixel = function (pixel, floating) {
var rows = floating === constants_1.Constants.FLOATING_TOP ? this.floatingTopRows : this.floatingBottomRows;
if (utils_1.Utils.missingOrEmpty(rows)) {
return 0; // this should never happen, just in case, 0 is graceful failure
}
for (var i = 0; i < rows.length; i++) {
var rowNode = rows[i];
var rowTopPixel = rowNode.rowTop + rowNode.rowHeight - 1;
// only need to range check against the top pixel, as we are going through the list
// in order, first row to hit the pixel wins
if (rowTopPixel >= pixel) {
return i;
}
}
return rows.length - 1;
};
FloatingRowModel.prototype.setFloatingTopRowData = function (rowData) {
this.floatingTopRows = this.createNodesFromData(rowData, true);
this.eventService.dispatchEvent(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED);
};
FloatingRowModel.prototype.setFloatingBottomRowData = function (rowData) {
this.floatingBottomRows = this.createNodesFromData(rowData, false);
this.eventService.dispatchEvent(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED);
};
FloatingRowModel.prototype.createNodesFromData = function (allData, isTop) {
var _this = this;
var rowNodes = [];
if (allData) {
var nextRowTop = 0;
allData.forEach(function (dataItem) {
var rowNode = new rowNode_1.RowNode();
_this.context.wireBean(rowNode);
rowNode.data = dataItem;
rowNode.floating = isTop ? constants_1.Constants.FLOATING_TOP : constants_1.Constants.FLOATING_BOTTOM;
rowNode.rowTop = nextRowTop;
rowNode.rowHeight = _this.gridOptionsWrapper.getRowHeightForNode(rowNode);
nextRowTop += rowNode.rowHeight;
rowNodes.push(rowNode);
});
}
return rowNodes;
};
FloatingRowModel.prototype.getFloatingTopRowData = function () {
return this.floatingTopRows;
};
FloatingRowModel.prototype.getFloatingBottomRowData = function () {
return this.floatingBottomRows;
};
FloatingRowModel.prototype.getFloatingTopTotalHeight = function () {
return this.getTotalHeight(this.floatingTopRows);
};
FloatingRowModel.prototype.getFloatingBottomTotalHeight = function () {
return this.getTotalHeight(this.floatingBottomRows);
};
FloatingRowModel.prototype.getTotalHeight = function (rowNodes) {
if (!rowNodes || rowNodes.length === 0) {
return 0;
}
else {
var lastNode = rowNodes[rowNodes.length - 1];
return lastNode.rowTop + lastNode.rowHeight;
}
};
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], FloatingRowModel.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_2.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], FloatingRowModel.prototype, "eventService", void 0);
__decorate([
context_2.Autowired('context'),
__metadata('design:type', context_1.Context)
], FloatingRowModel.prototype, "context", void 0);
__decorate([
context_3.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], FloatingRowModel.prototype, "init", null);
FloatingRowModel = __decorate([
context_1.Bean('floatingRowModel'),
__metadata('design:paramtypes', [])
], FloatingRowModel);
return FloatingRowModel;
})();
exports.FloatingRowModel = FloatingRowModel;
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var gridOptionsWrapper_1 = __webpack_require__(3);
var selectionController_1 = __webpack_require__(28);
var valueService_1 = __webpack_require__(29);
var columnController_1 = __webpack_require__(13);
var context_1 = __webpack_require__(6);
var constants_1 = __webpack_require__(8);
var RowNode = (function () {
function RowNode() {
/** Children mapped by the pivot columns */
this.childrenMapped = {};
this.selected = false;
}
RowNode.prototype.setData = function (data) {
var oldData = this.data;
this.data = data;
var event = { oldData: oldData, newData: data };
this.dispatchLocalEvent(RowNode.EVENT_DATA_CHANGED, event);
};
RowNode.prototype.dispatchLocalEvent = function (eventName, event) {
if (this.eventService) {
this.eventService.dispatchEvent(eventName, event);
}
};
// we also allow editing the value via the editors. when it is done via
// the editors, no 'cell changed' event gets fired, as it's assumed that
// the cell knows about the change given it's in charge of the editing.
// this method is for the client to call, so the cell listens for the change
// event, and also flashes the cell when the change occurs.
RowNode.prototype.setDataValue = function (colKey, newValue) {
var column = this.columnController.getPrimaryColumn(colKey);
this.valueService.setValue(this, column, newValue);
var event = { column: column, newValue: newValue };
this.dispatchLocalEvent(RowNode.EVENT_CELL_CHANGED, event);
};
RowNode.prototype.resetQuickFilterAggregateText = function () {
this.quickFilterAggregateText = null;
};
RowNode.prototype.isSelected = function () {
// for footers, we just return what our sibling selected state is, as cannot select a footer
if (this.footer) {
return this.sibling.isSelected();
}
return this.selected;
};
RowNode.prototype.deptFirstSearch = function (callback) {
if (this.childrenAfterGroup) {
this.childrenAfterGroup.forEach(function (child) { return child.deptFirstSearch(callback); });
}
callback(this);
};
// + rowController.updateGroupsInSelection()
RowNode.prototype.calculateSelectedFromChildren = function () {
var atLeastOneSelected = false;
var atLeastOneDeSelected = false;
var atLeastOneMixed = false;
var newSelectedValue;
if (this.childrenAfterGroup) {
for (var i = 0; i < this.childrenAfterGroup.length; i++) {
var childState = this.childrenAfterGroup[i].isSelected();
switch (childState) {
case true:
atLeastOneSelected = true;
break;
case false:
atLeastOneDeSelected = true;
break;
default:
atLeastOneMixed = true;
break;
}
}
}
if (atLeastOneMixed) {
newSelectedValue = undefined;
}
else if (atLeastOneSelected && !atLeastOneDeSelected) {
newSelectedValue = true;
}
else if (!atLeastOneSelected && atLeastOneDeSelected) {
newSelectedValue = false;
}
else {
newSelectedValue = undefined;
}
this.selectThisNode(newSelectedValue);
};
RowNode.prototype.calculateSelectedFromChildrenBubbleUp = function () {
this.calculateSelectedFromChildren();
if (this.parent) {
this.parent.calculateSelectedFromChildren();
}
};
RowNode.prototype.setSelectedInitialValue = function (selected) {
this.selected = selected;
};
/** Returns true if this row is selected */
RowNode.prototype.setSelected = function (newValue, clearSelection, tailingNodeInSequence) {
if (clearSelection === void 0) { clearSelection = false; }
if (tailingNodeInSequence === void 0) { tailingNodeInSequence = false; }
this.setSelectedParams({
newValue: newValue,
clearSelection: clearSelection,
tailingNodeInSequence: tailingNodeInSequence,
rangeSelect: false
});
};
// to make calling code more readable, this is the same method as setSelected except it takes names parameters
RowNode.prototype.setSelectedParams = function (params) {
var newValue = params.newValue === true;
var clearSelection = params.clearSelection === true;
var tailingNodeInSequence = params.tailingNodeInSequence === true;
var rangeSelect = params.rangeSelect === true;
if (this.floating) {
console.log('ag-Grid: cannot select floating rows');
return;
}
// if we are a footer, we don't do selection, just pass the info
// to the sibling (the parent of the group)
if (this.footer) {
this.sibling.setSelectedParams(params);
return;
}
if (rangeSelect) {
var rowModelNormal = this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_NORMAL;
var newRowClicked = this.selectionController.getLastSelectedNode() !== this;
var allowMultiSelect = this.gridOptionsWrapper.isRowSelectionMulti();
if (rowModelNormal && newRowClicked && allowMultiSelect) {
this.doRowRangeSelection();
return;
}
}
this.selectThisNode(newValue);
var groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
if (groupSelectsChildren && this.group) {
this.selectChildNodes(newValue);
}
// clear other nodes if not doing multi select
var actionWasOnThisNode = !tailingNodeInSequence;
if (actionWasOnThisNode) {
if (newValue && (clearSelection || !this.gridOptionsWrapper.isRowSelectionMulti())) {
this.selectionController.clearOtherNodes(this);
}
if (groupSelectsChildren && this.parent) {
this.parent.calculateSelectedFromChildrenBubbleUp();
}
// this is the very end of the 'action node', so we are finished all the updates,
// include any parent / child changes that this method caused
this.mainEventService.dispatchEvent(events_1.Events.EVENT_SELECTION_CHANGED);
// so if user next does shift-select, we know where to start the selection from
if (newValue) {
this.selectionController.setLastSelectedNode(this);
}
}
};
// selects all rows between this node and the last selected node (or the top if this is the first selection).
// not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by
// holding down 'shift'.
RowNode.prototype.doRowRangeSelection = function () {
var _this = this;
var lastSelectedNode = this.selectionController.getLastSelectedNode();
// if lastSelectedNode is missing, we start at the first row
var firstRowHit = !lastSelectedNode;
var lastRowHit = false;
var lastRow;
var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
var inMemoryRowModel = this.rowModel;
inMemoryRowModel.forEachNodeAfterFilterAndSort(function (rowNode) {
var lookingForLastRow = firstRowHit && !lastRowHit;
// check if we need to flip the select switch
if (!firstRowHit) {
if (rowNode === lastSelectedNode || rowNode === _this) {
firstRowHit = true;
}
}
var skipThisGroupNode = rowNode.group && groupsSelectChildren;
if (!skipThisGroupNode) {
var inRange = firstRowHit && !lastRowHit;
var childOfLastRow = rowNode.isParentOfNode(lastRow);
rowNode.selectThisNode(inRange || childOfLastRow);
}
if (lookingForLastRow) {
if (rowNode === lastSelectedNode || rowNode === _this) {
lastRowHit = true;
if (rowNode === lastSelectedNode) {
lastRow = lastSelectedNode;
}
else {
lastRow = _this;
}
}
}
});
if (groupsSelectChildren) {
this.calculatedSelectedForAllGroupNodes();
}
this.mainEventService.dispatchEvent(events_1.Events.EVENT_SELECTION_CHANGED);
};
RowNode.prototype.isParentOfNode = function (potentialParent) {
var parentNode = this.parent;
while (parentNode) {
if (parentNode === potentialParent) {
return true;
}
parentNode = parentNode.parent;
}
return false;
};
RowNode.prototype.calculatedSelectedForAllGroupNodes = function () {
// we have to make sure we do this dept first, as parent nodes
// will have dependencies on the children having correct values
var inMemoryRowModel = this.rowModel;
inMemoryRowModel.getTopLevelNodes().forEach(function (topLevelNode) {
if (topLevelNode.group) {
topLevelNode.deptFirstSearch(function (childNode) {
if (childNode.group) {
childNode.calculateSelectedFromChildren();
}
});
topLevelNode.calculateSelectedFromChildren();
}
});
};
RowNode.prototype.selectThisNode = function (newValue) {
if (this.selected !== newValue) {
this.selected = newValue;
if (this.eventService) {
this.dispatchLocalEvent(RowNode.EVENT_ROW_SELECTED);
}
var event = { node: this };
this.mainEventService.dispatchEvent(events_1.Events.EVENT_ROW_SELECTED, event);
}
};
RowNode.prototype.selectChildNodes = function (newValue) {
for (var i = 0; i < this.childrenAfterGroup.length; i++) {
this.childrenAfterGroup[i].setSelectedParams({
newValue: newValue,
clearSelection: false,
tailingNodeInSequence: true
});
}
};
RowNode.prototype.addEventListener = function (eventType, listener) {
if (!this.eventService) {
this.eventService = new eventService_1.EventService();
}
this.eventService.addEventListener(eventType, listener);
};
RowNode.prototype.removeEventListener = function (eventType, listener) {
this.eventService.removeEventListener(eventType, listener);
};
RowNode.prototype.onMouseEnter = function () {
this.dispatchLocalEvent(RowNode.EVENT_MOUSE_ENTER);
};
RowNode.prototype.onMouseLeave = function () {
this.dispatchLocalEvent(RowNode.EVENT_MOUSE_LEAVE);
};
RowNode.EVENT_ROW_SELECTED = 'rowSelected';
RowNode.EVENT_DATA_CHANGED = 'dataChanged';
RowNode.EVENT_CELL_CHANGED = 'cellChanged';
RowNode.EVENT_MOUSE_ENTER = 'mouseEnter';
RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave';
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], RowNode.prototype, "mainEventService", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], RowNode.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], RowNode.prototype, "selectionController", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], RowNode.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], RowNode.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], RowNode.prototype, "rowModel", void 0);
return RowNode;
})();
exports.RowNode = RowNode;
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = __webpack_require__(7);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var logger_1 = __webpack_require__(5);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var context_3 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var context_4 = __webpack_require__(6);
var constants_1 = __webpack_require__(8);
var SelectionController = (function () {
function SelectionController() {
}
SelectionController.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('SelectionController');
this.reset();
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.eventService.addEventListener(events_1.Events.EVENT_ROW_DATA_CHANGED, this.reset.bind(this));
}
else {
this.logger.log('dont know what to do here');
}
};
SelectionController.prototype.init = function () {
this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
this.eventService.addEventListener(events_1.Events.EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
};
SelectionController.prototype.setLastSelectedNode = function (rowNode) {
this.lastSelectedNode = rowNode;
};
SelectionController.prototype.getLastSelectedNode = function () {
return this.lastSelectedNode;
};
SelectionController.prototype.getSelectedNodes = function () {
var selectedNodes = [];
utils_1.Utils.iterateObject(this.selectedNodes, function (key, rowNode) {
if (rowNode) {
selectedNodes.push(rowNode);
}
});
return selectedNodes;
};
SelectionController.prototype.getSelectedRows = function () {
var selectedRows = [];
utils_1.Utils.iterateObject(this.selectedNodes, function (key, rowNode) {
if (rowNode) {
selectedRows.push(rowNode.data);
}
});
return selectedRows;
};
SelectionController.prototype.removeGroupsFromSelection = function () {
var _this = this;
utils_1.Utils.iterateObject(this.selectedNodes, function (key, rowNode) {
if (rowNode && rowNode.group) {
_this.selectedNodes[rowNode.id] = undefined;
}
});
};
// should only be called if groupSelectsChildren=true
SelectionController.prototype.updateGroupsFromChildrenSelections = function () {
if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_NORMAL) {
console.warn('updateGroupsFromChildrenSelections not available when rowModel is not normal');
}
var inMemoryRowModel = this.rowModel;
inMemoryRowModel.getTopLevelNodes().forEach(function (rowNode) {
rowNode.deptFirstSearch(function (rowNode) {
if (rowNode.group) {
rowNode.calculateSelectedFromChildren();
}
});
});
};
SelectionController.prototype.getNodeForIdIfSelected = function (id) {
return this.selectedNodes[id];
};
SelectionController.prototype.clearOtherNodes = function (rowNodeToKeepSelected) {
var _this = this;
var groupsToRefresh = {};
utils_1.Utils.iterateObject(this.selectedNodes, function (key, otherRowNode) {
if (otherRowNode && otherRowNode.id !== rowNodeToKeepSelected.id) {
_this.selectedNodes[otherRowNode.id].setSelectedParams({ newValue: false, clearSelection: false, tailingNodeInSequence: true });
if (_this.groupSelectsChildren && otherRowNode.parent) {
groupsToRefresh[otherRowNode.parent.id] = otherRowNode.parent;
}
}
});
utils_1.Utils.iterateObject(groupsToRefresh, function (key, group) {
group.calculateSelectedFromChildren();
});
};
SelectionController.prototype.onRowSelected = function (event) {
var rowNode = event.node;
// we do not store the group rows when the groups select children
if (this.groupSelectsChildren && rowNode.group) {
return;
}
if (rowNode.isSelected()) {
this.selectedNodes[rowNode.id] = rowNode;
}
else {
this.selectedNodes[rowNode.id] = undefined;
}
};
SelectionController.prototype.syncInRowNode = function (rowNode) {
if (this.selectedNodes[rowNode.id] !== undefined) {
rowNode.setSelectedInitialValue(true);
this.selectedNodes[rowNode.id] = rowNode;
}
};
SelectionController.prototype.reset = function () {
this.logger.log('reset');
this.selectedNodes = {};
this.lastSelectedNode = null;
};
// returns a list of all nodes at 'best cost' - a feature to be used
// with groups / trees. if a group has all it's children selected,
// then the group appears in the result, but not the children.
// Designed for use with 'children' as the group selection type,
// where groups don't actually appear in the selection normally.
SelectionController.prototype.getBestCostNodeSelection = function () {
if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_NORMAL) {
console.warn('getBestCostNodeSelection is only avilable when using normal row model');
}
var inMemoryRowModel = this.rowModel;
var topLevelNodes = inMemoryRowModel.getTopLevelNodes();
if (topLevelNodes === null) {
console.warn('selectAll not available doing rowModel=virtual');
return;
}
var result = [];
// recursive function, to find the selected nodes
function traverse(nodes) {
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (node.isSelected()) {
result.push(node);
}
else {
// if not selected, then if it's a group, and the group
// has children, continue to search for selections
if (node.group && node.children) {
traverse(node.children);
}
}
}
}
traverse(topLevelNodes);
return result;
};
SelectionController.prototype.setRowModel = function (rowModel) {
this.rowModel = rowModel;
};
SelectionController.prototype.isEmpty = function () {
var count = 0;
utils_1.Utils.iterateObject(this.selectedNodes, function (nodeId, rowNode) {
if (rowNode) {
count++;
}
});
return count === 0;
};
SelectionController.prototype.deselectAllRowNodes = function () {
utils_1.Utils.iterateObject(this.selectedNodes, function (nodeId, rowNode) {
if (rowNode) {
rowNode.selectThisNode(false);
}
});
// we should not have to do this, as deselecting the nodes fires events
// that we pick up, however it's good to clean it down, as we are still
// left with entries pointing to 'undefined'
this.selectedNodes = {};
this.eventService.dispatchEvent(events_1.Events.EVENT_SELECTION_CHANGED);
};
SelectionController.prototype.selectAllRowNodes = function () {
if (this.rowModel.getType() !== constants_1.Constants.ROW_MODEL_TYPE_NORMAL) {
throw 'selectAll only available with normal row model, ie not virtual pagination';
}
this.rowModel.forEachNode(function (rowNode) {
rowNode.selectThisNode(true);
});
this.eventService.dispatchEvent(events_1.Events.EVENT_SELECTION_CHANGED);
};
// Deprecated method
SelectionController.prototype.selectNode = function (rowNode, tryMulti) {
rowNode.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
};
// Deprecated method
SelectionController.prototype.deselectIndex = function (rowIndex) {
var node = this.rowModel.getRow(rowIndex);
this.deselectNode(node);
};
// Deprecated method
SelectionController.prototype.deselectNode = function (rowNode) {
rowNode.setSelectedParams({ newValue: false, clearSelection: false });
};
// Deprecated method
SelectionController.prototype.selectIndex = function (index, tryMulti) {
var node = this.rowModel.getRow(index);
this.selectNode(node, tryMulti);
};
__decorate([
context_3.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], SelectionController.prototype, "eventService", void 0);
__decorate([
context_3.Autowired('rowModel'),
__metadata('design:type', Object)
], SelectionController.prototype, "rowModel", void 0);
__decorate([
context_3.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], SelectionController.prototype, "gridOptionsWrapper", void 0);
__decorate([
__param(0, context_2.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], SelectionController.prototype, "setBeans", null);
__decorate([
context_4.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], SelectionController.prototype, "init", null);
SelectionController = __decorate([
context_1.Bean('selectionController'),
__metadata('design:paramtypes', [])
], SelectionController);
return SelectionController;
})();
exports.SelectionController = SelectionController;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var expressionService_1 = __webpack_require__(18);
var columnController_1 = __webpack_require__(13);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var context_3 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var events_1 = __webpack_require__(10);
var eventService_1 = __webpack_require__(4);
var ValueService = (function () {
function ValueService() {
this.initialised = false;
}
ValueService.prototype.init = function () {
this.suppressDotNotation = this.gridOptionsWrapper.isSuppressFieldDotNotation();
this.cellExpressions = this.gridOptionsWrapper.isEnableCellExpressions();
this.userProvidedTheGroups = utils_1.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
this.suppressUseColIdForGroups = this.gridOptionsWrapper.isSuppressUseColIdForGroups();
this.initialised = true;
};
ValueService.prototype.getValue = function (column, node) {
return this.getValueUsingSpecificData(column, node.data, node);
};
ValueService.prototype.getValueUsingSpecificData = function (column, data, node) {
// hack - the grid is getting refreshed before this bean gets initialised, race condition.
// really should have a way so they get initialised in the right order???
if (!this.initialised) {
this.init();
}
var colDef = column.getColDef();
var field = colDef.field;
var result;
// if there is a value getter, this gets precedence over a field
// - need to revisit this, we check 'data' as this is the way for the grid to
// not render when on the footer row
if (data && node.group && !this.userProvidedTheGroups && !this.suppressUseColIdForGroups) {
result = node.data ? node.data[column.getId()] : undefined;
}
else if (colDef.valueGetter) {
result = this.executeValueGetter(colDef.valueGetter, data, column, node);
}
else if (field && data) {
result = this.getValueUsingField(data, field, column.isFieldContainsDots());
}
else {
result = undefined;
}
// the result could be an expression itself, if we are allowing cell values to be expressions
if (this.cellExpressions && (typeof result === 'string') && result.indexOf('=') === 0) {
var cellValueGetter = result.substring(1);
result = this.executeValueGetter(cellValueGetter, data, column, node);
}
return result;
};
ValueService.prototype.getValueUsingField = function (data, field, fieldContainsDots) {
if (!field || !data) {
return;
}
// if no '.', then it's not a deep value
if (!fieldContainsDots) {
return data[field];
}
else {
// otherwise it is a deep value, so need to dig for it
var fields = field.split('.');
var currentObject = data;
for (var i = 0; i < fields.length; i++) {
currentObject = currentObject[fields[i]];
if (utils_1.Utils.missing(currentObject)) {
return null;
}
}
return currentObject;
}
};
ValueService.prototype.setValue = function (rowNode, colKey, newValue) {
var column = this.columnController.getPrimaryColumn(colKey);
if (!rowNode || !column) {
return;
}
// this will only happen if user is trying to paste into a group row, which doesn't make sense
// the user should not be trying to paste into group rows
var data = rowNode.data;
if (utils_1.Utils.missing(data)) {
return;
}
var field = column.getColDef().field;
var newValueHandler = column.getColDef().newValueHandler;
// need either a field or a newValueHandler for this to work
if (utils_1.Utils.missing(field) && utils_1.Utils.missing(newValueHandler)) {
return;
}
var paramsForCallbacks = {
node: rowNode,
data: rowNode.data,
oldValue: this.getValue(column, rowNode),
newValue: newValue,
colDef: column.getColDef(),
api: this.gridOptionsWrapper.getApi(),
context: this.gridOptionsWrapper.getContext()
};
if (newValueHandler) {
newValueHandler(paramsForCallbacks);
}
else {
this.setValueUsingField(data, field, newValue, column.isFieldContainsDots());
}
// reset quick filter on this row
rowNode.resetQuickFilterAggregateText();
paramsForCallbacks.newValue = this.getValue(column, rowNode);
if (typeof column.getColDef().onCellValueChanged === 'function') {
column.getColDef().onCellValueChanged(paramsForCallbacks);
}
this.eventService.dispatchEvent(events_1.Events.EVENT_CELL_VALUE_CHANGED, paramsForCallbacks);
};
ValueService.prototype.setValueUsingField = function (data, field, newValue, isFieldContainsDots) {
// if no '.', then it's not a deep value
if (!isFieldContainsDots) {
data[field] = newValue;
}
else {
// otherwise it is a deep value, so need to dig for it
var fieldPieces = field.split('.');
var currentObject = data;
while (fieldPieces.length > 0 && currentObject) {
var fieldPiece = fieldPieces.shift();
if (fieldPieces.length === 0) {
currentObject[fieldPiece] = newValue;
}
else {
currentObject = currentObject[fieldPiece];
}
}
}
};
ValueService.prototype.executeValueGetter = function (valueGetter, data, column, node) {
var context = this.gridOptionsWrapper.getContext();
var api = this.gridOptionsWrapper.getApi();
var params = {
data: data,
node: node,
colDef: column.getColDef(),
api: api,
context: context,
getValue: this.getValueCallback.bind(this, data, node)
};
if (typeof valueGetter === 'function') {
// valueGetter is a function, so just call it
return valueGetter(params);
}
else if (typeof valueGetter === 'string') {
// valueGetter is an expression, so execute the expression
return this.expressionService.evaluate(valueGetter, params);
}
};
ValueService.prototype.getValueCallback = function (data, node, field) {
var otherColumn = this.columnController.getPrimaryColumn(field);
if (otherColumn) {
return this.getValueUsingSpecificData(otherColumn, data, node);
}
else {
return null;
}
};
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], ValueService.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_2.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], ValueService.prototype, "expressionService", void 0);
__decorate([
context_2.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], ValueService.prototype, "columnController", void 0);
__decorate([
context_2.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], ValueService.prototype, "eventService", void 0);
__decorate([
context_3.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], ValueService.prototype, "init", null);
ValueService = __decorate([
context_1.Bean('valueService'),
__metadata('design:paramtypes', [])
], ValueService);
return ValueService;
})();
exports.ValueService = ValueService;
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var BorderLayout = (function () {
function BorderLayout(params) {
this.sizeChangeListeners = [];
this.isLayoutPanel = true;
this.fullHeight = !params.north && !params.south;
var template;
if (!params.dontFill) {
if (this.fullHeight) {
template =
'<div style="height: 100%; overflow: auto; position: relative;">' +
'<div id="west" style="height: 100%; float: left;"></div>' +
'<div id="east" style="height: 100%; float: right;"></div>' +
'<div id="center" style="height: 100%;"></div>' +
'<div id="overlay" style="pointer-events: none; position: absolute; height: 100%; width: 100%; top: 0px; left: 0px;"></div>' +
'</div>';
}
else {
template =
'<div style="height: 100%; position: relative;">' +
'<div id="north"></div>' +
'<div id="centerRow" style="height: 100%; overflow: hidden;">' +
'<div id="west" style="height: 100%; float: left;"></div>' +
'<div id="east" style="height: 100%; float: right;"></div>' +
'<div id="center" style="height: 100%;"></div>' +
'</div>' +
'<div id="south"></div>' +
'<div id="overlay" style="pointer-events: none; position: absolute; height: 100%; width: 100%; top: 0px; left: 0px;"></div>' +
'</div>';
}
this.layoutActive = true;
}
else {
template =
'<div style="position: relative;">' +
'<div id="north"></div>' +
'<div id="centerRow">' +
'<div id="west"></div>' +
'<div id="east"></div>' +
'<div id="center"></div>' +
'</div>' +
'<div id="south"></div>' +
'<div id="overlay" style="pointer-events: none; position: absolute; height: 100%; width: 100%; top: 0px; left: 0px;"></div>' +
'</div>';
this.layoutActive = false;
}
this.eGui = utils_1.Utils.loadTemplate(template);
this.id = 'borderLayout';
if (params.name) {
this.id += '_' + params.name;
}
this.eGui.setAttribute('id', this.id);
this.childPanels = [];
if (params) {
this.setupPanels(params);
}
this.overlays = params.overlays;
this.setupOverlays();
}
BorderLayout.prototype.addSizeChangeListener = function (listener) {
this.sizeChangeListeners.push(listener);
};
BorderLayout.prototype.fireSizeChanged = function () {
this.sizeChangeListeners.forEach(function (listener) {
listener();
});
};
BorderLayout.prototype.setupPanels = function (params) {
this.eNorthWrapper = this.eGui.querySelector('#north');
this.eSouthWrapper = this.eGui.querySelector('#south');
this.eEastWrapper = this.eGui.querySelector('#east');
this.eWestWrapper = this.eGui.querySelector('#west');
this.eCenterWrapper = this.eGui.querySelector('#center');
this.eOverlayWrapper = this.eGui.querySelector('#overlay');
this.eCenterRow = this.eGui.querySelector('#centerRow');
this.eNorthChildLayout = this.setupPanel(params.north, this.eNorthWrapper);
this.eSouthChildLayout = this.setupPanel(params.south, this.eSouthWrapper);
this.eEastChildLayout = this.setupPanel(params.east, this.eEastWrapper);
this.eWestChildLayout = this.setupPanel(params.west, this.eWestWrapper);
this.eCenterChildLayout = this.setupPanel(params.center, this.eCenterWrapper);
};
BorderLayout.prototype.setupPanel = function (content, ePanel) {
if (!ePanel) {
return;
}
if (content) {
if (content.isLayoutPanel) {
this.childPanels.push(content);
ePanel.appendChild(content.getGui());
return content;
}
else {
ePanel.appendChild(content);
return null;
}
}
else {
ePanel.parentNode.removeChild(ePanel);
return null;
}
};
BorderLayout.prototype.getGui = function () {
return this.eGui;
};
// returns true if any item changed size, otherwise returns false
BorderLayout.prototype.doLayout = function () {
if (!utils_1.Utils.isVisible(this.eGui)) {
return false;
}
var atLeastOneChanged = false;
var childLayouts = [this.eNorthChildLayout, this.eSouthChildLayout, this.eEastChildLayout, this.eWestChildLayout];
var that = this;
utils_1.Utils.forEach(childLayouts, function (childLayout) {
var childChangedSize = that.layoutChild(childLayout);
if (childChangedSize) {
atLeastOneChanged = true;
}
});
if (this.layoutActive) {
var ourHeightChanged = this.layoutHeight();
var ourWidthChanged = this.layoutWidth();
if (ourHeightChanged || ourWidthChanged) {
atLeastOneChanged = true;
}
}
var centerChanged = this.layoutChild(this.eCenterChildLayout);
if (centerChanged) {
atLeastOneChanged = true;
}
if (atLeastOneChanged) {
this.fireSizeChanged();
}
return atLeastOneChanged;
};
BorderLayout.prototype.layoutChild = function (childPanel) {
if (childPanel) {
return childPanel.doLayout();
}
else {
return false;
}
};
BorderLayout.prototype.layoutHeight = function () {
if (this.fullHeight) {
return this.layoutHeightFullHeight();
}
else {
return this.layoutHeightNormal();
}
};
// full height never changes the height, because the center is always 100%,
// however we do check for change, to inform the listeners
BorderLayout.prototype.layoutHeightFullHeight = function () {
var centerHeight = utils_1.Utils.offsetHeight(this.eGui);
if (centerHeight < 0) {
centerHeight = 0;
}
if (this.centerHeightLastTime !== centerHeight) {
this.centerHeightLastTime = centerHeight;
return true;
}
else {
return false;
}
};
BorderLayout.prototype.layoutHeightNormal = function () {
var totalHeight = utils_1.Utils.offsetHeight(this.eGui);
var northHeight = utils_1.Utils.offsetHeight(this.eNorthWrapper);
var southHeight = utils_1.Utils.offsetHeight(this.eSouthWrapper);
var centerHeight = totalHeight - northHeight - southHeight;
if (centerHeight < 0) {
centerHeight = 0;
}
if (this.centerHeightLastTime !== centerHeight) {
this.eCenterRow.style.height = centerHeight + 'px';
this.centerHeightLastTime = centerHeight;
return true; // return true because there was a change
}
else {
return false;
}
};
BorderLayout.prototype.getCentreHeight = function () {
return this.centerHeightLastTime;
};
BorderLayout.prototype.layoutWidth = function () {
var totalWidth = utils_1.Utils.offsetWidth(this.eGui);
var eastWidth = utils_1.Utils.offsetWidth(this.eEastWrapper);
var westWidth = utils_1.Utils.offsetWidth(this.eWestWrapper);
var centerWidth = totalWidth - eastWidth - westWidth;
if (centerWidth < 0) {
centerWidth = 0;
}
if (this.centerWidthLastTime !== centerWidth) {
this.centerWidthLastTime = centerWidth;
this.eCenterWrapper.style.width = centerWidth + 'px';
return true; // return true because there was a change
}
else {
return false;
}
};
BorderLayout.prototype.setEastVisible = function (visible) {
if (this.eEastWrapper) {
this.eEastWrapper.style.display = visible ? '' : 'none';
}
this.doLayout();
};
BorderLayout.prototype.setNorthVisible = function (visible) {
if (this.eNorthWrapper) {
this.eNorthWrapper.style.display = visible ? '' : 'none';
}
this.doLayout();
};
BorderLayout.prototype.setupOverlays = function () {
// if no overlays, just remove the panel
if (!this.overlays) {
this.eOverlayWrapper.parentNode.removeChild(this.eOverlayWrapper);
return;
}
this.hideOverlay();
//
//this.setOverlayVisible(false);
};
BorderLayout.prototype.hideOverlay = function () {
utils_1.Utils.removeAllChildren(this.eOverlayWrapper);
this.eOverlayWrapper.style.display = 'none';
};
BorderLayout.prototype.showOverlay = function (key) {
var overlay = this.overlays ? this.overlays[key] : null;
if (overlay) {
utils_1.Utils.removeAllChildren(this.eOverlayWrapper);
this.eOverlayWrapper.style.display = '';
this.eOverlayWrapper.appendChild(overlay);
}
else {
console.log('ag-Grid: unknown overlay');
this.hideOverlay();
}
};
BorderLayout.prototype.setSouthVisible = function (visible) {
if (this.eSouthWrapper) {
this.eSouthWrapper.style.display = visible ? '' : 'none';
}
this.doLayout();
};
return BorderLayout;
})();
exports.BorderLayout = BorderLayout;
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var logger_1 = __webpack_require__(5);
var utils_1 = __webpack_require__(7);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
/** Adds drag listening onto an element. In ag-Grid this is used twice, first is resizing columns,
* second is moving the columns and column groups around (ie the 'drag' part of Drag and Drop. */
var DragService = (function () {
function DragService() {
this.onMouseUpListener = this.onMouseUp.bind(this);
this.onMouseMoveListener = this.onMouseMove.bind(this);
this.destroyFunctions = [];
}
DragService.prototype.init = function () {
this.logger = this.loggerFactory.create('DragService');
this.eBody = document.querySelector('body');
};
DragService.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) { return func(); });
};
DragService.prototype.setNoSelectToBody = function (noSelect) {
if (utils_1.Utils.exists(this.eBody)) {
utils_1.Utils.addOrRemoveCssClass(this.eBody, 'ag-body-no-select', noSelect);
}
};
DragService.prototype.addDragSource = function (params) {
var listener = this.onMouseDown.bind(this, params);
params.eElement.addEventListener('mousedown', listener);
this.destroyFunctions.push(function () { return params.eElement.removeEventListener('mousedown', listener); });
};
// gets called whenever mouse down on any drag source
DragService.prototype.onMouseDown = function (params, mouseEvent) {
// only interested in left button clicks
if (mouseEvent.button !== 0) {
return;
}
this.currentDragParams = params;
this.dragging = false;
this.eventLastTime = mouseEvent;
this.dragStartEvent = mouseEvent;
// we temporally add these listeners, for the duration of the drag, they
// are removed in mouseup handling.
document.addEventListener('mousemove', this.onMouseMoveListener);
document.addEventListener('mouseup', this.onMouseUpListener);
// see if we want to start dragging straight away
if (params.dragStartPixels === 0) {
this.onMouseMove(mouseEvent);
}
};
// returns true if the event is close to the original event by X pixels either vertically or horizontally.
// we only start dragging after X pixels so this allows us to know if we should start dragging yet.
DragService.prototype.isEventNearStartEvent = function (event) {
// by default, we wait 4 pixels before starting the drag
var requiredPixelDiff = utils_1.Utils.exists(this.currentDragParams.dragStartPixels) ? this.currentDragParams.dragStartPixels : 4;
if (requiredPixelDiff === 0) {
return false;
}
var diffX = Math.abs(event.clientX - this.dragStartEvent.clientX);
var diffY = Math.abs(event.clientY - this.dragStartEvent.clientY);
return Math.max(diffX, diffY) <= requiredPixelDiff;
};
// only gets called after a mouse down - as this is only added after mouseDown
// and is removed when mouseUp happens
DragService.prototype.onMouseMove = function (mouseEvent) {
if (!this.dragging) {
// if mouse hasn't travelled from the start position enough, do nothing
var toEarlyToDrag = !this.dragging && this.isEventNearStartEvent(mouseEvent);
if (toEarlyToDrag) {
return;
}
else {
this.dragging = true;
this.eventService.dispatchEvent(events_1.Events.EVENT_DRAG_STARTED);
this.currentDragParams.onDragStart(this.dragStartEvent);
this.setNoSelectToBody(true);
}
}
this.currentDragParams.onDragging(mouseEvent);
};
DragService.prototype.onMouseUp = function (mouseEvent) {
document.removeEventListener('mouseup', this.onMouseUpListener);
document.removeEventListener('mousemove', this.onMouseMoveListener);
if (this.dragging) {
this.currentDragParams.onDragStop(mouseEvent);
}
this.dragStartEvent = null;
this.eventLastTime = null;
this.dragging = false;
this.setNoSelectToBody(false);
this.eventService.dispatchEvent(events_1.Events.EVENT_DRAG_STOPPED);
};
__decorate([
context_1.Autowired('loggerFactory'),
__metadata('design:type', logger_1.LoggerFactory)
], DragService.prototype, "loggerFactory", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], DragService.prototype, "eventService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], DragService.prototype, "init", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], DragService.prototype, "destroy", null);
DragService = __decorate([
context_1.Bean('dragService'),
__metadata('design:paramtypes', [])
], DragService);
return DragService;
})();
exports.DragService = DragService;
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var gridPanel_1 = __webpack_require__(24);
var columnController_1 = __webpack_require__(13);
var column_1 = __webpack_require__(15);
var constants_1 = __webpack_require__(8);
var floatingRowModel_1 = __webpack_require__(26);
var utils_1 = __webpack_require__(7);
var gridCell_1 = __webpack_require__(33);
var gridOptionsWrapper_1 = __webpack_require__(3);
var MouseEventService = (function () {
function MouseEventService() {
}
MouseEventService.prototype.getCellForMouseEvent = function (mouseEvent) {
var floating = this.getFloating(mouseEvent);
var rowIndex = this.getRowIndex(mouseEvent, floating);
var column = this.getColumn(mouseEvent);
if (rowIndex >= 0 && utils_1.Utils.exists(column)) {
return new gridCell_1.GridCell(rowIndex, floating, column);
}
else {
return null;
}
};
MouseEventService.prototype.getFloating = function (mouseEvent) {
var floatingTopRect = this.gridPanel.getFloatingTopClientRect();
var floatingBottomRect = this.gridPanel.getFloatingBottomClientRect();
var floatingTopRowsExist = !this.floatingRowModel.isEmpty(constants_1.Constants.FLOATING_TOP);
var floatingBottomRowsExist = !this.floatingRowModel.isEmpty(constants_1.Constants.FLOATING_BOTTOM);
if (floatingTopRowsExist && floatingTopRect.bottom >= mouseEvent.clientY) {
return constants_1.Constants.FLOATING_TOP;
}
else if (floatingBottomRowsExist && floatingBottomRect.top <= mouseEvent.clientY) {
return constants_1.Constants.FLOATING_BOTTOM;
}
else {
return null;
}
};
MouseEventService.prototype.getFloatingRowIndex = function (mouseEvent, floating) {
var clientRect;
switch (floating) {
case constants_1.Constants.FLOATING_TOP:
clientRect = this.gridPanel.getFloatingTopClientRect();
break;
case constants_1.Constants.FLOATING_BOTTOM:
clientRect = this.gridPanel.getFloatingBottomClientRect();
break;
}
var bodyY = mouseEvent.clientY - clientRect.top;
var rowIndex = this.floatingRowModel.getRowAtPixel(bodyY, floating);
return rowIndex;
};
MouseEventService.prototype.getRowIndex = function (mouseEvent, floating) {
switch (floating) {
case constants_1.Constants.FLOATING_TOP:
case constants_1.Constants.FLOATING_BOTTOM:
return this.getFloatingRowIndex(mouseEvent, floating);
default: return this.getBodyRowIndex(mouseEvent);
}
};
MouseEventService.prototype.getBodyRowIndex = function (mouseEvent) {
var clientRect = this.gridPanel.getBodyViewportClientRect();
var scrollY = this.gridPanel.getVerticalScrollPosition();
var bodyY = mouseEvent.clientY - clientRect.top + scrollY;
var rowIndex = this.rowModel.getRowIndexAtPixel(bodyY);
return rowIndex;
};
MouseEventService.prototype.getContainer = function (mouseEvent) {
var centerRect = this.gridPanel.getBodyViewportClientRect();
var mouseX = mouseEvent.clientX;
if (mouseX < centerRect.left && this.columnController.isPinningLeft()) {
return column_1.Column.PINNED_LEFT;
}
else if (mouseX > centerRect.right && this.columnController.isPinningRight()) {
return column_1.Column.PINNED_RIGHT;
}
else {
return null;
}
};
MouseEventService.prototype.getColumn = function (mouseEvent) {
if (this.columnController.isEmpty()) {
return null;
}
var container = this.getContainer(mouseEvent);
var columns = this.getColumnsForContainer(container);
var containerX = this.getXForContainer(container, mouseEvent);
var hoveringColumn;
if (containerX < 0) {
hoveringColumn = columns[0];
}
columns.forEach(function (column) {
var afterLeft = containerX >= column.getLeft();
var beforeRight = containerX <= column.getRight();
if (afterLeft && beforeRight) {
hoveringColumn = column;
}
});
if (!hoveringColumn) {
hoveringColumn = columns[columns.length - 1];
}
return hoveringColumn;
};
MouseEventService.prototype.getColumnsForContainer = function (container) {
switch (container) {
case column_1.Column.PINNED_LEFT: return this.columnController.getDisplayedLeftColumns();
case column_1.Column.PINNED_RIGHT: return this.columnController.getDisplayedRightColumns();
default: return this.columnController.getDisplayedCenterColumns();
}
};
MouseEventService.prototype.getXForContainer = function (container, mouseEvent) {
var containerX;
switch (container) {
case column_1.Column.PINNED_LEFT:
containerX = this.gridPanel.getPinnedLeftColsViewportClientRect().left;
break;
case column_1.Column.PINNED_RIGHT:
containerX = this.gridPanel.getPinnedRightColsViewportClientRect().left;
break;
default:
var centerRect = this.gridPanel.getBodyViewportClientRect();
var centerScroll = this.gridPanel.getHorizontalScrollPosition();
containerX = centerRect.left - centerScroll;
}
var result = mouseEvent.clientX - containerX;
return result;
};
__decorate([
context_2.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], MouseEventService.prototype, "gridPanel", void 0);
__decorate([
context_2.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], MouseEventService.prototype, "columnController", void 0);
__decorate([
context_2.Autowired('rowModel'),
__metadata('design:type', Object)
], MouseEventService.prototype, "rowModel", void 0);
__decorate([
context_2.Autowired('floatingRowModel'),
__metadata('design:type', floatingRowModel_1.FloatingRowModel)
], MouseEventService.prototype, "floatingRowModel", void 0);
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], MouseEventService.prototype, "gridOptionsWrapper", void 0);
MouseEventService = __decorate([
context_1.Bean('mouseEventService'),
__metadata('design:paramtypes', [])
], MouseEventService);
return MouseEventService;
})();
exports.MouseEventService = MouseEventService;
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var gridRow_1 = __webpack_require__(34);
var GridCell = (function () {
function GridCell(rowIndex, floating, column) {
this.rowIndex = rowIndex;
this.column = column;
this.floating = utils_1.Utils.makeNull(floating);
}
GridCell.prototype.getGridRow = function () {
return new gridRow_1.GridRow(this.rowIndex, this.floating);
};
GridCell.prototype.toString = function () {
return "rowIndex = " + this.rowIndex + ", floating = " + this.floating + ", column = " + (this.column ? this.column.getId() : null);
};
GridCell.prototype.createId = function () {
return this.rowIndex + "." + this.floating + "." + this.column.getId();
};
return GridCell;
})();
exports.GridCell = GridCell;
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var constants_1 = __webpack_require__(8);
var utils_1 = __webpack_require__(7);
var gridCell_1 = __webpack_require__(33);
var GridRow = (function () {
function GridRow(rowIndex, floating) {
this.rowIndex = rowIndex;
this.floating = utils_1.Utils.makeNull(floating);
}
GridRow.prototype.isFloatingTop = function () {
return this.floating === constants_1.Constants.FLOATING_TOP;
};
GridRow.prototype.isFloatingBottom = function () {
return this.floating === constants_1.Constants.FLOATING_BOTTOM;
};
GridRow.prototype.isNotFloating = function () {
return !this.isFloatingBottom() && !this.isFloatingTop();
};
GridRow.prototype.equals = function (otherSelection) {
return this.rowIndex === otherSelection.rowIndex
&& this.floating === otherSelection.floating;
};
GridRow.prototype.toString = function () {
return "rowIndex = " + this.rowIndex + ", floating = " + this.floating;
};
GridRow.prototype.getGridCell = function (column) {
return new gridCell_1.GridCell(this.rowIndex, this.floating, column);
};
// tests if this row selection is before the other row selection
GridRow.prototype.before = function (otherSelection) {
var otherFloating = otherSelection.floating;
switch (this.floating) {
case constants_1.Constants.FLOATING_TOP:
// we we are floating top, and other isn't, then we are always before
if (otherFloating !== constants_1.Constants.FLOATING_TOP) {
return true;
}
break;
case constants_1.Constants.FLOATING_BOTTOM:
// if we are floating bottom, and the other isn't, then we are never before
if (otherFloating !== constants_1.Constants.FLOATING_BOTTOM) {
return false;
}
break;
default:
// if we are not floating, but the other one is floating...
if (utils_1.Utils.exists(otherFloating)) {
if (otherFloating === constants_1.Constants.FLOATING_TOP) {
// we are not floating, other is floating top, we are first
return false;
}
else {
// we are not floating, other is floating bottom, we are always first
return true;
}
}
break;
}
return this.rowIndex <= otherSelection.rowIndex;
};
return GridRow;
})();
exports.GridRow = GridRow;
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var utils_1 = __webpack_require__(7);
var gridCell_1 = __webpack_require__(33);
var constants_1 = __webpack_require__(8);
var FocusedCellController = (function () {
function FocusedCellController() {
}
FocusedCellController.prototype.init = function () {
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.clearFocusedCell.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.clearFocusedCell.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_GROUP_OPENED, this.clearFocusedCell.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_MOVED, this.clearFocusedCell.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PINNED, this.clearFocusedCell.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.clearFocusedCell.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VISIBLE, this.clearFocusedCell.bind(this));
};
FocusedCellController.prototype.clearFocusedCell = function () {
this.focusedCell = null;
this.onCellFocused(false);
};
FocusedCellController.prototype.getFocusedCell = function () {
return this.focusedCell;
};
// we check if the browser is focusing something, and if it is, and
// it's the cell we think is focused, then return the cell. so this
// methods returns the cell if a) we think it has focus and b) the
// browser thinks it has focus. this then returns nothign if we
// first focus a cell, then second click outside the grid, as then the
// grid cell will still be focused as far as the grid is conerned,
// however the browser focus will have moved somewhere else.
FocusedCellController.prototype.getFocusCellIfBrowserFocused = function () {
if (!this.focusedCell) {
return null;
}
var browserFocusedCell = this.getGridCellForDomElement(document.activeElement);
if (!browserFocusedCell) {
return null;
}
var gridFocusId = this.focusedCell.createId();
var browserFocusId = browserFocusedCell.createId();
if (gridFocusId === browserFocusId) {
return this.focusedCell;
}
else {
return null;
}
};
FocusedCellController.prototype.getGridCellForDomElement = function (eBrowserCell) {
if (!eBrowserCell) {
return null;
}
var column = null;
var row = null;
var floating = null;
var that = this;
while (eBrowserCell) {
checkRow(eBrowserCell);
checkColumn(eBrowserCell);
eBrowserCell = eBrowserCell.parentNode;
}
if (utils_1.Utils.exists(column) && utils_1.Utils.exists(row)) {
var gridCell = new gridCell_1.GridCell(row, floating, column);
return gridCell;
}
else {
return null;
}
function checkRow(eTarget) {
// match the column by checking a) it has a valid colId and b) it has the 'ag-cell' class
var rowId = utils_1.Utils.getElementAttribute(eTarget, 'row');
if (utils_1.Utils.exists(rowId) && utils_1.Utils.containsClass(eTarget, 'ag-row')) {
if (rowId.indexOf('ft') === 0) {
floating = constants_1.Constants.FLOATING_TOP;
rowId = rowId.substr(3);
}
else if (rowId.indexOf('fb') === 0) {
floating = constants_1.Constants.FLOATING_BOTTOM;
rowId = rowId.substr(3);
}
else {
floating = null;
}
row = parseInt(rowId);
}
}
function checkColumn(eTarget) {
// match the column by checking a) it has a valid colId and b) it has the 'ag-cell' class
var colId = utils_1.Utils.getElementAttribute(eTarget, 'colid');
if (utils_1.Utils.exists(colId) && utils_1.Utils.containsClass(eTarget, 'ag-cell')) {
var foundColumn = that.columnController.getGridColumn(colId);
if (foundColumn) {
column = foundColumn;
}
}
}
};
FocusedCellController.prototype.setFocusedCell = function (rowIndex, colKey, floating, forceBrowserFocus) {
if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
if (this.gridOptionsWrapper.isSuppressCellSelection()) {
return;
}
var column = utils_1.Utils.makeNull(this.columnController.getGridColumn(colKey));
this.focusedCell = new gridCell_1.GridCell(rowIndex, utils_1.Utils.makeNull(floating), column);
this.onCellFocused(forceBrowserFocus);
};
FocusedCellController.prototype.isCellFocused = function (gridCell) {
if (utils_1.Utils.missing(this.focusedCell)) {
return false;
}
return this.focusedCell.column === gridCell.column && this.isRowFocused(gridCell.rowIndex, gridCell.floating);
};
FocusedCellController.prototype.isRowFocused = function (rowIndex, floating) {
if (utils_1.Utils.missing(this.focusedCell)) {
return false;
}
var floatingOrNull = utils_1.Utils.makeNull(floating);
return this.focusedCell.rowIndex === rowIndex && this.focusedCell.floating === floatingOrNull;
};
FocusedCellController.prototype.onCellFocused = function (forceBrowserFocus) {
var event = {
rowIndex: null,
column: null,
floating: null,
forceBrowserFocus: forceBrowserFocus
};
if (this.focusedCell) {
event.rowIndex = this.focusedCell.rowIndex;
event.column = this.focusedCell.column;
event.floating = this.focusedCell.floating;
}
this.eventService.dispatchEvent(events_1.Events.EVENT_CELL_FOCUSED, event);
};
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], FocusedCellController.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], FocusedCellController.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], FocusedCellController.prototype, "columnController", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], FocusedCellController.prototype, "init", null);
FocusedCellController = __decorate([
context_1.Bean('focusedCellController'),
__metadata('design:paramtypes', [])
], FocusedCellController);
return FocusedCellController;
})();
exports.FocusedCellController = FocusedCellController;
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var TemplateService = (function () {
function TemplateService() {
this.templateCache = {};
this.waitingCallbacks = {};
}
// returns the template if it is loaded, or null if it is not loaded
// but will call the callback when it is loaded
TemplateService.prototype.getTemplate = function (url, callback) {
var templateFromCache = this.templateCache[url];
if (templateFromCache) {
return templateFromCache;
}
var callbackList = this.waitingCallbacks[url];
var that = this;
if (!callbackList) {
// first time this was called, so need a new list for callbacks
callbackList = [];
this.waitingCallbacks[url] = callbackList;
// and also need to do the http request
var client = new XMLHttpRequest();
client.onload = function () {
that.handleHttpResult(this, url);
};
client.open("GET", url);
client.send();
}
// add this callback
if (callback) {
callbackList.push(callback);
}
// caller needs to wait for template to load, so return null
return null;
};
TemplateService.prototype.handleHttpResult = function (httpResult, url) {
if (httpResult.status !== 200 || httpResult.response === null) {
console.warn('Unable to get template error ' + httpResult.status + ' - ' + url);
return;
}
// response success, so process it
// in IE9 the response is in - responseText
this.templateCache[url] = httpResult.response || httpResult.responseText;
// inform all listeners that this is now in the cache
var callbacks = this.waitingCallbacks[url];
for (var i = 0; i < callbacks.length; i++) {
var callback = callbacks[i];
// we could pass the callback the response, however we know the client of this code
// is the cell renderer, and it passes the 'cellRefresh' method in as the callback
// which doesn't take any parameters.
callback();
}
if (this.$scope) {
var that = this;
setTimeout(function () {
that.$scope.$apply();
}, 0);
}
};
__decorate([
context_2.Autowired('$scope'),
__metadata('design:type', Object)
], TemplateService.prototype, "$scope", void 0);
TemplateService = __decorate([
context_1.Bean('templateService'),
__metadata('design:paramtypes', [])
], TemplateService);
return TemplateService;
})();
exports.TemplateService = TemplateService;
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var renderedCell_1 = __webpack_require__(38);
var rowNode_1 = __webpack_require__(27);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var column_1 = __webpack_require__(15);
var events_1 = __webpack_require__(10);
var eventService_1 = __webpack_require__(4);
var context_1 = __webpack_require__(6);
var focusedCellController_1 = __webpack_require__(35);
var constants_1 = __webpack_require__(8);
var cellRendererService_1 = __webpack_require__(60);
var cellRendererFactory_1 = __webpack_require__(55);
var RenderedRow = (function () {
function RenderedRow(parentScope, rowRenderer, eBodyContainer, ePinnedLeftContainer, ePinnedRightContainer, node, rowIndex) {
this.renderedCells = {};
this.destroyFunctions = [];
this.initialised = false;
this.parentScope = parentScope;
this.rowRenderer = rowRenderer;
this.eBodyContainer = eBodyContainer;
this.ePinnedLeftContainer = ePinnedLeftContainer;
this.ePinnedRightContainer = ePinnedRightContainer;
this.rowIndex = rowIndex;
this.rowNode = node;
}
RenderedRow.prototype.init = function () {
this.createContainers();
var groupHeaderTakesEntireRow = this.gridOptionsWrapper.isGroupUseEntireRow();
this.rowIsHeaderThatSpans = this.rowNode.group && groupHeaderTakesEntireRow;
this.scope = this.createChildScopeOrNull(this.rowNode.data);
if (this.rowIsHeaderThatSpans) {
this.refreshGroupRow();
}
else {
this.refreshCellsIntoRow();
}
this.addDynamicStyles();
this.addDynamicClasses();
this.addRowIds();
this.setTopAndHeightCss();
this.addRowSelectedListener();
this.addCellFocusedListener();
this.addNodeDataChangedListener();
this.addColumnListener();
this.addHoverFunctionality();
this.attachContainers();
this.gridOptionsWrapper.executeProcessRowPostCreateFunc({
eRow: this.eBodyRow,
ePinnedLeftRow: this.ePinnedLeftRow,
ePinnedRightRow: this.ePinnedRightRow,
node: this.rowNode,
api: this.gridOptionsWrapper.getApi(),
rowIndex: this.rowIndex,
addRenderedRowListener: this.addEventListener.bind(this),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext()
});
this.angular1Compile();
this.initialised = true;
};
RenderedRow.prototype.angular1Compile = function () {
var _this = this;
if (this.scope) {
console.log('angular1Compile');
this.eLeftCenterAndRightRows.forEach(function (row) { return _this.$compile(row)(_this.scope); });
}
};
RenderedRow.prototype.addColumnListener = function () {
var _this = this;
var columnListener = this.onDisplayedColumnsChanged.bind(this);
var virtualListener = this.onVirtualColumnsChanged.bind(this);
this.mainEventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, columnListener);
this.mainEventService.addEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, virtualListener);
this.mainEventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, columnListener);
this.destroyFunctions.push(function () {
_this.mainEventService.removeEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, columnListener);
_this.mainEventService.removeEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, virtualListener);
_this.mainEventService.removeEventListener(events_1.Events.EVENT_COLUMN_RESIZED, columnListener);
});
};
RenderedRow.prototype.onDisplayedColumnsChanged = function (event) {
// if row is a group row that spans, then it's not impacted by column changes, with exception of pinning
if (this.rowIsHeaderThatSpans) {
var columnPinned = event.getType() === events_1.Events.EVENT_COLUMN_PINNED;
if (columnPinned) {
this.refreshGroupRow();
}
}
else {
this.refreshCellsIntoRow();
this.angular1Compile();
}
};
RenderedRow.prototype.onVirtualColumnsChanged = function (event) {
// if row is a group row that spans, then it's not impacted by column changes, with exception of pinning
if (!this.rowIsHeaderThatSpans) {
this.refreshCellsIntoRow();
this.angular1Compile();
}
};
// method makes sure the right cells are present, and are in the right container. so when this gets called for
// the first time, it sets up all the cells. but then over time the cells might appear / dissappear or move
// container (ie into pinned)
RenderedRow.prototype.refreshCellsIntoRow = function () {
var _this = this;
var columns = this.columnController.getAllDisplayedVirtualColumns();
var renderedCellKeys = Object.keys(this.renderedCells);
columns.forEach(function (column) {
var renderedCell = _this.getOrCreateCell(column);
_this.ensureCellInCorrectRow(renderedCell);
utils_1.Utils.removeFromArray(renderedCellKeys, column.getColId());
});
// remove old cells from gui, but we don't destroy them, we might use them again
renderedCellKeys.forEach(function (key) {
var renderedCell = _this.renderedCells[key];
// could be old reference, ie removed cell
if (!renderedCell) {
return;
}
if (renderedCell.getParentRow()) {
renderedCell.getParentRow().removeChild(renderedCell.getGui());
renderedCell.setParentRow(null);
}
renderedCell.destroy();
_this.renderedCells[key] = null;
});
};
RenderedRow.prototype.ensureCellInCorrectRow = function (renderedCell) {
var eRowGui = renderedCell.getGui();
var column = renderedCell.getColumn();
var rowWeWant;
switch (column.getPinned()) {
case column_1.Column.PINNED_LEFT:
rowWeWant = this.ePinnedLeftRow;
break;
case column_1.Column.PINNED_RIGHT:
rowWeWant = this.ePinnedRightRow;
break;
default:
rowWeWant = this.eBodyRow;
break;
}
// if in wrong container, remove it
var oldRow = renderedCell.getParentRow();
var inWrongRow = oldRow !== rowWeWant;
if (inWrongRow) {
// take out from old row
if (oldRow) {
oldRow.removeChild(eRowGui);
}
rowWeWant.appendChild(eRowGui);
renderedCell.setParentRow(rowWeWant);
}
};
RenderedRow.prototype.getOrCreateCell = function (column) {
var colId = column.getColId();
if (this.renderedCells[colId]) {
return this.renderedCells[colId];
}
else {
var renderedCell = new renderedCell_1.RenderedCell(column, this.rowNode, this.rowIndex, this.scope, this);
this.context.wireBean(renderedCell);
this.renderedCells[colId] = renderedCell;
return renderedCell;
}
};
RenderedRow.prototype.addRowSelectedListener = function () {
var _this = this;
var rowSelectedListener = function () {
var selected = _this.rowNode.isSelected();
_this.eLeftCenterAndRightRows.forEach(function (row) { return utils_1.Utils.addOrRemoveCssClass(row, 'ag-row-selected', selected); });
};
this.rowNode.addEventListener(rowNode_1.RowNode.EVENT_ROW_SELECTED, rowSelectedListener);
this.destroyFunctions.push(function () {
_this.rowNode.removeEventListener(rowNode_1.RowNode.EVENT_ROW_SELECTED, rowSelectedListener);
});
};
RenderedRow.prototype.addHoverFunctionality = function () {
var _this = this;
var onGuiMouseEnter = this.rowNode.onMouseEnter.bind(this.rowNode);
var onGuiMouseLeave = this.rowNode.onMouseLeave.bind(this.rowNode);
this.eLeftCenterAndRightRows.forEach(function (eRow) {
eRow.addEventListener('mouseenter', onGuiMouseEnter);
eRow.addEventListener('mouseleave', onGuiMouseLeave);
});
var onNodeMouseEnter = this.addHoverClass.bind(this, true);
var onNodeMouseLeave = this.addHoverClass.bind(this, false);
this.rowNode.addEventListener(rowNode_1.RowNode.EVENT_MOUSE_ENTER, onNodeMouseEnter);
this.rowNode.addEventListener(rowNode_1.RowNode.EVENT_MOUSE_LEAVE, onNodeMouseLeave);
this.destroyFunctions.push(function () {
_this.eLeftCenterAndRightRows.forEach(function (eRow) {
eRow.removeEventListener('mouseenter', onGuiMouseEnter);
eRow.removeEventListener('mouseleave', onGuiMouseLeave);
});
_this.rowNode.removeEventListener(rowNode_1.RowNode.EVENT_MOUSE_ENTER, onNodeMouseEnter);
_this.rowNode.removeEventListener(rowNode_1.RowNode.EVENT_MOUSE_LEAVE, onNodeMouseLeave);
});
};
RenderedRow.prototype.addHoverClass = function (hover) {
this.eLeftCenterAndRightRows.forEach(function (eRow) { return utils_1.Utils.addOrRemoveCssClass(eRow, 'ag-row-hover', hover); });
};
RenderedRow.prototype.addCellFocusedListener = function () {
var _this = this;
var rowFocusedLastTime = null;
var rowFocusedListener = function () {
var rowFocused = _this.focusedCellController.isRowFocused(_this.rowIndex, _this.rowNode.floating);
if (rowFocused !== rowFocusedLastTime) {
_this.eLeftCenterAndRightRows.forEach(function (row) { return utils_1.Utils.addOrRemoveCssClass(row, 'ag-row-focus', rowFocused); });
_this.eLeftCenterAndRightRows.forEach(function (row) { return utils_1.Utils.addOrRemoveCssClass(row, 'ag-row-no-focus', !rowFocused); });
rowFocusedLastTime = rowFocused;
}
};
this.mainEventService.addEventListener(events_1.Events.EVENT_CELL_FOCUSED, rowFocusedListener);
this.destroyFunctions.push(function () {
_this.mainEventService.removeEventListener(events_1.Events.EVENT_CELL_FOCUSED, rowFocusedListener);
});
rowFocusedListener();
};
RenderedRow.prototype.forEachRenderedCell = function (callback) {
utils_1.Utils.iterateObject(this.renderedCells, function (key, renderedCell) {
if (renderedCell) {
callback(renderedCell);
}
});
};
RenderedRow.prototype.addNodeDataChangedListener = function () {
var _this = this;
var nodeDataChangedListener = function () {
var animate = false;
var newData = true;
_this.forEachRenderedCell(function (renderedCell) { return renderedCell.refreshCell(animate, newData); });
};
this.rowNode.addEventListener(rowNode_1.RowNode.EVENT_DATA_CHANGED, nodeDataChangedListener);
this.destroyFunctions.push(function () {
_this.rowNode.removeEventListener(rowNode_1.RowNode.EVENT_DATA_CHANGED, nodeDataChangedListener);
});
};
RenderedRow.prototype.createContainers = function () {
this.eBodyRow = this.createRowContainer();
this.eLeftCenterAndRightRows = [this.eBodyRow];
if (!this.gridOptionsWrapper.isForPrint()) {
this.ePinnedLeftRow = this.createRowContainer();
this.ePinnedRightRow = this.createRowContainer();
this.eLeftCenterAndRightRows.push(this.ePinnedLeftRow);
this.eLeftCenterAndRightRows.push(this.ePinnedRightRow);
}
};
RenderedRow.prototype.attachContainers = function () {
this.eBodyContainer.appendChild(this.eBodyRow);
if (!this.gridOptionsWrapper.isForPrint()) {
this.ePinnedLeftContainer.appendChild(this.ePinnedLeftRow);
this.ePinnedRightContainer.appendChild(this.ePinnedRightRow);
}
};
RenderedRow.prototype.onMouseEvent = function (eventName, mouseEvent, eventSource, cell) {
var renderedCell = this.renderedCells[cell.column.getId()];
if (renderedCell) {
renderedCell.onMouseEvent(eventName, mouseEvent, eventSource);
}
};
RenderedRow.prototype.setTopAndHeightCss = function () {
// if showing scrolls, position on the container
if (!this.gridOptionsWrapper.isForPrint()) {
var topPx = this.rowNode.rowTop + "px";
this.eLeftCenterAndRightRows.forEach(function (row) { return row.style.top = topPx; });
}
var heightPx = this.rowNode.rowHeight + 'px';
this.eLeftCenterAndRightRows.forEach(function (row) { return row.style.height = heightPx; });
};
// adds in row and row-id attributes to the row
RenderedRow.prototype.addRowIds = function () {
var rowStr = this.rowIndex.toString();
if (this.rowNode.floating === constants_1.Constants.FLOATING_BOTTOM) {
rowStr = 'fb-' + rowStr;
}
else if (this.rowNode.floating === constants_1.Constants.FLOATING_TOP) {
rowStr = 'ft-' + rowStr;
}
this.eLeftCenterAndRightRows.forEach(function (row) { return row.setAttribute('row', rowStr); });
if (typeof this.gridOptionsWrapper.getBusinessKeyForNodeFunc() === 'function') {
var businessKey = this.gridOptionsWrapper.getBusinessKeyForNodeFunc()(this.rowNode);
if (typeof businessKey === 'string' || typeof businessKey === 'number') {
this.eLeftCenterAndRightRows.forEach(function (row) { return row.setAttribute('row-id', businessKey); });
}
}
};
RenderedRow.prototype.addEventListener = function (eventType, listener) {
if (!this.renderedRowEventService) {
this.renderedRowEventService = new eventService_1.EventService();
}
this.renderedRowEventService.addEventListener(eventType, listener);
};
RenderedRow.prototype.removeEventListener = function (eventType, listener) {
this.renderedRowEventService.removeEventListener(eventType, listener);
};
RenderedRow.prototype.getRenderedCellForColumn = function (column) {
return this.renderedCells[column.getColId()];
};
RenderedRow.prototype.getCellForCol = function (column) {
var renderedCell = this.renderedCells[column.getColId()];
if (renderedCell) {
return renderedCell.getGui();
}
else {
return null;
}
};
RenderedRow.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) { return func(); });
this.destroyScope();
this.eBodyContainer.removeChild(this.eBodyRow);
if (!this.gridOptionsWrapper.isForPrint()) {
this.ePinnedLeftContainer.removeChild(this.ePinnedLeftRow);
this.ePinnedRightContainer.removeChild(this.ePinnedRightRow);
}
this.forEachRenderedCell(function (renderedCell) { return renderedCell.destroy(); });
if (this.renderedRowEventService) {
this.renderedRowEventService.dispatchEvent(RenderedRow.EVENT_RENDERED_ROW_REMOVED, { node: this.rowNode });
}
};
RenderedRow.prototype.destroyScope = function () {
if (this.scope) {
this.scope.$destroy();
this.scope = null;
}
};
RenderedRow.prototype.isDataInList = function (rows) {
return rows.indexOf(this.rowNode.data) >= 0;
};
RenderedRow.prototype.isGroup = function () {
return this.rowNode.group === true;
};
RenderedRow.prototype.refreshGroupRow = function () {
// where the components go changes with pinning, it's easiest ot just remove from all containers
// and start again if the pinning changes
utils_1.Utils.removeAllChildren(this.ePinnedLeftRow);
utils_1.Utils.removeAllChildren(this.ePinnedRightRow);
utils_1.Utils.removeAllChildren(this.eBodyRow);
// create main component if not already existing from previous refresh
if (!this.eGroupRow) {
this.eGroupRow = this.createGroupSpanningEntireRowCell(false);
}
var pinningLeft = this.columnController.isPinningLeft();
var pinningRight = this.columnController.isPinningRight();
// if pinning left, then main component goes into left and we pad centre, otherwise it goes into centre
if (pinningLeft) {
this.ePinnedLeftRow.appendChild(this.eGroupRow);
if (!this.eGroupRowPaddingCentre) {
this.eGroupRowPaddingCentre = this.createGroupSpanningEntireRowCell(true);
}
this.eBodyRow.appendChild(this.eGroupRowPaddingCentre);
}
else {
this.eBodyRow.appendChild(this.eGroupRow);
}
// main component is never in right, but if pinning right, we put padding into the right
if (pinningRight) {
if (!this.eGroupRowPaddingRight) {
this.eGroupRowPaddingRight = this.createGroupSpanningEntireRowCell(true);
}
this.ePinnedRightRow.appendChild(this.eGroupRowPaddingRight);
}
};
RenderedRow.prototype.createGroupSpanningEntireRowCell = function (padding) {
var eRow = document.createElement('span');
// padding means we are on the right hand side of a pinned table, ie
// in the main body.
if (!padding) {
var cellRenderer = this.gridOptionsWrapper.getGroupRowRenderer();
var cellRendererParams = this.gridOptionsWrapper.getGroupRowRendererParams();
if (!cellRenderer) {
cellRenderer = cellRendererFactory_1.CellRendererFactory.GROUP;
cellRendererParams = {
innerRenderer: this.gridOptionsWrapper.getGroupRowInnerRenderer(),
};
}
var params = {
data: this.rowNode.data,
node: this.rowNode,
$scope: this.scope,
rowIndex: this.rowIndex,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext(),
eGridCell: eRow,
eParentOfValue: eRow,
addRenderedRowListener: this.addEventListener.bind(this),
colDef: {
cellRenderer: cellRenderer,
cellRendererParams: cellRendererParams
}
};
if (cellRendererParams) {
utils_1.Utils.assign(params, cellRendererParams);
}
var cellComponent = this.cellRendererService.useCellRenderer(cellRenderer, eRow, params);
if (cellComponent && cellComponent.destroy) {
this.destroyFunctions.push(function () { return cellComponent.destroy(); });
}
}
if (this.rowNode.footer) {
utils_1.Utils.addCssClass(eRow, 'ag-footer-cell-entire-row');
}
else {
utils_1.Utils.addCssClass(eRow, 'ag-group-cell-entire-row');
}
return eRow;
};
RenderedRow.prototype.createChildScopeOrNull = function (data) {
if (this.gridOptionsWrapper.isAngularCompileRows()) {
var newChildScope = this.parentScope.$new();
newChildScope.data = data;
newChildScope.context = this.gridOptionsWrapper.getContext();
return newChildScope;
}
else {
return null;
}
};
RenderedRow.prototype.addDynamicStyles = function () {
var rowStyle = this.gridOptionsWrapper.getRowStyle();
if (rowStyle) {
if (typeof rowStyle === 'function') {
console.log('ag-Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead');
}
else {
this.eLeftCenterAndRightRows.forEach(function (row) { return utils_1.Utils.addStylesToElement(row, rowStyle); });
}
}
var rowStyleFunc = this.gridOptionsWrapper.getRowStyleFunc();
if (rowStyleFunc) {
var params = {
data: this.rowNode.data,
node: this.rowNode,
api: this.gridOptionsWrapper.getApi(),
context: this.gridOptionsWrapper.getContext(),
$scope: this.scope
};
var cssToUseFromFunc = rowStyleFunc(params);
this.eLeftCenterAndRightRows.forEach(function (row) { return utils_1.Utils.addStylesToElement(row, cssToUseFromFunc); });
}
};
RenderedRow.prototype.createParams = function () {
var params = {
node: this.rowNode,
data: this.rowNode.data,
rowIndex: this.rowIndex,
$scope: this.scope,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi()
};
return params;
};
RenderedRow.prototype.createEvent = function (event, eventSource) {
var agEvent = this.createParams();
agEvent.event = event;
agEvent.eventSource = eventSource;
return agEvent;
};
RenderedRow.prototype.createRowContainer = function () {
var _this = this;
var eRow = document.createElement('div');
eRow.addEventListener("click", this.onRowClicked.bind(this));
eRow.addEventListener("dblclick", function (event) {
var agEvent = _this.createEvent(event, _this);
_this.mainEventService.dispatchEvent(events_1.Events.EVENT_ROW_DOUBLE_CLICKED, agEvent);
});
return eRow;
};
RenderedRow.prototype.onRowClicked = function (event) {
var agEvent = this.createEvent(event, this);
this.mainEventService.dispatchEvent(events_1.Events.EVENT_ROW_CLICKED, agEvent);
// ctrlKey for windows, metaKey for Apple
var multiSelectKeyPressed = event.ctrlKey || event.metaKey;
var shiftKeyPressed = event.shiftKey;
// we do not allow selecting groups by clicking (as the click here expands the group)
// so return if it's a group row
if (this.rowNode.group) {
return;
}
// we also don't allow selection of floating rows
if (this.rowNode.floating) {
return;
}
// making local variables to make the below more readable
var gridOptionsWrapper = this.gridOptionsWrapper;
// if no selection method enabled, do nothing
if (!gridOptionsWrapper.isRowSelection()) {
return;
}
// if click selection suppressed, do nothing
if (gridOptionsWrapper.isSuppressRowClickSelection()) {
return;
}
if (this.rowNode.isSelected()) {
if (multiSelectKeyPressed) {
if (gridOptionsWrapper.isRowDeselection()) {
this.rowNode.setSelectedParams({ newValue: false });
}
}
else {
// selected with no multi key, must make sure anything else is unselected
this.rowNode.setSelectedParams({ newValue: true, clearSelection: true });
}
}
else {
this.rowNode.setSelectedParams({ newValue: true, clearSelection: !multiSelectKeyPressed, rangeSelect: shiftKeyPressed });
}
};
RenderedRow.prototype.getRowNode = function () {
return this.rowNode;
};
RenderedRow.prototype.getRowIndex = function () {
return this.rowIndex;
};
RenderedRow.prototype.refreshCells = function (colIds, animate) {
if (!colIds) {
return;
}
var columnsToRefresh = this.columnController.getGridColumns(colIds);
this.forEachRenderedCell(function (renderedCell) {
var colForCel = renderedCell.getColumn();
if (columnsToRefresh.indexOf(colForCel) >= 0) {
renderedCell.refreshCell(animate);
}
});
};
RenderedRow.prototype.addDynamicClasses = function () {
var _this = this;
var classes = [];
classes.push('ag-row');
classes.push('ag-row-no-focus');
classes.push(this.rowIndex % 2 == 0 ? "ag-row-even" : "ag-row-odd");
if (this.rowNode.isSelected()) {
classes.push("ag-row-selected");
}
if (this.rowNode.group) {
classes.push("ag-row-group");
// if a group, put the level of the group in
classes.push("ag-row-level-" + this.rowNode.level);
if (!this.rowNode.footer && this.rowNode.expanded) {
classes.push("ag-row-group-expanded");
}
if (!this.rowNode.footer && !this.rowNode.expanded) {
// opposite of expanded is contracted according to the internet.
classes.push("ag-row-group-contracted");
}
if (this.rowNode.footer) {
classes.push("ag-row-footer");
}
}
else {
// if a leaf, and a parent exists, put a level of the parent, else put level of 0 for top level item
if (this.rowNode.parent) {
classes.push("ag-row-level-" + (this.rowNode.parent.level + 1));
}
else {
classes.push("ag-row-level-0");
}
}
// add in extra classes provided by the config
var gridOptionsRowClass = this.gridOptionsWrapper.getRowClass();
if (gridOptionsRowClass) {
if (typeof gridOptionsRowClass === 'function') {
console.warn('ag-Grid: rowClass should not be a function, please use getRowClass instead');
}
else {
if (typeof gridOptionsRowClass === 'string') {
classes.push(gridOptionsRowClass);
}
else if (Array.isArray(gridOptionsRowClass)) {
gridOptionsRowClass.forEach(function (classItem) {
classes.push(classItem);
});
}
}
}
var gridOptionsRowClassFunc = this.gridOptionsWrapper.getRowClassFunc();
if (gridOptionsRowClassFunc) {
var params = {
node: this.rowNode,
data: this.rowNode.data,
rowIndex: this.rowIndex,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi()
};
var classToUseFromFunc = gridOptionsRowClassFunc(params);
if (classToUseFromFunc) {
if (typeof classToUseFromFunc === 'string') {
classes.push(classToUseFromFunc);
}
else if (Array.isArray(classToUseFromFunc)) {
classToUseFromFunc.forEach(function (classItem) {
classes.push(classItem);
});
}
}
}
classes.forEach(function (classStr) {
_this.eLeftCenterAndRightRows.forEach(function (row) { return utils_1.Utils.addCssClass(row, classStr); });
});
};
RenderedRow.EVENT_RENDERED_ROW_REMOVED = 'renderedRowRemoved';
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], RenderedRow.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], RenderedRow.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('$compile'),
__metadata('design:type', Object)
], RenderedRow.prototype, "$compile", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], RenderedRow.prototype, "mainEventService", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], RenderedRow.prototype, "context", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], RenderedRow.prototype, "focusedCellController", void 0);
__decorate([
context_1.Autowired('cellRendererService'),
__metadata('design:type', cellRendererService_1.CellRendererService)
], RenderedRow.prototype, "cellRendererService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], RenderedRow.prototype, "init", null);
return RenderedRow;
})();
exports.RenderedRow = RenderedRow;
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var column_1 = __webpack_require__(15);
var rowNode_1 = __webpack_require__(27);
var gridOptionsWrapper_1 = __webpack_require__(3);
var expressionService_1 = __webpack_require__(18);
var rowRenderer_1 = __webpack_require__(23);
var templateService_1 = __webpack_require__(36);
var columnController_1 = __webpack_require__(13);
var valueService_1 = __webpack_require__(29);
var eventService_1 = __webpack_require__(4);
var constants_1 = __webpack_require__(8);
var events_1 = __webpack_require__(10);
var context_1 = __webpack_require__(6);
var gridApi_1 = __webpack_require__(11);
var focusedCellController_1 = __webpack_require__(35);
var gridCell_1 = __webpack_require__(33);
var focusService_1 = __webpack_require__(39);
var cellEditorFactory_1 = __webpack_require__(48);
var component_1 = __webpack_require__(47);
var popupService_1 = __webpack_require__(44);
var cellRendererFactory_1 = __webpack_require__(55);
var cellRendererService_1 = __webpack_require__(60);
var valueFormatterService_1 = __webpack_require__(61);
var checkboxSelectionComponent_1 = __webpack_require__(62);
var setLeftFeature_1 = __webpack_require__(63);
var RenderedCell = (function (_super) {
__extends(RenderedCell, _super);
function RenderedCell(column, node, rowIndex, scope, renderedRow) {
_super.call(this, '<div/>');
this.firstRightPinned = false;
this.lastLeftPinned = false;
// because we reference eGridCell everywhere in this class,
// we keep a local reference
this.eGridCell = this.getGui();
this.column = column;
this.node = node;
this.rowIndex = rowIndex;
this.scope = scope;
this.renderedRow = renderedRow;
this.gridCell = new gridCell_1.GridCell(rowIndex, node.floating, column);
}
RenderedCell.prototype.destroy = function () {
_super.prototype.destroy.call(this);
if (this.cellEditor && this.cellEditor.destroy) {
this.cellEditor.destroy();
}
if (this.cellRenderer && this.cellRenderer.destroy) {
this.cellRenderer.destroy();
}
};
RenderedCell.prototype.setPinnedClasses = function () {
var _this = this;
var firstPinnedChangedListener = function () {
if (_this.firstRightPinned !== _this.column.isFirstRightPinned()) {
_this.firstRightPinned = _this.column.isFirstRightPinned();
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-first-right-pinned', _this.firstRightPinned);
}
if (_this.lastLeftPinned !== _this.column.isLastLeftPinned()) {
_this.lastLeftPinned = _this.column.isLastLeftPinned();
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-last-left-pinned', _this.lastLeftPinned);
}
};
this.column.addEventListener(column_1.Column.EVENT_FIRST_RIGHT_PINNED_CHANGED, firstPinnedChangedListener);
this.column.addEventListener(column_1.Column.EVENT_LAST_LEFT_PINNED_CHANGED, firstPinnedChangedListener);
this.addDestroyFunc(function () {
_this.column.removeEventListener(column_1.Column.EVENT_FIRST_RIGHT_PINNED_CHANGED, firstPinnedChangedListener);
_this.column.removeEventListener(column_1.Column.EVENT_LAST_LEFT_PINNED_CHANGED, firstPinnedChangedListener);
});
firstPinnedChangedListener();
};
RenderedCell.prototype.getParentRow = function () {
return this.eParentRow;
};
RenderedCell.prototype.setParentRow = function (eParentRow) {
this.eParentRow = eParentRow;
};
RenderedCell.prototype.calculateCheckboxSelection = function () {
// never allow selection on floating rows
if (this.node.floating) {
return false;
}
// if boolean set, then just use it
var colDef = this.column.getColDef();
if (typeof colDef.checkboxSelection === 'boolean') {
return colDef.checkboxSelection;
}
// if function, then call the function to find out. we first check colDef for
// a function, and if missing then check gridOptions, so colDef has precedence
var selectionFunc;
if (typeof colDef.checkboxSelection === 'function') {
selectionFunc = colDef.checkboxSelection;
}
if (!selectionFunc && this.gridOptionsWrapper.getCheckboxSelection()) {
selectionFunc = this.gridOptionsWrapper.getCheckboxSelection();
}
if (selectionFunc) {
var params = this.createParams();
return selectionFunc(params);
}
return false;
};
RenderedCell.prototype.getColumn = function () {
return this.column;
};
RenderedCell.prototype.getValue = function () {
var data = this.getDataForRow();
return this.valueService.getValueUsingSpecificData(this.column, data, this.node);
};
RenderedCell.prototype.getDataForRow = function () {
if (this.node.footer) {
// if footer, we always show the data
return this.node.data;
}
else if (this.node.group) {
// if header and header is expanded, we show data in footer only
var footersEnabled = this.gridOptionsWrapper.isGroupIncludeFooter();
var suppressHideHeader = this.gridOptionsWrapper.isGroupSuppressBlankHeader();
if (this.node.expanded && footersEnabled && !suppressHideHeader) {
return undefined;
}
else {
return this.node.data;
}
}
else {
// otherwise it's a normal node, just return data as normal
return this.node.data;
}
};
RenderedCell.prototype.addRangeSelectedListener = function () {
var _this = this;
if (!this.rangeController) {
return;
}
var rangeCountLastTime = 0;
var rangeSelectedListener = function () {
var rangeCount = _this.rangeController.getCellRangeCount(_this.gridCell);
if (rangeCountLastTime !== rangeCount) {
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-range-selected', rangeCount !== 0);
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-range-selected-1', rangeCount === 1);
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-range-selected-2', rangeCount === 2);
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-range-selected-3', rangeCount === 3);
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-range-selected-4', rangeCount >= 4);
rangeCountLastTime = rangeCount;
}
};
this.eventService.addEventListener(events_1.Events.EVENT_RANGE_SELECTION_CHANGED, rangeSelectedListener);
this.addDestroyFunc(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_RANGE_SELECTION_CHANGED, rangeSelectedListener);
});
rangeSelectedListener();
};
RenderedCell.prototype.addHighlightListener = function () {
var _this = this;
if (!this.rangeController) {
return;
}
var clipboardListener = function (event) {
var cellId = _this.gridCell.createId();
var shouldFlash = event.cells[cellId];
if (shouldFlash) {
_this.animateCellWithHighlight();
}
};
this.eventService.addEventListener(events_1.Events.EVENT_FLASH_CELLS, clipboardListener);
this.addDestroyFunc(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_FLASH_CELLS, clipboardListener);
});
};
RenderedCell.prototype.addChangeListener = function () {
var _this = this;
var cellChangeListener = function (event) {
if (event.column === _this.column) {
_this.refreshCell();
_this.animateCellWithDataChanged();
}
};
this.addDestroyableEventListener(this.node, rowNode_1.RowNode.EVENT_CELL_CHANGED, cellChangeListener);
};
RenderedCell.prototype.animateCellWithDataChanged = function () {
if (this.gridOptionsWrapper.isEnableCellChangeFlash() || this.column.getColDef().enableCellChangeFlash) {
this.animateCell('data-changed');
}
};
RenderedCell.prototype.animateCellWithHighlight = function () {
this.animateCell('highlight');
};
RenderedCell.prototype.animateCell = function (cssName) {
var _this = this;
var fullName = 'ag-cell-' + cssName;
var animationFullName = 'ag-cell-' + cssName + '-animation';
// we want to highlight the cells, without any animation
utils_1.Utils.addCssClass(this.eGridCell, fullName);
utils_1.Utils.removeCssClass(this.eGridCell, animationFullName);
// then once that is applied, we remove the highlight with animation
setTimeout(function () {
utils_1.Utils.removeCssClass(_this.eGridCell, fullName);
utils_1.Utils.addCssClass(_this.eGridCell, animationFullName);
setTimeout(function () {
// and then to leave things as we got them, we remove the animation
utils_1.Utils.removeCssClass(_this.eGridCell, animationFullName);
}, 1000);
}, 500);
};
RenderedCell.prototype.addCellFocusedListener = function () {
var _this = this;
// set to null, not false, as we need to set 'ag-cell-no-focus' first time around
var cellFocusedLastTime = null;
var cellFocusedListener = function (event) {
var cellFocused = _this.focusedCellController.isCellFocused(_this.gridCell);
// see if we need to change the classes on this cell
if (cellFocused !== cellFocusedLastTime) {
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-focus', cellFocused);
utils_1.Utils.addOrRemoveCssClass(_this.eGridCell, 'ag-cell-no-focus', !cellFocused);
cellFocusedLastTime = cellFocused;
}
// if this cell was just focused, see if we need to force browser focus, his can
// happen if focus is programmatically set.
if (cellFocused && event && event.forceBrowserFocus) {
_this.eGridCell.focus();
}
// if another cell was focused, and we are editing, then stop editing
if (_this.editingCell && !cellFocused) {
_this.stopEditing();
}
};
this.eventService.addEventListener(events_1.Events.EVENT_CELL_FOCUSED, cellFocusedListener);
this.addDestroyFunc(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_CELL_FOCUSED, cellFocusedListener);
});
cellFocusedListener();
};
RenderedCell.prototype.setWidthOnCell = function () {
var _this = this;
var widthChangedListener = function () {
_this.eGridCell.style.width = _this.column.getActualWidth() + "px";
};
this.column.addEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
this.addDestroyFunc(function () {
_this.column.removeEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
});
widthChangedListener();
};
RenderedCell.prototype.init = function () {
this.value = this.getValue();
this.checkboxSelection = this.calculateCheckboxSelection();
this.setWidthOnCell();
this.setPinnedClasses();
this.addRangeSelectedListener();
this.addHighlightListener();
this.addChangeListener();
this.addCellFocusedListener();
this.addKeyDownListener();
this.addKeyPressListener();
// this.addFocusListener();
var setLeftFeature = new setLeftFeature_1.SetLeftFeature(this.column, this.eGridCell);
this.addDestroyFunc(setLeftFeature.destroy.bind(setLeftFeature));
// only set tab index if cell selection is enabled
if (!this.gridOptionsWrapper.isSuppressCellSelection()) {
this.eGridCell.setAttribute("tabindex", "-1");
}
// these are the grid styles, don't change between soft refreshes
this.addClasses();
this.setInlineEditingClass();
this.createParentOfValue();
this.populateCell();
};
RenderedCell.prototype.onEnterKeyDown = function () {
if (this.editingCell) {
this.stopEditing();
this.focusCell(true);
}
else {
this.startEditingIfEnabled(constants_1.Constants.KEY_ENTER);
}
};
RenderedCell.prototype.onF2KeyDown = function () {
if (!this.editingCell) {
this.startEditingIfEnabled(constants_1.Constants.KEY_F2);
}
};
RenderedCell.prototype.onEscapeKeyDown = function () {
if (this.editingCell) {
this.stopEditing(true);
this.focusCell(true);
}
};
RenderedCell.prototype.onPopupEditorClosed = function () {
if (this.editingCell) {
this.stopEditing(true);
// we only focus cell again if this cell is still focused. it is possible
// it is not focused if the user cancelled the edit by clicking on another
// cell outside of this one
if (this.focusedCellController.isCellFocused(this.gridCell)) {
this.focusCell(true);
}
}
};
RenderedCell.prototype.onTabKeyDown = function (event) {
var editNextCell;
if (this.editingCell) {
// if editing, we stop editing, then start editing next cell
this.stopEditing();
editNextCell = true;
}
else {
// otherwise we just move to the next cell
editNextCell = false;
}
var foundCell = this.rowRenderer.moveFocusToNextCell(this.rowIndex, this.column, this.node.floating, event.shiftKey, editNextCell);
// only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
// to the normal tabbing so user can exit the grid.
if (foundCell) {
event.preventDefault();
}
};
RenderedCell.prototype.onBackspaceOrDeleteKeyPressed = function (key) {
if (!this.editingCell) {
this.startEditingIfEnabled(key);
}
};
RenderedCell.prototype.onSpaceKeyPressed = function () {
if (!this.editingCell && this.gridOptionsWrapper.isRowSelection()) {
var selected = this.node.isSelected();
this.node.setSelected(!selected);
}
// prevent default as space key, by default, moves browser scroll down
event.preventDefault();
};
RenderedCell.prototype.onNavigationKeyPressed = function (event, key) {
if (this.editingCell) {
this.stopEditing();
}
this.rowRenderer.navigateToNextCell(key, this.rowIndex, this.column, this.node.floating);
// if we don't prevent default, the grid will scroll with the navigation keys
event.preventDefault();
};
RenderedCell.prototype.addKeyPressListener = function () {
var _this = this;
var keyPressListener = function (event) {
if (!_this.editingCell) {
var pressedChar = String.fromCharCode(event.charCode);
if (pressedChar === ' ') {
_this.onSpaceKeyPressed();
}
else {
if (RenderedCell.PRINTABLE_CHARACTERS.indexOf(pressedChar) >= 0) {
_this.startEditingIfEnabled(null, pressedChar);
// if we don't prevent default, then the keypress also gets applied to the text field
// (at least when doing the default editor), but we need to allow the editor to decide
// what it wants to do.
event.preventDefault();
}
}
}
};
this.eGridCell.addEventListener('keypress', keyPressListener);
this.addDestroyFunc(function () {
_this.eGridCell.removeEventListener('keypress', keyPressListener);
});
};
RenderedCell.prototype.onKeyDown = function (event) {
var key = event.which || event.keyCode;
switch (key) {
case constants_1.Constants.KEY_ENTER:
this.onEnterKeyDown();
break;
case constants_1.Constants.KEY_F2:
this.onF2KeyDown();
break;
case constants_1.Constants.KEY_ESCAPE:
this.onEscapeKeyDown();
break;
case constants_1.Constants.KEY_TAB:
this.onTabKeyDown(event);
break;
case constants_1.Constants.KEY_BACKSPACE:
case constants_1.Constants.KEY_DELETE:
this.onBackspaceOrDeleteKeyPressed(key);
break;
case constants_1.Constants.KEY_DOWN:
case constants_1.Constants.KEY_UP:
case constants_1.Constants.KEY_RIGHT:
case constants_1.Constants.KEY_LEFT:
this.onNavigationKeyPressed(event, key);
break;
}
};
RenderedCell.prototype.addKeyDownListener = function () {
var _this = this;
var editingKeyListener = this.onKeyDown.bind(this);
this.eGridCell.addEventListener('keydown', editingKeyListener);
this.addDestroyFunc(function () {
_this.eGridCell.removeEventListener('keydown', editingKeyListener);
});
};
RenderedCell.prototype.createCellEditor = function (keyPress, charPress) {
var colDef = this.column.getColDef();
var cellEditor = this.cellEditorFactory.createCellEditor(colDef.cellEditor);
if (cellEditor.init) {
var params = {
value: this.getValue(),
keyPress: keyPress,
charPress: charPress,
column: this.column,
node: this.node,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext(),
onKeyDown: this.onKeyDown.bind(this),
stopEditing: this.stopEditingAndFocus.bind(this),
eGridCell: this.eGridCell
};
if (colDef.cellEditorParams) {
utils_1.Utils.assign(params, colDef.cellEditorParams);
}
if (cellEditor.init) {
cellEditor.init(params);
}
}
return cellEditor;
};
// cell editors call this, when they want to stop for reasons other
// than what we pick up on. eg selecting from a dropdown ends editing.
RenderedCell.prototype.stopEditingAndFocus = function () {
this.stopEditing();
this.focusCell(true);
};
// called by rowRenderer when user navigates via tab key
RenderedCell.prototype.startEditingIfEnabled = function (keyPress, charPress) {
if (!this.isCellEditable()) {
return;
}
var cellEditor = this.createCellEditor(keyPress, charPress);
if (cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart()) {
if (cellEditor.destroy) {
cellEditor.destroy();
}
return;
}
if (!cellEditor.getGui) {
console.warn("ag-Grid: cellEditor for column " + this.column.getId() + " is missing getGui() method");
return;
}
this.cellEditor = cellEditor;
this.editingCell = true;
this.cellEditorInPopup = this.cellEditor.isPopup && this.cellEditor.isPopup();
this.setInlineEditingClass();
if (this.cellEditorInPopup) {
this.addPopupCellEditor();
}
else {
this.addInCellEditor();
}
if (cellEditor.afterGuiAttached) {
cellEditor.afterGuiAttached();
}
};
RenderedCell.prototype.addInCellEditor = function () {
utils_1.Utils.removeAllChildren(this.eGridCell);
this.eGridCell.appendChild(this.cellEditor.getGui());
if (this.gridOptionsWrapper.isAngularCompileRows()) {
this.$compile(this.eGridCell)(this.scope);
}
};
RenderedCell.prototype.addPopupCellEditor = function () {
var _this = this;
var ePopupGui = this.cellEditor.getGui();
this.hideEditorPopup = this.popupService.addAsModalPopup(ePopupGui, true,
// callback for when popup disappears
function () {
// we only call stopEditing if we are editing, as
// it's possible the popup called 'stop editing'
// before this, eg if 'enter key' was pressed on
// the editor
if (_this.editingCell) {
_this.onPopupEditorClosed();
}
});
this.popupService.positionPopupOverComponent({
eventSource: this.eGridCell,
ePopup: ePopupGui,
keepWithinBounds: true
});
if (this.gridOptionsWrapper.isAngularCompileRows()) {
this.$compile(ePopupGui)(this.scope);
}
};
RenderedCell.prototype.focusCell = function (forceBrowserFocus) {
this.focusedCellController.setFocusedCell(this.rowIndex, this.column, this.node.floating, forceBrowserFocus);
};
// pass in 'true' to cancel the editing.
RenderedCell.prototype.stopEditing = function (cancel) {
if (cancel === void 0) { cancel = false; }
if (!this.editingCell) {
return;
}
this.editingCell = false;
// also have another option here to cancel after editing, so for example user could have a popup editor and
// it is closed by user clicking outside the editor. then the editor will close automatically (with false
// passed above) and we need to see if the editor wants to accept the new value.
var cancelAfterEnd = this.cellEditor.isCancelAfterEnd && this.cellEditor.isCancelAfterEnd();
var acceptNewValue = !cancel && !cancelAfterEnd;
if (acceptNewValue) {
var newValue = this.cellEditor.getValue();
this.valueService.setValue(this.node, this.column, newValue);
this.value = this.getValue();
}
if (this.cellEditor.destroy) {
this.cellEditor.destroy();
}
if (this.cellEditorInPopup) {
this.hideEditorPopup();
this.hideEditorPopup = null;
}
else {
utils_1.Utils.removeAllChildren(this.eGridCell);
// put the cell back the way it was before editing
if (this.checkboxSelection) {
// if wrapper, then put the wrapper back
this.eGridCell.appendChild(this.eCellWrapper);
}
else {
// if cellRenderer, then put the gui back in. if the renderer has
// a refresh, it will be called. however if it doesn't, then later
// the renderer will be destroyed and a new one will be created.
if (this.cellRenderer) {
this.eGridCell.appendChild(this.cellRenderer.getGui());
}
}
}
this.setInlineEditingClass();
this.refreshCell();
};
RenderedCell.prototype.createParams = function () {
var params = {
node: this.node,
data: this.node.data,
value: this.value,
rowIndex: this.rowIndex,
colDef: this.column.getColDef(),
$scope: this.scope,
context: this.gridOptionsWrapper.getContext(),
api: this.gridApi,
columnApi: this.columnApi
};
return params;
};
RenderedCell.prototype.createEvent = function (event, eventSource) {
var agEvent = this.createParams();
agEvent.event = event;
//agEvent.eventSource = eventSource;
return agEvent;
};
RenderedCell.prototype.isCellEditable = function () {
if (this.editingCell) {
return false;
}
// never allow editing of groups
if (this.node.group) {
return false;
}
return this.column.isCellEditable(this.node);
};
RenderedCell.prototype.onMouseEvent = function (eventName, mouseEvent, eventSource) {
switch (eventName) {
case 'click':
this.onCellClicked(mouseEvent);
break;
case 'mousedown':
this.onMouseDown();
break;
case 'dblclick':
this.onCellDoubleClicked(mouseEvent, eventSource);
break;
case 'contextmenu':
this.onContextMenu(mouseEvent);
break;
}
};
RenderedCell.prototype.onContextMenu = function (mouseEvent) {
// to allow us to debug in chrome, we ignore the event if ctrl is pressed,
// thus the normal menu is displayed
if (mouseEvent.ctrlKey || mouseEvent.metaKey) {
return;
}
var colDef = this.column.getColDef();
var agEvent = this.createEvent(mouseEvent);
this.eventService.dispatchEvent(events_1.Events.EVENT_CELL_CONTEXT_MENU, agEvent);
if (colDef.onCellContextMenu) {
colDef.onCellContextMenu(agEvent);
}
if (this.contextMenuFactory && !this.gridOptionsWrapper.isSuppressContextMenu()) {
this.contextMenuFactory.showMenu(this.node, this.column, this.value, mouseEvent);
mouseEvent.preventDefault();
}
};
RenderedCell.prototype.onCellDoubleClicked = function (mouseEvent, eventSource) {
var colDef = this.column.getColDef();
// always dispatch event to eventService
var agEvent = this.createEvent(mouseEvent, eventSource);
this.eventService.dispatchEvent(events_1.Events.EVENT_CELL_DOUBLE_CLICKED, agEvent);
// check if colDef also wants to handle event
if (typeof colDef.onCellDoubleClicked === 'function') {
colDef.onCellDoubleClicked(agEvent);
}
if (!this.gridOptionsWrapper.isSingleClickEdit()) {
this.startEditingIfEnabled();
}
};
RenderedCell.prototype.onMouseDown = function () {
// we pass false to focusCell, as we don't want the cell to focus
// also get the browser focus. if we did, then the cellRenderer could
// have a text field in it, for example, and as the user clicks on the
// text field, the text field, the focus doesn't get to the text
// field, instead to goes to the div behind, making it impossible to
// select the text field.
this.focusCell(false);
// if it's a right click, then if the cell is already in range,
// don't change the range, however if the cell is not in a range,
// we set a new range
if (this.rangeController) {
var thisCell = this.gridCell;
var cellAlreadyInRange = this.rangeController.isCellInAnyRange(thisCell);
if (!cellAlreadyInRange) {
this.rangeController.setRangeToCell(thisCell);
}
}
};
RenderedCell.prototype.onCellClicked = function (mouseEvent) {
var agEvent = this.createEvent(mouseEvent, this);
this.eventService.dispatchEvent(events_1.Events.EVENT_CELL_CLICKED, agEvent);
var colDef = this.column.getColDef();
if (colDef.onCellClicked) {
colDef.onCellClicked(agEvent);
}
if (this.gridOptionsWrapper.isSingleClickEdit()) {
this.startEditingIfEnabled();
}
};
// if we are editing inline, then we don't have the padding in the cell (set in the themes)
// to allow the text editor full access to the entire cell
RenderedCell.prototype.setInlineEditingClass = function () {
var editingInline = this.editingCell && !this.cellEditorInPopup;
utils_1.Utils.addOrRemoveCssClass(this.eGridCell, 'ag-cell-inline-editing', editingInline);
utils_1.Utils.addOrRemoveCssClass(this.eGridCell, 'ag-cell-not-inline-editing', !editingInline);
};
RenderedCell.prototype.populateCell = function () {
// populate
this.putDataIntoCell();
// style
this.addStylesFromColDef();
this.addClassesFromColDef();
this.addClassesFromRules();
};
RenderedCell.prototype.addStylesFromColDef = function () {
var colDef = this.column.getColDef();
if (colDef.cellStyle) {
var cssToUse;
if (typeof colDef.cellStyle === 'function') {
var cellStyleParams = {
value: this.value,
data: this.node.data,
node: this.node,
colDef: colDef,
column: this.column,
$scope: this.scope,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi()
};
var cellStyleFunc = colDef.cellStyle;
cssToUse = cellStyleFunc(cellStyleParams);
}
else {
cssToUse = colDef.cellStyle;
}
if (cssToUse) {
utils_1.Utils.addStylesToElement(this.eGridCell, cssToUse);
}
}
};
RenderedCell.prototype.addClassesFromColDef = function () {
var _this = this;
var colDef = this.column.getColDef();
if (colDef.cellClass) {
var classToUse;
if (typeof colDef.cellClass === 'function') {
var cellClassParams = {
value: this.value,
data: this.node.data,
node: this.node,
colDef: colDef,
$scope: this.scope,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi()
};
var cellClassFunc = colDef.cellClass;
classToUse = cellClassFunc(cellClassParams);
}
else {
classToUse = colDef.cellClass;
}
if (typeof classToUse === 'string') {
utils_1.Utils.addCssClass(this.eGridCell, classToUse);
}
else if (Array.isArray(classToUse)) {
classToUse.forEach(function (cssClassItem) {
utils_1.Utils.addCssClass(_this.eGridCell, cssClassItem);
});
}
}
};
RenderedCell.prototype.addClassesFromRules = function () {
var colDef = this.column.getColDef();
var classRules = colDef.cellClassRules;
if (typeof classRules === 'object' && classRules !== null) {
var params = {
value: this.value,
data: this.node.data,
node: this.node,
colDef: colDef,
rowIndex: this.rowIndex,
api: this.gridOptionsWrapper.getApi(),
context: this.gridOptionsWrapper.getContext()
};
var classNames = Object.keys(classRules);
for (var i = 0; i < classNames.length; i++) {
var className = classNames[i];
var rule = classRules[className];
var resultOfRule;
if (typeof rule === 'string') {
resultOfRule = this.expressionService.evaluate(rule, params);
}
else if (typeof rule === 'function') {
resultOfRule = rule(params);
}
if (resultOfRule) {
utils_1.Utils.addCssClass(this.eGridCell, className);
}
else {
utils_1.Utils.removeCssClass(this.eGridCell, className);
}
}
}
};
RenderedCell.prototype.createParentOfValue = function () {
if (this.checkboxSelection) {
this.eCellWrapper = document.createElement('span');
utils_1.Utils.addCssClass(this.eCellWrapper, 'ag-cell-wrapper');
this.eGridCell.appendChild(this.eCellWrapper);
var cbSelectionComponent = new checkboxSelectionComponent_1.CheckboxSelectionComponent();
this.context.wireBean(cbSelectionComponent);
cbSelectionComponent.init({ rowNode: this.node });
this.eCellWrapper.appendChild(cbSelectionComponent.getGui());
this.addDestroyFunc(function () { return cbSelectionComponent.destroy(); });
// eventually we call eSpanWithValue.innerHTML = xxx, so cannot include the checkbox (above) in this span
this.eSpanWithValue = document.createElement('span');
utils_1.Utils.addCssClass(this.eSpanWithValue, 'ag-cell-value');
this.eCellWrapper.appendChild(this.eSpanWithValue);
this.eParentOfValue = this.eSpanWithValue;
}
else {
utils_1.Utils.addCssClass(this.eGridCell, 'ag-cell-value');
this.eParentOfValue = this.eGridCell;
}
};
RenderedCell.prototype.isVolatile = function () {
return this.column.getColDef().volatile;
};
RenderedCell.prototype.refreshCell = function (animate, newData) {
if (animate === void 0) { animate = false; }
if (newData === void 0) { newData = false; }
this.value = this.getValue();
// if it's 'new data', then we don't refresh the cellRenderer, even if refresh method is available.
// this is because if the whole data is new (ie we are showing stock price 'BBA' now and not 'SSD')
// then we are not showing a movement in the stock price, rather we are showing different stock.
if (!newData && this.cellRenderer && this.cellRenderer.refresh) {
// if the cell renderer has a refresh method, we call this instead of doing a refresh
// note: should pass in params here instead of value?? so that client has formattedValue
var valueFormatted = this.formatValue(this.value);
var cellRendererParams = this.column.getColDef().cellRendererParams;
var params = this.createRendererAndRefreshParams(valueFormatted, cellRendererParams);
this.cellRenderer.refresh(params);
// need to check rules. note, we ignore colDef classes and styles, these are assumed to be static
this.addClassesFromRules();
}
else {
// otherwise we rip out the cell and replace it
utils_1.Utils.removeAllChildren(this.eParentOfValue);
// remove old renderer component if it exists
if (this.cellRenderer && this.cellRenderer.destroy) {
this.cellRenderer.destroy();
}
this.cellRenderer = null;
this.populateCell();
// if angular compiling, then need to also compile the cell again (angular compiling sucks, please wait...)
if (this.gridOptionsWrapper.isAngularCompileRows()) {
this.$compile(this.eGridCell)(this.scope);
}
}
if (animate) {
this.animateCellWithDataChanged();
}
};
RenderedCell.prototype.putDataIntoCell = function () {
// template gets preference, then cellRenderer, then do it ourselves
var colDef = this.column.getColDef();
var valueFormatted = this.valueFormatterService.formatValue(this.column, this.node, this.scope, this.rowIndex, this.value);
if (colDef.template) {
this.eParentOfValue.innerHTML = colDef.template;
}
else if (colDef.templateUrl) {
var template = this.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
if (template) {
this.eParentOfValue.innerHTML = template;
}
}
else if (colDef.floatingCellRenderer && this.node.floating) {
this.useCellRenderer(colDef.floatingCellRenderer, colDef.floatingCellRendererParams, valueFormatted);
}
else if (colDef.cellRenderer) {
this.useCellRenderer(colDef.cellRenderer, colDef.cellRendererParams, valueFormatted);
}
else {
// if we insert undefined, then it displays as the string 'undefined', ugly!
var valueToRender = utils_1.Utils.exists(valueFormatted) ? valueFormatted : this.value;
if (utils_1.Utils.exists(valueToRender) && valueToRender !== '') {
// not using innerHTML to prevent injection of HTML
// https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations
this.eParentOfValue.textContent = valueToRender.toString();
}
}
if (colDef.tooltipField) {
var data = this.getDataForRow();
if (utils_1.Utils.exists(data)) {
var tooltip = data[colDef.tooltipField];
this.eParentOfValue.setAttribute('title', tooltip);
}
}
};
RenderedCell.prototype.formatValue = function (value) {
return this.valueFormatterService.formatValue(this.column, this.node, this.scope, this.rowIndex, value);
};
RenderedCell.prototype.createRendererAndRefreshParams = function (valueFormatted, cellRendererParams) {
var params = {
value: this.value,
valueFormatted: valueFormatted,
valueGetter: this.getValue,
formatValue: this.formatValue.bind(this),
data: this.node.data,
node: this.node,
colDef: this.column.getColDef(),
column: this.column,
$scope: this.scope,
rowIndex: this.rowIndex,
api: this.gridOptionsWrapper.getApi(),
columnApi: this.gridOptionsWrapper.getColumnApi(),
context: this.gridOptionsWrapper.getContext(),
refreshCell: this.refreshCell.bind(this),
eGridCell: this.eGridCell,
eParentOfValue: this.eParentOfValue,
addRenderedRowListener: this.renderedRow.addEventListener.bind(this.renderedRow)
};
if (cellRendererParams) {
utils_1.Utils.assign(params, cellRendererParams);
}
return params;
};
RenderedCell.prototype.useCellRenderer = function (cellRendererKey, cellRendererParams, valueFormatted) {
var params = this.createRendererAndRefreshParams(valueFormatted, cellRendererParams);
this.cellRenderer = this.cellRendererService.useCellRenderer(cellRendererKey, this.eParentOfValue, params);
};
RenderedCell.prototype.addClasses = function () {
utils_1.Utils.addCssClass(this.eGridCell, 'ag-cell');
this.eGridCell.setAttribute("colId", this.column.getColId());
if (this.node.group && this.node.footer) {
utils_1.Utils.addCssClass(this.eGridCell, 'ag-footer-cell');
}
if (this.node.group && !this.node.footer) {
utils_1.Utils.addCssClass(this.eGridCell, 'ag-group-cell');
}
};
RenderedCell.PRINTABLE_CHARACTERS = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!"£$%^&*()_+-=[];\'#,./\|<>?:@~{}';
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], RenderedCell.prototype, "context", void 0);
__decorate([
context_1.Autowired('columnApi'),
__metadata('design:type', columnController_1.ColumnApi)
], RenderedCell.prototype, "columnApi", void 0);
__decorate([
context_1.Autowired('gridApi'),
__metadata('design:type', gridApi_1.GridApi)
], RenderedCell.prototype, "gridApi", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], RenderedCell.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], RenderedCell.prototype, "expressionService", void 0);
__decorate([
context_1.Autowired('rowRenderer'),
__metadata('design:type', rowRenderer_1.RowRenderer)
], RenderedCell.prototype, "rowRenderer", void 0);
__decorate([
context_1.Autowired('$compile'),
__metadata('design:type', Object)
], RenderedCell.prototype, "$compile", void 0);
__decorate([
context_1.Autowired('templateService'),
__metadata('design:type', templateService_1.TemplateService)
], RenderedCell.prototype, "templateService", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], RenderedCell.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], RenderedCell.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], RenderedCell.prototype, "columnController", void 0);
__decorate([
context_1.Optional('rangeController'),
__metadata('design:type', Object)
], RenderedCell.prototype, "rangeController", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], RenderedCell.prototype, "focusedCellController", void 0);
__decorate([
context_1.Optional('contextMenuFactory'),
__metadata('design:type', Object)
], RenderedCell.prototype, "contextMenuFactory", void 0);
__decorate([
context_1.Autowired('focusService'),
__metadata('design:type', focusService_1.FocusService)
], RenderedCell.prototype, "focusService", void 0);
__decorate([
context_1.Autowired('cellEditorFactory'),
__metadata('design:type', cellEditorFactory_1.CellEditorFactory)
], RenderedCell.prototype, "cellEditorFactory", void 0);
__decorate([
context_1.Autowired('cellRendererFactory'),
__metadata('design:type', cellRendererFactory_1.CellRendererFactory)
], RenderedCell.prototype, "cellRendererFactory", void 0);
__decorate([
context_1.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], RenderedCell.prototype, "popupService", void 0);
__decorate([
context_1.Autowired('cellRendererService'),
__metadata('design:type', cellRendererService_1.CellRendererService)
], RenderedCell.prototype, "cellRendererService", void 0);
__decorate([
context_1.Autowired('valueFormatterService'),
__metadata('design:type', valueFormatterService_1.ValueFormatterService)
], RenderedCell.prototype, "valueFormatterService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], RenderedCell.prototype, "init", null);
return RenderedCell;
})(component_1.Component);
exports.RenderedCell = RenderedCell;
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var gridCore_1 = __webpack_require__(40);
var columnController_1 = __webpack_require__(13);
var constants_1 = __webpack_require__(8);
var gridCell_1 = __webpack_require__(33);
// tracks when focus goes into a cell. cells listen to this, so they know to stop editing
// if focus goes into another cell.
var FocusService = (function () {
function FocusService() {
this.destroyMethods = [];
this.listeners = [];
}
FocusService.prototype.addListener = function (listener) {
this.listeners.push(listener);
};
FocusService.prototype.removeListener = function (listener) {
utils_1.Utils.removeFromArray(this.listeners, listener);
};
FocusService.prototype.init = function () {
var _this = this;
var focusListener = function (focusEvent) {
var gridCell = _this.getCellForFocus(focusEvent);
if (gridCell) {
_this.informListeners({ gridCell: gridCell });
}
};
var eRootGui = this.gridCore.getRootGui();
eRootGui.addEventListener('focus', focusListener, true);
this.destroyMethods.push(function () {
eRootGui.removeEventListener('focus', focusListener);
});
};
FocusService.prototype.getCellForFocus = function (focusEvent) {
var column = null;
var row = null;
var floating = null;
var that = this;
var eTarget = focusEvent.target;
while (eTarget) {
checkRow(eTarget);
checkColumn(eTarget);
eTarget = eTarget.parentNode;
}
if (utils_1.Utils.exists(column) && utils_1.Utils.exists(row)) {
var gridCell = new gridCell_1.GridCell(row, floating, column);
return gridCell;
}
else {
return null;
}
function checkRow(eTarget) {
// match the column by checking a) it has a valid colId and b) it has the 'ag-cell' class
var rowId = utils_1.Utils.getElementAttribute(eTarget, 'row');
if (utils_1.Utils.exists(rowId) && utils_1.Utils.containsClass(eTarget, 'ag-row')) {
if (rowId.indexOf('ft') === 0) {
floating = constants_1.Constants.FLOATING_TOP;
rowId = rowId.substr(3);
}
else if (rowId.indexOf('fb') === 0) {
floating = constants_1.Constants.FLOATING_BOTTOM;
rowId = rowId.substr(3);
}
else {
floating = null;
}
row = parseInt(rowId);
}
}
function checkColumn(eTarget) {
// match the column by checking a) it has a valid colId and b) it has the 'ag-cell' class
var colId = utils_1.Utils.getElementAttribute(eTarget, 'colid');
if (utils_1.Utils.exists(colId) && utils_1.Utils.containsClass(eTarget, 'ag-cell')) {
var foundColumn = that.columnController.getGridColumn(colId);
if (foundColumn) {
column = foundColumn;
}
}
}
};
FocusService.prototype.informListeners = function (event) {
this.listeners.forEach(function (listener) { return listener(event); });
};
FocusService.prototype.destroy = function () {
this.destroyMethods.forEach(function (destroyMethod) { return destroyMethod(); });
};
__decorate([
context_1.Autowired('gridCore'),
__metadata('design:type', gridCore_1.GridCore)
], FocusService.prototype, "gridCore", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], FocusService.prototype, "columnController", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], FocusService.prototype, "init", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], FocusService.prototype, "destroy", null);
FocusService = __decorate([
context_1.Bean('focusService'),
__metadata('design:paramtypes', [])
], FocusService);
return FocusService;
})();
exports.FocusService = FocusService;
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var paginationController_1 = __webpack_require__(41);
var columnController_1 = __webpack_require__(13);
var rowRenderer_1 = __webpack_require__(23);
var filterManager_1 = __webpack_require__(43);
var eventService_1 = __webpack_require__(4);
var gridPanel_1 = __webpack_require__(24);
var logger_1 = __webpack_require__(5);
var constants_1 = __webpack_require__(8);
var popupService_1 = __webpack_require__(44);
var events_1 = __webpack_require__(10);
var borderLayout_1 = __webpack_require__(30);
var context_1 = __webpack_require__(6);
var focusedCellController_1 = __webpack_require__(35);
var component_1 = __webpack_require__(47);
var GridCore = (function () {
function GridCore(loggerFactory) {
this.logger = loggerFactory.create('GridCore');
}
GridCore.prototype.init = function () {
var _this = this;
// and the last bean, done in it's own section, as it's optional
var toolPanelGui;
var eSouthPanel = this.createSouthPanel();
if (this.toolPanel && !this.gridOptionsWrapper.isForPrint()) {
toolPanelGui = this.toolPanel.getGui();
}
var rowGroupGui;
if (this.rowGroupCompFactory) {
this.rowGroupComp = this.rowGroupCompFactory.create();
rowGroupGui = this.rowGroupComp.getGui();
}
this.eRootPanel = new borderLayout_1.BorderLayout({
center: this.gridPanel.getLayout(),
east: toolPanelGui,
north: rowGroupGui,
south: eSouthPanel,
dontFill: this.gridOptionsWrapper.isForPrint(),
name: 'eRootPanel'
});
// see what the grid options are for default of toolbar
this.showToolPanel(this.gridOptionsWrapper.isShowToolPanel());
this.eGridDiv.appendChild(this.eRootPanel.getGui());
// if using angular, watch for quickFilter changes
if (this.$scope) {
this.$scope.$watch(this.quickFilterOnScope, function (newFilter) { return _this.filterManager.setQuickFilter(newFilter); });
}
if (!this.gridOptionsWrapper.isForPrint()) {
this.addWindowResizeListener();
}
this.doLayout();
this.finished = false;
this.periodicallyDoLayout();
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onRowGroupChanged.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.onRowGroupChanged.bind(this));
this.onRowGroupChanged();
this.logger.log('ready');
};
GridCore.prototype.getRootGui = function () {
return this.eRootPanel.getGui();
};
GridCore.prototype.createSouthPanel = function () {
if (!this.statusBar && this.gridOptionsWrapper.isEnableStatusBar()) {
console.warn('ag-Grid: status bar is only available in ag-Grid-Enterprise');
}
var statusBarEnabled = this.statusBar && this.gridOptionsWrapper.isEnableStatusBar();
var paginationPanelEnabled = this.gridOptionsWrapper.isRowModelPagination() && !this.gridOptionsWrapper.isForPrint();
if (!statusBarEnabled && !paginationPanelEnabled) {
return null;
}
var eSouthPanel = document.createElement('div');
if (statusBarEnabled) {
eSouthPanel.appendChild(this.statusBar.getGui());
}
if (paginationPanelEnabled) {
eSouthPanel.appendChild(this.paginationController.getGui());
}
return eSouthPanel;
};
GridCore.prototype.onRowGroupChanged = function () {
if (!this.rowGroupComp) {
return;
}
var rowGroupPanelShow = this.gridOptionsWrapper.getRowGroupPanelShow();
if (rowGroupPanelShow === constants_1.Constants.ALWAYS) {
this.eRootPanel.setNorthVisible(true);
}
else if (rowGroupPanelShow === constants_1.Constants.ONLY_WHEN_GROUPING) {
var grouping = !this.columnController.isRowGroupEmpty();
this.eRootPanel.setNorthVisible(grouping);
}
else {
this.eRootPanel.setNorthVisible(false);
}
};
GridCore.prototype.addWindowResizeListener = function () {
var that = this;
// putting this into a function, so when we remove the function,
// we are sure we are removing the exact same function (i'm not
// sure what 'bind' does to the function reference, if it's safe
// the result from 'bind').
this.windowResizeListener = function resizeListener() {
that.doLayout();
};
window.addEventListener('resize', this.windowResizeListener);
};
GridCore.prototype.periodicallyDoLayout = function () {
var _this = this;
if (!this.finished) {
var intervalMillis = this.gridOptionsWrapper.getLayoutInterval();
// if interval is negative, this stops the layout from happening
if (intervalMillis > 0) {
setTimeout(function () {
_this.doLayout();
_this.gridPanel.periodicallyCheck();
_this.periodicallyDoLayout();
}, intervalMillis);
}
else {
// if user provided negative number, we still do the check every 5 seconds,
// in case the user turns the number positive again
setTimeout(function () {
_this.periodicallyDoLayout();
}, 5000);
}
}
};
GridCore.prototype.showToolPanel = function (show) {
if (show && !this.toolPanel) {
console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
this.toolPanelShowing = false;
return;
}
this.toolPanelShowing = show;
this.eRootPanel.setEastVisible(show);
};
GridCore.prototype.isToolPanelShowing = function () {
return this.toolPanelShowing;
};
GridCore.prototype.destroy = function () {
if (this.windowResizeListener) {
window.removeEventListener('resize', this.windowResizeListener);
this.logger.log('Removing windowResizeListener');
}
this.finished = true;
this.eGridDiv.removeChild(this.eRootPanel.getGui());
this.logger.log('Grid DOM removed');
};
GridCore.prototype.ensureNodeVisible = function (comparator) {
if (this.doingVirtualPaging) {
throw 'Cannot use ensureNodeVisible when doing virtual paging, as we cannot check rows that are not in memory';
}
// look for the node index we want to display
var rowCount = this.rowModel.getRowCount();
var comparatorIsAFunction = typeof comparator === 'function';
var indexToSelect = -1;
// go through all the nodes, find the one we want to show
for (var i = 0; i < rowCount; i++) {
var node = this.rowModel.getRow(i);
if (comparatorIsAFunction) {
if (comparator(node)) {
indexToSelect = i;
break;
}
}
else {
// check object equality against node and data
if (comparator === node || comparator === node.data) {
indexToSelect = i;
break;
}
}
}
if (indexToSelect >= 0) {
this.gridPanel.ensureIndexVisible(indexToSelect);
}
};
GridCore.prototype.doLayout = function () {
// need to do layout first, as drawVirtualRows and setPinnedColHeight
// need to know the result of the resizing of the panels.
var sizeChanged = this.eRootPanel.doLayout();
// both of the two below should be done in gridPanel, the gridPanel should register 'resize' to the panel
if (sizeChanged) {
this.rowRenderer.drawVirtualRows();
var event = {
clientWidth: this.eRootPanel.getGui().clientWidth,
clientHeight: this.eRootPanel.getGui().clientHeight
};
this.eventService.dispatchEvent(events_1.Events.EVENT_GRID_SIZE_CHANGED, event);
}
};
__decorate([
context_1.Autowired('gridOptions'),
__metadata('design:type', Object)
], GridCore.prototype, "gridOptions", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], GridCore.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('paginationController'),
__metadata('design:type', paginationController_1.PaginationController)
], GridCore.prototype, "paginationController", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], GridCore.prototype, "rowModel", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], GridCore.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('rowRenderer'),
__metadata('design:type', rowRenderer_1.RowRenderer)
], GridCore.prototype, "rowRenderer", void 0);
__decorate([
context_1.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], GridCore.prototype, "filterManager", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], GridCore.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], GridCore.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('eGridDiv'),
__metadata('design:type', HTMLElement)
], GridCore.prototype, "eGridDiv", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], GridCore.prototype, "$scope", void 0);
__decorate([
context_1.Autowired('quickFilterOnScope'),
__metadata('design:type', String)
], GridCore.prototype, "quickFilterOnScope", void 0);
__decorate([
context_1.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], GridCore.prototype, "popupService", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], GridCore.prototype, "focusedCellController", void 0);
__decorate([
context_1.Optional('rowGroupCompFactory'),
__metadata('design:type', Object)
], GridCore.prototype, "rowGroupCompFactory", void 0);
__decorate([
context_1.Optional('toolPanel'),
__metadata('design:type', component_1.Component)
], GridCore.prototype, "toolPanel", void 0);
__decorate([
context_1.Optional('statusBar'),
__metadata('design:type', component_1.Component)
], GridCore.prototype, "statusBar", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridCore.prototype, "init", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridCore.prototype, "destroy", null);
GridCore = __decorate([
context_1.Bean('gridCore'),
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:paramtypes', [logger_1.LoggerFactory])
], GridCore);
return GridCore;
})();
exports.GridCore = GridCore;
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var context_1 = __webpack_require__(6);
var gridPanel_1 = __webpack_require__(24);
var selectionController_1 = __webpack_require__(28);
var context_2 = __webpack_require__(6);
var sortController_1 = __webpack_require__(42);
var context_3 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var filterManager_1 = __webpack_require__(43);
var constants_1 = __webpack_require__(8);
var template = '<div class="ag-paging-panel ag-font-style">' +
'<span id="pageRowSummaryPanel" class="ag-paging-row-summary-panel">' +
'<span id="firstRowOnPage"></span>' +
' [TO] ' +
'<span id="lastRowOnPage"></span>' +
' [OF] ' +
'<span id="recordCount"></span>' +
'</span>' +
'<span class="ag-paging-page-summary-panel">' +
'<button type="button" class="ag-paging-button" id="btFirst">[FIRST]</button>' +
'<button type="button" class="ag-paging-button" id="btPrevious">[PREVIOUS]</button>' +
'[PAGE] ' +
'<span id="current"></span>' +
' [OF] ' +
'<span id="total"></span>' +
'<button type="button" class="ag-paging-button" id="btNext">[NEXT]</button>' +
'<button type="button" class="ag-paging-button" id="btLast">[LAST]</button>' +
'</span>' +
'</div>';
var PaginationController = (function () {
function PaginationController() {
}
PaginationController.prototype.init = function () {
var _this = this;
// if we are doing pagination, we are guaranteed that the model type
// is normal. if it is not, then this paginationController service
// will never be called.
if (this.rowModel.getType() === constants_1.Constants.ROW_MODEL_TYPE_NORMAL) {
this.inMemoryRowModel = this.rowModel;
}
this.setupComponents();
this.callVersion = 0;
var paginationEnabled = this.gridOptionsWrapper.isRowModelPagination();
this.eventService.addEventListener(events_1.Events.EVENT_FILTER_CHANGED, function () {
if (paginationEnabled && _this.gridOptionsWrapper.isEnableServerSideFilter()) {
_this.reset();
}
});
this.eventService.addEventListener(events_1.Events.EVENT_SORT_CHANGED, function () {
if (paginationEnabled && _this.gridOptionsWrapper.isEnableServerSideSorting()) {
_this.reset();
}
});
if (paginationEnabled && this.gridOptionsWrapper.getDatasource()) {
this.setDatasource(this.gridOptionsWrapper.getDatasource());
}
};
PaginationController.prototype.setDatasource = function (datasource) {
this.datasource = datasource;
if (!datasource) {
// only continue if we have a valid datasource to work with
return;
}
this.reset();
};
PaginationController.prototype.reset = function () {
// important to return here, as the user could be setting filter or sort before
// data-source is set
if (utils_1.Utils.missing(this.datasource)) {
return;
}
this.selectionController.reset();
// copy pageSize, to guard against it changing the the datasource between calls
if (this.datasource.pageSize && typeof this.datasource.pageSize !== 'number') {
console.warn('datasource.pageSize should be a number');
}
this.pageSize = this.datasource.pageSize;
// see if we know the total number of pages, or if it's 'to be decided'
if (typeof this.datasource.rowCount === 'number' && this.datasource.rowCount >= 0) {
this.rowCount = this.datasource.rowCount;
this.foundMaxRow = true;
this.calculateTotalPages();
}
else {
this.rowCount = 0;
this.foundMaxRow = false;
this.totalPages = null;
}
this.currentPage = 0;
// hide the summary panel until something is loaded
this.ePageRowSummaryPanel.style.visibility = 'hidden';
this.setTotalLabels();
this.loadPage();
};
// the native method number.toLocaleString(undefined, {minimumFractionDigits: 0}) puts in decimal places in IE
PaginationController.prototype.myToLocaleString = function (input) {
if (typeof input !== 'number') {
return '';
}
else {
// took this from: http://blog.tompawlak.org/number-currency-formatting-javascript
return input.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
}
};
PaginationController.prototype.setTotalLabels = function () {
if (this.foundMaxRow) {
this.lbTotal.innerHTML = this.myToLocaleString(this.totalPages);
this.lbRecordCount.innerHTML = this.myToLocaleString(this.rowCount);
}
else {
var moreText = this.gridOptionsWrapper.getLocaleTextFunc()('more', 'more');
this.lbTotal.innerHTML = moreText;
this.lbRecordCount.innerHTML = moreText;
}
};
PaginationController.prototype.calculateTotalPages = function () {
this.totalPages = Math.floor((this.rowCount - 1) / this.pageSize) + 1;
};
PaginationController.prototype.pageLoaded = function (rows, lastRowIndex) {
var firstId = this.currentPage * this.pageSize;
this.inMemoryRowModel.setRowData(rows, true, firstId);
// see if we hit the last row
if (!this.foundMaxRow && typeof lastRowIndex === 'number' && lastRowIndex >= 0) {
this.foundMaxRow = true;
this.rowCount = lastRowIndex;
this.calculateTotalPages();
this.setTotalLabels();
// if overshot pages, go back
if (this.currentPage > this.totalPages) {
this.currentPage = this.totalPages - 1;
this.loadPage();
}
}
this.enableOrDisableButtons();
this.updateRowLabels();
};
PaginationController.prototype.updateRowLabels = function () {
var startRow;
var endRow;
if (this.isZeroPagesToDisplay()) {
startRow = 0;
endRow = 0;
}
else {
startRow = (this.pageSize * this.currentPage) + 1;
endRow = startRow + this.pageSize - 1;
if (this.foundMaxRow && endRow > this.rowCount) {
endRow = this.rowCount;
}
}
this.lbFirstRowOnPage.innerHTML = this.myToLocaleString(startRow);
this.lbLastRowOnPage.innerHTML = this.myToLocaleString(endRow);
// show the summary panel, when first shown, this is blank
this.ePageRowSummaryPanel.style.visibility = "";
};
PaginationController.prototype.loadPage = function () {
var _this = this;
this.enableOrDisableButtons();
var startRow = this.currentPage * this.datasource.pageSize;
var endRow = (this.currentPage + 1) * this.datasource.pageSize;
this.lbCurrent.innerHTML = this.myToLocaleString(this.currentPage + 1);
this.callVersion++;
var callVersionCopy = this.callVersion;
var that = this;
this.gridPanel.showLoadingOverlay();
var sortModel;
if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
sortModel = this.sortController.getSortModel();
}
var filterModel;
if (this.gridOptionsWrapper.isEnableServerSideFilter()) {
filterModel = this.filterManager.getFilterModel();
}
var params = {
startRow: startRow,
endRow: endRow,
successCallback: successCallback,
failCallback: failCallback,
sortModel: sortModel,
filterModel: filterModel,
context: this.gridOptionsWrapper.getContext()
};
// check if old version of datasource used
var getRowsParams = utils_1.Utils.getFunctionParameters(this.datasource.getRows);
if (getRowsParams.length > 1) {
console.warn('ag-grid: It looks like your paging datasource is of the old type, taking more than one parameter.');
console.warn('ag-grid: From ag-grid 1.9.0, now the getRows takes one parameter. See the documentation for details.');
}
// put in timeout, to force result to be async
setTimeout(function () {
_this.datasource.getRows(params);
}, 0);
function successCallback(rows, lastRowIndex) {
if (that.isCallDaemon(callVersionCopy)) {
return;
}
that.pageLoaded(rows, lastRowIndex);
}
function failCallback() {
if (that.isCallDaemon(callVersionCopy)) {
return;
}
// set in an empty set of rows, this will at
// least get rid of the loading panel, and
// stop blocking things
that.inMemoryRowModel.setRowData([], true);
}
};
PaginationController.prototype.isCallDaemon = function (versionCopy) {
return versionCopy !== this.callVersion;
};
PaginationController.prototype.onBtNext = function () {
this.currentPage++;
this.loadPage();
};
PaginationController.prototype.onBtPrevious = function () {
this.currentPage--;
this.loadPage();
};
PaginationController.prototype.onBtFirst = function () {
this.currentPage = 0;
this.loadPage();
};
PaginationController.prototype.onBtLast = function () {
this.currentPage = this.totalPages - 1;
this.loadPage();
};
PaginationController.prototype.isZeroPagesToDisplay = function () {
return this.foundMaxRow && this.totalPages === 0;
};
PaginationController.prototype.enableOrDisableButtons = function () {
var disablePreviousAndFirst = this.currentPage === 0;
this.btPrevious.disabled = disablePreviousAndFirst;
this.btFirst.disabled = disablePreviousAndFirst;
var zeroPagesToDisplay = this.isZeroPagesToDisplay();
var onLastPage = this.foundMaxRow && this.currentPage === (this.totalPages - 1);
var disableNext = onLastPage || zeroPagesToDisplay;
this.btNext.disabled = disableNext;
var disableLast = !this.foundMaxRow || zeroPagesToDisplay || this.currentPage === (this.totalPages - 1);
this.btLast.disabled = disableLast;
};
PaginationController.prototype.createTemplate = function () {
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
return template
.replace('[PAGE]', localeTextFunc('page', 'Page'))
.replace('[TO]', localeTextFunc('to', 'to'))
.replace('[OF]', localeTextFunc('of', 'of'))
.replace('[OF]', localeTextFunc('of', 'of'))
.replace('[FIRST]', localeTextFunc('first', 'First'))
.replace('[PREVIOUS]', localeTextFunc('previous', 'Previous'))
.replace('[NEXT]', localeTextFunc('next', 'Next'))
.replace('[LAST]', localeTextFunc('last', 'Last'));
};
PaginationController.prototype.getGui = function () {
return this.eGui;
};
PaginationController.prototype.setupComponents = function () {
this.eGui = utils_1.Utils.loadTemplate(this.createTemplate());
this.btNext = this.eGui.querySelector('#btNext');
this.btPrevious = this.eGui.querySelector('#btPrevious');
this.btFirst = this.eGui.querySelector('#btFirst');
this.btLast = this.eGui.querySelector('#btLast');
this.lbCurrent = this.eGui.querySelector('#current');
this.lbTotal = this.eGui.querySelector('#total');
this.lbRecordCount = this.eGui.querySelector('#recordCount');
this.lbFirstRowOnPage = this.eGui.querySelector('#firstRowOnPage');
this.lbLastRowOnPage = this.eGui.querySelector('#lastRowOnPage');
this.ePageRowSummaryPanel = this.eGui.querySelector('#pageRowSummaryPanel');
var that = this;
this.btNext.addEventListener('click', function () {
that.onBtNext();
});
this.btPrevious.addEventListener('click', function () {
that.onBtPrevious();
});
this.btFirst.addEventListener('click', function () {
that.onBtFirst();
});
this.btLast.addEventListener('click', function () {
that.onBtLast();
});
};
__decorate([
context_2.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], PaginationController.prototype, "filterManager", void 0);
__decorate([
context_2.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], PaginationController.prototype, "gridPanel", void 0);
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], PaginationController.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_2.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], PaginationController.prototype, "selectionController", void 0);
__decorate([
context_2.Autowired('sortController'),
__metadata('design:type', sortController_1.SortController)
], PaginationController.prototype, "sortController", void 0);
__decorate([
context_2.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], PaginationController.prototype, "eventService", void 0);
__decorate([
context_2.Autowired('rowModel'),
__metadata('design:type', Object)
], PaginationController.prototype, "rowModel", void 0);
__decorate([
context_3.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], PaginationController.prototype, "init", null);
PaginationController = __decorate([
context_1.Bean('paginationController'),
__metadata('design:paramtypes', [])
], PaginationController);
return PaginationController;
})();
exports.PaginationController = PaginationController;
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var column_1 = __webpack_require__(15);
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var context_2 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var SortController = (function () {
function SortController() {
}
SortController.prototype.progressSort = function (column, multiSort) {
// update sort on current col
column.setSort(this.getNextSortDirection(column));
// sortedAt used for knowing order of cols when multi-col sort
if (column.getSort()) {
column.setSortedAt(new Date().valueOf());
}
else {
column.setSortedAt(null);
}
var doingMultiSort = multiSort && !this.gridOptionsWrapper.isSuppressMultiSort();
// clear sort on all columns except this one, and update the icons
if (!doingMultiSort) {
this.clearSortBarThisColumn(column);
}
this.dispatchSortChangedEvents();
};
SortController.prototype.dispatchSortChangedEvents = function () {
this.eventService.dispatchEvent(events_1.Events.EVENT_BEFORE_SORT_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_SORT_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_AFTER_SORT_CHANGED);
};
SortController.prototype.clearSortBarThisColumn = function (columnToSkip) {
this.columnController.getPrimaryAndSecondaryAndAutoColumns().forEach(function (columnToClear) {
// Do not clear if either holding shift, or if column in question was clicked
if (!(columnToClear === columnToSkip)) {
columnToClear.setSort(null);
}
});
};
SortController.prototype.getNextSortDirection = function (column) {
var sortingOrder;
if (column.getColDef().sortingOrder) {
sortingOrder = column.getColDef().sortingOrder;
}
else if (this.gridOptionsWrapper.getSortingOrder()) {
sortingOrder = this.gridOptionsWrapper.getSortingOrder();
}
else {
sortingOrder = SortController.DEFAULT_SORTING_ORDER;
}
if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {
console.warn('ag-grid: sortingOrder must be an array with at least one element, currently it\'s ' + sortingOrder);
return;
}
var currentIndex = sortingOrder.indexOf(column.getSort());
var notInArray = currentIndex < 0;
var lastItemInArray = currentIndex == sortingOrder.length - 1;
var result;
if (notInArray || lastItemInArray) {
result = sortingOrder[0];
}
else {
result = sortingOrder[currentIndex + 1];
}
// verify the sort type exists, as the user could provide the sortOrder, need to make sure it's valid
if (SortController.DEFAULT_SORTING_ORDER.indexOf(result) < 0) {
console.warn('ag-grid: invalid sort type ' + result);
return null;
}
return result;
};
// used by the public api, for saving the sort model
SortController.prototype.getSortModel = function () {
var columnsWithSorting = this.getColumnsWithSortingOrdered();
return utils_1.Utils.map(columnsWithSorting, function (column) {
return {
colId: column.getColId(),
sort: column.getSort()
};
});
};
SortController.prototype.setSortModel = function (sortModel) {
if (!this.gridOptionsWrapper.isEnableSorting()) {
console.warn('ag-grid: You are setting the sort model on a grid that does not have sorting enabled');
return;
}
// first up, clear any previous sort
var sortModelProvided = sortModel && sortModel.length > 0;
var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
allColumnsIncludingAuto.forEach(function (column) {
var sortForCol = null;
var sortedAt = -1;
if (sortModelProvided && !column.getColDef().suppressSorting) {
for (var j = 0; j < sortModel.length; j++) {
var sortModelEntry = sortModel[j];
if (typeof sortModelEntry.colId === 'string'
&& typeof column.getColId() === 'string'
&& sortModelEntry.colId === column.getColId()) {
sortForCol = sortModelEntry.sort;
sortedAt = j;
}
}
}
if (sortForCol) {
column.setSort(sortForCol);
column.setSortedAt(sortedAt);
}
else {
column.setSort(null);
column.setSortedAt(null);
}
});
this.dispatchSortChangedEvents();
};
SortController.prototype.getColumnsWithSortingOrdered = function () {
// pull out all the columns that have sorting set
var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
var columnsWithSorting = utils_1.Utils.filter(allColumnsIncludingAuto, function (column) { return !!column.getSort(); });
// put the columns in order of which one got sorted first
columnsWithSorting.sort(function (a, b) { return a.sortedAt - b.sortedAt; });
return columnsWithSorting;
};
// used by row controller, when doing the sorting
SortController.prototype.getSortForRowController = function () {
var columnsWithSorting = this.getColumnsWithSortingOrdered();
return utils_1.Utils.map(columnsWithSorting, function (column) {
var ascending = column.getSort() === column_1.Column.SORT_ASC;
return {
inverter: ascending ? 1 : -1,
column: column
};
});
};
SortController.DEFAULT_SORTING_ORDER = [column_1.Column.SORT_ASC, column_1.Column.SORT_DESC, null];
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], SortController.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], SortController.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], SortController.prototype, "eventService", void 0);
SortController = __decorate([
context_2.Bean('sortController'),
__metadata('design:paramtypes', [])
], SortController);
return SortController;
})();
exports.SortController = SortController;
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var popupService_1 = __webpack_require__(44);
var valueService_1 = __webpack_require__(29);
var columnController_1 = __webpack_require__(13);
var textFilter_1 = __webpack_require__(45);
var numberFilter_1 = __webpack_require__(46);
var context_1 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var FilterManager = (function () {
function FilterManager() {
this.allFilters = {};
this.quickFilter = null;
this.availableFilters = {
'text': textFilter_1.TextFilter,
'number': numberFilter_1.NumberFilter
};
}
FilterManager.prototype.init = function () {
this.eventService.addEventListener(events_1.Events.EVENT_ROW_DATA_CHANGED, this.onNewRowsLoaded.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
this.quickFilter = this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText());
};
FilterManager.prototype.registerFilter = function (key, Filter) {
this.availableFilters[key] = Filter;
};
FilterManager.prototype.setFilterModel = function (model) {
var _this = this;
if (model) {
// mark the filters as we set them, so any active filters left over we stop
var modelKeys = Object.keys(model);
utils_1.Utils.iterateObject(this.allFilters, function (colId, filterWrapper) {
utils_1.Utils.removeFromArray(modelKeys, colId);
var newModel = model[colId];
_this.setModelOnFilterWrapper(filterWrapper.filter, newModel);
});
// at this point, processedFields contains data for which we don't have a filter working yet
utils_1.Utils.iterateArray(modelKeys, function (colId) {
var column = _this.columnController.getPrimaryColumn(colId);
if (!column) {
console.warn('Warning ag-grid setFilterModel - no column found for colId ' + colId);
return;
}
var filterWrapper = _this.getOrCreateFilterWrapper(column);
_this.setModelOnFilterWrapper(filterWrapper.filter, model[colId]);
});
}
else {
utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
_this.setModelOnFilterWrapper(filterWrapper.filter, null);
});
}
this.onFilterChanged();
};
FilterManager.prototype.setModelOnFilterWrapper = function (filter, newModel) {
// because user can provide filters, we provide useful error checking and messages
if (typeof filter.getApi !== 'function') {
console.warn('Warning ag-grid - filter missing getApi method, which is needed for getFilterModel');
return;
}
var filterApi = filter.getApi();
if (typeof filterApi.setModel !== 'function') {
console.warn('Warning ag-grid - filter API missing setModel method, which is needed for setFilterModel');
return;
}
filterApi.setModel(newModel);
};
FilterManager.prototype.getFilterModel = function () {
var result = {};
utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
// because user can provide filters, we provide useful error checking and messages
if (typeof filterWrapper.filter.getApi !== 'function') {
console.warn('Warning ag-grid - filter missing getApi method, which is needed for getFilterModel');
return;
}
var filterApi = filterWrapper.filter.getApi();
if (typeof filterApi.getModel !== 'function') {
console.warn('Warning ag-grid - filter API missing getModel method, which is needed for getFilterModel');
return;
}
var model = filterApi.getModel();
if (utils_1.Utils.exists(model)) {
result[key] = model;
}
});
return result;
};
// returns true if any advanced filter (ie not quick filter) active
FilterManager.prototype.isAdvancedFilterPresent = function () {
var atLeastOneActive = false;
utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
if (!filterWrapper.filter.isFilterActive) {
console.error('Filter is missing method isFilterActive');
}
if (filterWrapper.filter.isFilterActive()) {
atLeastOneActive = true;
filterWrapper.column.setFilterActive(true);
}
else {
filterWrapper.column.setFilterActive(false);
}
});
return atLeastOneActive;
};
// returns true if quickFilter or advancedFilter
FilterManager.prototype.isAnyFilterPresent = function () {
return this.isQuickFilterPresent() || this.advancedFilterPresent || this.externalFilterPresent;
};
FilterManager.prototype.doesFilterPass = function (node, filterToSkip) {
var data = node.data;
var colKeys = Object.keys(this.allFilters);
for (var i = 0, l = colKeys.length; i < l; i++) {
var colId = colKeys[i];
var filterWrapper = this.allFilters[colId];
// if no filter, always pass
if (filterWrapper === undefined) {
continue;
}
if (filterWrapper.filter === filterToSkip) {
continue;
}
// don't bother with filters that are not active
if (!filterWrapper.filter.isFilterActive()) {
continue;
}
if (!filterWrapper.filter.doesFilterPass) {
console.error('Filter is missing method doesFilterPass');
}
var params = {
node: node,
data: data
};
if (!filterWrapper.filter.doesFilterPass(params)) {
return false;
}
}
// all filters passed
return true;
};
FilterManager.prototype.parseQuickFilter = function (newFilter) {
if (utils_1.Utils.missing(newFilter) || newFilter === "") {
return null;
}
if (this.gridOptionsWrapper.isRowModelVirtual()) {
console.warn('ag-grid: cannot do quick filtering when doing virtual paging');
return null;
}
return newFilter.toUpperCase();
};
// returns true if it has changed (not just same value again)
FilterManager.prototype.setQuickFilter = function (newFilter) {
var parsedFilter = this.parseQuickFilter(newFilter);
if (this.quickFilter !== parsedFilter) {
this.quickFilter = parsedFilter;
this.onFilterChanged();
}
};
FilterManager.prototype.onFilterChanged = function () {
this.eventService.dispatchEvent(events_1.Events.EVENT_BEFORE_FILTER_CHANGED);
this.advancedFilterPresent = this.isAdvancedFilterPresent();
this.externalFilterPresent = this.gridOptionsWrapper.isExternalFilterPresent();
utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
if (filterWrapper.filter.onAnyFilterChanged) {
filterWrapper.filter.onAnyFilterChanged();
}
});
this.eventService.dispatchEvent(events_1.Events.EVENT_FILTER_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_AFTER_FILTER_CHANGED);
};
FilterManager.prototype.isQuickFilterPresent = function () {
return this.quickFilter !== null;
};
FilterManager.prototype.doesRowPassOtherFilters = function (filterToSkip, node) {
return this.doesRowPassFilter(node, filterToSkip);
};
FilterManager.prototype.doesRowPassFilter = function (node, filterToSkip) {
//first up, check quick filter
if (this.isQuickFilterPresent()) {
if (!node.quickFilterAggregateText) {
this.aggregateRowForQuickFilter(node);
}
if (node.quickFilterAggregateText.indexOf(this.quickFilter) < 0) {
//quick filter fails, so skip item
return false;
}
}
//secondly, give the client a chance to reject this row
if (this.externalFilterPresent) {
if (!this.gridOptionsWrapper.doesExternalFilterPass(node)) {
return false;
}
}
//lastly, check our internal advanced filter
if (this.advancedFilterPresent) {
if (!this.doesFilterPass(node, filterToSkip)) {
return false;
}
}
//got this far, all filters pass
return true;
};
FilterManager.prototype.aggregateRowForQuickFilter = function (node) {
var aggregatedText = '';
var that = this;
this.columnController.getAllPrimaryColumns().forEach(function (column) {
var value = that.valueService.getValue(column, node);
if (value && value !== '') {
aggregatedText = aggregatedText + value.toString().toUpperCase() + "_";
}
});
node.quickFilterAggregateText = aggregatedText;
};
FilterManager.prototype.onNewRowsLoaded = function () {
var that = this;
Object.keys(this.allFilters).forEach(function (field) {
var filter = that.allFilters[field].filter;
if (filter.onNewRowsLoaded) {
filter.onNewRowsLoaded();
}
});
};
FilterManager.prototype.createValueGetter = function (column) {
var that = this;
return function valueGetter(node) {
return that.valueService.getValue(column, node);
};
};
FilterManager.prototype.getFilterApi = function (column) {
var filterWrapper = this.getOrCreateFilterWrapper(column);
if (filterWrapper) {
if (typeof filterWrapper.filter.getApi === 'function') {
return filterWrapper.filter.getApi();
}
}
};
FilterManager.prototype.getOrCreateFilterWrapper = function (column) {
var filterWrapper = this.allFilters[column.getColId()];
if (!filterWrapper) {
filterWrapper = this.createFilterWrapper(column);
this.allFilters[column.getColId()] = filterWrapper;
}
return filterWrapper;
};
// destroys the filter, so it not longer takes par
FilterManager.prototype.destroyFilter = function (column) {
var filterWrapper = this.allFilters[column.getColId()];
if (filterWrapper) {
if (filterWrapper.destroy) {
filterWrapper.destroy();
}
delete this.allFilters[column.getColId()];
this.onFilterChanged();
filterWrapper.column.setFilterActive(false);
}
};
FilterManager.prototype.createFilterWrapper = function (column) {
var _this = this;
var colDef = column.getColDef();
var filterWrapper = {
column: column,
filter: null,
scope: null,
gui: null
};
if (typeof colDef.filter === 'function') {
// if user provided a filter, just use it
// first up, create child scope if needed
if (this.gridOptionsWrapper.isAngularCompileFilters()) {
filterWrapper.scope = this.$scope.$new();
filterWrapper.scope.context = this.gridOptionsWrapper.getContext();
}
// now create filter (had to cast to any to get 'new' working)
this.assertMethodHasNoParameters(colDef.filter);
filterWrapper.filter = new colDef.filter();
}
else if (utils_1.Utils.missing(colDef.filter) || typeof colDef.filter === 'string') {
var Filter = this.getFilterFromCache(colDef.filter);
filterWrapper.filter = new Filter();
}
else {
console.error('ag-Grid: colDef.filter should be function or a string');
}
this.context.wireBean(filterWrapper.filter);
var filterChangedCallback = this.onFilterChanged.bind(this);
var filterModifiedCallback = function () { return _this.eventService.dispatchEvent(events_1.Events.EVENT_FILTER_MODIFIED); };
var doesRowPassOtherFilters = this.doesRowPassOtherFilters.bind(this, filterWrapper.filter);
var filterParams = colDef.filterParams;
var params = {
column: column,
colDef: colDef,
rowModel: this.rowModel,
filterChangedCallback: filterChangedCallback,
filterModifiedCallback: filterModifiedCallback,
filterParams: filterParams,
localeTextFunc: this.gridOptionsWrapper.getLocaleTextFunc(),
valueGetter: this.createValueGetter(column),
doesRowPassOtherFilter: doesRowPassOtherFilters,
context: this.gridOptionsWrapper.getContext(),
$scope: filterWrapper.scope
};
if (!filterWrapper.filter.init) {
throw 'Filter is missing method init';
}
filterWrapper.filter.init(params);
if (!filterWrapper.filter.getGui) {
throw 'Filter is missing method getGui';
}
var eFilterGui = document.createElement('div');
eFilterGui.className = 'ag-filter';
var guiFromFilter = filterWrapper.filter.getGui();
if (utils_1.Utils.isNodeOrElement(guiFromFilter)) {
//a dom node or element was returned, so add child
eFilterGui.appendChild(guiFromFilter);
}
else {
//otherwise assume it was html, so just insert
var eTextSpan = document.createElement('span');
eTextSpan.innerHTML = guiFromFilter;
eFilterGui.appendChild(eTextSpan);
}
if (filterWrapper.scope) {
filterWrapper.gui = this.$compile(eFilterGui)(filterWrapper.scope)[0];
}
else {
filterWrapper.gui = eFilterGui;
}
return filterWrapper;
};
FilterManager.prototype.getFilterFromCache = function (filterType) {
var defaultFilterType = this.enterprise ? 'set' : 'text';
var defaultFilter = this.availableFilters[defaultFilterType];
if (utils_1.Utils.missing(filterType)) {
return defaultFilter;
}
if (!this.enterprise && filterType === 'set') {
console.warn('ag-Grid: Set filter is only available in Enterprise ag-Grid');
filterType = 'text';
}
if (this.availableFilters[filterType]) {
return this.availableFilters[filterType];
}
else {
console.error('ag-Grid: Could not find filter type ' + filterType);
return this.availableFilters[defaultFilter];
}
};
FilterManager.prototype.onNewColumnsLoaded = function () {
this.destroy();
};
FilterManager.prototype.destroy = function () {
utils_1.Utils.iterateObject(this.allFilters, function (key, filterWrapper) {
if (filterWrapper.filter.destroy) {
filterWrapper.filter.destroy();
filterWrapper.column.setFilterActive(false);
}
});
this.allFilters = {};
};
FilterManager.prototype.assertMethodHasNoParameters = function (theMethod) {
var getRowsParams = utils_1.Utils.getFunctionParameters(theMethod);
if (getRowsParams.length > 0) {
console.warn('ag-grid: It looks like your filter is of the old type and expecting parameters in the constructor.');
console.warn('ag-grid: From ag-grid 1.14, the constructor should take no parameters and init() used instead.');
}
};
__decorate([
context_1.Autowired('$compile'),
__metadata('design:type', Object)
], FilterManager.prototype, "$compile", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], FilterManager.prototype, "$scope", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], FilterManager.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('gridCore'),
__metadata('design:type', Object)
], FilterManager.prototype, "gridCore", void 0);
__decorate([
context_1.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], FilterManager.prototype, "popupService", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], FilterManager.prototype, "valueService", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], FilterManager.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], FilterManager.prototype, "rowModel", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], FilterManager.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('enterprise'),
__metadata('design:type', Boolean)
], FilterManager.prototype, "enterprise", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], FilterManager.prototype, "context", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], FilterManager.prototype, "init", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], FilterManager.prototype, "destroy", null);
FilterManager = __decorate([
context_1.Bean('filterManager'),
__metadata('design:paramtypes', [])
], FilterManager);
return FilterManager;
})();
exports.FilterManager = FilterManager;
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var constants_1 = __webpack_require__(8);
var context_1 = __webpack_require__(6);
var gridCore_1 = __webpack_require__(40);
var PopupService = (function () {
function PopupService() {
}
// this.popupService.setPopupParent(this.eRootPanel.getGui());
PopupService.prototype.getPopupParent = function () {
return this.gridCore.getRootGui();
};
PopupService.prototype.positionPopupForMenu = function (params) {
var sourceRect = params.eventSource.getBoundingClientRect();
var parentRect = this.getPopupParent().getBoundingClientRect();
var x = sourceRect.right - parentRect.left - 2;
var y = sourceRect.top - parentRect.top;
var minWidth;
if (params.ePopup.clientWidth > 0) {
minWidth = params.ePopup.clientWidth;
}
else {
minWidth = 200;
}
var widthOfParent = parentRect.right - parentRect.left;
var maxX = widthOfParent - minWidth;
if (x > maxX) {
// try putting menu to the left
x = sourceRect.left - minWidth;
}
if (x < 0) {
x = 0;
}
params.ePopup.style.left = x + "px";
params.ePopup.style.top = y + "px";
};
PopupService.prototype.positionPopupUnderMouseEvent = function (params) {
var parentRect = this.getPopupParent().getBoundingClientRect();
this.positionPopup({
ePopup: params.ePopup,
x: params.mouseEvent.clientX - parentRect.left,
y: params.mouseEvent.clientY - parentRect.top,
keepWithinBounds: true
});
};
PopupService.prototype.positionPopupUnderComponent = function (params) {
var sourceRect = params.eventSource.getBoundingClientRect();
var parentRect = this.getPopupParent().getBoundingClientRect();
this.positionPopup({
ePopup: params.ePopup,
minWidth: params.minWidth,
nudgeX: params.nudgeX,
nudgeY: params.nudgeY,
x: sourceRect.left - parentRect.left,
y: sourceRect.top - parentRect.top + sourceRect.height,
keepWithinBounds: params.keepWithinBounds
});
};
PopupService.prototype.positionPopupOverComponent = function (params) {
var sourceRect = params.eventSource.getBoundingClientRect();
var parentRect = this.getPopupParent().getBoundingClientRect();
this.positionPopup({
ePopup: params.ePopup,
minWidth: params.minWidth,
nudgeX: params.nudgeX,
nudgeY: params.nudgeY,
x: sourceRect.left - parentRect.left,
y: sourceRect.top - parentRect.top,
keepWithinBounds: params.keepWithinBounds
});
};
PopupService.prototype.positionPopup = function (params) {
var parentRect = this.getPopupParent().getBoundingClientRect();
var x = params.x;
var y = params.y;
if (params.nudgeX) {
x += params.nudgeX;
}
if (params.nudgeY) {
y += params.nudgeY;
}
// if popup is overflowing to the bottom, move it up
if (params.keepWithinBounds) {
checkHorizontalOverflow();
checkVerticalOverflow();
}
params.ePopup.style.left = x + "px";
params.ePopup.style.top = y + "px";
function checkHorizontalOverflow() {
var minWidth;
if (params.minWidth > 0) {
minWidth = params.minWidth;
}
else if (params.ePopup.clientWidth > 0) {
minWidth = params.ePopup.clientWidth;
}
else {
minWidth = 200;
}
var widthOfParent = parentRect.right - parentRect.left;
var maxX = widthOfParent - minWidth - 5;
if (x > maxX) {
x = maxX;
}
if (x < 0) {
x = 0;
}
}
function checkVerticalOverflow() {
var minHeight;
if (params.ePopup.clientWidth > 0) {
minHeight = params.ePopup.clientHeight;
}
else {
minHeight = 200;
}
var heightOfParent = parentRect.bottom - parentRect.top;
var maxY = heightOfParent - minHeight - 5;
if (y > maxY) {
y = maxY;
}
if (y < 0) {
y = 0;
}
}
};
//adds an element to a div, but also listens to background checking for clicks,
//so that when the background is clicked, the child is removed again, giving
//a model look to popups.
PopupService.prototype.addAsModalPopup = function (eChild, closeOnEsc, closedCallback) {
var eBody = document.body;
if (!eBody) {
console.warn('ag-grid: could not find the body of the document, document.body is empty');
return;
}
eChild.style.top = '0px';
eChild.style.left = '0px';
var popupAlreadyShown = utils_1.Utils.isVisible(eChild);
if (popupAlreadyShown) {
return;
}
this.getPopupParent().appendChild(eChild);
var that = this;
var popupHidden = false;
// if we add these listeners now, then the current mouse
// click will be included, which we don't want
setTimeout(function () {
if (closeOnEsc) {
eBody.addEventListener('keydown', hidePopupOnEsc);
}
eBody.addEventListener('click', hidePopup);
eBody.addEventListener('contextmenu', hidePopup);
//eBody.addEventListener('mousedown', hidePopup);
eChild.addEventListener('click', consumeClick);
//eChild.addEventListener('mousedown', consumeClick);
}, 0);
var eventFromChild = null;
function hidePopupOnEsc(event) {
var key = event.which || event.keyCode;
if (key === constants_1.Constants.KEY_ESCAPE) {
hidePopup(null);
}
}
function hidePopup(event) {
if (event && event === eventFromChild) {
return;
}
// this method should only be called once. the client can have different
// paths, each one wanting to close, so this method may be called multiple
// times.
if (popupHidden) {
return;
}
popupHidden = true;
that.getPopupParent().removeChild(eChild);
eBody.removeEventListener('keydown', hidePopupOnEsc);
//eBody.removeEventListener('mousedown', hidePopupOnEsc);
eBody.removeEventListener('click', hidePopup);
eBody.removeEventListener('contextmenu', hidePopup);
eChild.removeEventListener('click', consumeClick);
//eChild.removeEventListener('mousedown', consumeClick);
if (closedCallback) {
closedCallback();
}
}
function consumeClick(event) {
eventFromChild = event;
}
return hidePopup;
};
__decorate([
context_1.Autowired('gridCore'),
__metadata('design:type', gridCore_1.GridCore)
], PopupService.prototype, "gridCore", void 0);
PopupService = __decorate([
context_1.Bean('popupService'),
__metadata('design:paramtypes', [])
], PopupService);
return PopupService;
})();
exports.PopupService = PopupService;
/***/ },
/* 45 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var template = '<div>' +
'<div>' +
'<select class="ag-filter-select" id="filterType">' +
'<option value="1">[CONTAINS]</option>' +
'<option value="2">[EQUALS]</option>' +
'<option value="3">[NOT EQUALS]</option>' +
'<option value="4">[STARTS WITH]</option>' +
'<option value="5">[ENDS WITH]</option>' +
'</select>' +
'</div>' +
'<div>' +
'<input class="ag-filter-filter" id="filterText" type="text" placeholder="[FILTER...]"/>' +
'</div>' +
'<div class="ag-filter-apply-panel" id="applyPanel">' +
'<button type="button" id="applyButton">[APPLY FILTER]</button>' +
'</div>' +
'</div>';
var CONTAINS = 1;
var EQUALS = 2;
var NOT_EQUALS = 3;
var STARTS_WITH = 4;
var ENDS_WITH = 5;
var TextFilter = (function () {
function TextFilter() {
}
TextFilter.prototype.init = function (params) {
this.filterParams = params.filterParams;
this.applyActive = this.filterParams && this.filterParams.apply === true;
this.filterChangedCallback = params.filterChangedCallback;
this.filterModifiedCallback = params.filterModifiedCallback;
this.localeTextFunc = params.localeTextFunc;
this.valueGetter = params.valueGetter;
this.createGui();
this.filterText = null;
this.filterType = CONTAINS;
this.createApi();
};
TextFilter.prototype.onNewRowsLoaded = function () {
var keepSelection = this.filterParams && this.filterParams.newRowsAction === 'keep';
if (!keepSelection) {
this.api.setType(CONTAINS);
this.api.setFilter(null);
}
};
TextFilter.prototype.afterGuiAttached = function () {
this.eFilterTextField.focus();
};
TextFilter.prototype.doesFilterPass = function (node) {
if (!this.filterText) {
return true;
}
var value = this.valueGetter(node);
if (!value) {
return false;
}
var valueLowerCase = value.toString().toLowerCase();
switch (this.filterType) {
case CONTAINS:
return valueLowerCase.indexOf(this.filterText) >= 0;
case EQUALS:
return valueLowerCase === this.filterText;
case NOT_EQUALS:
return valueLowerCase != this.filterText;
case STARTS_WITH:
return valueLowerCase.indexOf(this.filterText) === 0;
case ENDS_WITH:
var index = valueLowerCase.lastIndexOf(this.filterText);
return index >= 0 && index === (valueLowerCase.length - this.filterText.length);
default:
// should never happen
console.warn('invalid filter type ' + this.filterType);
return false;
}
};
TextFilter.prototype.getGui = function () {
return this.eGui;
};
TextFilter.prototype.isFilterActive = function () {
return this.filterText !== null;
};
TextFilter.prototype.createTemplate = function () {
return template
.replace('[FILTER...]', this.localeTextFunc('filterOoo', 'Filter...'))
.replace('[EQUALS]', this.localeTextFunc('equals', 'Equals'))
.replace('[NOT EQUALS]', this.localeTextFunc('notEquals', 'Not equals'))
.replace('[CONTAINS]', this.localeTextFunc('contains', 'Contains'))
.replace('[STARTS WITH]', this.localeTextFunc('startsWith', 'Starts with'))
.replace('[ENDS WITH]', this.localeTextFunc('endsWith', 'Ends with'))
.replace('[APPLY FILTER]', this.localeTextFunc('applyFilter', 'Apply Filter'));
};
TextFilter.prototype.createGui = function () {
this.eGui = utils_1.Utils.loadTemplate(this.createTemplate());
this.eFilterTextField = this.eGui.querySelector("#filterText");
this.eTypeSelect = this.eGui.querySelector("#filterType");
utils_1.Utils.addChangeListener(this.eFilterTextField, this.onFilterChanged.bind(this));
this.eTypeSelect.addEventListener("change", this.onTypeChanged.bind(this));
this.setupApply();
};
TextFilter.prototype.setupApply = function () {
var _this = this;
if (this.applyActive) {
this.eApplyButton = this.eGui.querySelector('#applyButton');
this.eApplyButton.addEventListener('click', function () {
_this.filterChangedCallback();
});
}
else {
utils_1.Utils.removeElement(this.eGui, '#applyPanel');
}
};
TextFilter.prototype.onTypeChanged = function () {
this.filterType = parseInt(this.eTypeSelect.value);
this.filterChanged();
};
TextFilter.prototype.onFilterChanged = function () {
var filterText = utils_1.Utils.makeNull(this.eFilterTextField.value);
if (filterText && filterText.trim() === '') {
filterText = null;
}
var newFilterText;
if (filterText !== null && filterText !== undefined) {
newFilterText = filterText.toLowerCase();
}
else {
newFilterText = null;
}
if (this.filterText !== newFilterText) {
this.filterText = newFilterText;
this.filterChanged();
}
};
TextFilter.prototype.filterChanged = function () {
this.filterModifiedCallback();
if (!this.applyActive) {
this.filterChangedCallback();
}
};
TextFilter.prototype.createApi = function () {
var that = this;
this.api = {
EQUALS: EQUALS,
NOT_EQUALS: NOT_EQUALS,
CONTAINS: CONTAINS,
STARTS_WITH: STARTS_WITH,
ENDS_WITH: ENDS_WITH,
setType: function (type) {
that.filterType = type;
that.eTypeSelect.value = type;
},
setFilter: function (filter) {
filter = utils_1.Utils.makeNull(filter);
if (filter) {
that.filterText = filter.toLowerCase();
that.eFilterTextField.value = filter;
}
else {
that.filterText = null;
that.eFilterTextField.value = null;
}
},
getType: function () {
return that.filterType;
},
getFilter: function () {
return that.filterText;
},
getModel: function () {
if (that.isFilterActive()) {
return {
type: that.filterType,
filter: that.filterText
};
}
else {
return null;
}
},
setModel: function (dataModel) {
if (dataModel) {
this.setType(dataModel.type);
this.setFilter(dataModel.filter);
}
else {
this.setFilter(null);
}
}
};
};
TextFilter.prototype.getApi = function () {
return this.api;
};
return TextFilter;
})();
exports.TextFilter = TextFilter;
/***/ },
/* 46 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var template = '<div>' +
'<div>' +
'<select class="ag-filter-select" id="filterType">' +
'<option value="1">[EQUALS]</option>' +
'<option value="2">[NOT EQUAL]</option>' +
'<option value="3">[LESS THAN]</option>' +
'<option value="4">[LESS THAN OR EQUAL]</option>' +
'<option value="5">[GREATER THAN]</option>' +
'<option value="6">[GREATER THAN OR EQUAL]</option>' +
'</select>' +
'</div>' +
'<div>' +
'<input class="ag-filter-filter" id="filterText" type="text" placeholder="[FILTER...]"/>' +
'</div>' +
'<div class="ag-filter-apply-panel" id="applyPanel">' +
'<button type="button" id="applyButton">[APPLY FILTER]</button>' +
'</div>' +
'</div>';
var EQUALS = 1;
var NOT_EQUAL = 2;
var LESS_THAN = 3;
var LESS_THAN_OR_EQUAL = 4;
var GREATER_THAN = 5;
var GREATER_THAN_OR_EQUAL = 6;
var NumberFilter = (function () {
function NumberFilter() {
}
NumberFilter.prototype.init = function (params) {
this.filterParams = params.filterParams;
this.applyActive = this.filterParams && this.filterParams.apply === true;
this.filterChangedCallback = params.filterChangedCallback;
this.filterModifiedCallback = params.filterModifiedCallback;
this.localeTextFunc = params.localeTextFunc;
this.valueGetter = params.valueGetter;
this.createGui();
this.filterNumber = null;
this.filterType = EQUALS;
this.createApi();
};
NumberFilter.prototype.onNewRowsLoaded = function () {
var keepSelection = this.filterParams && this.filterParams.newRowsAction === 'keep';
if (!keepSelection) {
this.api.setType(EQUALS);
this.api.setFilter(null);
}
};
NumberFilter.prototype.afterGuiAttached = function () {
this.eFilterTextField.focus();
};
NumberFilter.prototype.doesFilterPass = function (node) {
if (this.filterNumber === null) {
return true;
}
var value = this.valueGetter(node);
if (!value && value !== 0) {
return false;
}
var valueAsNumber;
if (typeof value === 'number') {
valueAsNumber = value;
}
else {
valueAsNumber = parseFloat(value);
}
switch (this.filterType) {
case EQUALS:
return valueAsNumber === this.filterNumber;
case LESS_THAN:
return valueAsNumber < this.filterNumber;
case GREATER_THAN:
return valueAsNumber > this.filterNumber;
case LESS_THAN_OR_EQUAL:
return valueAsNumber <= this.filterNumber;
case GREATER_THAN_OR_EQUAL:
return valueAsNumber >= this.filterNumber;
case NOT_EQUAL:
return valueAsNumber != this.filterNumber;
default:
// should never happen
console.warn('invalid filter type ' + this.filterType);
return false;
}
};
NumberFilter.prototype.getGui = function () {
return this.eGui;
};
NumberFilter.prototype.isFilterActive = function () {
return this.filterNumber !== null;
};
NumberFilter.prototype.createTemplate = function () {
return template
.replace('[FILTER...]', this.localeTextFunc('filterOoo', 'Filter...'))
.replace('[EQUALS]', this.localeTextFunc('equals', 'Equals'))
.replace('[LESS THAN]', this.localeTextFunc('lessThan', 'Less than'))
.replace('[GREATER THAN]', this.localeTextFunc('greaterThan', 'Greater than'))
.replace('[LESS THAN OR EQUAL]', this.localeTextFunc('lessThanOrEqual', 'Less than or equal'))
.replace('[GREATER THAN OR EQUAL]', this.localeTextFunc('greaterThanOrEqual', 'Greater than or equal'))
.replace('[NOT EQUAL]', this.localeTextFunc('notEqual', 'Not equal'))
.replace('[APPLY FILTER]', this.localeTextFunc('applyFilter', 'Apply Filter'));
};
NumberFilter.prototype.createGui = function () {
this.eGui = utils_1.Utils.loadTemplate(this.createTemplate());
this.eFilterTextField = this.eGui.querySelector("#filterText");
this.eTypeSelect = this.eGui.querySelector("#filterType");
utils_1.Utils.addChangeListener(this.eFilterTextField, this.onFilterChanged.bind(this));
this.eTypeSelect.addEventListener("change", this.onTypeChanged.bind(this));
this.setupApply();
};
NumberFilter.prototype.setupApply = function () {
var _this = this;
if (this.applyActive) {
this.eApplyButton = this.eGui.querySelector('#applyButton');
this.eApplyButton.addEventListener('click', function () {
_this.filterChangedCallback();
});
}
else {
utils_1.Utils.removeElement(this.eGui, '#applyPanel');
}
};
NumberFilter.prototype.onTypeChanged = function () {
this.filterType = parseInt(this.eTypeSelect.value);
this.filterChanged();
};
NumberFilter.prototype.filterChanged = function () {
this.filterModifiedCallback();
if (!this.applyActive) {
this.filterChangedCallback();
}
};
NumberFilter.prototype.onFilterChanged = function () {
var filterText = utils_1.Utils.makeNull(this.eFilterTextField.value);
if (filterText && filterText.trim() === '') {
filterText = null;
}
var newFilter;
if (filterText !== null && filterText !== undefined) {
newFilter = parseFloat(filterText);
}
else {
newFilter = null;
}
if (this.filterNumber !== newFilter) {
this.filterNumber = newFilter;
this.filterChanged();
}
};
NumberFilter.prototype.createApi = function () {
var that = this;
this.api = {
EQUALS: EQUALS,
NOT_EQUAL: NOT_EQUAL,
LESS_THAN: LESS_THAN,
GREATER_THAN: GREATER_THAN,
LESS_THAN_OR_EQUAL: LESS_THAN_OR_EQUAL,
GREATER_THAN_OR_EQUAL: GREATER_THAN_OR_EQUAL,
setType: function (type) {
that.filterType = type;
that.eTypeSelect.value = type;
},
setFilter: function (filter) {
filter = utils_1.Utils.makeNull(filter);
if (filter !== null && !(typeof filter === 'number')) {
filter = parseFloat(filter);
}
that.filterNumber = filter;
that.eFilterTextField.value = filter;
},
getType: function () {
return that.filterType;
},
getFilter: function () {
return that.filterNumber;
},
getModel: function () {
if (that.isFilterActive()) {
return {
type: that.filterType,
filter: that.filterNumber
};
}
else {
return null;
}
},
setModel: function (dataModel) {
if (dataModel) {
this.setType(dataModel.type);
this.setFilter(dataModel.filter);
}
else {
this.setFilter(null);
}
}
};
};
NumberFilter.prototype.getApi = function () {
return this.api;
};
return NumberFilter;
})();
exports.NumberFilter = NumberFilter;
/***/ },
/* 47 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var eventService_1 = __webpack_require__(4);
var Component = (function () {
function Component(template) {
this.destroyFunctions = [];
this.childComponents = [];
this.annotatedEventListeners = [];
if (template) {
this.setTemplate(template);
}
}
Component.prototype.instantiate = function (context) {
this.instantiateRecurse(this.getGui(), context);
};
Component.prototype.instantiateRecurse = function (parentNode, context) {
var childCount = parentNode.childNodes ? parentNode.childNodes.length : 0;
for (var i = 0; i < childCount; i++) {
var childNode = parentNode.childNodes[i];
var newComponent = context.createComponent(childNode);
if (newComponent) {
this.swapComponentForNode(newComponent, parentNode, childNode);
}
else {
if (childNode.childNodes) {
this.instantiateRecurse(childNode, context);
}
}
}
};
Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) {
parentNode.replaceChild(newComponent.getGui(), childNode);
this.childComponents.push(newComponent);
this.swapInComponentForQuerySelectors(newComponent, childNode);
};
Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) {
var metaData = this.__agComponentMetaData;
if (!metaData || !metaData.querySelectors) {
return;
}
var thisNoType = this;
metaData.querySelectors.forEach(function (querySelector) {
if (thisNoType[querySelector.attributeName] === childNode) {
thisNoType[querySelector.attributeName] = newComponent;
}
});
};
Component.prototype.setTemplate = function (template) {
this.eGui = utils_1.Utils.loadTemplate(template);
this.eGui.__agComponent = this;
this.addAnnotatedEventListeners();
this.wireQuerySelectors();
};
Component.prototype.wireQuerySelectors = function () {
var _this = this;
var metaData = this.__agComponentMetaData;
if (!metaData || !metaData.querySelectors) {
return;
}
if (!this.eGui) {
return;
}
var thisNoType = this;
metaData.querySelectors.forEach(function (querySelector) {
var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector);
if (resultOfQuery) {
var backingComponent = resultOfQuery.__agComponent;
if (backingComponent) {
thisNoType[querySelector.attributeName] = backingComponent;
}
else {
thisNoType[querySelector.attributeName] = resultOfQuery;
}
}
else {
}
});
};
Component.prototype.addAnnotatedEventListeners = function () {
var _this = this;
this.removeAnnotatedEventListeners();
var metaData = this.__agComponentMetaData;
if (!metaData || !metaData.listenerMethods) {
return;
}
if (!this.eGui) {
return;
}
if (!this.annotatedEventListeners) {
this.annotatedEventListeners = [];
}
metaData.listenerMethods.forEach(function (eventListener) {
var listener = _this[eventListener.methodName].bind(_this);
_this.eGui.addEventListener(eventListener.eventName, listener);
_this.annotatedEventListeners.push({ eventName: eventListener.eventName, listener: listener });
});
};
Component.prototype.removeAnnotatedEventListeners = function () {
var _this = this;
if (!this.annotatedEventListeners) {
return;
}
if (!this.eGui) {
return;
}
this.annotatedEventListeners.forEach(function (eventListener) {
_this.eGui.removeEventListener(eventListener.eventName, eventListener.listener);
});
this.annotatedEventListeners = null;
};
Component.prototype.addEventListener = function (eventType, listener) {
if (!this.localEventService) {
this.localEventService = new eventService_1.EventService();
}
this.localEventService.addEventListener(eventType, listener);
};
Component.prototype.removeEventListener = function (eventType, listener) {
if (this.localEventService) {
this.localEventService.removeEventListener(eventType, listener);
}
};
Component.prototype.dispatchEventAsync = function (eventType, event) {
var _this = this;
setTimeout(function () { return _this.dispatchEvent(eventType, event); }, 0);
};
Component.prototype.dispatchEvent = function (eventType, event) {
if (this.localEventService) {
this.localEventService.dispatchEvent(eventType, event);
}
};
Component.prototype.getGui = function () {
return this.eGui;
};
Component.prototype.queryForHtmlElement = function (cssSelector) {
return this.eGui.querySelector(cssSelector);
};
Component.prototype.queryForHtmlInputElement = function (cssSelector) {
return this.eGui.querySelector(cssSelector);
};
Component.prototype.appendChild = function (newChild) {
if (utils_1.Utils.isNodeOrElement(newChild)) {
this.eGui.appendChild(newChild);
}
else {
var childComponent = newChild;
this.eGui.appendChild(childComponent.getGui());
this.childComponents.push(childComponent);
}
};
Component.prototype.setVisible = function (visible) {
utils_1.Utils.addOrRemoveCssClass(this.eGui, 'ag-hidden', !visible);
};
Component.prototype.destroy = function () {
this.childComponents.forEach(function (childComponent) { return childComponent.destroy(); });
this.destroyFunctions.forEach(function (func) { return func(); });
this.removeAnnotatedEventListeners();
};
Component.prototype.addGuiEventListener = function (event, listener) {
var _this = this;
this.getGui().addEventListener(event, listener);
this.destroyFunctions.push(function () { return _this.getGui().removeEventListener(event, listener); });
};
Component.prototype.addDestroyableEventListener = function (eElement, event, listener) {
if (eElement instanceof HTMLElement) {
eElement.addEventListener(event, listener);
}
else {
eElement.addEventListener(event, listener);
}
this.destroyFunctions.push(function () {
if (eElement instanceof HTMLElement) {
eElement.removeEventListener(event, listener);
}
else {
eElement.removeEventListener(event, listener);
}
});
};
Component.prototype.addDestroyFunc = function (func) {
this.destroyFunctions.push(func);
};
Component.prototype.addCssClass = function (className) {
utils_1.Utils.addCssClass(this.getGui(), className);
};
Component.prototype.getAttribute = function (key) {
var eGui = this.getGui();
if (eGui) {
return eGui.getAttribute(key);
}
else {
return null;
}
};
return Component;
})();
exports.Component = Component;
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var textCellEditor_1 = __webpack_require__(49);
var selectCellEditor_1 = __webpack_require__(50);
var popupEditorWrapper_1 = __webpack_require__(51);
var popupTextCellEditor_1 = __webpack_require__(52);
var popupSelectCellEditor_1 = __webpack_require__(53);
var dateCellEditor_1 = __webpack_require__(54);
var gridOptionsWrapper_1 = __webpack_require__(3);
var CellEditorFactory = (function () {
function CellEditorFactory() {
this.cellEditorMap = {};
}
CellEditorFactory.prototype.init = function () {
this.cellEditorMap[CellEditorFactory.TEXT] = textCellEditor_1.TextCellEditor;
this.cellEditorMap[CellEditorFactory.SELECT] = selectCellEditor_1.SelectCellEditor;
this.cellEditorMap[CellEditorFactory.POPUP_TEXT] = popupTextCellEditor_1.PopupTextCellEditor;
this.cellEditorMap[CellEditorFactory.POPUP_SELECT] = popupSelectCellEditor_1.PopupSelectCellEditor;
this.cellEditorMap[CellEditorFactory.DATE] = dateCellEditor_1.DateCellEditor;
};
CellEditorFactory.prototype.addCellEditor = function (key, cellEditor) {
this.cellEditorMap[key] = cellEditor;
};
// private registerEditorsFromGridOptions(): void {
// var userProvidedCellEditors = this.gridOptionsWrapper.getCellEditors();
// _.iterateObject(userProvidedCellEditors, (key: string, cellEditor: {new(): ICellEditor})=> {
// this.addCellEditor(key, cellEditor);
// });
// }
CellEditorFactory.prototype.createCellEditor = function (key) {
var CellEditorClass;
if (utils_1.Utils.missing(key)) {
CellEditorClass = this.cellEditorMap[CellEditorFactory.TEXT];
}
else if (typeof key === 'string') {
CellEditorClass = this.cellEditorMap[key];
if (utils_1.Utils.missing(CellEditorClass)) {
console.warn('ag-Grid: unable to find cellEditor for key ' + key);
CellEditorClass = this.cellEditorMap[CellEditorFactory.TEXT];
}
}
else {
CellEditorClass = key;
}
var cellEditor = new CellEditorClass();
this.context.wireBean(cellEditor);
if (cellEditor.isPopup && cellEditor.isPopup()) {
cellEditor = new popupEditorWrapper_1.PopupEditorWrapper(cellEditor);
}
return cellEditor;
};
CellEditorFactory.TEXT = 'text';
CellEditorFactory.SELECT = 'select';
CellEditorFactory.DATE = 'date';
CellEditorFactory.POPUP_TEXT = 'popupText';
CellEditorFactory.POPUP_SELECT = 'popupSelect';
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], CellEditorFactory.prototype, "context", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], CellEditorFactory.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], CellEditorFactory.prototype, "init", null);
CellEditorFactory = __decorate([
context_1.Bean('cellEditorFactory'),
__metadata('design:paramtypes', [])
], CellEditorFactory);
return CellEditorFactory;
})();
exports.CellEditorFactory = CellEditorFactory;
/***/ },
/* 49 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var constants_1 = __webpack_require__(8);
var component_1 = __webpack_require__(47);
var utils_1 = __webpack_require__(7);
var TextCellEditor = (function (_super) {
__extends(TextCellEditor, _super);
function TextCellEditor() {
_super.call(this, TextCellEditor.TEMPLATE);
}
TextCellEditor.prototype.init = function (params) {
var eInput = this.getGui();
var startValue;
var keyPressBackspaceOrDelete = params.keyPress === constants_1.Constants.KEY_BACKSPACE
|| params.keyPress === constants_1.Constants.KEY_DELETE;
if (keyPressBackspaceOrDelete) {
startValue = '';
}
else if (params.charPress) {
startValue = params.charPress;
}
else {
startValue = params.value;
if (params.keyPress === constants_1.Constants.KEY_F2) {
this.putCursorAtEndOnFocus = true;
}
else {
this.highlightAllOnFocus = true;
}
}
if (utils_1.Utils.exists(startValue)) {
eInput.value = startValue;
}
this.addDestroyableEventListener(eInput, 'keydown', function (event) {
var isNavigationKey = event.keyCode === constants_1.Constants.KEY_LEFT || event.keyCode === constants_1.Constants.KEY_RIGHT;
if (isNavigationKey) {
event.stopPropagation();
}
});
};
TextCellEditor.prototype.afterGuiAttached = function () {
var eInput = this.getGui();
eInput.focus();
if (this.highlightAllOnFocus) {
eInput.select();
}
else {
// when we started editing, we want the carot at the end, not the start.
// this comes into play in two scenarios: a) when user hits F2 and b)
// when user hits a printable character, then on IE (and only IE) the carot
// was placed after the first character, thus 'apply' would end up as 'pplea'
var length = eInput.value ? eInput.value.length : 0;
if (length > 0) {
eInput.setSelectionRange(length, length);
}
}
};
TextCellEditor.prototype.getValue = function () {
var eInput = this.getGui();
return eInput.value;
};
TextCellEditor.TEMPLATE = '<input class="ag-cell-edit-input" type="text"/>';
return TextCellEditor;
})(component_1.Component);
exports.TextCellEditor = TextCellEditor;
/***/ },
/* 50 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var component_1 = __webpack_require__(47);
var utils_1 = __webpack_require__(7);
var SelectCellEditor = (function (_super) {
__extends(SelectCellEditor, _super);
function SelectCellEditor() {
_super.call(this, '<div class="ag-cell-edit-input"><select class="ag-cell-edit-input"/></div>');
}
SelectCellEditor.prototype.init = function (params) {
var eSelect = this.getGui().querySelector('select');
if (utils_1.Utils.missing(params.values)) {
console.log('ag-Grid: no values found for select cellEditor');
return;
}
params.values.forEach(function (value) {
var option = document.createElement('option');
option.value = value;
option.text = value;
if (params.value === value) {
option.selected = true;
}
eSelect.appendChild(option);
});
this.addDestroyableEventListener(eSelect, 'change', function () { return params.stopEditing(); });
};
SelectCellEditor.prototype.afterGuiAttached = function () {
var eSelect = this.getGui().querySelector('select');
eSelect.focus();
};
SelectCellEditor.prototype.getValue = function () {
var eSelect = this.getGui().querySelector('select');
return eSelect.value;
};
return SelectCellEditor;
})(component_1.Component);
exports.SelectCellEditor = SelectCellEditor;
/***/ },
/* 51 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var component_1 = __webpack_require__(47);
var PopupEditorWrapper = (function (_super) {
__extends(PopupEditorWrapper, _super);
function PopupEditorWrapper(cellEditor) {
_super.call(this, '<div class="ag-popup-editor"/>');
this.getGuiCalledOnChild = false;
this.cellEditor = cellEditor;
this.addDestroyFunc(function () { return cellEditor.destroy(); });
this.addDestroyableEventListener(
// this needs to be 'super' and not 'this' as if we call 'this',
// it ends up called 'getGui()' on the child before 'init' was called,
// which is not good
_super.prototype.getGui.call(this), 'keydown', this.onKeyDown.bind(this));
}
PopupEditorWrapper.prototype.onKeyDown = function (event) {
this.params.onKeyDown(event);
};
PopupEditorWrapper.prototype.getGui = function () {
// we call getGui() on child here (rather than in the constructor)
// as we should wait for 'init' to be called on child first.
if (!this.getGuiCalledOnChild) {
this.appendChild(this.cellEditor.getGui());
this.getGuiCalledOnChild = true;
}
return _super.prototype.getGui.call(this);
};
PopupEditorWrapper.prototype.init = function (params) {
this.params = params;
if (this.cellEditor.init) {
this.cellEditor.init(params);
}
};
PopupEditorWrapper.prototype.afterGuiAttached = function () {
if (this.cellEditor.afterGuiAttached) {
this.cellEditor.afterGuiAttached();
}
};
PopupEditorWrapper.prototype.getValue = function () {
return this.cellEditor.getValue();
};
PopupEditorWrapper.prototype.isPopup = function () {
return true;
};
PopupEditorWrapper.prototype.isCancelBeforeStart = function () {
if (this.cellEditor.isCancelBeforeStart) {
return this.cellEditor.isCancelBeforeStart();
}
};
PopupEditorWrapper.prototype.isCancelAfterEnd = function () {
if (this.cellEditor.isCancelAfterEnd) {
return this.cellEditor.isCancelAfterEnd();
}
};
return PopupEditorWrapper;
})(component_1.Component);
exports.PopupEditorWrapper = PopupEditorWrapper;
/***/ },
/* 52 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var textCellEditor_1 = __webpack_require__(49);
var PopupTextCellEditor = (function (_super) {
__extends(PopupTextCellEditor, _super);
function PopupTextCellEditor() {
_super.apply(this, arguments);
}
PopupTextCellEditor.prototype.isPopup = function () {
return true;
};
return PopupTextCellEditor;
})(textCellEditor_1.TextCellEditor);
exports.PopupTextCellEditor = PopupTextCellEditor;
/***/ },
/* 53 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var selectCellEditor_1 = __webpack_require__(50);
var PopupSelectCellEditor = (function (_super) {
__extends(PopupSelectCellEditor, _super);
function PopupSelectCellEditor() {
_super.apply(this, arguments);
}
PopupSelectCellEditor.prototype.isPopup = function () {
return true;
};
return PopupSelectCellEditor;
})(selectCellEditor_1.SelectCellEditor);
exports.PopupSelectCellEditor = PopupSelectCellEditor;
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var component_1 = __webpack_require__(47);
var context_1 = __webpack_require__(6);
var popupService_1 = __webpack_require__(44);
var utils_1 = __webpack_require__(7);
var DateCellEditor = (function (_super) {
__extends(DateCellEditor, _super);
function DateCellEditor() {
_super.call(this, DateCellEditor.TEMPLATE);
this.eText = this.queryForHtmlInputElement('input');
this.eButton = this.queryForHtmlElement('button');
this.eButton.addEventListener('click', this.onBtPush.bind(this));
}
DateCellEditor.prototype.getValue = function () {
return this.eText.value;
};
DateCellEditor.prototype.onBtPush = function () {
var ePopup = utils_1.Utils.loadTemplate('<div style="position: absolute; border: 1px solid darkgreen; background: lightcyan">' +
'<div>This is the popup</div>' +
'<div><input/></div>' +
'<div>Under the input</div>' +
'</div>');
this.popupService.addAsModalPopup(ePopup, true, function () {
console.log('popup was closed');
});
this.popupService.positionPopupUnderComponent({
eventSource: this.getGui(),
ePopup: ePopup
});
var eText = ePopup.querySelector('input');
eText.focus();
};
DateCellEditor.prototype.afterGuiAttached = function () {
this.eText.focus();
};
DateCellEditor.TEMPLATE = '<span>' +
'<input type="text" style="width: 80%"/>' +
'<button style="width: 20%">+</button>' +
'</span>';
__decorate([
context_1.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], DateCellEditor.prototype, "popupService", void 0);
return DateCellEditor;
})(component_1.Component);
exports.DateCellEditor = DateCellEditor;
/***/ },
/* 55 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var eventService_1 = __webpack_require__(4);
var expressionService_1 = __webpack_require__(18);
var animateSlideCellRenderer_1 = __webpack_require__(56);
var animateShowChangeCellRenderer_1 = __webpack_require__(57);
var groupCellRenderer_1 = __webpack_require__(58);
var CellRendererFactory = (function () {
function CellRendererFactory() {
this.cellRendererMap = {};
}
CellRendererFactory.prototype.init = function () {
this.cellRendererMap[CellRendererFactory.ANIMATE_SLIDE] = animateSlideCellRenderer_1.AnimateSlideCellRenderer;
this.cellRendererMap[CellRendererFactory.ANIMATE_SHOW_CHANGE] = animateShowChangeCellRenderer_1.AnimateShowChangeCellRenderer;
this.cellRendererMap[CellRendererFactory.GROUP] = groupCellRenderer_1.GroupCellRenderer;
// this.registerRenderersFromGridOptions();
};
// private registerRenderersFromGridOptions(): void {
// var userProvidedCellRenderers = this.gridOptionsWrapper.getCellRenderers();
// _.iterateObject(userProvidedCellRenderers, (key: string, cellRenderer: {new(): ICellRenderer} | ICellRendererFunc)=> {
// this.addCellRenderer(key, cellRenderer);
// });
// }
CellRendererFactory.prototype.addCellRenderer = function (key, cellRenderer) {
this.cellRendererMap[key] = cellRenderer;
};
CellRendererFactory.prototype.getCellRenderer = function (key) {
var result = this.cellRendererMap[key];
if (utils_1.Utils.missing(result)) {
console.warn('ag-Grid: unable to find cellRenderer for key ' + key);
return null;
}
return result;
};
CellRendererFactory.ANIMATE_SLIDE = 'animateSlide';
CellRendererFactory.ANIMATE_SHOW_CHANGE = 'animateShowChange';
CellRendererFactory.GROUP = 'group';
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], CellRendererFactory.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], CellRendererFactory.prototype, "expressionService", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], CellRendererFactory.prototype, "eventService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], CellRendererFactory.prototype, "init", null);
CellRendererFactory = __decorate([
context_1.Bean('cellRendererFactory'),
__metadata('design:paramtypes', [])
], CellRendererFactory);
return CellRendererFactory;
})();
exports.CellRendererFactory = CellRendererFactory;
/***/ },
/* 56 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var utils_1 = __webpack_require__(7);
var component_1 = __webpack_require__(47);
var AnimateSlideCellRenderer = (function (_super) {
__extends(AnimateSlideCellRenderer, _super);
function AnimateSlideCellRenderer() {
_super.call(this, AnimateSlideCellRenderer.TEMPLATE);
this.refreshCount = 0;
this.eCurrent = this.queryForHtmlElement('.ag-value-slide-current');
}
AnimateSlideCellRenderer.prototype.init = function (params) {
this.params = params;
this.refresh(params);
};
AnimateSlideCellRenderer.prototype.addSlideAnimation = function () {
var _this = this;
this.refreshCount++;
// below we keep checking this, and stop working on the animation
// if it no longer matches - this means another animation has started
// and this one is stale.
var refreshCountCopy = this.refreshCount;
// if old animation, remove it
if (this.ePrevious) {
this.getGui().removeChild(this.ePrevious);
}
this.ePrevious = utils_1.Utils.loadTemplate('<span class="ag-value-slide-previous ag-fade-out"></span>');
this.ePrevious.innerHTML = this.eCurrent.innerHTML;
this.getGui().insertBefore(this.ePrevious, this.eCurrent);
// having timeout of 0 allows use to skip to the next css turn,
// so we know the previous css classes have been applied. so the
// complex set of setTimeout below creates the animation
setTimeout(function () {
if (refreshCountCopy !== _this.refreshCount) {
return;
}
utils_1.Utils.addCssClass(_this.ePrevious, 'ag-fade-out-end');
}, 50);
setTimeout(function () {
if (refreshCountCopy !== _this.refreshCount) {
return;
}
_this.getGui().removeChild(_this.ePrevious);
_this.ePrevious = null;
}, 3000);
};
AnimateSlideCellRenderer.prototype.refresh = function (params) {
var value = params.value;
if (utils_1.Utils.missing(value)) {
value = '';
}
if (value === this.lastValue) {
return;
}
this.addSlideAnimation();
this.lastValue = value;
if (utils_1.Utils.exists(params.valueFormatted)) {
this.eCurrent.innerHTML = params.valueFormatted;
}
else if (utils_1.Utils.exists(params.value)) {
this.eCurrent.innerHTML = value;
}
else {
this.eCurrent.innerHTML = '';
}
};
AnimateSlideCellRenderer.TEMPLATE = '<span>' +
'<span class="ag-value-slide-current"></span>' +
'</span>';
return AnimateSlideCellRenderer;
})(component_1.Component);
exports.AnimateSlideCellRenderer = AnimateSlideCellRenderer;
/***/ },
/* 57 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var utils_1 = __webpack_require__(7);
var component_1 = __webpack_require__(47);
var ARROW_UP = '↑';
var ARROW_DOWN = '↓';
var AnimateShowChangeCellRenderer = (function (_super) {
__extends(AnimateShowChangeCellRenderer, _super);
function AnimateShowChangeCellRenderer() {
_super.call(this, AnimateShowChangeCellRenderer.TEMPLATE);
this.refreshCount = 0;
}
AnimateShowChangeCellRenderer.prototype.init = function (params) {
this.params = params;
this.eValue = this.queryForHtmlElement('.ag-value-change-value');
this.eDelta = this.queryForHtmlElement('.ag-value-change-delta');
this.refresh(params);
};
AnimateShowChangeCellRenderer.prototype.showDelta = function (params, delta) {
var absDelta = Math.abs(delta);
var valueFormatted = params.formatValue(absDelta);
var valueToUse = utils_1.Utils.exists(valueFormatted) ? valueFormatted : absDelta;
var deltaUp = (delta >= 0);
if (deltaUp) {
this.eDelta.innerHTML = ARROW_UP + valueToUse;
}
else {
// because negative, use ABS to remove sign
this.eDelta.innerHTML = ARROW_DOWN + valueToUse;
}
// class makes it green (in ag-fresh)
utils_1.Utils.addOrRemoveCssClass(this.eDelta, 'ag-value-change-delta-up', deltaUp);
// class makes it red (in ag-fresh)
utils_1.Utils.addOrRemoveCssClass(this.eDelta, 'ag-value-change-delta-down', !deltaUp);
};
AnimateShowChangeCellRenderer.prototype.setTimerToRemoveDelta = function () {
var _this = this;
// the refreshCount makes sure that if the value updates again while
// the below timer is waiting, then the below timer will realise it
// is not the most recent and will not try to remove the delta value.
this.refreshCount++;
var refreshCountCopy = this.refreshCount;
setTimeout(function () {
if (refreshCountCopy === _this.refreshCount) {
_this.hideDeltaValue();
}
}, 2000);
};
AnimateShowChangeCellRenderer.prototype.hideDeltaValue = function () {
utils_1.Utils.removeCssClass(this.eValue, 'ag-value-change-value-highlight');
this.eDelta.innerHTML = '';
};
AnimateShowChangeCellRenderer.prototype.refresh = function (params) {
var value = params.value;
if (value === this.lastValue) {
return;
}
if (utils_1.Utils.exists(params.valueFormatted)) {
this.eValue.innerHTML = params.valueFormatted;
}
else if (utils_1.Utils.exists(params.value)) {
this.eValue.innerHTML = value;
}
else {
this.eValue.innerHTML = '';
}
if (typeof value === 'number' && typeof this.lastValue === 'number') {
var delta = value - this.lastValue;
this.showDelta(params, delta);
}
// highlight the current value, but only if it's not new, otherwise it
// would get highlighted first time the value is shown
if (this.lastValue) {
utils_1.Utils.addCssClass(this.eValue, 'ag-value-change-value-highlight');
}
this.setTimerToRemoveDelta();
this.lastValue = value;
};
AnimateShowChangeCellRenderer.TEMPLATE = '<span>' +
'<span class="ag-value-change-delta"></span>' +
'<span class="ag-value-change-value"></span>' +
'</span>';
return AnimateShowChangeCellRenderer;
})(component_1.Component);
exports.AnimateShowChangeCellRenderer = AnimateShowChangeCellRenderer;
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var svgFactory_1 = __webpack_require__(59);
var gridOptionsWrapper_1 = __webpack_require__(3);
var expressionService_1 = __webpack_require__(18);
var eventService_1 = __webpack_require__(4);
var constants_1 = __webpack_require__(8);
var utils_1 = __webpack_require__(7);
var events_1 = __webpack_require__(10);
var context_1 = __webpack_require__(6);
var component_1 = __webpack_require__(47);
var cellRendererService_1 = __webpack_require__(60);
var valueFormatterService_1 = __webpack_require__(61);
var checkboxSelectionComponent_1 = __webpack_require__(62);
var columnController_1 = __webpack_require__(13);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var GroupCellRenderer = (function (_super) {
__extends(GroupCellRenderer, _super);
function GroupCellRenderer() {
_super.call(this, GroupCellRenderer.TEMPLATE);
this.eExpanded = this.queryForHtmlElement('.ag-group-expanded');
this.eContracted = this.queryForHtmlElement('.ag-group-contracted');
this.eCheckbox = this.queryForHtmlElement('.ag-group-checkbox');
this.eValue = this.queryForHtmlElement('.ag-group-value');
this.eChildCount = this.queryForHtmlElement('.ag-group-child-count');
}
GroupCellRenderer.prototype.init = function (params) {
this.rowNode = params.node;
this.rowIndex = params.rowIndex;
this.gridApi = params.api;
this.addExpandAndContract(params.eGridCell);
this.addCheckboxIfNeeded(params);
this.addValueElement(params);
this.addPadding(params);
};
GroupCellRenderer.prototype.addPadding = function (params) {
// only do this if an indent - as this overwrites the padding that
// the theme set, which will make things look 'not aligned' for the
// first group level.
var node = this.rowNode;
var suppressPadding = params.suppressPadding;
if (!suppressPadding && (node.footer || node.level > 0)) {
var paddingFactor;
if (params.colDef && params.padding >= 0) {
paddingFactor = params.padding;
}
else {
paddingFactor = 10;
}
var paddingPx = node.level * paddingFactor;
var reducedLeafNode = this.columnController.isPivotMode() && this.rowNode.leafGroup;
if (node.footer) {
paddingPx += 15;
}
else if (!node.group || reducedLeafNode) {
paddingPx += 10;
}
this.getGui().style.paddingLeft = paddingPx + 'px';
}
};
GroupCellRenderer.prototype.addValueElement = function (params) {
if (params.innerRenderer) {
this.createFromInnerRenderer(params);
}
else if (this.rowNode.footer) {
this.createFooterCell(params);
}
else if (this.rowNode.group) {
this.createGroupCell(params);
this.addChildCount(params);
}
else {
this.createLeafCell(params);
}
};
GroupCellRenderer.prototype.createFromInnerRenderer = function (params) {
this.cellRendererService.useCellRenderer(params.innerRenderer, this.eValue, params);
};
GroupCellRenderer.prototype.createFooterCell = function (params) {
var footerValue;
var groupName = this.getGroupName(params);
if (params.footerValueGetter) {
var footerValueGetter = params.footerValueGetter;
// params is same as we were given, except we set the value as the item to display
var paramsClone = utils_1.Utils.cloneObject(params);
paramsClone.value = groupName;
if (typeof footerValueGetter === 'function') {
footerValue = footerValueGetter(paramsClone);
}
else if (typeof footerValueGetter === 'string') {
footerValue = this.expressionService.evaluate(footerValueGetter, paramsClone);
}
else {
console.warn('ag-Grid: footerValueGetter should be either a function or a string (expression)');
}
}
else {
footerValue = 'Total ' + groupName;
}
this.eValue.innerHTML = footerValue;
};
GroupCellRenderer.prototype.createGroupCell = function (params) {
// pull out the column that the grouping is on
var rowGroupColumns = params.columnApi.getRowGroupColumns();
// if we are using in memory grid grouping, then we try to look up the column that
// we did the grouping on. however if it is not possible (happens when user provides
// the data already grouped) then we just the current col, ie use cellrenderer of current col
var columnOfGroupedCol = rowGroupColumns[params.node.level];
if (utils_1.Utils.missing(columnOfGroupedCol)) {
columnOfGroupedCol = params.column;
}
var colDefOfGroupedCol = columnOfGroupedCol.getColDef();
var groupName = this.getGroupName(params);
var valueFormatted = this.valueFormatterService.formatValue(columnOfGroupedCol, params.node, params.scope, this.rowIndex, groupName);
// reuse the params but change the value
if (colDefOfGroupedCol && typeof colDefOfGroupedCol.cellRenderer === 'function') {
// reuse the params but change the value
params.value = groupName;
params.valueFormatted = valueFormatted;
// because we are talking about the different column to the original, any user provided params
// are for the wrong column, so need to copy them in again.
if (colDefOfGroupedCol.cellRendererParams) {
utils_1.Utils.assign(params, colDefOfGroupedCol.cellRendererParams);
}
this.cellRendererService.useCellRenderer(colDefOfGroupedCol.cellRenderer, this.eValue, params);
}
else {
var valueToRender = utils_1.Utils.exists(valueFormatted) ? valueFormatted : groupName;
if (utils_1.Utils.exists(valueToRender) && valueToRender !== '') {
this.eValue.appendChild(document.createTextNode(valueToRender));
}
}
};
GroupCellRenderer.prototype.addChildCount = function (params) {
// only include the child count if it's included, eg if user doing custom aggregation,
// then this could be left out, or set to -1, ie no child count
var suppressCount = params.suppressCount;
if (!suppressCount && params.node.allChildrenCount >= 0) {
this.eChildCount.innerHTML = "(" + params.node.allChildrenCount + ")";
}
};
GroupCellRenderer.prototype.getGroupName = function (params) {
if (params.keyMap && typeof params.keyMap === 'object') {
var valueFromMap = params.keyMap[params.node.key];
if (valueFromMap) {
return valueFromMap;
}
else {
return params.node.key;
}
}
else {
return params.node.key;
}
};
GroupCellRenderer.prototype.createLeafCell = function (params) {
if (utils_1.Utils.exists(params.value)) {
this.eValue.innerHTML = params.value;
}
};
GroupCellRenderer.prototype.addCheckboxIfNeeded = function (params) {
var checkboxNeeded = params.checkbox && !this.rowNode.footer && !this.rowNode.floating;
if (checkboxNeeded) {
var cbSelectionComponent = new checkboxSelectionComponent_1.CheckboxSelectionComponent();
this.context.wireBean(cbSelectionComponent);
cbSelectionComponent.init({ rowNode: this.rowNode });
this.eCheckbox.appendChild(cbSelectionComponent.getGui());
this.addDestroyFunc(function () { return cbSelectionComponent.destroy(); });
}
};
GroupCellRenderer.prototype.addExpandAndContract = function (eGroupCell) {
var eExpandedIcon = utils_1.Utils.createIconNoSpan('groupExpanded', this.gridOptionsWrapper, null, svgFactory.createGroupContractedIcon);
var eContractedIcon = utils_1.Utils.createIconNoSpan('groupContracted', this.gridOptionsWrapper, null, svgFactory.createGroupExpandedIcon);
this.eExpanded.appendChild(eExpandedIcon);
this.eContracted.appendChild(eContractedIcon);
this.addDestroyableEventListener(this.eExpanded, 'click', this.onExpandOrContract.bind(this));
this.addDestroyableEventListener(this.eContracted, 'click', this.onExpandOrContract.bind(this));
this.addDestroyableEventListener(eGroupCell, 'dblclick', this.onExpandOrContract.bind(this));
// expand / contract as the user hits enter
this.addDestroyableEventListener(eGroupCell, 'keydown', this.onKeyDown.bind(this));
this.showExpandAndContractIcons();
};
GroupCellRenderer.prototype.onKeyDown = function (event) {
if (utils_1.Utils.isKeyPressed(event, constants_1.Constants.KEY_ENTER)) {
this.onExpandOrContract();
event.preventDefault();
}
};
GroupCellRenderer.prototype.onExpandOrContract = function () {
this.rowNode.expanded = !this.rowNode.expanded;
var refreshIndex = this.getRefreshFromIndex();
this.gridApi.onGroupExpandedOrCollapsed(refreshIndex);
this.showExpandAndContractIcons();
var event = { node: this.rowNode };
this.eventService.dispatchEvent(events_1.Events.EVENT_ROW_GROUP_OPENED, event);
};
GroupCellRenderer.prototype.showExpandAndContractIcons = function () {
var reducedLeafNode = this.columnController.isPivotMode() && this.rowNode.leafGroup;
var expandable = this.rowNode.group && !this.rowNode.footer && !reducedLeafNode;
if (expandable) {
// if expandable, show one based on expand state
utils_1.Utils.setVisible(this.eExpanded, this.rowNode.expanded);
utils_1.Utils.setVisible(this.eContracted, !this.rowNode.expanded);
}
else {
// it not expandable, show neither
utils_1.Utils.setVisible(this.eExpanded, false);
utils_1.Utils.setVisible(this.eContracted, false);
}
};
// if we are showing footers, then opening / closing the group also changes the group
// row, as the 'summaries' move to and from the header and footer. if not using footers,
// then we only need to refresh from this row down.
GroupCellRenderer.prototype.getRefreshFromIndex = function () {
if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
return this.rowIndex;
}
else {
return this.rowIndex + 1;
}
};
GroupCellRenderer.TEMPLATE = '<span>' +
'<span class="ag-group-expanded"></span>' +
'<span class="ag-group-contracted"></span>' +
'<span class="ag-group-checkbox"></span>' +
'<span class="ag-group-value"></span>' +
'<span class="ag-group-child-count"></span>' +
'</span>';
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], GroupCellRenderer.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], GroupCellRenderer.prototype, "expressionService", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], GroupCellRenderer.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('cellRendererService'),
__metadata('design:type', cellRendererService_1.CellRendererService)
], GroupCellRenderer.prototype, "cellRendererService", void 0);
__decorate([
context_1.Autowired('valueFormatterService'),
__metadata('design:type', valueFormatterService_1.ValueFormatterService)
], GroupCellRenderer.prototype, "valueFormatterService", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], GroupCellRenderer.prototype, "context", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], GroupCellRenderer.prototype, "columnController", void 0);
return GroupCellRenderer;
})(component_1.Component);
exports.GroupCellRenderer = GroupCellRenderer;
/***/ },
/* 59 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var SVG_NS = "http://www.w3.org/2000/svg";
var SvgFactory = (function () {
function SvgFactory() {
}
SvgFactory.getInstance = function () {
if (!this.theInstance) {
this.theInstance = new SvgFactory();
}
return this.theInstance;
};
SvgFactory.prototype.createFilterSvg = function () {
var eSvg = createIconSvg();
var eFunnel = document.createElementNS(SVG_NS, "polygon");
eFunnel.setAttribute("points", "0,0 4,4 4,10 6,10 6,4 10,0");
eFunnel.setAttribute("class", "ag-header-icon");
eSvg.appendChild(eFunnel);
return eSvg;
};
SvgFactory.prototype.createFilterSvg12 = function () {
var eSvg = createIconSvg(12);
var eFunnel = document.createElementNS(SVG_NS, "polygon");
eFunnel.setAttribute("points", "0,0 5,5 5,12 7,12 7,5 12,0");
eFunnel.setAttribute("class", "ag-header-icon");
eSvg.appendChild(eFunnel);
return eSvg;
};
SvgFactory.prototype.createMenuSvg = function () {
var eSvg = document.createElementNS(SVG_NS, "svg");
var size = "12";
eSvg.setAttribute("width", size);
eSvg.setAttribute("height", size);
["0", "5", "10"].forEach(function (y) {
var eLine = document.createElementNS(SVG_NS, "rect");
eLine.setAttribute("y", y);
eLine.setAttribute("width", size);
eLine.setAttribute("height", "2");
eLine.setAttribute("class", "ag-header-icon");
eSvg.appendChild(eLine);
});
return eSvg;
};
SvgFactory.prototype.createColumnsSvg12 = function () {
var eSvg = createIconSvg(12);
[0, 4, 8].forEach(function (y) {
[0, 7].forEach(function (x) {
var eBar = document.createElementNS(SVG_NS, "rect");
eBar.setAttribute("y", y.toString());
eBar.setAttribute("x", x.toString());
eBar.setAttribute("width", "5");
eBar.setAttribute("height", "3");
eBar.setAttribute("class", "ag-header-icon");
eSvg.appendChild(eBar);
});
});
return eSvg;
};
SvgFactory.prototype.createArrowUpSvg = function () {
return createPolygonSvg("0,10 5,0 10,10");
};
SvgFactory.prototype.createArrowLeftSvg = function () {
return createPolygonSvg("10,0 0,5 10,10");
};
SvgFactory.prototype.createArrowDownSvg = function () {
return createPolygonSvg("0,0 5,10 10,0");
};
SvgFactory.prototype.createArrowRightSvg = function () {
return createPolygonSvg("0,0 10,5 0,10");
};
SvgFactory.prototype.createSmallArrowRightSvg = function () {
return createPolygonSvg("0,0 6,3 0,6", 6);
};
SvgFactory.prototype.createSmallArrowDownSvg = function () {
return createPolygonSvg("0,0 3,6 6,0", 6);
};
//public createOpenSvg() {
// return createPlusMinus(true);
//}
//
//public createCloseSvg() {
// return createPlusMinus(false);
//}
// UnSort Icon SVG
SvgFactory.prototype.createArrowUpDownSvg = function () {
var svg = createIconSvg();
var eAscIcon = document.createElementNS(SVG_NS, "polygon");
eAscIcon.setAttribute("points", '0,4 5,0 10,4');
svg.appendChild(eAscIcon);
var eDescIcon = document.createElementNS(SVG_NS, "polygon");
eDescIcon.setAttribute("points", '0,6 5,10 10,6');
svg.appendChild(eDescIcon);
return svg;
};
//public createFolderOpen(size: number): HTMLElement {
// var svg = `<svg width="${size}" height="${size}" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1717 931q0-35-53-35h-1088q-40 0-85.5 21.5t-71.5 52.5l-294 363q-18 24-18 40 0 35 53 35h1088q40 0 86-22t71-53l294-363q18-22 18-39zm-1141-163h768v-160q0-40-28-68t-68-28h-576q-40 0-68-28t-28-68v-64q0-40-28-68t-68-28h-320q-40 0-68 28t-28 68v853l256-315q44-53 116-87.5t140-34.5zm1269 163q0 62-46 120l-295 363q-43 53-116 87.5t-140 34.5h-1088q-92 0-158-66t-66-158v-960q0-92 66-158t158-66h320q92 0 158 66t66 158v32h544q92 0 158 66t66 158v160h192q54 0 99 24.5t67 70.5q15 32 15 68z"/></svg>`;
// return _.loadTemplate(svg);
//}
//
//public createFolderClosed(size: number): HTMLElement {
// var svg = `<svg width="${size}" height="${size}" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1600 1312v-704q0-40-28-68t-68-28h-704q-40 0-68-28t-28-68v-64q0-40-28-68t-68-28h-320q-40 0-68 28t-28 68v960q0 40 28 68t68 28h1216q40 0 68-28t28-68zm128-704v704q0 92-66 158t-158 66h-1216q-92 0-158-66t-66-158v-960q0-92 66-158t158-66h320q92 0 158 66t66 158v32h672q92 0 158 66t66 158z"/></svg>`;
// return _.loadTemplate(svg);
//}
SvgFactory.prototype.createFolderOpen = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZpJREFUeNqkU0tLQkEUPjN3ShAzF66CaNGiaNEviFpLgbSpXf2ACIqgFkELaVFhtAratQ8qokU/oFVbMQtJvWpWGvYwtet9TWfu1QorvOGBb84M5/WdOTOEcw7tCKHBlT8sMIhr4BfLGXC4BrALM8QUoveHG9oPQ/NhwVCQbOjp0C5F6zDiwE7Aed/p5tKWruufTlY8bkqliqVN8wvH6wvhydWd5UYdkYCqqgaKotQTCEewnJuDBSqVmshOrWhKgCJVqeHcKtiGKdqTgGIOQmwGum7AxVUKinXKzX1/1y5Xp6g8gpe8iBxuGZhcKjyXQZIkmBkfczS62YnRQCKX75/b3t8QDNhD8QX83V5Ipe7Bybug2Pt5NJ7A4nEqGOQKT+Bzu0HTDNB1syUYYxCJy0kwzIRogb0rKjAiQVXXHLVQrqqvsZtsFu8hbyXwe73WeMQtO5GonJGxuiyeC+Oa4fF5PEirw9nbx9FdxtN5eMwkzcgRnoeCa9DVM/CvH/R2l+axkz3clQguOFjw1f+FUzEQCqJG2v3OHwIMAOW1JPnAAAJxAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createFolderClosed = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARlJREFUeNqsUz1PwzAUPDtOUASpYKkQVWcQA/+DhbLA32CoKAMSTAwgFsQfQWLoX4GRDFXGIiqiyk4e7wUWmg8phJPOtvzunc6WrYgIXaD06KKhij0eD2uqUxBeDC9OmcNKCYd7ujm7ryodXz5ong6UPpqcP9+O76y1vwS+7yOOY1jr0OttlQyiaB0n148TAyK9XFqkaboiSTEYDNnkDUkyKxkkiSQkzQbwsiyHcBXz+Tv6/W1m+QiSEDT1igTO5RBWYbH4rNwPw/AnQU5ek0EdCj33SgLjHEHYzoAkgfmHBDmZuktsQqHPvxN0MyCbbWjtIQjWWhlIj/QqtT+6QrSz+6ef9DF7VTwFzE2madnu5K2prt/5S4ABADcIlSf6Ag8YAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createColumnIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAOCAYAAAAMn20lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RTcwQ0JFMzlENjZEMTFFNUFEQ0U5RDRCNjFFRENGMUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RTcwQ0JFM0FENjZEMTFFNUFEQ0U5RDRCNjFFRENGMUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFNzBDQkUzN0Q2NkQxMUU1QURDRTlENEI2MUVEQ0YxQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFNzBDQkUzOEQ2NkQxMUU1QURDRTlENEI2MUVEQ0YxQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqDOrJYAAABxSURBVHjalJBBDsAgCAQXxXvj2/o/X9Cvmd4lUpV4MXroJMTAuihQSklVMSCysxSBW4uWKzjG6zZLDxrlWis5EVEThoWmi3N+nxAYs2WnXQY34L3HisMWPQlHB+2FPtNW6D/8+ziBRcroOXc0B/wEGABY6TPS1FU0bwAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createColumnsIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENFQkI4NDhENzJDMTFFNUJDNEVFRjgwRDI3MkU1Q0EiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENFQkI4NDlENzJDMTFFNUJDNEVFRjgwRDI3MkU1Q0EiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0VCQjg0NkQ3MkMxMUU1QkM0RUVGODBEMjcyRTVDQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0VCQjg0N0Q3MkMxMUU1QkM0RUVGODBEMjcyRTVDQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pj6ozGQAAAAuSURBVHjaYmRgYPjPgBswQml8anBK/idGDQsxNpCghnTAOBoGo2EwGgZgABBgAHbrH/l4grETAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createPinIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAedJREFUeNqkUktLG1EYPTN31CIN0oWbIAWhKJR0FXcG6gOqkKGKVvEXCKULC91YSBcK7jXgQoIbFxn3ErFgFlIfCxUsQsCoIJYEm9LWNsGmJjPTM+Oo44Aa6IUzd+bec77H+UYyTRP/s5SsLFfCCxEjOhD9CXw64ccXJj7nLleYaMSvaa/+Au9Y73P3RUUBDIuXyaAxGu35A7xnkM57A7icCZXIO8/nkVleRn1/f9cv0xzjfVclFdi9N8ZivfnDQxQKBTwoFvFicLCVQSesJIpHMEY8dSqQWa54Eov1fF9ZQVHXsZNMblhnNE/wPmJPIX1zjOG2+fkgslnozHR2eopLcSIe3yoD48y45FbIxoVJNjimyMehoW3T58PvdBq53V18zeWwFo+vUfyBlCVvj0Li4/M1DnaAUtXCQkNDR4f/294eaoTAwdHRCROMWlzJZfC+1cKcJF07b5o+btWvV1eDyVBouyUcDj5UFDg924tVYtERpz0mCkmSulOp1GQgEIj0yvKPYiKBlwMDQXfPU47walEEmb8z0a5p2qaiKMPEoz6ezQLdM8DWNDDzltym24YthHimquoshSoDicvzZkK9S+h48pjCN4ZhrBPHTptlD0qevezwdCtAHVHrMti4A7rr3eb+E2AAoGnGkgkzpg8AAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createPlusIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAatJREFUeNqkU71KA0EQ/vaiib+lWCiordidpSg+QHwDBSt7n8DGhwhYCPoEgqCCINomARuLVIqgYKFG5f6z68xOzrvzYuXA3P7MzLffN7unjDH4jw3xx91bQXuxU4woNDjUX7VgsFOIH3/BnHgC0J65AzwFjDpZgoG7vb7lMsPDq6MiuK+B+kjGwFpCUjwK1DIQ3/dl0ssVh5TTM0UJP8aBgBKGleSGIWyP0oKYRm3KPSgYJ0Q0EpEgCASA2WmWZQY3kazBmjP9UhBFEbTWAgA0f9W2yHeG+vrd+tqGy5r5xNTT9erSqpvfdxwHN7fXOQZ0QhzH1oWArLsfXXieJ/KTGEZLcbVaTVn9ALTOLk9L+mYX5lxd0Xh6eGyVgspK6APwI8n3x9hmNpORJOuBo5ah8GcTc7dAHmkhNpYQlpHr47Hq2NspA1yEwHkoO/MVYLMmWJNarjEUQBzQw7rPvardFC8tZuOEwwB4p9PHqXgCdm738sUDJPB8mnwKj7qCTtJ527+XyAs6tOf2Bb6SP0OeGxRTVMp2h9nweWMoKS20l3+QT/vwqfZbgAEAUCrnlLQ+w4QAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createMinusIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKVJREFUeNpi/P//PwMlgImBQjBqAAMDy3JGRgZGBoaZQGxMikZg3J0F4nSWHxC+cUBamvHXr18Zfv36Bca/f/8G43///oExKLphmImJieHagQMQF7QDiSwg/vnzJ8P3799RDPj79y+KRhhmBLr6I1DPNJABtxkYZM4xMFx7uXAhSX5/CtQD0gv0OgMfyCAgZgViZiL1/wXi30D8h3E0KVNuAECAAQDr51qtGxzf1wAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createMoveIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAoZJREFUeNpsU81rE0EUf7uzu2lNVJL6Eb0IBWusepqcKm3wEFkvxqDgQbwUtYeeg5cccwj4F7QKChEPipRcdMGDiaAoJAexLYViwYsfbU1JYkx3Zz98b8220Wbg7ez7vXm/mffmN9Kh1G2QGQOmMDiRyYEkSaCoKjDGdAAooOUdxzFsIcDzPPhSvgeO7YDrOLBRmQdlJHULVE0DNRSCvqFjUuHqhWP8+etvhR5m0CeengVhmiAsywdl2Dt03K1wZSrO220XaCaf8AFrQel32s0mrDcaWfovrq3Vc9OTvHj/Tb0Xzh6JxQwNyxtIgPXpqqJk94fDM+1Oh6CaEF4QTiIOGJ/DdQtBObsEmGxbll/rkCyDPDwMzW4XhHD88EH0NcRxDUeX4/qdnsi0s8Aas+kEp8Zg82pMkmpDigKbjSbQTD7hFL94/jin9ZRHBNLo3Wrt+uUkbzQsiEZVMPGKfv76DaawodnahkhY86+PNnXxs77ZgVOjMahWVuufi1NJRZhWvvT0beHGtQn++Nm7en+DzqXO8vfVxX+wsYnT/JWxWEe95P0eILsvkkdPKn4PUEBJmunILab5992PLVU++skoNmOniT7JX2Fkt5GM1EjqbMohXzQmqo7KwCQ6zYKiabu30PpQAnZ0HKSRMcMRwnBddw4ZOO4GLRYKFFdDhrrteTMMdWB9/QTdH8sIp0EKmNT4GWDjGZAPJ3TcrbBv+ibfwtwDqBvzYck/truxYjjLZRDflwLt7JUmEoAymdPV7INa5IXn0Uw+4f8PIqATMLQIWpQ0E/RFTmQ4nLx0B1Zfzrsr5eAmbLQW2hYpHwkcqfegNBJhzwY9sGC4aCZaF81CAvePAAMAcwtApJX/Wo0AAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createLeftIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAe9JREFUeNqkUz1oE2EYfu7uuyRKLCFt6g+4VNQWWod+mQRRR1En0UFOHKoNCMKNju4SEQsOzsFNcRGl4CS42AzaKhKcsqhk0Etj7u+773y/6+USbOLSF5574b33eX+e906L4xh7MaYeC/c/IFcowMznEzDTBGPMoldnqEFtkPy708mIqvHHe0s7BcaYJYSwRwPu9vbYRH1XJI4tEYb2jYtHOHko9LvdxE9cYZQcBoF9+9oJ7jgRQt+HFAJSyv9rkO6UkGvXF3mr9QelkpkUINsYR6T8Jrkay8i+b9+5yfnmppMmSFw6e4yrIynBBsdS3jQ1PH/zeTiBIt+9dZpvbTlZh1+Oh/Z3F33XRUj7R1GUxA3DwMx0EYHnDUUMPe9Rfe1tc26uiL6M8aXno+UH6O7PIShPIapMQx6sQMxW4JbL+MkKCKhwNgGN2FD7Pnz82j63coF/aoc4ekDHtxfrzUniaZrW/FfEBomI9Scv7fnVq7zdBwIqajBWpeTd99d3vgBNCaQSzMOLyJ+6ApSPWxSzD61a/MfThupSjVuvxk2A3sazYYGBGbML0OcvW9rMyeRLFO8eVGXnKyacMiug5ikSplLs05dXzqNQWpbv6/URjpK+m6JH3GhQQI2QI+RTmBO0EwQ/RUBcqe31d/4rwAB0lPTXqN6HzgAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createRightIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfBJREFUeNqkUz1s00AU/hwSh1SEhiFCYuhCVSExgHRiYKjEVCEyMMGAsjCxZunesWM7dIgEA8JISPyoUhFDFoZOSE2GgtrSIAYWSEPb1HUS23c+8+7iuE5/JKQ+6fOdz/e+970fG2EY4jyWVo9b819hGEZ8WCgW4z2dV2lZFUJYgnNwz9PwXRebc3cGBMfN6XSQy+eHryyCMuv43dRpBCpSz7b1qlB+cI3RWkEYlv+LQFkgBLxuV8s9OAhQLk0w7vsnSHQKVMhqQuYRSRBouK5AqyXwpHSdvfywUYkKb8UEFIU9fXybOY6A+jbszGAP7O/7RBKg2eR4dH+KvV5ej0k0gaqobXO0214c3acUDnt99Pp9cKqDUqLsx68LuHd3gtU+b1eOCOiSaaZQKJjgMsSOy7EnJcSYCZnLwKbojic1weTVMXz81KhTexeSKdSXqrUzh2X84Qxr9SQmx1P48q6mnTPZrJUs4jMp5QlHlSd1Y203fRGFK8DPV28HzqZpjXShW3+D00bamCrpNU9DuvvcGsjea1rO+nvw39+AxRCGckyO8ciQFG8gPT27ptX8/b4gt1asYGdzRGE6MVCXCJcj5NShbG9B/NnYhttpyMYL5XmTYEdw1KgMFSgJJiEbIXNGPQXBi+CTrzTO+zv/E2AA3Y8Nbp4Kn1sAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createColumnVisibleIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdhJREFUeNrUk01LAlEUhu845QdRUxZBhIIWtFBso2AwRAVNLqKltHCb63b9A/9AixZCELhyYdAmEyYCBcOlNa1CSQoxog/DMY3x9p5B27Zw1YGH8XrO+55759wROOdsmLCwIWNoAwFh/ugfZQKsAQV4gbNf9woqIAeuQHOgGxgIMNix2Wx7iqIsxmKxWU3TxgqFgpWSsix3fT5fK5VKPedyuftOp5OE7oz60hHsYD8UCh3k83k5k8ksGYYx5XK5rK2WzgiIrPQf5aiGakljakVRjKDrZaPR6Oi6zglVVTlFMnnMZXmdK8o2x674IE+1pCHtCFx2w+GwE9u3drtd81yJRAKdDXZ4eGSuFxb87PHxjg3yVEsaNNolg5NSqTTVbDaX7Agq8Hg8TFWLbGVl0xTY7TY2Our5NfhCQPNAWtFisdSr1WqvWCwawWBwRpKkcZyXadoN83qXmSQ50V1jGxurpnGlUqnH4/FzvItTmoo5ApjQNMIOh2MrEon4o9Gov1arzZXL5XHKBwKBT7fbXU+n07fZbPa23W5f4BVd93o9TgYimATTMHHCbB5PN9ZSf0LmrsEHRDWInvB8w/oFvAv920iFDkBzF/64fHTjvoFOxsL//5h+BBgAwjbgRLl5ImwAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createColumnHiddenIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0ZGNDRBMkJENkU3MTFFNUIwOTBGRTc0MTA3OTI2OEYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0ZGNDRBMkNENkU3MTFFNUIwOTBGRTc0MTA3OTI2OEYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RkY0NEEyOUQ2RTcxMUU1QjA5MEZFNzQxMDc5MjY4RiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RkY0NEEyQUQ2RTcxMUU1QjA5MEZFNzQxMDc5MjY4RiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjQ0mkwAAACISURBVHjaYvz//z8DJYCJgUIwDAxgKSwspMwAIOYDYlcgtgNiJSBWBGJhIGaHyoHAJyD+CcRvgfg+EN8D4kNAvBtkwGEg1iNgkSCUlgBibSg7D4gvgwywRXKBChArALEIELMCsQBU8Qcg/g3Eb4D4ARDfBeKDMBeAnLcWikkGjKMpcRAYABBgACqXGpPEq63VAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createColumnIndeterminateIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUY1QTkyNDUxRTkzMTFFNkFEQzVDNjE1NDE4RDlEQUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUY1QTkyNDYxRTkzMTFFNkFEQzVDNjE1NDE4RDlEQUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5RjVBOTI0MzFFOTMxMUU2QURDNUM2MTU0MThEOURBQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5RjVBOTI0NDFFOTMxMUU2QURDNUM2MTU0MThEOURBQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Por9Q7gAAAGzSURBVHja1JOxSwJRHMffqXcqSoVBQ0FDNN7iIBxO5WA3NYoEjm0u/T2Bkw2ONZlgNEk4Bw6GiGiippmRnp76+n4PbWhpcOoHH57P+36/7/e8n4qUUmxSLrFhbRygoJwPq6tsgRMQB0cgtNINQA0UwCMYrX3rAAUB516v9zIejx+nUqm90WgUDIfDaq1WE9PpdK6q6mc2m+0WCoUX7K/hu+O5TPCBq0gkUiqXy0PbtqVlWXK5XDqwuE4mEzmfzyU11NJDr3C73SZOfeh0OtPxeCyR7oixlzhdVqtV2ev1nCB+Tw219NDrQRtJwzBCaF+bzWbsSGQyGVEsFoWmacLj8YjBYCBisZhIp9MC3Qhq6YEmyQ5OTdO8bTQak263K8m69d+FIOc5tfTQywAvTrmIRqM3pVLptd1uy3q9/nN3slgsZLPZlHxGDbX00Ou8ApfLxbdh+P3+MyTriURC7/f7+7hCsFKpCF3XvwKBQCuXyz3n8/ln/Bb3yH9iOAPcYAfsIiSEsAOsh9hvA99qDizwAVMDphbWd+zfwFBZTSOFfqBxJv4YPk6cDcYMVv7/n+lbgAEAtdcjOjP715MAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createGroupIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NUVCNUI1OUNENkYwMTFFNThGNjJDNUE3ODIwMEZERDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NUVCNUI1OURENkYwMTFFNThGNjJDNUE3ODIwMEZERDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1RUI1QjU5QUQ2RjAxMUU1OEY2MkM1QTc4MjAwRkRENyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1RUI1QjU5QkQ2RjAxMUU1OEY2MkM1QTc4MjAwRkRENyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlkCTGoAAACDSURBVHjaYmRgYPjPgBswQun/+BT8X3x5DoZErG4KCj/3/DcMNZMNuRiYGPADRiRX4HYBJV5AB0QrhAGW//8hehgZES6FiaGLYzUAq7sxNf0nxQCsinHFAguegCPKBYxoYfAfWQxNnPgwINJVYMDEQCEYfLHASGoKRQlxPN7BqQggwAAN+SopPnDCwgAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createPivotIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAitJREFUeNqcU01rE1EUPfPVJjFqdYw2pJQkNS2hYhQUiwj+AaugKFYUBWutG3HjokgNrroRKYKbglBBFF0o1IW404qClGIDxpYKTQgULZJmmpiYkPnwvmtNspPmweOcmXnnvPPufSOdjsf7AfjR3PiOU6OjV50mh9CqtmVJDlkNjWU3tPXEiA6hlS3Lkm3HQbFYxO5hnTF0pQ3Bwa3MAxc98F9wMd95TsOOswpzoRFa1TJNyaKHtTUD07cNdv9wx6jtNDNW53N369xyOiC0qmmanMAwcjh+/yimrr/D28kjf8WLizjY3c38YzKJw729zKcTCU4gtLUE+Xwejy+94gWfl5agKQr8uo4Eccu2USr48SWVQq5QWE/gcAJZuIgF5XIF5yf7GfcGg9Cos4O3UoiFw2jFLrx+/wtRet+3nkJoOAEbkJtty5g484I+yUivrODekxb4tmuInZhCuFPHyHAXZubnUTXNWgKhlc1qlY+gaZsw9PwkY4fPhxsDXvxcrWL25TE8G+8DFAOxSAQHotG6AWlrRXS52vD08ifGr5kM1+BBPIBkOo3flQpaNA2zCwug+8MGdkMCPoLbvQ0DDw8xRgIBBNvbsUoF6yK+h+pQJpN91JH9PT2NCWS1Ui4rNhtswZubPxi/LS9TTWxemKTK/9t1jtramEBo1Vw226pRvEfj3oaL6v3vVRYaoZXcodA12ePpbOZXtEuljEToprmZprpBvehn4Y8AAwDB0mLL0M405wAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createAggregationIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMZJREFUeNpi/P//PwMlgImBQjDwBrCgmMYENq8RiLVxqL8KxPX//v1DiIACEYYZGRlBmBOIe4B4PRDrQMUYoGyQGIoebAbADJkAxFuAWA9JXJdYA0CYC4inAPFOINZHlkPWgxKIcFMhQA0aFveB+DbOUERxDhQAbTEC4qNAPBfqEmRx3F6AAhOgojNAvBikGckumDiKHhY0B3ECcTVQQhRIg/B1NNeeB1IgQ7/BXYvmdE6oAnYcPv4NxF+BerAbMDTzAkCAAQChYIl8b86M1gAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createGroupIcon12 = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTNFQzE0NTdEOTk1MTFFNUI4MjJGMjBFRDk4MkMxNjAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTNFQzE0NThEOTk1MTFFNUI4MjJGMjBFRDk4MkMxNjAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxM0VDMTQ1NUQ5OTUxMUU1QjgyMkYyMEVEOTgyQzE2MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxM0VDMTQ1NkQ5OTUxMUU1QjgyMkYyMEVEOTgyQzE2MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PiInRbAAAAEjSURBVHjaYuTi5XqkpKvI9/fXHwZWDlaGZ/eeM7x59raDAQj4pOQrBBUVGP78+MfAzMbE8PLKhU8Mhnb6/6//P/f/8N/d/x8AWUn1cf+BaleCsFPt5P/T/v//3/zj//8JQFrB1vM/I5IN3EAbfgBt+Au0QRBqw3sMG0DiQMwPxFuB2BzKZmLAAViA+BOU/QOI7wPxRyhfCIhT0NT/ZETi7AZiZiD+DOXL6EdlGdkWFzF8evaDgUuIg2F9eiTYBrhuIJ4NxHegfDsgnobuJGQbNgBxMRDfhfLFgDgB3UnInPVALMxAACDbcBGItwDxAyhfCRismejBiuyHiUBsDMQmUL6cSXIJf0hTDsNboEN42RkYJth58TPisV0eaMNFdBsAAgwANVJzd8zQrUcAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createCutIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlRJREFUeNqkU09okmEcfj6ThNRhjUEJDhxDZ1t4sI3lDrKDhESHpC6x6yBoh52GfcdBJDvtElEUdKhOSq1JjF0SabSton9OmIeRxVKIrUgdU5xvv8e+hXXYpRcefv+e5/mh7/tpSin8z9Gi0Sg0TTsv+edarfa+Wq2iUqmgXC6DudVqhd1uh81ma+UWi8Uv3G5ZPJ9MJmGq1+twOBynBOek6T9oG+fkkU8djymVSiGTyWBiYuL6QSb7YvLIp679+D0ej57NZpX8JD0QCPj7+vrgcrnAyJp9zskj3zD928Tr9er5fF5FIhFdiH4aMLJmn/N98R+Dq5qGSUFQwKFs1AuFggqFQrrT6bzIyJp9zoMGn7qWQU6ST4JNQeK3kd/n8+nFYlGFw+HFdDqtWLOfMHjk5wwDjckRwGYGeJVnBMdXgaNrbveJKysr/etu91pHtVo8BnyXWUnwsgHM7wAVX7MJ0cEmjWvW4eGzjpGRXnNnZ8cFeRi9pRI+dnXtjMbj/cLp57rG1tbPH0tLwd3l5QHp3RBU8E7Txr4MDb1V8bh60tOzfhN4vTc9rRYkCm4tGDX7nJNHPnWt/+CFpt1rF9emptScxKfA2DNZwThn9NtNWjoxMH1Tqru+va02NzbK47FY4PHMzJtdYPYD8OChGDCyZp9z8sinrnWXt4E7q4ODRbrelw0x2Xjyn1fImn3OySOfutYt+IDRSeCycAZeAYm7wKLkshR87A1+cILDAss4EDkNXJI8Ows8yin1nENn+5MXNA3hnpHzHBKYjWhqe4lffwkwAMRcPMqRQZ4vAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createCopyIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgBJREFUeNqMk79rFEEcxd/M7V2QAzVFEOMFGwNiIGCjEdIEhYODmEawsFf8G4QQSCPYyqUWCdhY2qSQECSpInvFJYT8Ki6dZO8Sb2P29pfvu+4sm+UKv/AYZna/b95ndla9WFyEUmoewG0Mr+9hGB5EYYhypZIseO0fCHa3sP/LhxVFkazd+by0tOIFAQac+3w5imPYto1Pa2tv+VxR+8bRuv8EevIRxn5uQoszpWI2RjSIBgMMLi/hui76/T6+Li+v8Pkz9k0Wo409pFHAJooUCiWqYlk46nTQ2ttD+/gY75pNPKjVmmfd7gf2vKbu5U0sMWBpzWatNcAkv7n789lZ1GdmMqQ3cbxApIUikg58H5S0JgkSE/L/L1JmoNJmMZEDzCNdK5cxwtFxHHxcXcXTqalm27Zf7rRaRKBBhkAhxcgjiYlUo16HfKlqtYpv29u95Az81EClCFLyaQ0SCib/dtNJ6qsGfDmJnRqoXIKiyVUDz8sSSGy5VnI3ikh5k1KplBnog/V19BxnRCZmV15dGCSdO1wziphcS3rrT7d71zk5Ob8+Pf3eMN4aH3/8qtGYM0hp7iyJbO0bBOrMPTz8kl6OpGoTEzEncwapaCLrRNfu6Wli0Etl6mbfdb0MiYrlXsjZyAUTE0qwOxsbo9aQ3/dGEWlYRRcX5xxG/wowAC8cIjzfyA4lAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createPasteIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAadJREFUeNpinGLPAAaMjAxwcJ9Tk+0Bt7YPkCkKFXqt8PXqFsXv13/B1Pz/D6FZENoYZgKxMYgh9OI6i567q5hFUp4kiH9i3qTnT3auqWPgZ/gDVXsWiNPBFk+2hxtwxi0syfjy5csM0vFzGTg42Bj4+XnAEh8/fmH48eMXw9OFyQy6uroMu1bNAxlgAnbB338IJ6hlzWU4uXgJw6FDO4Ga+Rl4eXkZWFlZGb58/crw6eNHBjG7Iga1yAiG7SvmwfWw/P2LMADkraiYaIb79+4xYAOKSkpgNch6UFzwFxgy//79Y5BTUMBqwF+g3H8mJgZkPSgu+Ac04M+/fwz4AAswulBc8Ocfqg1/kGWxAEagAch6WP78RfUCIQOYmJkZ/qC44A+qAb8JeIEZZMkfXC4gwgsQNUgG/CbRC2BXIhvw8AsDgzQnkgEEvACxBMJ++h0YJmufMTA8ABry8xckGkFOxIdBakBqQXpAekGZiXPTSwbeUAEgB5hsObm58acDoJp3nxkYNn1gEANyP4MNAGKxh18ZbsXxsjMQA97/Z7gF0gPEfwACDAB/y9xB1I3/FQAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createMenuIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QjM3MUVBMzlERkJEMTFFNUEwMjFFNDJDMDlCMUY3OTciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QjM3MUVBM0FERkJEMTFFNUEwMjFFNDJDMDlCMUY3OTciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpCMzcxRUEzN0RGQkQxMUU1QTAyMUU0MkMwOUIxRjc5NyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCMzcxRUEzOERGQkQxMUU1QTAyMUU0MkMwOUIxRjc5NyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pux7nZcAAAGtSURBVHjalFM9a8JQFL0veYkfYJUQEYuIIF07uToVpGuHOgid3dJN+i+K4C6CXQqFjplcCoKbXZ0EqRUFP/CTxCS9NzTdNOmBx32P3Nx3zj33sXq9/tRqtbRYLCaLomhBANi2La5WK7NSqTRYNpt1LMsCLACO47iLMXY2CoIAm80GZFkGoVQqfWy3WzBNE6gQVveNhmHAbreDYrHYZaPRKKTr+i0ykTDBPnUzgfYEvFkYDAZWoVDQWb/fB9QD6XQajscjBCkQDodhOBzCcrkEVq1WXfoEL9EPlEdSZrMZ8Pl8frVYLO7QgRB+sPx+/GUk4qUGNvOdYSO+JpPJJdHyc8ADnUluIpH45vv9XiFbiFIQC71IjuBe5ZlM5gYlPHLOL7C4AcEgofXbXC7X4PF4vKuqahf+AWJxOBwgEokA6/V67kFRFFcGLU/SqShJkusATSNbr9fQ6XSuU6mUQP3BBIaJZyM6BuPx2Mnn85+sVqu9ttvt+2QyGXgOqInT6RTK5fIbwwl0iFI0Gv2btCA9QPdcOVzTtOdms/mAnnKkaAexES0UcG/hc375EWAA94tOP0vEOEcAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createCheckboxCheckedIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpFQ0VGQkU3ODM4MTFFNjExQjlCQzhERUVDNkNGMzFDMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpBRkJCRDU1MTEyM0ExMUU2ODE4MUUyOTNBNTRGQkIxNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpBRkJCRDU1MDEyM0ExMUU2ODE4MUUyOTNBNTRGQkIxNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjIzMkM4M0M1M0MxMUU2MTFCOUJDOERFRUM2Q0YzMUMzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkVDRUZCRTc4MzgxMUU2MTFCOUJDOERFRUM2Q0YzMUMzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+riMaEQAAAL5JREFUeNqUks0JhDAQhSd7tgtLMDUIyTXF2IdNWIE3c0ruYg9LtgcPzvpEF8SfHR8MGR75hpcwRERmrjQXCyutDKUQAkuFu2AUpsyiJ1JK0UtycRgGMsbsPBFYVRVZaw/+7Zu895znOY/j+PPWT7oGp2lirTU3TbPz/4IAAGLALeic47Ztlx7RELHrusPAAwgoy7LlrOuay7I8TXIadYOLouC+7+XgBiP2lTbw0crFGAF9ANq1kS75G8xXgAEAiqu9OeWZ/voAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createCheckboxUncheckedIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpFQ0VGQkU3ODM4MTFFNjExQjlCQzhERUVDNkNGMzFDMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2MkU1Rjk1NDExNDExMUU2ODhEQkMyRTJGOUNGODYyQyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2MkU1Rjk1MzExNDExMUU2ODhEQkMyRTJGOUNGODYyQyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjI1MkM4M0M1M0MxMUU2MTFCOUJDOERFRUM2Q0YzMUMzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkVDRUZCRTc4MzgxMUU2MTFCOUJDOERFRUM2Q0YzMUMzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+t+CXswAAAFBJREFUeNrsksENwDAIA023a9YGNqlItkixlAFIn1VOMv5wvACAOxOZWUwsB6Gqswp36QivJNhBRHDhI0f8j9jNrCy4O2twNMobT/7QeQUYAFaKU1yE2OfhAAAAAElFTkSuQmCC';
return eImg;
};
SvgFactory.prototype.createCheckboxIndeterminateIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpFQ0VGQkU3ODM4MTFFNjExQjlCQzhERUVDNkNGMzFDMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGMjU4MzhGQjEyM0ExMUU2QjAxM0Q2QjZFQ0IzNzM4NiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGMjU4MzhGQTEyM0ExMUU2QjAxM0Q2QjZFQ0IzNzM4NiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjIzMkM4M0M1M0MxMUU2MTFCOUJDOERFRUM2Q0YzMUMzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkVDRUZCRTc4MzgxMUU2MTFCOUJDOERFRUM2Q0YzMUMzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+2Xml2QAAAGBJREFUeNpiYGBg8ATiZ0D8n0j8DKqH4dnhw4f/EwtAakF6GEGmAAEDKYCRkZGBiYFMQH+NLNjcjw2ghwMLIQWDx48Do/H5kSNHiNZw9OhREPUCRHiBNJOQyJ+A9AAEGACqkFldNkPUwwAAAABJRU5ErkJggg==';
return eImg;
};
SvgFactory.prototype.createGroupExpandedIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzBBODQ4M0ExMjM4MTFFNkFDNEJDMjUzQUJBQ0I2QjkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzBBODQ4M0IxMjM4MTFFNkFDNEJDMjUzQUJBQ0I2QjkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3MEE4NDgzODEyMzgxMUU2QUM0QkMyNTNBQkFDQjZCOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3MEE4NDgzOTEyMzgxMUU2QUM0QkMyNTNBQkFDQjZCOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhKAo60AAADVSURBVHjajFC9DkRgEJzzFhqiligURKcjR+UFJK7wGN7jOq+glXgCvSgUCnyVn47GHsVdcURsss3s7OzOPEzTdB3HeTPGeMMw0DQNOI4Dz/PI8xyWZSGO4y4MwxeSJGnruqarGseRNE1r4fv+YSgIwgErioJwpgrggHmeR7Bt+xZ5GAbCNE2/0zvpv78v6bpOUFX1lvK6roQz92dkWZYJiqLcSmOeZ9qDb6uqusx5WRaSJIlBFEUnTdNuC536vifXdaksSwqCgLIsoyiKdnNs23l+BBgAK/54I/P5bhMAAAAASUVORK5CYII=';
return eImg;
};
SvgFactory.prototype.createGroupContractedIcon = function () {
var eImg = document.createElement('img');
eImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U2QUVBRDYxMjM4MTFFNjk3NjVBRUM0MUJDRjFCODgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U2QUVBRDcxMjM4MTFFNjk3NjVBRUM0MUJDRjFCODgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTZBRUFENDEyMzgxMUU2OTc2NUFFQzQxQkNGMUI4OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTZBRUFENTEyMzgxMUU2OTc2NUFFQzQxQkNGMUI4OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhjzsKsAAADSSURBVHjajJAvioVgFMXPuAuLYhYMBsVmU54mNyA4wWW4j2luwSq4ArsYDAZ9X/JP0+KZ58CkgTffD264l3MPnPPh+34cRdGXEEL1PA/TNEFRFKiqirZtEQQByrJ85nn+iaqq5nEc+Y5t2+g4zow0TSlD13XEf66/JElChGEoJV7Xldj3/WfRNI0A/sx9v3Fdl7BtW8r5ui6CkpimSViWJSU+joN38fMwDG+F53nSMAwBXdejuq6fr9K5LAvjOGbf98yyjE3TsCiKO5x4/Ty+BRgA3R6JXc/jqsQAAAAASUVORK5CYII=';
return eImg;
};
return SvgFactory;
})();
exports.SvgFactory = SvgFactory;
// i couldn't figure out how to not make these blurry
/*function createPlusMinus(plus: boolean) {
var eSvg = document.createElementNS(SVG_NS, "svg");
var size = "14";
eSvg.setAttribute("width", size);
eSvg.setAttribute("height", size);
var eRect = document.createElementNS(SVG_NS, "rect");
eRect.setAttribute('x', '1');
eRect.setAttribute('y', '1');
eRect.setAttribute('width', '12');
eRect.setAttribute('height', '12');
eRect.setAttribute('rx', '2');
eRect.setAttribute('ry', '2');
eRect.setAttribute('fill', 'none');
eRect.setAttribute('stroke', 'black');
eRect.setAttribute('stroke-width', '1');
eRect.setAttribute('stroke-linecap', 'butt');
eSvg.appendChild(eRect);
var eLineAcross = document.createElementNS(SVG_NS, "line");
eLineAcross.setAttribute('x1','2');
eLineAcross.setAttribute('x2','12');
eLineAcross.setAttribute('y1','7');
eLineAcross.setAttribute('y2','7');
eLineAcross.setAttribute('stroke','black');
eLineAcross.setAttribute('stroke-width', '1');
eLineAcross.setAttribute('stroke-linecap', 'butt');
eSvg.appendChild(eLineAcross);
if (plus) {
var eLineDown = document.createElementNS(SVG_NS, "line");
eLineDown.setAttribute('x1','7');
eLineDown.setAttribute('x2','7');
eLineDown.setAttribute('y1','2');
eLineDown.setAttribute('y2','12');
eLineDown.setAttribute('stroke','black');
eLineDown.setAttribute('stroke-width', '1');
eLineDown.setAttribute('stroke-linecap', 'butt');
eSvg.appendChild(eLineDown);
}
return eSvg;
}*/
function createPolygonSvg(points, width) {
var eSvg = createIconSvg(width);
var eDescIcon = document.createElementNS(SVG_NS, "polygon");
eDescIcon.setAttribute("points", points);
eSvg.appendChild(eDescIcon);
return eSvg;
}
// util function for the above
function createIconSvg(width) {
var eSvg = document.createElementNS(SVG_NS, "svg");
if (width > 0) {
eSvg.setAttribute("width", width);
eSvg.setAttribute("height", width);
}
else {
eSvg.setAttribute("width", "10");
eSvg.setAttribute("height", "10");
}
return eSvg;
}
function createCircle(fill) {
var eSvg = createIconSvg();
var eCircle = document.createElementNS(SVG_NS, "circle");
eCircle.setAttribute("cx", "5");
eCircle.setAttribute("cy", "5");
eCircle.setAttribute("r", "5");
eCircle.setAttribute("stroke", "black");
eCircle.setAttribute("stroke-width", "2");
if (fill) {
eCircle.setAttribute("fill", "black");
}
else {
eCircle.setAttribute("fill", "none");
}
eSvg.appendChild(eCircle);
return eSvg;
}
/***/ },
/* 60 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var context_1 = __webpack_require__(6);
var cellRendererFactory_1 = __webpack_require__(55);
/** Class to use a cellRenderer. */
var CellRendererService = (function () {
function CellRendererService() {
}
/** Uses a cellRenderer, and returns the cellRenderer object if it is a class implementing ICellRenderer.
* @cellRendererKey: The cellRenderer to use. Can be: a) a class that we call 'new' on b) a function we call
* or c) a string that we use to look up the cellRenderer.
* @params: The params to pass to the cell renderer if it's a function or a class.
* @eTarget: The DOM element we will put the results of the html element into *
* @return: If options a, it returns the created class instance */
CellRendererService.prototype.useCellRenderer = function (cellRendererKey, eTarget, params) {
var cellRenderer = this.lookUpCellRenderer(cellRendererKey);
if (utils_1.Utils.missing(cellRenderer)) {
// this is a bug in users config, they specified a cellRenderer that doesn't exist,
// the factory already printed to console, so here we just skip
return;
}
var resultFromRenderer;
var iCellRendererInstance = null;
this.checkForDeprecatedItems(cellRenderer);
// we check if the class has the 'getGui' method to know if it's a component
var rendererIsAComponent = this.doesImplementICellRenderer(cellRenderer);
// if it's a component, we create and initialise it
if (rendererIsAComponent) {
var CellRendererClass = cellRenderer;
iCellRendererInstance = new CellRendererClass();
this.context.wireBean(iCellRendererInstance);
if (iCellRendererInstance.init) {
iCellRendererInstance.init(params);
}
resultFromRenderer = iCellRendererInstance.getGui();
}
else {
// otherwise it's a function, so we just use it
var cellRendererFunc = cellRenderer;
resultFromRenderer = cellRendererFunc(params);
}
if (resultFromRenderer === null || resultFromRenderer === '') {
return;
}
if (utils_1.Utils.isNodeOrElement(resultFromRenderer)) {
// a dom node or element was returned, so add child
eTarget.appendChild(resultFromRenderer);
}
else {
// otherwise assume it was html, so just insert
eTarget.innerHTML = resultFromRenderer;
}
return iCellRendererInstance;
};
CellRendererService.prototype.checkForDeprecatedItems = function (cellRenderer) {
if (cellRenderer && cellRenderer.renderer) {
console.warn('ag-grid: colDef.cellRenderer should not be an object, it should be a string, function or class. this ' +
'changed in v4.1.x, please check the documentation on Cell Rendering, or if you are doing grouping, look at the grouping examples.');
}
};
CellRendererService.prototype.doesImplementICellRenderer = function (cellRenderer) {
// see if the class has a prototype that defines a getGui method. this is very rough,
// but javascript doesn't have types, so is the only way!
return cellRenderer.prototype && 'getGui' in cellRenderer.prototype;
};
CellRendererService.prototype.lookUpCellRenderer = function (cellRendererKey) {
if (typeof cellRendererKey === 'string') {
return this.cellRendererFactory.getCellRenderer(cellRendererKey);
}
else {
return cellRendererKey;
}
};
__decorate([
context_1.Autowired('cellRendererFactory'),
__metadata('design:type', cellRendererFactory_1.CellRendererFactory)
], CellRendererService.prototype, "cellRendererFactory", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], CellRendererService.prototype, "context", void 0);
CellRendererService = __decorate([
context_1.Bean('cellRendererService'),
__metadata('design:paramtypes', [])
], CellRendererService);
return CellRendererService;
})();
exports.CellRendererService = CellRendererService;
/***/ },
/* 61 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var ValueFormatterService = (function () {
function ValueFormatterService() {
}
ValueFormatterService.prototype.formatValue = function (column, rowNode, $scope, rowIndex, value) {
var formatter;
var colDef = column.getColDef();
// if floating, give preference to the floating formatter
if (rowNode.floating) {
formatter = colDef.floatingCellFormatter ? colDef.floatingCellFormatter : colDef.cellFormatter;
}
else {
formatter = colDef.cellFormatter;
}
var result = null;
if (formatter) {
var params = {
value: value,
node: rowNode,
column: column,
$scope: $scope,
rowIndex: rowIndex,
api: this.gridOptionsWrapper.getApi(),
context: this.gridOptionsWrapper.getContext()
};
result = formatter(params);
}
return result;
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], ValueFormatterService.prototype, "gridOptionsWrapper", void 0);
ValueFormatterService = __decorate([
context_1.Bean('valueFormatterService'),
__metadata('design:paramtypes', [])
], ValueFormatterService);
return ValueFormatterService;
})();
exports.ValueFormatterService = ValueFormatterService;
/***/ },
/* 62 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var component_1 = __webpack_require__(47);
var rowNode_1 = __webpack_require__(27);
var utils_1 = __webpack_require__(7);
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var svgFactory_1 = __webpack_require__(59);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var CheckboxSelectionComponent = (function (_super) {
__extends(CheckboxSelectionComponent, _super);
function CheckboxSelectionComponent() {
_super.call(this, "<span class=\"ag-selection-checkbox\"/>");
}
CheckboxSelectionComponent.prototype.createAndAddIcons = function () {
this.eCheckedIcon = utils_1.Utils.createIconNoSpan('checkboxChecked', this.gridOptionsWrapper, null, svgFactory.createCheckboxCheckedIcon);
this.eUncheckedIcon = utils_1.Utils.createIconNoSpan('checkboxUnchecked', this.gridOptionsWrapper, null, svgFactory.createCheckboxUncheckedIcon);
this.eIndeterminateIcon = utils_1.Utils.createIconNoSpan('checkboxIndeterminate', this.gridOptionsWrapper, null, svgFactory.createCheckboxIndeterminateIcon);
var eGui = this.getGui();
eGui.appendChild(this.eCheckedIcon);
eGui.appendChild(this.eUncheckedIcon);
eGui.appendChild(this.eIndeterminateIcon);
};
CheckboxSelectionComponent.prototype.onSelectionChanged = function () {
var state = this.rowNode.isSelected();
utils_1.Utils.setVisible(this.eCheckedIcon, state === true);
utils_1.Utils.setVisible(this.eUncheckedIcon, state === false);
utils_1.Utils.setVisible(this.eIndeterminateIcon, typeof state !== 'boolean');
};
CheckboxSelectionComponent.prototype.onCheckedClicked = function () {
this.rowNode.setSelected(false);
};
CheckboxSelectionComponent.prototype.onUncheckedClicked = function (event) {
this.rowNode.setSelectedParams({ newValue: true, rangeSelect: event.shiftKey });
};
CheckboxSelectionComponent.prototype.onIndeterminateClicked = function (event) {
this.rowNode.setSelectedParams({ newValue: true, rangeSelect: event.shiftKey });
};
CheckboxSelectionComponent.prototype.init = function (params) {
this.createAndAddIcons();
this.rowNode = params.rowNode;
this.onSelectionChanged();
// we don't want the row clicked event to fire when selecting the checkbox, otherwise the row
// would possibly get selected twice
this.addGuiEventListener('click', function (event) { return event.stopPropagation(); });
// likewise we don't want double click on this icon to open a group
this.addGuiEventListener('dblclick', function (event) { return event.stopPropagation(); });
this.addDestroyableEventListener(this.eCheckedIcon, 'click', this.onCheckedClicked.bind(this));
this.addDestroyableEventListener(this.eUncheckedIcon, 'click', this.onUncheckedClicked.bind(this));
this.addDestroyableEventListener(this.eIndeterminateIcon, 'click', this.onIndeterminateClicked.bind(this));
this.addDestroyableEventListener(this.rowNode, rowNode_1.RowNode.EVENT_ROW_SELECTED, this.onSelectionChanged.bind(this));
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], CheckboxSelectionComponent.prototype, "gridOptionsWrapper", void 0);
return CheckboxSelectionComponent;
})(component_1.Component);
exports.CheckboxSelectionComponent = CheckboxSelectionComponent;
/***/ },
/* 63 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var column_1 = __webpack_require__(15);
var SetLeftFeature = (function () {
function SetLeftFeature(columnOrGroup, eCell) {
this.destroyFunctions = [];
this.columnOrGroup = columnOrGroup;
this.eCell = eCell;
this.init();
}
SetLeftFeature.prototype.init = function () {
var _this = this;
var listener = this.onLeftChanged.bind(this);
this.columnOrGroup.addEventListener(column_1.Column.EVENT_LEFT_CHANGED, listener);
this.destroyFunctions.push(function () {
_this.columnOrGroup.removeEventListener(column_1.Column.EVENT_LEFT_CHANGED, listener);
});
this.onLeftChanged();
};
SetLeftFeature.prototype.onLeftChanged = function () {
var newLeft = this.columnOrGroup.getLeft();
if (utils_1.Utils.exists(newLeft)) {
this.eCell.style.left = this.columnOrGroup.getLeft() + 'px';
}
else {
this.eCell.style.left = '';
}
};
SetLeftFeature.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) {
func();
});
};
return SetLeftFeature;
})();
exports.SetLeftFeature = SetLeftFeature;
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var constants_1 = __webpack_require__(8);
var columnController_1 = __webpack_require__(13);
var floatingRowModel_1 = __webpack_require__(26);
var utils_1 = __webpack_require__(7);
var gridRow_1 = __webpack_require__(34);
var gridCell_1 = __webpack_require__(33);
var CellNavigationService = (function () {
function CellNavigationService() {
}
CellNavigationService.prototype.getNextCellToFocus = function (key, lastCellToFocus) {
switch (key) {
case constants_1.Constants.KEY_UP: return this.getCellAbove(lastCellToFocus);
case constants_1.Constants.KEY_DOWN: return this.getCellBelow(lastCellToFocus);
case constants_1.Constants.KEY_RIGHT: return this.getCellToRight(lastCellToFocus);
case constants_1.Constants.KEY_LEFT: return this.getCellToLeft(lastCellToFocus);
default: console.log('ag-Grid: unknown key for navigation ' + key);
}
};
CellNavigationService.prototype.getCellToLeft = function (lastCell) {
var colToLeft = this.columnController.getDisplayedColBefore(lastCell.column);
if (!colToLeft) {
return null;
}
else {
return new gridCell_1.GridCell(lastCell.rowIndex, lastCell.floating, colToLeft);
}
};
CellNavigationService.prototype.getCellToRight = function (lastCell) {
var colToRight = this.columnController.getDisplayedColAfter(lastCell.column);
// if already on right, do nothing
if (!colToRight) {
return null;
}
else {
return new gridCell_1.GridCell(lastCell.rowIndex, lastCell.floating, colToRight);
}
};
CellNavigationService.prototype.getRowBelow = function (lastRow) {
// if already on top row, do nothing
if (this.isLastRowInContainer(lastRow)) {
if (lastRow.isFloatingBottom()) {
return null;
}
else if (lastRow.isNotFloating()) {
if (this.floatingRowModel.isRowsToRender(constants_1.Constants.FLOATING_BOTTOM)) {
return new gridRow_1.GridRow(0, constants_1.Constants.FLOATING_BOTTOM);
}
else {
return null;
}
}
else {
if (this.rowModel.isRowsToRender()) {
return new gridRow_1.GridRow(0, null);
}
else if (this.floatingRowModel.isRowsToRender(constants_1.Constants.FLOATING_BOTTOM)) {
return new gridRow_1.GridRow(0, constants_1.Constants.FLOATING_BOTTOM);
}
else {
return null;
}
}
}
else {
return new gridRow_1.GridRow(lastRow.rowIndex + 1, lastRow.floating);
}
};
CellNavigationService.prototype.getCellBelow = function (lastCell) {
var rowBelow = this.getRowBelow(lastCell.getGridRow());
if (rowBelow) {
return new gridCell_1.GridCell(rowBelow.rowIndex, rowBelow.floating, lastCell.column);
}
else {
return null;
}
};
CellNavigationService.prototype.isLastRowInContainer = function (gridRow) {
if (gridRow.isFloatingTop()) {
var lastTopIndex = this.floatingRowModel.getFloatingTopRowData().length - 1;
return lastTopIndex === gridRow.rowIndex;
}
else if (gridRow.isFloatingBottom()) {
var lastBottomIndex = this.floatingRowModel.getFloatingBottomRowData().length - 1;
return lastBottomIndex === gridRow.rowIndex;
}
else {
var lastBodyIndex = this.rowModel.getRowCount() - 1;
return lastBodyIndex === gridRow.rowIndex;
}
};
CellNavigationService.prototype.getRowAbove = function (lastRow) {
// if already on top row, do nothing
if (lastRow.rowIndex === 0) {
if (lastRow.isFloatingTop()) {
return null;
}
else if (lastRow.isNotFloating()) {
if (this.floatingRowModel.isRowsToRender(constants_1.Constants.FLOATING_TOP)) {
return this.getLastFloatingTopRow();
}
else {
return null;
}
}
else {
// last floating bottom
if (this.rowModel.isRowsToRender()) {
return this.getLastBodyCell();
}
else if (this.floatingRowModel.isRowsToRender(constants_1.Constants.FLOATING_TOP)) {
return this.getLastFloatingTopRow();
}
else {
return null;
}
}
}
else {
return new gridRow_1.GridRow(lastRow.rowIndex - 1, lastRow.floating);
}
};
CellNavigationService.prototype.getCellAbove = function (lastCell) {
var rowAbove = this.getRowAbove(lastCell.getGridRow());
if (rowAbove) {
return new gridCell_1.GridCell(rowAbove.rowIndex, rowAbove.floating, lastCell.column);
}
else {
return null;
}
};
CellNavigationService.prototype.getLastBodyCell = function () {
var lastBodyRow = this.rowModel.getRowCount() - 1;
return new gridRow_1.GridRow(lastBodyRow, null);
};
CellNavigationService.prototype.getLastFloatingTopRow = function () {
var lastFloatingRow = this.floatingRowModel.getFloatingTopRowData().length - 1;
return new gridRow_1.GridRow(lastFloatingRow, constants_1.Constants.FLOATING_TOP);
};
CellNavigationService.prototype.getNextTabbedCell = function (gridCell, backwards) {
if (backwards) {
return this.getNextTabbedCellBackwards(gridCell);
}
else {
return this.getNextTabbedCellForwards(gridCell);
}
};
CellNavigationService.prototype.getNextTabbedCellForwards = function (gridCell) {
var displayedColumns = this.columnController.getAllDisplayedColumns();
var newRowIndex = gridCell.rowIndex;
var newFloating = gridCell.floating;
// move along to the next cell
var newColumn = this.columnController.getDisplayedColAfter(gridCell.column);
// check if end of the row, and if so, go forward a row
if (!newColumn) {
newColumn = displayedColumns[0];
var rowBelow = this.getRowBelow(gridCell.getGridRow());
if (utils_1.Utils.missing(rowBelow)) {
return;
}
newRowIndex = rowBelow.rowIndex;
newFloating = rowBelow.floating;
}
return new gridCell_1.GridCell(newRowIndex, newFloating, newColumn);
};
CellNavigationService.prototype.getNextTabbedCellBackwards = function (gridCell) {
var displayedColumns = this.columnController.getAllDisplayedColumns();
var newRowIndex = gridCell.rowIndex;
var newFloating = gridCell.floating;
// move along to the next cell
var newColumn = this.columnController.getDisplayedColBefore(gridCell.column);
// check if end of the row, and if so, go forward a row
if (!newColumn) {
newColumn = displayedColumns[displayedColumns.length - 1];
var rowAbove = this.getRowAbove(gridCell.getGridRow());
if (utils_1.Utils.missing(rowAbove)) {
return;
}
newRowIndex = rowAbove.rowIndex;
newFloating = rowAbove.floating;
}
return new gridCell_1.GridCell(newRowIndex, newFloating, newColumn);
};
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], CellNavigationService.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], CellNavigationService.prototype, "rowModel", void 0);
__decorate([
context_1.Autowired('floatingRowModel'),
__metadata('design:type', floatingRowModel_1.FloatingRowModel)
], CellNavigationService.prototype, "floatingRowModel", void 0);
CellNavigationService = __decorate([
context_1.Bean('cellNavigationService'),
__metadata('design:paramtypes', [])
], CellNavigationService);
return CellNavigationService;
})();
exports.CellNavigationService = CellNavigationService;
/***/ },
/* 65 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var ColumnChangeEvent = (function () {
function ColumnChangeEvent(type) {
this.type = type;
}
ColumnChangeEvent.prototype.toString = function () {
var result = 'ColumnChangeEvent {type: ' + this.type;
if (this.column) {
result += ', column: ' + this.column.getColId();
}
if (this.columnGroup) {
result += true ? this.columnGroup.getColGroupDef().headerName : '(not defined]';
}
if (this.toIndex) {
result += ', toIndex: ' + this.toIndex;
}
if (this.visible) {
result += ', visible: ' + this.visible;
}
if (this.pinned) {
result += ', pinned: ' + this.pinned;
}
if (typeof this.finished == 'boolean') {
result += ', finished: ' + this.finished;
}
result += '}';
return result;
};
ColumnChangeEvent.prototype.withPinned = function (pinned) {
this.pinned = pinned;
return this;
};
ColumnChangeEvent.prototype.withVisible = function (visible) {
this.visible = visible;
return this;
};
ColumnChangeEvent.prototype.isVisible = function () {
return this.visible;
};
ColumnChangeEvent.prototype.getPinned = function () {
return this.pinned;
};
ColumnChangeEvent.prototype.withColumn = function (column) {
this.column = column;
return this;
};
ColumnChangeEvent.prototype.withColumns = function (columns) {
this.columns = columns;
return this;
};
ColumnChangeEvent.prototype.withFinished = function (finished) {
this.finished = finished;
return this;
};
ColumnChangeEvent.prototype.withColumnGroup = function (columnGroup) {
this.columnGroup = columnGroup;
return this;
};
ColumnChangeEvent.prototype.withToIndex = function (toIndex) {
this.toIndex = toIndex;
return this;
};
ColumnChangeEvent.prototype.getToIndex = function () {
return this.toIndex;
};
ColumnChangeEvent.prototype.getType = function () {
return this.type;
};
ColumnChangeEvent.prototype.getColumn = function () {
return this.column;
};
ColumnChangeEvent.prototype.getColumns = function () {
return this.columns;
};
ColumnChangeEvent.prototype.getColumnGroup = function () {
return this.columnGroup;
};
ColumnChangeEvent.prototype.isFinished = function () {
return this.finished;
};
return ColumnChangeEvent;
})();
exports.ColumnChangeEvent = ColumnChangeEvent;
/***/ },
/* 66 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
// class returns unique instance id's for columns.
// eg, the following calls (in this order) will result in:
//
// getInstanceIdForKey('country') => 0
// getInstanceIdForKey('country') => 1
// getInstanceIdForKey('country') => 2
// getInstanceIdForKey('country') => 3
// getInstanceIdForKey('age') => 0
// getInstanceIdForKey('age') => 1
// getInstanceIdForKey('country') => 4
var GroupInstanceIdCreator = (function () {
function GroupInstanceIdCreator() {
// this map contains keys to numbers, so we remember what the last call was
this.existingIds = {};
}
GroupInstanceIdCreator.prototype.getInstanceIdForKey = function (key) {
var lastResult = this.existingIds[key];
var result;
if (typeof lastResult !== 'number') {
// first time this key
result = 0;
}
else {
result = lastResult + 1;
}
this.existingIds[key] = result;
return result;
};
return GroupInstanceIdCreator;
})();
exports.GroupInstanceIdCreator = GroupInstanceIdCreator;
/***/ },
/* 67 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
function defaultGroupComparator(valueA, valueB, nodeA, nodeB) {
var nodeAIsGroup = utils_1.Utils.exists(nodeA) && nodeA.group;
var nodeBIsGroup = utils_1.Utils.exists(nodeB) && nodeB.group;
var bothAreGroups = nodeAIsGroup && nodeBIsGroup;
var bothAreNormal = !nodeAIsGroup && !nodeBIsGroup;
if (bothAreGroups) {
return utils_1.Utils.defaultComparator(nodeA.key, nodeB.key);
}
else if (bothAreNormal) {
return utils_1.Utils.defaultComparator(valueA, valueB);
}
else if (nodeAIsGroup) {
return 1;
}
else {
return -1;
}
}
exports.defaultGroupComparator = defaultGroupComparator;
/***/ },
/* 68 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var gridPanel_1 = __webpack_require__(24);
var column_1 = __webpack_require__(15);
var context_1 = __webpack_require__(6);
var headerContainer_1 = __webpack_require__(69);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var HeaderRenderer = (function () {
function HeaderRenderer() {
}
HeaderRenderer.prototype.init = function () {
var _this = this;
this.eHeaderViewport = this.gridPanel.getHeaderViewport();
this.eRoot = this.gridPanel.getRoot();
this.eHeaderOverlay = this.gridPanel.getHeaderOverlay();
this.centerContainer = new headerContainer_1.HeaderContainer(this.gridPanel.getHeaderContainer(), this.gridPanel.getHeaderViewport(), this.eRoot, null);
this.childContainers = [this.centerContainer];
if (!this.gridOptionsWrapper.isForPrint()) {
this.pinnedLeftContainer = new headerContainer_1.HeaderContainer(this.gridPanel.getPinnedLeftHeader(), null, this.eRoot, column_1.Column.PINNED_LEFT);
this.pinnedRightContainer = new headerContainer_1.HeaderContainer(this.gridPanel.getPinnedRightHeader(), null, this.eRoot, column_1.Column.PINNED_RIGHT);
this.childContainers.push(this.pinnedLeftContainer);
this.childContainers.push(this.pinnedRightContainer);
}
this.childContainers.forEach(function (container) { return _this.context.wireBean(container); });
// when grid columns change, it means the number of rows in the header has changed and it's all new columns
this.eventService.addEventListener(events_1.Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
// shotgun way to get labels to change, eg from sum(amount) to avg(amount)
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.refreshHeader.bind(this));
// for resized, the individual cells take care of this, so don't need to refresh everything
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.setPinnedColContainerWidth.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.setPinnedColContainerWidth.bind(this));
if (this.columnController.isReady()) {
this.refreshHeader();
}
};
HeaderRenderer.prototype.destroy = function () {
this.childContainers.forEach(function (container) { return container.destroy(); });
};
HeaderRenderer.prototype.onGridColumnsChanged = function () {
this.setHeight();
};
// this is called from the API and refreshes everything, should be broken out
// into refresh everything vs just something changed
HeaderRenderer.prototype.refreshHeader = function () {
this.setHeight();
this.childContainers.forEach(function (container) { return container.refresh(); });
this.setPinnedColContainerWidth();
};
HeaderRenderer.prototype.setHeight = function () {
// if forPrint, overlay is missing
if (this.eHeaderOverlay) {
var rowHeight = this.gridOptionsWrapper.getHeaderHeight();
// we can probably get rid of this when we no longer need the overlay
var dept = this.columnController.getHeaderRowCount();
this.eHeaderOverlay.style.height = rowHeight + 'px';
this.eHeaderOverlay.style.top = ((dept - 1) * rowHeight) + 'px';
}
};
HeaderRenderer.prototype.setPinnedColContainerWidth = function () {
// pinned col doesn't exist when doing forPrint
if (this.gridOptionsWrapper.isForPrint()) {
return;
}
var pinnedLeftWidth = this.columnController.getPinnedLeftContainerWidth();
this.eHeaderViewport.style.marginLeft = pinnedLeftWidth + 'px';
this.pinnedLeftContainer.setWidth(pinnedLeftWidth);
var pinnedRightWidth = this.columnController.getPinnedRightContainerWidth();
this.eHeaderViewport.style.marginRight = pinnedRightWidth + 'px';
this.pinnedRightContainer.setWidth(pinnedRightWidth);
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], HeaderRenderer.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], HeaderRenderer.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], HeaderRenderer.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], HeaderRenderer.prototype, "context", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], HeaderRenderer.prototype, "eventService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], HeaderRenderer.prototype, "init", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], HeaderRenderer.prototype, "destroy", null);
HeaderRenderer = __decorate([
context_1.Bean('headerRenderer'),
__metadata('design:paramtypes', [])
], HeaderRenderer);
return HeaderRenderer;
})();
exports.HeaderRenderer = HeaderRenderer;
/***/ },
/* 69 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var context_1 = __webpack_require__(6);
var column_1 = __webpack_require__(15);
var context_2 = __webpack_require__(6);
var dragAndDropService_1 = __webpack_require__(70);
var moveColumnController_1 = __webpack_require__(71);
var columnController_1 = __webpack_require__(13);
var gridPanel_1 = __webpack_require__(24);
var context_3 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var headerRowComp_1 = __webpack_require__(72);
var HeaderContainer = (function () {
function HeaderContainer(eContainer, eViewport, eRoot, pinned) {
this.headerRowComps = [];
this.eContainer = eContainer;
this.eRoot = eRoot;
this.pinned = pinned;
this.eViewport = eViewport;
}
HeaderContainer.prototype.setWidth = function (width) {
this.eContainer.style.width = width + 'px';
};
HeaderContainer.prototype.init = function () {
this.setupDragAndDrop();
// if value changes, then if not pivoting, we at least need to change the label eg from sum() to avg(),
// if pivoting, then the columns have changed
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.onGridColumnsChanged.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
};
HeaderContainer.prototype.destroy = function () {
this.removeHeaderRowComps();
};
// grid cols have changed - this also means the number of rows in the header can have
// changed. so we remove all the old rows and insert new ones for a complete refresh
HeaderContainer.prototype.onGridColumnsChanged = function () {
this.removeHeaderRowComps();
this.createHeaderRowComps();
};
// we expose this for gridOptions.api.refreshHeader() to call
HeaderContainer.prototype.refresh = function () {
this.onGridColumnsChanged();
};
HeaderContainer.prototype.setupDragAndDrop = function () {
var moveColumnController = new moveColumnController_1.MoveColumnController(this.pinned);
this.context.wireBean(moveColumnController);
var secondaryContainers;
switch (this.pinned) {
case column_1.Column.PINNED_LEFT:
secondaryContainers = this.gridPanel.getDropTargetLeftContainers();
break;
case column_1.Column.PINNED_RIGHT:
secondaryContainers = this.gridPanel.getDropTargetPinnedRightContainers();
break;
default:
secondaryContainers = this.gridPanel.getDropTargetBodyContainers();
break;
}
var icon = this.pinned ? dragAndDropService_1.DragAndDropService.ICON_PINNED : dragAndDropService_1.DragAndDropService.ICON_MOVE;
this.dropTarget = {
eContainer: this.eViewport ? this.eViewport : this.eContainer,
iconName: icon,
eSecondaryContainers: secondaryContainers,
onDragging: moveColumnController.onDragging.bind(moveColumnController),
onDragEnter: moveColumnController.onDragEnter.bind(moveColumnController),
onDragLeave: moveColumnController.onDragLeave.bind(moveColumnController),
onDragStop: moveColumnController.onDragStop.bind(moveColumnController)
};
this.dragAndDropService.addDropTarget(this.dropTarget);
};
HeaderContainer.prototype.removeHeaderRowComps = function () {
this.headerRowComps.forEach(function (headerRowComp) {
headerRowComp.destroy();
});
this.headerRowComps.length = 0;
utils_1.Utils.removeAllChildren(this.eContainer);
};
HeaderContainer.prototype.createHeaderRowComps = function () {
// if we are displaying header groups, then we have many rows here.
// go through each row of the header, one by one.
var rowCount = this.columnController.getHeaderRowCount();
for (var dept = 0; dept < rowCount; dept++) {
var groupRow = dept !== (rowCount - 1);
var headerRowComp = new headerRowComp_1.HeaderRowComp(dept, groupRow, this.pinned, this.eRoot, this.dropTarget);
this.context.wireBean(headerRowComp);
this.headerRowComps.push(headerRowComp);
this.eContainer.appendChild(headerRowComp.getGui());
}
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], HeaderContainer.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_2.Context)
], HeaderContainer.prototype, "context", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], HeaderContainer.prototype, "$scope", void 0);
__decorate([
context_1.Autowired('dragAndDropService'),
__metadata('design:type', dragAndDropService_1.DragAndDropService)
], HeaderContainer.prototype, "dragAndDropService", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], HeaderContainer.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], HeaderContainer.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], HeaderContainer.prototype, "eventService", void 0);
__decorate([
context_3.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], HeaderContainer.prototype, "init", null);
return HeaderContainer;
})();
exports.HeaderContainer = HeaderContainer;
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var context_1 = __webpack_require__(6);
var logger_1 = __webpack_require__(5);
var context_2 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var context_3 = __webpack_require__(6);
var svgFactory_1 = __webpack_require__(59);
var dragService_1 = __webpack_require__(31);
var columnController_1 = __webpack_require__(13);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var DragAndDropService = (function () {
function DragAndDropService() {
this.dropTargets = [];
}
DragAndDropService.prototype.init = function () {
this.ePinnedIcon = utils_1.Utils.createIcon('columnMovePin', this.gridOptionsWrapper, null, svgFactory.createPinIcon);
this.ePlusIcon = utils_1.Utils.createIcon('columnMoveAdd', this.gridOptionsWrapper, null, svgFactory.createPlusIcon);
this.eHiddenIcon = utils_1.Utils.createIcon('columnMoveHide', this.gridOptionsWrapper, null, svgFactory.createColumnHiddenIcon);
this.eMoveIcon = utils_1.Utils.createIcon('columnMoveMove', this.gridOptionsWrapper, null, svgFactory.createMoveIcon);
this.eLeftIcon = utils_1.Utils.createIcon('columnMoveLeft', this.gridOptionsWrapper, null, svgFactory.createLeftIcon);
this.eRightIcon = utils_1.Utils.createIcon('columnMoveRight', this.gridOptionsWrapper, null, svgFactory.createRightIcon);
this.eGroupIcon = utils_1.Utils.createIcon('columnMoveGroup', this.gridOptionsWrapper, null, svgFactory.createGroupIcon);
this.eAggregateIcon = utils_1.Utils.createIcon('columnMoveValue', this.gridOptionsWrapper, null, svgFactory.createAggregationIcon);
};
DragAndDropService.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('OldToolPanelDragAndDropService');
this.eBody = document.querySelector('body');
if (!this.eBody) {
console.warn('ag-Grid: could not find document body, it is needed for dragging columns');
}
};
// we do not need to clean up drag sources, as we are just adding a listener to the element.
// when the element is disposed, the drag source is also disposed, even though this service
// remains. this is a bit different to normal 'addListener' methods
DragAndDropService.prototype.addDragSource = function (dragSource) {
this.dragService.addDragSource({
eElement: dragSource.eElement,
onDragStart: this.onDragStart.bind(this, dragSource),
onDragStop: this.onDragStop.bind(this),
onDragging: this.onDragging.bind(this)
});
};
DragAndDropService.prototype.nudge = function () {
if (this.dragging) {
this.onDragging(this.eventLastTime, true);
}
};
DragAndDropService.prototype.onDragStart = function (dragSource, mouseEvent) {
this.dragging = true;
this.dragSource = dragSource;
this.eventLastTime = mouseEvent;
this.dragSource.dragItem.forEach(function (column) { return column.setMoving(true); });
this.dragItem = this.dragSource.dragItem;
this.lastDropTarget = this.dragSource.dragSourceDropTarget;
this.createGhost();
};
DragAndDropService.prototype.onDragStop = function (mouseEvent) {
this.eventLastTime = null;
this.dragging = false;
this.dragItem.forEach(function (column) { return column.setMoving(false); });
if (this.lastDropTarget && this.lastDropTarget.onDragStop) {
var draggingEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, null, false);
this.lastDropTarget.onDragStop(draggingEvent);
}
this.lastDropTarget = null;
this.dragItem = null;
this.removeGhost();
};
DragAndDropService.prototype.onDragging = function (mouseEvent, fromNudge) {
var direction = this.workOutDirection(mouseEvent);
this.eventLastTime = mouseEvent;
this.positionGhost(mouseEvent);
// check if mouseEvent intersects with any of the drop targets
var dropTarget = utils_1.Utils.find(this.dropTargets, this.isMouseOnDropTarget.bind(this, mouseEvent));
if (dropTarget !== this.lastDropTarget) {
this.leaveLastTargetIfExists(mouseEvent, direction, fromNudge);
this.enterDragTargetIfExists(dropTarget, mouseEvent, direction, fromNudge);
this.lastDropTarget = dropTarget;
}
else if (dropTarget) {
var draggingEvent = this.createDropTargetEvent(dropTarget, mouseEvent, direction, fromNudge);
dropTarget.onDragging(draggingEvent);
}
};
DragAndDropService.prototype.enterDragTargetIfExists = function (dropTarget, mouseEvent, direction, fromNudge) {
if (!dropTarget) {
return;
}
var dragEnterEvent = this.createDropTargetEvent(dropTarget, mouseEvent, direction, fromNudge);
dropTarget.onDragEnter(dragEnterEvent);
this.setGhostIcon(dropTarget.iconName);
};
DragAndDropService.prototype.leaveLastTargetIfExists = function (mouseEvent, direction, fromNudge) {
if (!this.lastDropTarget) {
return;
}
var dragLeaveEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, direction, fromNudge);
this.lastDropTarget.onDragLeave(dragLeaveEvent);
this.setGhostIcon(null);
};
// checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers
DragAndDropService.prototype.isMouseOnDropTarget = function (mouseEvent, dropTarget) {
var ePrimaryAndSecondaryContainers = [dropTarget.eContainer];
if (dropTarget.eSecondaryContainers) {
ePrimaryAndSecondaryContainers = ePrimaryAndSecondaryContainers.concat(dropTarget.eSecondaryContainers);
}
var gotMatch = false;
ePrimaryAndSecondaryContainers.forEach(function (eContainer) {
if (!eContainer) {
return;
} // secondary can be missing
var rect = eContainer.getBoundingClientRect();
// if element is not visible, then width and height are zero
if (rect.width === 0 || rect.height === 0) {
return;
}
var horizontalFit = mouseEvent.clientX >= rect.left && mouseEvent.clientX <= rect.right;
var verticalFit = mouseEvent.clientY >= rect.top && mouseEvent.clientY <= rect.bottom;
//console.log(`rect.width = ${rect.width} || rect.height = ${rect.height} ## verticalFit = ${verticalFit}, horizontalFit = ${horizontalFit}, `);
if (horizontalFit && verticalFit) {
gotMatch = true;
}
});
return gotMatch;
};
DragAndDropService.prototype.addDropTarget = function (dropTarget) {
this.dropTargets.push(dropTarget);
};
DragAndDropService.prototype.workOutDirection = function (event) {
var direction;
if (this.eventLastTime.clientX > event.clientX) {
direction = DragAndDropService.DIRECTION_LEFT;
}
else if (this.eventLastTime.clientX < event.clientX) {
direction = DragAndDropService.DIRECTION_RIGHT;
}
else {
direction = null;
}
return direction;
};
DragAndDropService.prototype.createDropTargetEvent = function (dropTarget, event, direction, fromNudge) {
// localise x and y to the target component
var rect = dropTarget.eContainer.getBoundingClientRect();
var x = event.clientX - rect.left;
var y = event.clientY - rect.top;
var dropTargetEvent = {
event: event,
x: x,
y: y,
direction: direction,
dragSource: this.dragSource,
fromNudge: fromNudge
};
return dropTargetEvent;
};
DragAndDropService.prototype.positionGhost = function (event) {
var ghostRect = this.eGhost.getBoundingClientRect();
var ghostHeight = ghostRect.height;
// for some reason, without the '-2', it still overlapped by 1 or 2 pixels, which
// then brought in scrollbars to the browser. no idea why, but putting in -2 here
// works around it which is good enough for me.
var browserWidth = utils_1.Utils.getBodyWidth() - 2;
var browserHeight = utils_1.Utils.getBodyHeight() - 2;
// put ghost vertically in middle of cursor
var top = event.pageY - (ghostHeight / 2);
// horizontally, place cursor just right of icon
var left = event.pageX - 30;
// check ghost is not positioned outside of the browser
if (browserWidth > 0) {
if ((left + this.eGhost.clientWidth) > browserWidth) {
left = browserWidth - this.eGhost.clientWidth;
}
}
if (left < 0) {
left = 0;
}
if (browserHeight > 0) {
if ((top + this.eGhost.clientHeight) > browserHeight) {
top = browserHeight - this.eGhost.clientHeight;
}
}
if (top < 0) {
top = 0;
}
this.eGhost.style.left = left + 'px';
this.eGhost.style.top = top + 'px';
};
DragAndDropService.prototype.removeGhost = function () {
if (this.eGhost) {
this.eBody.removeChild(this.eGhost);
}
this.eGhost = null;
};
DragAndDropService.prototype.createGhost = function () {
this.eGhost = utils_1.Utils.loadTemplate(DragAndDropService.GHOST_TEMPLATE);
this.eGhostIcon = this.eGhost.querySelector('.ag-dnd-ghost-icon');
if (this.lastDropTarget) {
this.setGhostIcon(this.lastDropTarget.iconName);
}
var eText = this.eGhost.querySelector('.ag-dnd-ghost-label');
eText.innerHTML = this.dragSource.dragItemName;
this.eGhost.style.height = this.gridOptionsWrapper.getHeaderHeight() + 'px';
this.eGhost.style.top = '20px';
this.eGhost.style.left = '20px';
this.eBody.appendChild(this.eGhost);
};
/*
// took this out as it wasn't making sense when dragging from the side panel, as it was possible to drag
columns that were not visible - which is fine, as you are selecting from all columns here. what should be
done is we check what columns to include in the drag depending on what started to drag - but that is to
much coding for now, so just hardcoding the width to 200px for now.
private getActualWidth(columns: Column[]): number {
var totalColWidth = 0;
// we only include displayed columns so hidden columns do not add space as this would look weird,
// if for example moving a group with 5 cols, but only 1 displayed, we want ghost to be just the width
// of the 1 displayed column
var allDisplayedColumns = this.columnController.getAllDisplayedColumns();
var displayedColumns = _.filter(columns, column => allDisplayedColumns.indexOf(column) >= 0 );
displayedColumns.forEach( column => totalColWidth += column.getActualWidth() );
return totalColWidth;
}
*/
DragAndDropService.prototype.setGhostIcon = function (iconName, shake) {
if (shake === void 0) { shake = false; }
utils_1.Utils.removeAllChildren(this.eGhostIcon);
var eIcon;
switch (iconName) {
case DragAndDropService.ICON_ADD:
eIcon = this.ePlusIcon;
break;
case DragAndDropService.ICON_PINNED:
eIcon = this.ePinnedIcon;
break;
case DragAndDropService.ICON_MOVE:
eIcon = this.eMoveIcon;
break;
case DragAndDropService.ICON_LEFT:
eIcon = this.eLeftIcon;
break;
case DragAndDropService.ICON_RIGHT:
eIcon = this.eRightIcon;
break;
case DragAndDropService.ICON_GROUP:
eIcon = this.eGroupIcon;
break;
case DragAndDropService.ICON_AGGREGATE:
eIcon = this.eAggregateIcon;
break;
default:
eIcon = this.eHiddenIcon;
break;
}
this.eGhostIcon.appendChild(eIcon);
utils_1.Utils.addOrRemoveCssClass(this.eGhostIcon, 'ag-shake-left-to-right', shake);
};
DragAndDropService.DIRECTION_LEFT = 'left';
DragAndDropService.DIRECTION_RIGHT = 'right';
DragAndDropService.ICON_PINNED = 'pinned';
DragAndDropService.ICON_ADD = 'add';
DragAndDropService.ICON_MOVE = 'move';
DragAndDropService.ICON_LEFT = 'left';
DragAndDropService.ICON_RIGHT = 'right';
DragAndDropService.ICON_GROUP = 'group';
DragAndDropService.ICON_AGGREGATE = 'aggregate';
DragAndDropService.GHOST_TEMPLATE = '<div class="ag-dnd-ghost">' +
' <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>' +
' <div class="ag-dnd-ghost-label">' +
' </div>' +
'</div>';
__decorate([
context_3.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], DragAndDropService.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_3.Autowired('dragService'),
__metadata('design:type', dragService_1.DragService)
], DragAndDropService.prototype, "dragService", void 0);
__decorate([
context_3.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], DragAndDropService.prototype, "columnController", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], DragAndDropService.prototype, "init", null);
__decorate([
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], DragAndDropService.prototype, "setBeans", null);
DragAndDropService = __decorate([
context_2.Bean('dragAndDropService'),
__metadata('design:paramtypes', [])
], DragAndDropService);
return DragAndDropService;
})();
exports.DragAndDropService = DragAndDropService;
/***/ },
/* 71 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var logger_1 = __webpack_require__(5);
var columnController_1 = __webpack_require__(13);
var column_1 = __webpack_require__(15);
var utils_1 = __webpack_require__(7);
var dragAndDropService_1 = __webpack_require__(70);
var gridPanel_1 = __webpack_require__(24);
var gridOptionsWrapper_1 = __webpack_require__(3);
var MoveColumnController = (function () {
function MoveColumnController(pinned) {
this.needToMoveLeft = false;
this.needToMoveRight = false;
this.pinned = pinned;
this.centerContainer = !utils_1.Utils.exists(pinned);
}
MoveColumnController.prototype.init = function () {
this.logger = this.loggerFactory.create('MoveColumnController');
};
MoveColumnController.prototype.onDragEnter = function (draggingEvent) {
// we do dummy drag, so make sure column appears in the right location when first placed
var columns = draggingEvent.dragSource.dragItem;
this.columnController.setColumnsVisible(columns, true);
this.columnController.setColumnsPinned(columns, this.pinned);
this.onDragging(draggingEvent, true);
};
MoveColumnController.prototype.onDragLeave = function (draggingEvent) {
var hideColumnOnExit = !this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns() && !draggingEvent.fromNudge;
if (hideColumnOnExit) {
var columns = draggingEvent.dragSource.dragItem;
this.columnController.setColumnsVisible(columns, false);
}
this.ensureIntervalCleared();
};
MoveColumnController.prototype.onDragStop = function () {
this.ensureIntervalCleared();
};
MoveColumnController.prototype.adjustXForScroll = function (draggingEvent) {
if (this.centerContainer) {
return draggingEvent.x + this.gridPanel.getHorizontalScrollPosition();
}
else {
return draggingEvent.x;
}
};
MoveColumnController.prototype.workOutNewIndex = function (displayedColumns, allColumns, dragColumn, direction, xAdjustedForScroll) {
if (direction === dragAndDropService_1.DragAndDropService.DIRECTION_LEFT) {
return this.getNewIndexForColMovingLeft(displayedColumns, allColumns, dragColumn, xAdjustedForScroll);
}
else {
return this.getNewIndexForColMovingRight(displayedColumns, allColumns, dragColumn, xAdjustedForScroll);
}
};
MoveColumnController.prototype.checkCenterForScrolling = function (xAdjustedForScroll) {
if (this.centerContainer) {
// scroll if the mouse has gone outside the grid (or just outside the scrollable part if pinning)
// putting in 50 buffer, so even if user gets to edge of grid, a scroll will happen
var firstVisiblePixel = this.gridPanel.getHorizontalScrollPosition();
var lastVisiblePixel = firstVisiblePixel + this.gridPanel.getCenterWidth();
this.needToMoveLeft = xAdjustedForScroll < (firstVisiblePixel + 50);
this.needToMoveRight = xAdjustedForScroll > (lastVisiblePixel - 50);
if (this.needToMoveLeft || this.needToMoveRight) {
this.ensureIntervalStarted();
}
else {
this.ensureIntervalCleared();
}
}
};
MoveColumnController.prototype.onDragging = function (draggingEvent, fromEnter) {
if (fromEnter === void 0) { fromEnter = false; }
this.lastDraggingEvent = draggingEvent;
// if moving up or down (ie not left or right) then do nothing
if (!draggingEvent.direction) {
return;
}
var xAdjustedForScroll = this.adjustXForScroll(draggingEvent);
// if the user is dragging into the panel, ie coming from the side panel into the main grid,
// we don't want to scroll the grid this time, it would appear like the table is jumping
// each time a column is dragged in.
if (!fromEnter) {
this.checkCenterForScrolling(xAdjustedForScroll);
}
var columnsToMove = draggingEvent.dragSource.dragItem;
this.attemptMoveColumns(columnsToMove, draggingEvent.direction, xAdjustedForScroll, fromEnter);
};
MoveColumnController.prototype.attemptMoveColumns = function (allMovingColumns, dragDirection, xAdjustedForScroll, fromEnter) {
var displayedColumns = this.columnController.getDisplayedColumns(this.pinned);
var gridColumns = this.columnController.getAllGridColumns();
var draggingLeft = dragDirection === dragAndDropService_1.DragAndDropService.DIRECTION_LEFT;
var draggingRight = dragDirection === dragAndDropService_1.DragAndDropService.DIRECTION_RIGHT;
var dragColumn;
var displayedMovingColumns = utils_1.Utils.filter(allMovingColumns, function (column) { return displayedColumns.indexOf(column) >= 0; });
// if dragging left, we want to use the left most column, ie move the left most column to
// under the mouse pointer
if (draggingLeft) {
dragColumn = displayedMovingColumns[0];
}
else {
dragColumn = displayedMovingColumns[displayedMovingColumns.length - 1];
}
var newIndex = this.workOutNewIndex(displayedColumns, gridColumns, dragColumn, dragDirection, xAdjustedForScroll);
var oldIndex = gridColumns.indexOf(dragColumn);
// the two check below stop an error when the user grabs a group my a middle column, then
// it is possible the mouse pointer is to the right of a column while been dragged left.
// so we need to make sure that the mouse pointer is actually left of the left most column
// if moving left, and right of the right most column if moving right
// we check 'fromEnter' below so we move the column to the new spot if the mouse is coming from
// outside the grid, eg if the column is moving from side panel, mouse is moving left, then we should
// place the column to the RHS even if the mouse is moving left and the column is already on
// the LHS. otherwise we stick to the rule described above.
// only allow left drag if this column is moving left
if (!fromEnter && draggingLeft && newIndex >= oldIndex) {
return;
}
// only allow right drag if this column is moving right
if (!fromEnter && draggingRight && newIndex <= oldIndex) {
return;
}
// if moving right, the new index is the index of the right most column, so adjust to first column
if (draggingRight) {
newIndex = newIndex - allMovingColumns.length + 1;
}
this.columnController.moveColumns(allMovingColumns, newIndex);
};
MoveColumnController.prototype.getNewIndexForColMovingLeft = function (displayedColumns, allColumns, dragColumn, x) {
var usedX = 0;
var leftColumn = null;
for (var i = 0; i < displayedColumns.length; i++) {
var currentColumn = displayedColumns[i];
if (currentColumn === dragColumn) {
continue;
}
usedX += currentColumn.getActualWidth();
if (usedX > x) {
break;
}
leftColumn = currentColumn;
}
var newIndex;
if (leftColumn) {
newIndex = allColumns.indexOf(leftColumn) + 1;
var oldIndex = allColumns.indexOf(dragColumn);
if (oldIndex < newIndex) {
newIndex--;
}
}
else {
newIndex = 0;
}
return newIndex;
};
MoveColumnController.prototype.getNewIndexForColMovingRight = function (displayedColumns, allColumns, dragColumnOrGroup, x) {
var dragColumn = dragColumnOrGroup;
var usedX = dragColumn.getActualWidth();
var leftColumn = null;
for (var i = 0; i < displayedColumns.length; i++) {
if (usedX > x) {
break;
}
var currentColumn = displayedColumns[i];
if (currentColumn === dragColumn) {
continue;
}
usedX += currentColumn.getActualWidth();
leftColumn = currentColumn;
}
var newIndex;
if (leftColumn) {
newIndex = allColumns.indexOf(leftColumn) + 1;
var oldIndex = allColumns.indexOf(dragColumn);
if (oldIndex < newIndex) {
newIndex--;
}
}
else {
newIndex = 0;
}
return newIndex;
};
MoveColumnController.prototype.ensureIntervalStarted = function () {
if (!this.movingIntervalId) {
this.intervalCount = 0;
this.failedMoveAttempts = 0;
this.movingIntervalId = setInterval(this.moveInterval.bind(this), 100);
if (this.needToMoveLeft) {
this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_LEFT, true);
}
else {
this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_RIGHT, true);
}
}
};
MoveColumnController.prototype.ensureIntervalCleared = function () {
if (this.moveInterval) {
clearInterval(this.movingIntervalId);
this.movingIntervalId = null;
this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_MOVE);
}
};
MoveColumnController.prototype.moveInterval = function () {
var pixelsToMove;
this.intervalCount++;
pixelsToMove = 10 + (this.intervalCount * 5);
if (pixelsToMove > 100) {
pixelsToMove = 100;
}
var pixelsMoved;
if (this.needToMoveLeft) {
pixelsMoved = this.gridPanel.scrollHorizontally(-pixelsToMove);
}
else if (this.needToMoveRight) {
pixelsMoved = this.gridPanel.scrollHorizontally(pixelsToMove);
}
if (pixelsMoved !== 0) {
this.onDragging(this.lastDraggingEvent);
this.failedMoveAttempts = 0;
}
else {
this.failedMoveAttempts++;
this.dragAndDropService.setGhostIcon(dragAndDropService_1.DragAndDropService.ICON_PINNED);
if (this.failedMoveAttempts > 7) {
var columns = this.lastDraggingEvent.dragSource.dragItem;
var pinType = this.needToMoveLeft ? column_1.Column.PINNED_LEFT : column_1.Column.PINNED_RIGHT;
this.columnController.setColumnsPinned(columns, pinType);
this.dragAndDropService.nudge();
}
}
};
__decorate([
context_1.Autowired('loggerFactory'),
__metadata('design:type', logger_1.LoggerFactory)
], MoveColumnController.prototype, "loggerFactory", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], MoveColumnController.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], MoveColumnController.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('dragAndDropService'),
__metadata('design:type', dragAndDropService_1.DragAndDropService)
], MoveColumnController.prototype, "dragAndDropService", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], MoveColumnController.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], MoveColumnController.prototype, "init", null);
return MoveColumnController;
})();
exports.MoveColumnController = MoveColumnController;
/***/ },
/* 72 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var component_1 = __webpack_require__(47);
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnGroup_1 = __webpack_require__(14);
var columnController_1 = __webpack_require__(13);
var renderedHeaderGroupCell_1 = __webpack_require__(73);
var renderedHeaderCell_1 = __webpack_require__(76);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var utils_1 = __webpack_require__(7);
var HeaderRowComp = (function (_super) {
__extends(HeaderRowComp, _super);
function HeaderRowComp(dept, showingGroups, pinned, eRoot, dropTarget) {
_super.call(this, "<div class=\"ag-header-row\"/>");
this.headerElements = {};
this.dept = dept;
this.showingGroups = showingGroups;
this.pinned = pinned;
this.eRoot = eRoot;
this.dropTarget = dropTarget;
}
HeaderRowComp.prototype.destroy = function () {
var idsOfAllChildren = Object.keys(this.headerElements);
this.removeAndDestroyChildComponents(idsOfAllChildren);
_super.prototype.destroy.call(this);
};
HeaderRowComp.prototype.removeAndDestroyChildComponents = function (idsToDestroy) {
var _this = this;
idsToDestroy.forEach(function (id) {
var child = _this.headerElements[id];
_this.getGui().removeChild(child.getGui());
child.destroy();
delete _this.headerElements[id];
});
};
HeaderRowComp.prototype.init = function () {
var _this = this;
var rowHeight = this.gridOptionsWrapper.getHeaderHeight();
this.getGui().style.top = (this.dept * rowHeight) + 'px';
this.getGui().style.height = rowHeight + 'px';
var virtualColumnsChangedListener = this.onVirtualColumnsChanged.bind(this);
var displayedColumnsChangedListener = this.onDisplayedColumnsChanged.bind(this);
this.eventService.addEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, virtualColumnsChangedListener);
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, displayedColumnsChangedListener);
this.addDestroyFunc(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, virtualColumnsChangedListener);
_this.eventService.removeEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, displayedColumnsChangedListener);
});
this.onVirtualColumnsChanged();
};
HeaderRowComp.prototype.onDisplayedColumnsChanged = function () {
// because column groups are created and destroyed on the fly as groups are opened / closed and columns are moved,
// we have to throw away all of the components when columns are changed, as the references to the old groups
// are no longer value. this is not true for columns where columns do not get destroyed between open / close
// or moving actions.
if (this.showingGroups) {
var idsOfAllChildren = Object.keys(this.headerElements);
this.removeAndDestroyChildComponents(idsOfAllChildren);
}
this.onVirtualColumnsChanged();
};
HeaderRowComp.prototype.onVirtualColumnsChanged = function () {
var _this = this;
var currentChildIds = Object.keys(this.headerElements);
var nodesAtDept = this.columnController.getVirtualHeaderGroupRow(this.pinned, this.dept);
nodesAtDept.forEach(function (child) {
var idOfChild = child.getUniqueId();
// if we already have this cell rendered, do nothing
if (currentChildIds.indexOf(idOfChild) >= 0) {
utils_1.Utils.removeFromArray(currentChildIds, idOfChild);
return;
}
// skip groups that have no displayed children. this can happen when the group is broken,
// and this section happens to have nothing to display for the open / closed state
if (child instanceof columnGroup_1.ColumnGroup && child.getDisplayedChildren().length === 0) {
return;
}
var renderedHeaderElement = _this.createHeaderElement(child);
_this.headerElements[idOfChild] = renderedHeaderElement;
_this.getGui().appendChild(renderedHeaderElement.getGui());
});
// at this point, anything left in currentChildIds is an element that is no longer in the viewport
this.removeAndDestroyChildComponents(currentChildIds);
};
HeaderRowComp.prototype.createHeaderElement = function (columnGroupChild) {
var result;
if (columnGroupChild instanceof columnGroup_1.ColumnGroup) {
result = new renderedHeaderGroupCell_1.RenderedHeaderGroupCell(columnGroupChild, this.eRoot, this.dropTarget);
}
else {
result = new renderedHeaderCell_1.RenderedHeaderCell(columnGroupChild, this.eRoot, this.dropTarget);
}
this.context.wireBean(result);
return result;
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], HeaderRowComp.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], HeaderRowComp.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], HeaderRowComp.prototype, "context", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], HeaderRowComp.prototype, "eventService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], HeaderRowComp.prototype, "init", null);
return HeaderRowComp;
})(component_1.Component);
exports.HeaderRowComp = HeaderRowComp;
/***/ },
/* 73 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var svgFactory_1 = __webpack_require__(59);
var columnController_1 = __webpack_require__(13);
var filterManager_1 = __webpack_require__(43);
var gridOptionsWrapper_1 = __webpack_require__(3);
var column_1 = __webpack_require__(15);
var horizontalDragService_1 = __webpack_require__(74);
var context_1 = __webpack_require__(6);
var cssClassApplier_1 = __webpack_require__(75);
var dragAndDropService_1 = __webpack_require__(70);
var setLeftFeature_1 = __webpack_require__(63);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var RenderedHeaderGroupCell = (function () {
function RenderedHeaderGroupCell(columnGroup, eRoot, dragSourceDropTarget) {
this.destroyFunctions = [];
this.columnGroup = columnGroup;
this.eRoot = eRoot;
this.dragSourceDropTarget = dragSourceDropTarget;
}
RenderedHeaderGroupCell.prototype.getGui = function () {
return this.eHeaderGroupCell;
};
RenderedHeaderGroupCell.prototype.onIndividualColumnResized = function (column) {
if (this.columnGroup.isChildInThisGroupDeepSearch(column)) {
this.setWidth();
}
};
RenderedHeaderGroupCell.prototype.init = function () {
this.eHeaderGroupCell = document.createElement('div');
cssClassApplier_1.CssClassApplier.addHeaderClassesFromCollDef(this.columnGroup.getColGroupDef(), this.eHeaderGroupCell, this.gridOptionsWrapper);
this.displayName = this.columnGroup.getHeaderName();
this.setupResize();
this.addClasses();
this.setupLabel();
this.setupMove();
this.setWidth();
var setLeftFeature = new setLeftFeature_1.SetLeftFeature(this.columnGroup, this.eHeaderGroupCell);
this.destroyFunctions.push(setLeftFeature.destroy.bind(setLeftFeature));
};
RenderedHeaderGroupCell.prototype.setupLabel = function () {
// no renderer, default text render
if (this.displayName && this.displayName !== '') {
var eGroupCellLabel = document.createElement("div");
eGroupCellLabel.className = 'ag-header-group-cell-label';
this.eHeaderGroupCell.appendChild(eGroupCellLabel);
if (utils_1.Utils.isBrowserSafari()) {
eGroupCellLabel.style.display = 'table-cell';
}
var eInnerText = document.createElement("span");
eInnerText.className = 'ag-header-group-text';
eInnerText.innerHTML = this.displayName;
eGroupCellLabel.appendChild(eInnerText);
if (this.columnGroup.isExpandable()) {
this.addGroupExpandIcon(eGroupCellLabel);
}
}
};
RenderedHeaderGroupCell.prototype.addClasses = function () {
utils_1.Utils.addCssClass(this.eHeaderGroupCell, 'ag-header-group-cell');
// having different classes below allows the style to not have a bottom border
// on the group header, if no group is specified
if (this.columnGroup.getColGroupDef()) {
utils_1.Utils.addCssClass(this.eHeaderGroupCell, 'ag-header-group-cell-with-group');
}
else {
utils_1.Utils.addCssClass(this.eHeaderGroupCell, 'ag-header-group-cell-no-group');
}
};
RenderedHeaderGroupCell.prototype.setupResize = function () {
var _this = this;
if (!this.gridOptionsWrapper.isEnableColResize()) {
return;
}
this.eHeaderCellResize = document.createElement("div");
this.eHeaderCellResize.className = "ag-header-cell-resize";
this.eHeaderGroupCell.appendChild(this.eHeaderCellResize);
this.dragService.addDragHandling({
eDraggableElement: this.eHeaderCellResize,
eBody: this.eRoot,
cursor: 'col-resize',
startAfterPixels: 0,
onDragStart: this.onDragStart.bind(this),
onDragging: this.onDragging.bind(this)
});
if (!this.gridOptionsWrapper.isSuppressAutoSize()) {
this.eHeaderCellResize.addEventListener('dblclick', function (event) {
// get list of all the column keys we are responsible for
var keys = [];
_this.columnGroup.getDisplayedLeafColumns().forEach(function (column) {
// not all cols in the group may be participating with auto-resize
if (!column.getColDef().suppressAutoSize) {
keys.push(column.getColId());
}
});
if (keys.length > 0) {
_this.columnController.autoSizeColumns(keys);
}
});
}
};
RenderedHeaderGroupCell.prototype.setupMove = function () {
var eLabel = this.eHeaderGroupCell.querySelector('.ag-header-group-cell-label');
if (!eLabel) {
return;
}
if (this.gridOptionsWrapper.isSuppressMovableColumns()) {
return;
}
// if any child is fixed, then don't allow moving
var atLeastOneChildNotMovable = false;
this.columnGroup.getLeafColumns().forEach(function (column) {
if (column.getColDef().suppressMovable) {
atLeastOneChildNotMovable = true;
}
});
if (atLeastOneChildNotMovable) {
return;
}
// don't allow moving of headers when forPrint, as the header overlay doesn't exist
if (this.gridOptionsWrapper.isForPrint()) {
return;
}
if (eLabel) {
var dragSource = {
eElement: eLabel,
dragItemName: this.displayName,
// we add in the original group leaf columns, so we move both visible and non-visible items
dragItem: this.getAllColumnsInThisGroup(),
dragSourceDropTarget: this.dragSourceDropTarget
};
this.dragAndDropService.addDragSource(dragSource);
}
};
// when moving the columns, we want to move all the columns in this group in one go, and in the order they
// are currently in the screen.
RenderedHeaderGroupCell.prototype.getAllColumnsInThisGroup = function () {
var allColumnsOriginalOrder = this.columnGroup.getOriginalColumnGroup().getLeafColumns();
var allColumnsCurrentOrder = [];
this.columnController.getAllDisplayedColumns().forEach(function (column) {
if (allColumnsOriginalOrder.indexOf(column) >= 0) {
allColumnsCurrentOrder.push(column);
utils_1.Utils.removeFromArray(allColumnsOriginalOrder, column);
}
});
// we are left with non-visible columns, stick these in at the end
allColumnsOriginalOrder.forEach(function (column) { return allColumnsCurrentOrder.push(column); });
return allColumnsCurrentOrder;
};
RenderedHeaderGroupCell.prototype.setWidth = function () {
var _this = this;
var widthChangedListener = function () {
_this.eHeaderGroupCell.style.width = _this.columnGroup.getActualWidth() + 'px';
};
this.columnGroup.getLeafColumns().forEach(function (column) {
column.addEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
_this.destroyFunctions.push(function () {
column.removeEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
});
});
widthChangedListener();
};
RenderedHeaderGroupCell.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) {
func();
});
};
RenderedHeaderGroupCell.prototype.addGroupExpandIcon = function (eGroupCellLabel) {
var eGroupIcon;
if (this.columnGroup.isExpanded()) {
eGroupIcon = utils_1.Utils.createIcon('columnGroupOpened', this.gridOptionsWrapper, null, svgFactory.createGroupContractedIcon);
}
else {
eGroupIcon = utils_1.Utils.createIcon('columnGroupClosed', this.gridOptionsWrapper, null, svgFactory.createGroupExpandedIcon);
}
eGroupIcon.className = 'ag-header-expand-icon';
eGroupCellLabel.appendChild(eGroupIcon);
var that = this;
eGroupIcon.onclick = function () {
var newExpandedValue = !that.columnGroup.isExpanded();
that.columnController.setColumnGroupOpened(that.columnGroup, newExpandedValue);
};
};
RenderedHeaderGroupCell.prototype.onDragStart = function () {
var _this = this;
this.groupWidthStart = this.columnGroup.getActualWidth();
this.childrenWidthStarts = [];
this.columnGroup.getDisplayedLeafColumns().forEach(function (column) {
_this.childrenWidthStarts.push(column.getActualWidth());
});
};
RenderedHeaderGroupCell.prototype.onDragging = function (dragChange, finished) {
var _this = this;
var newWidth = this.groupWidthStart + dragChange;
var minWidth = this.columnGroup.getMinWidth();
if (newWidth < minWidth) {
newWidth = minWidth;
}
// distribute the new width to the child headers
var changeRatio = newWidth / this.groupWidthStart;
// keep track of pixels used, and last column gets the remaining,
// to cater for rounding errors, and min width adjustments
var pixelsToDistribute = newWidth;
var displayedColumns = this.columnGroup.getDisplayedLeafColumns();
displayedColumns.forEach(function (column, index) {
var notLastCol = index !== (displayedColumns.length - 1);
var newChildSize;
if (notLastCol) {
// if not the last col, calculate the column width as normal
var startChildSize = _this.childrenWidthStarts[index];
newChildSize = startChildSize * changeRatio;
if (newChildSize < column.getMinWidth()) {
newChildSize = column.getMinWidth();
}
pixelsToDistribute -= newChildSize;
}
else {
// if last col, give it the remaining pixels
newChildSize = pixelsToDistribute;
}
_this.columnController.setColumnWidth(column, newChildSize, finished);
});
};
__decorate([
context_1.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], RenderedHeaderGroupCell.prototype, "filterManager", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], RenderedHeaderGroupCell.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('horizontalDragService'),
__metadata('design:type', horizontalDragService_1.HorizontalDragService)
], RenderedHeaderGroupCell.prototype, "dragService", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], RenderedHeaderGroupCell.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('dragAndDropService'),
__metadata('design:type', dragAndDropService_1.DragAndDropService)
], RenderedHeaderGroupCell.prototype, "dragAndDropService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], RenderedHeaderGroupCell.prototype, "init", null);
return RenderedHeaderGroupCell;
})();
exports.RenderedHeaderGroupCell = RenderedHeaderGroupCell;
/***/ },
/* 74 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var HorizontalDragService = (function () {
function HorizontalDragService() {
}
HorizontalDragService.prototype.addDragHandling = function (params) {
params.eDraggableElement.addEventListener('mousedown', function (startEvent) {
new DragInstance(params, startEvent);
});
};
HorizontalDragService = __decorate([
context_1.Bean('horizontalDragService'),
__metadata('design:paramtypes', [])
], HorizontalDragService);
return HorizontalDragService;
})();
exports.HorizontalDragService = HorizontalDragService;
var DragInstance = (function () {
function DragInstance(params, startEvent) {
this.mouseMove = this.onMouseMove.bind(this);
this.mouseUp = this.onMouseUp.bind(this);
this.mouseLeave = this.onMouseLeave.bind(this);
this.lastDelta = 0;
this.params = params;
this.eDragParent = document.querySelector('body');
this.dragStartX = startEvent.clientX;
this.startEvent = startEvent;
this.eDragParent.addEventListener('mousemove', this.mouseMove);
this.eDragParent.addEventListener('mouseup', this.mouseUp);
this.eDragParent.addEventListener('mouseleave', this.mouseLeave);
this.draggingStarted = false;
var startAfterPixelsExist = typeof params.startAfterPixels === 'number' && params.startAfterPixels > 0;
if (!startAfterPixelsExist) {
this.startDragging();
}
}
DragInstance.prototype.startDragging = function () {
this.draggingStarted = true;
this.oldBodyCursor = this.params.eBody.style.cursor;
this.oldParentCursor = this.eDragParent.style.cursor;
this.oldMsUserSelect = this.eDragParent.style.msUserSelect;
this.oldWebkitUserSelect = this.eDragParent.style.webkitUserSelect;
// change the body cursor, so when drag moves out of the drag bar, the cursor is still 'resize' (or 'move'
this.params.eBody.style.cursor = this.params.cursor;
// same for outside the grid, we want to keep the resize (or move) cursor
this.eDragParent.style.cursor = this.params.cursor;
// we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move)
this.eDragParent.style.msUserSelect = 'none';
this.eDragParent.style.webkitUserSelect = 'none';
this.params.onDragStart(this.startEvent);
};
DragInstance.prototype.onMouseMove = function (moveEvent) {
var newX = moveEvent.clientX;
this.lastDelta = newX - this.dragStartX;
if (!this.draggingStarted) {
var dragExceededStartAfterPixels = Math.abs(this.lastDelta) >= this.params.startAfterPixels;
if (dragExceededStartAfterPixels) {
this.startDragging();
}
}
if (this.draggingStarted) {
this.params.onDragging(this.lastDelta, false);
}
};
DragInstance.prototype.onMouseUp = function () {
this.stopDragging();
};
DragInstance.prototype.onMouseLeave = function () {
this.stopDragging();
};
DragInstance.prototype.stopDragging = function () {
// reset cursor back to original cursor, if they were changed in the first place
if (this.draggingStarted) {
this.params.eBody.style.cursor = this.oldBodyCursor;
this.eDragParent.style.cursor = this.oldParentCursor;
this.eDragParent.style.msUserSelect = this.oldMsUserSelect;
this.eDragParent.style.webkitUserSelect = this.oldWebkitUserSelect;
this.params.onDragging(this.lastDelta, true);
}
// always remove the listeners, as these are always added
this.eDragParent.removeEventListener('mousemove', this.mouseMove);
this.eDragParent.removeEventListener('mouseup', this.mouseUp);
this.eDragParent.removeEventListener('mouseleave', this.mouseLeave);
};
return DragInstance;
})();
/***/ },
/* 75 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var CssClassApplier = (function () {
function CssClassApplier() {
}
CssClassApplier.addHeaderClassesFromCollDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper) {
if (abstractColDef && abstractColDef.headerClass) {
var classToUse;
if (typeof abstractColDef.headerClass === 'function') {
var params = {
// bad naming, as colDef here can be a group or a column,
// however most people won't appreciate the difference,
// so keeping it as colDef to avoid confusion.
colDef: abstractColDef,
context: gridOptionsWrapper.getContext(),
api: gridOptionsWrapper.getApi()
};
var headerClassFunc = abstractColDef.headerClass;
classToUse = headerClassFunc(params);
}
else {
classToUse = abstractColDef.headerClass;
}
if (typeof classToUse === 'string') {
utils_1.Utils.addCssClass(eHeaderCell, classToUse);
}
else if (Array.isArray(classToUse)) {
classToUse.forEach(function (cssClassItem) {
utils_1.Utils.addCssClass(eHeaderCell, cssClassItem);
});
}
}
};
return CssClassApplier;
})();
exports.CssClassApplier = CssClassApplier;
/***/ },
/* 76 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var column_1 = __webpack_require__(15);
var filterManager_1 = __webpack_require__(43);
var columnController_1 = __webpack_require__(13);
var headerTemplateLoader_1 = __webpack_require__(77);
var gridOptionsWrapper_1 = __webpack_require__(3);
var horizontalDragService_1 = __webpack_require__(74);
var gridCore_1 = __webpack_require__(40);
var context_1 = __webpack_require__(6);
var cssClassApplier_1 = __webpack_require__(75);
var dragAndDropService_1 = __webpack_require__(70);
var sortController_1 = __webpack_require__(42);
var setLeftFeature_1 = __webpack_require__(63);
var RenderedHeaderCell = (function () {
function RenderedHeaderCell(column, eRoot, dragSourceDropTarget) {
// for better structured code, anything we need to do when this column gets destroyed,
// we put a function in here. otherwise we would have a big destroy function with lots
// of 'if / else' mapping to things that got created.
this.destroyFunctions = [];
this.column = column;
this.eRoot = eRoot;
this.dragSourceDropTarget = dragSourceDropTarget;
}
RenderedHeaderCell.prototype.init = function () {
this.eHeaderCell = this.headerTemplateLoader.createHeaderElement(this.column);
utils_1.Utils.addCssClass(this.eHeaderCell, 'ag-header-cell');
this.createScope();
this.addAttributes();
cssClassApplier_1.CssClassApplier.addHeaderClassesFromCollDef(this.column.getColDef(), this.eHeaderCell, this.gridOptionsWrapper);
// label div
var eHeaderCellLabel = this.eHeaderCell.querySelector('#agHeaderCellLabel');
this.displayName = this.columnController.getDisplayNameForCol(this.column, true);
this.setupMovingCss();
this.setupTooltip();
this.setupResize();
this.setupMove(eHeaderCellLabel);
this.setupMenu();
this.setupSort(eHeaderCellLabel);
this.setupFilterIcon();
this.setupText();
this.setupWidth();
var setLeftFeature = new setLeftFeature_1.SetLeftFeature(this.column, this.eHeaderCell);
this.destroyFunctions.push(setLeftFeature.destroy.bind(setLeftFeature));
};
RenderedHeaderCell.prototype.setupTooltip = function () {
var colDef = this.column.getColDef();
// add tooltip if exists
if (colDef.headerTooltip) {
this.eHeaderCell.title = colDef.headerTooltip;
}
};
RenderedHeaderCell.prototype.setupText = function () {
var colDef = this.column.getColDef();
// render the cell, use a renderer if one is provided
var headerCellRenderer;
if (colDef.headerCellRenderer) {
headerCellRenderer = colDef.headerCellRenderer;
}
else if (this.gridOptionsWrapper.getHeaderCellRenderer()) {
headerCellRenderer = this.gridOptionsWrapper.getHeaderCellRenderer();
}
var eText = this.eHeaderCell.querySelector('#agText');
if (eText) {
if (headerCellRenderer) {
this.useRenderer(this.displayName, headerCellRenderer, eText);
}
else {
// no renderer, default text render
eText.className = 'ag-header-cell-text';
eText.innerHTML = this.displayName;
}
}
};
RenderedHeaderCell.prototype.setupFilterIcon = function () {
var _this = this;
var eFilterIcon = this.eHeaderCell.querySelector('#agFilter');
if (!eFilterIcon) {
return;
}
var filterChangedListener = function () {
var filterPresent = _this.column.isFilterActive();
utils_1.Utils.addOrRemoveCssClass(_this.eHeaderCell, 'ag-header-cell-filtered', filterPresent);
utils_1.Utils.addOrRemoveCssClass(eFilterIcon, 'ag-hidden', !filterPresent);
};
this.column.addEventListener(column_1.Column.EVENT_FILTER_ACTIVE_CHANGED, filterChangedListener);
this.destroyFunctions.push(function () {
_this.column.removeEventListener(column_1.Column.EVENT_FILTER_ACTIVE_CHANGED, filterChangedListener);
});
filterChangedListener();
};
RenderedHeaderCell.prototype.setupWidth = function () {
var _this = this;
var widthChangedListener = function () {
_this.eHeaderCell.style.width = _this.column.getActualWidth() + 'px';
};
this.column.addEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
this.destroyFunctions.push(function () {
_this.column.removeEventListener(column_1.Column.EVENT_WIDTH_CHANGED, widthChangedListener);
});
widthChangedListener();
};
RenderedHeaderCell.prototype.getGui = function () {
return this.eHeaderCell;
};
RenderedHeaderCell.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) {
func();
});
};
RenderedHeaderCell.prototype.createScope = function () {
var _this = this;
if (this.gridOptionsWrapper.isAngularCompileHeaders()) {
this.childScope = this.$scope.$new();
this.childScope.colDef = this.column.getColDef();
this.childScope.colDefWrapper = this.column;
this.childScope.context = this.gridOptionsWrapper.getContext();
this.destroyFunctions.push(function () {
_this.childScope.$destroy();
});
}
};
RenderedHeaderCell.prototype.addAttributes = function () {
this.eHeaderCell.setAttribute("colId", this.column.getColId());
};
RenderedHeaderCell.prototype.setupMenu = function () {
var _this = this;
var eMenu = this.eHeaderCell.querySelector('#agMenu');
// if no menu provided in template, do nothing
if (!eMenu) {
return;
}
var weWantMenu = this.menuFactory.isMenuEnabled(this.column) && !this.column.getColDef().suppressMenu;
if (!weWantMenu) {
utils_1.Utils.removeFromParent(eMenu);
return;
}
eMenu.addEventListener('click', function () { return _this.showMenu(eMenu); });
if (!this.gridOptionsWrapper.isSuppressMenuHide()) {
eMenu.style.opacity = '0';
this.eHeaderCell.addEventListener('mouseover', function () {
eMenu.style.opacity = '1';
});
this.eHeaderCell.addEventListener('mouseout', function () {
eMenu.style.opacity = '0';
});
}
var style = eMenu.style;
style['transition'] = 'opacity 0.2s, border 0.2s';
style['-webkit-transition'] = 'opacity 0.2s, border 0.2s';
};
RenderedHeaderCell.prototype.showMenu = function (eventSource) {
this.menuFactory.showMenuAfterButtonClick(this.column, eventSource);
};
RenderedHeaderCell.prototype.setupMovingCss = function () {
var _this = this;
// this function adds or removes the moving css, based on if the col is moving
var addMovingCssFunc = function () {
if (_this.column.isMoving()) {
utils_1.Utils.addCssClass(_this.eHeaderCell, 'ag-header-cell-moving');
}
else {
utils_1.Utils.removeCssClass(_this.eHeaderCell, 'ag-header-cell-moving');
}
};
// call it now once, so the col is set up correctly
addMovingCssFunc();
// then call it every time we are informed of a moving state change in the col
this.column.addEventListener(column_1.Column.EVENT_MOVING_CHANGED, addMovingCssFunc);
// finally we remove the listener when this cell is no longer rendered
this.destroyFunctions.push(function () {
_this.column.removeEventListener(column_1.Column.EVENT_MOVING_CHANGED, addMovingCssFunc);
});
};
RenderedHeaderCell.prototype.setupMove = function (eHeaderCellLabel) {
if (this.gridOptionsWrapper.isSuppressMovableColumns() || this.column.getColDef().suppressMovable) {
return;
}
if (this.gridOptionsWrapper.isForPrint()) {
// don't allow moving of headers when forPrint, as the header overlay doesn't exist
return;
}
if (eHeaderCellLabel) {
var dragSource = {
eElement: eHeaderCellLabel,
dragItem: [this.column],
dragItemName: this.displayName,
dragSourceDropTarget: this.dragSourceDropTarget
};
this.dragAndDropService.addDragSource(dragSource);
}
};
RenderedHeaderCell.prototype.setupResize = function () {
var _this = this;
var colDef = this.column.getColDef();
var eResize = this.eHeaderCell.querySelector('#agResizeBar');
// if no eResize in template, do nothing
if (!eResize) {
return;
}
var weWantResize = this.gridOptionsWrapper.isEnableColResize() && !colDef.suppressResize;
if (!weWantResize) {
utils_1.Utils.removeFromParent(eResize);
return;
}
this.dragService.addDragHandling({
eDraggableElement: eResize,
eBody: this.eRoot,
cursor: 'col-resize',
startAfterPixels: 0,
onDragStart: this.onDragStart.bind(this),
onDragging: this.onDragging.bind(this)
});
var weWantAutoSize = !this.gridOptionsWrapper.isSuppressAutoSize() && !colDef.suppressAutoSize;
if (weWantAutoSize) {
eResize.addEventListener('dblclick', function () {
_this.columnController.autoSizeColumn(_this.column);
});
}
};
RenderedHeaderCell.prototype.useRenderer = function (headerNameValue, headerCellRenderer, eText) {
// renderer provided, use it
var cellRendererParams = {
colDef: this.column.getColDef(),
$scope: this.childScope,
context: this.gridOptionsWrapper.getContext(),
value: headerNameValue,
api: this.gridOptionsWrapper.getApi(),
eHeaderCell: this.eHeaderCell
};
var cellRendererResult = headerCellRenderer(cellRendererParams);
var childToAppend;
if (utils_1.Utils.isNodeOrElement(cellRendererResult)) {
// a dom node or element was returned, so add child
childToAppend = cellRendererResult;
}
else {
// otherwise assume it was html, so just insert
var eTextSpan = document.createElement("span");
eTextSpan.innerHTML = cellRendererResult;
childToAppend = eTextSpan;
}
// angular compile header if option is turned on
if (this.gridOptionsWrapper.isAngularCompileHeaders()) {
var childToAppendCompiled = this.$compile(childToAppend)(this.childScope)[0];
eText.appendChild(childToAppendCompiled);
}
else {
eText.appendChild(childToAppend);
}
};
RenderedHeaderCell.prototype.setupSort = function (eHeaderCellLabel) {
var _this = this;
var enableSorting = this.gridOptionsWrapper.isEnableSorting() && !this.column.getColDef().suppressSorting;
if (!enableSorting) {
utils_1.Utils.removeFromParent(this.eHeaderCell.querySelector('#agSortAsc'));
utils_1.Utils.removeFromParent(this.eHeaderCell.querySelector('#agSortDesc'));
utils_1.Utils.removeFromParent(this.eHeaderCell.querySelector('#agNoSort'));
return;
}
// add sortable class for styling
utils_1.Utils.addCssClass(this.eHeaderCell, 'ag-header-cell-sortable');
// add the event on the header, so when clicked, we do sorting
if (eHeaderCellLabel) {
eHeaderCellLabel.addEventListener("click", function (event) {
_this.sortController.progressSort(_this.column, event.shiftKey);
});
}
// add listener for sort changing, and update the icons accordingly
var eSortAsc = this.eHeaderCell.querySelector('#agSortAsc');
var eSortDesc = this.eHeaderCell.querySelector('#agSortDesc');
var eSortNone = this.eHeaderCell.querySelector('#agNoSort');
var sortChangedListener = function () {
utils_1.Utils.addOrRemoveCssClass(_this.eHeaderCell, 'ag-header-cell-sorted-asc', _this.column.isSortAscending());
utils_1.Utils.addOrRemoveCssClass(_this.eHeaderCell, 'ag-header-cell-sorted-desc', _this.column.isSortDescending());
utils_1.Utils.addOrRemoveCssClass(_this.eHeaderCell, 'ag-header-cell-sorted-none', _this.column.isSortNone());
if (eSortAsc) {
utils_1.Utils.addOrRemoveCssClass(eSortAsc, 'ag-hidden', !_this.column.isSortAscending());
}
if (eSortDesc) {
utils_1.Utils.addOrRemoveCssClass(eSortDesc, 'ag-hidden', !_this.column.isSortDescending());
}
if (eSortNone) {
var alwaysHideNoSort = !_this.column.getColDef().unSortIcon && !_this.gridOptionsWrapper.isUnSortIcon();
utils_1.Utils.addOrRemoveCssClass(eSortNone, 'ag-hidden', alwaysHideNoSort || !_this.column.isSortNone());
}
};
this.column.addEventListener(column_1.Column.EVENT_SORT_CHANGED, sortChangedListener);
this.destroyFunctions.push(function () {
_this.column.removeEventListener(column_1.Column.EVENT_SORT_CHANGED, sortChangedListener);
});
sortChangedListener();
};
RenderedHeaderCell.prototype.onDragStart = function () {
this.startWidth = this.column.getActualWidth();
};
RenderedHeaderCell.prototype.onDragging = function (dragChange, finished) {
var newWidth = this.startWidth + dragChange;
this.columnController.setColumnWidth(this.column, newWidth, finished);
};
RenderedHeaderCell.prototype.onIndividualColumnResized = function (column) {
if (this.column !== column) {
return;
}
var newWidthPx = column.getActualWidth() + "px";
this.eHeaderCell.style.width = newWidthPx;
};
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], RenderedHeaderCell.prototype, "context", void 0);
__decorate([
context_1.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], RenderedHeaderCell.prototype, "filterManager", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], RenderedHeaderCell.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('$compile'),
__metadata('design:type', Object)
], RenderedHeaderCell.prototype, "$compile", void 0);
__decorate([
context_1.Autowired('gridCore'),
__metadata('design:type', gridCore_1.GridCore)
], RenderedHeaderCell.prototype, "gridCore", void 0);
__decorate([
context_1.Autowired('headerTemplateLoader'),
__metadata('design:type', headerTemplateLoader_1.HeaderTemplateLoader)
], RenderedHeaderCell.prototype, "headerTemplateLoader", void 0);
__decorate([
context_1.Autowired('horizontalDragService'),
__metadata('design:type', horizontalDragService_1.HorizontalDragService)
], RenderedHeaderCell.prototype, "dragService", void 0);
__decorate([
context_1.Autowired('menuFactory'),
__metadata('design:type', Object)
], RenderedHeaderCell.prototype, "menuFactory", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], RenderedHeaderCell.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('dragAndDropService'),
__metadata('design:type', dragAndDropService_1.DragAndDropService)
], RenderedHeaderCell.prototype, "dragAndDropService", void 0);
__decorate([
context_1.Autowired('sortController'),
__metadata('design:type', sortController_1.SortController)
], RenderedHeaderCell.prototype, "sortController", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], RenderedHeaderCell.prototype, "$scope", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], RenderedHeaderCell.prototype, "init", null);
return RenderedHeaderCell;
})();
exports.RenderedHeaderCell = RenderedHeaderCell;
/***/ },
/* 77 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var svgFactory_1 = __webpack_require__(59);
var gridOptionsWrapper_1 = __webpack_require__(3);
var context_1 = __webpack_require__(6);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var HeaderTemplateLoader = (function () {
function HeaderTemplateLoader() {
}
HeaderTemplateLoader.prototype.createHeaderElement = function (column) {
var params = {
column: column,
colDef: column.getColDef,
context: this.gridOptionsWrapper.getContext(),
api: this.gridOptionsWrapper.getApi()
};
// option 1 - see if user provided a template in colDef
var userProvidedTemplate = column.getColDef().headerCellTemplate;
if (typeof userProvidedTemplate === 'function') {
var colDefFunc = userProvidedTemplate;
userProvidedTemplate = colDefFunc(params);
}
// option 2 - check the gridOptions for cellTemplate
if (!userProvidedTemplate && this.gridOptionsWrapper.getHeaderCellTemplate()) {
userProvidedTemplate = this.gridOptionsWrapper.getHeaderCellTemplate();
}
// option 3 - check the gridOptions for templateFunction
if (!userProvidedTemplate && this.gridOptionsWrapper.getHeaderCellTemplateFunc()) {
var gridOptionsFunc = this.gridOptionsWrapper.getHeaderCellTemplateFunc();
userProvidedTemplate = gridOptionsFunc(params);
}
// finally, if still no template, use the default
if (!userProvidedTemplate) {
userProvidedTemplate = this.createDefaultHeaderElement(column);
}
// template can be a string or a dom element, if string we need to convert to a dom element
var result;
if (typeof userProvidedTemplate === 'string') {
result = utils_1.Utils.loadTemplate(userProvidedTemplate);
}
else if (utils_1.Utils.isNodeOrElement(userProvidedTemplate)) {
result = userProvidedTemplate;
}
else {
console.error('ag-Grid: header template must be a string or an HTML element');
}
return result;
};
HeaderTemplateLoader.prototype.createDefaultHeaderElement = function (column) {
var eTemplate = utils_1.Utils.loadTemplate(HeaderTemplateLoader.HEADER_CELL_TEMPLATE);
this.addInIcon(eTemplate, 'sortAscending', '#agSortAsc', column, svgFactory.createArrowUpSvg);
this.addInIcon(eTemplate, 'sortDescending', '#agSortDesc', column, svgFactory.createArrowDownSvg);
this.addInIcon(eTemplate, 'sortUnSort', '#agNoSort', column, svgFactory.createArrowUpDownSvg);
this.addInIcon(eTemplate, 'menu', '#agMenu', column, svgFactory.createMenuSvg);
this.addInIcon(eTemplate, 'filter', '#agFilter', column, svgFactory.createFilterSvg);
return eTemplate;
};
HeaderTemplateLoader.prototype.addInIcon = function (eTemplate, iconName, cssSelector, column, defaultIconFactory) {
var eIcon = utils_1.Utils.createIconNoSpan(iconName, this.gridOptionsWrapper, column, defaultIconFactory);
eTemplate.querySelector(cssSelector).appendChild(eIcon);
};
HeaderTemplateLoader.HEADER_CELL_TEMPLATE = '<div class="ag-header-cell">' +
' <div id="agResizeBar" class="ag-header-cell-resize"></div>' +
' <span id="agMenu" class="ag-header-icon ag-header-cell-menu-button"></span>' +
' <div id="agHeaderCellLabel" class="ag-header-cell-label">' +
' <span id="agSortAsc" class="ag-header-icon ag-sort-ascending-icon"></span>' +
' <span id="agSortDesc" class="ag-header-icon ag-sort-descending-icon"></span>' +
' <span id="agNoSort" class="ag-header-icon ag-sort-none-icon"></span>' +
' <span id="agFilter" class="ag-header-icon ag-filter-icon"></span>' +
' <span id="agText" class="ag-header-cell-text"></span>' +
' </div>' +
'</div>';
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], HeaderTemplateLoader.prototype, "gridOptionsWrapper", void 0);
HeaderTemplateLoader = __decorate([
context_1.Bean('headerTemplateLoader'),
__metadata('design:paramtypes', [])
], HeaderTemplateLoader);
return HeaderTemplateLoader;
})();
exports.HeaderTemplateLoader = HeaderTemplateLoader;
/***/ },
/* 78 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = __webpack_require__(7);
var logger_1 = __webpack_require__(5);
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
/** Functionality for internal DnD functionality between GUI widgets. Eg this service is used to drag columns
* from the 'available columns' list and putting them into the 'grouped columns' in the tool panel.
* This service is NOT used by the column headers for resizing and moving, that is a different use case. */
var OldToolPanelDragAndDropService = (function () {
function OldToolPanelDragAndDropService() {
this.destroyFunctions = [];
}
OldToolPanelDragAndDropService.prototype.agWire = function (loggerFactory) {
this.logger = loggerFactory.create('OldToolPanelDragAndDropService');
// need to clean this up, add to 'finished' logic in grid
var mouseUpListener = this.stopDragging.bind(this);
document.addEventListener('mouseup', mouseUpListener);
this.destroyFunctions.push(function () { document.removeEventListener('mouseup', mouseUpListener); });
};
OldToolPanelDragAndDropService.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) { return func(); });
document.removeEventListener('mouseup', this.mouseUpEventListener);
};
OldToolPanelDragAndDropService.prototype.stopDragging = function () {
if (this.dragItem) {
this.setDragCssClasses(this.dragItem.eDragSource, false);
this.dragItem = null;
}
};
OldToolPanelDragAndDropService.prototype.setDragCssClasses = function (eListItem, dragging) {
utils_1.Utils.addOrRemoveCssClass(eListItem, 'ag-dragging', dragging);
utils_1.Utils.addOrRemoveCssClass(eListItem, 'ag-not-dragging', !dragging);
};
OldToolPanelDragAndDropService.prototype.addDragSource = function (eDragSource, dragSourceCallback) {
this.setDragCssClasses(eDragSource, false);
eDragSource.addEventListener('mousedown', this.onMouseDownDragSource.bind(this, eDragSource, dragSourceCallback));
};
OldToolPanelDragAndDropService.prototype.onMouseDownDragSource = function (eDragSource, dragSourceCallback) {
if (this.dragItem) {
this.stopDragging();
}
var data;
if (dragSourceCallback.getData) {
data = dragSourceCallback.getData();
}
var containerId;
if (dragSourceCallback.getContainerId) {
containerId = dragSourceCallback.getContainerId();
}
this.dragItem = {
eDragSource: eDragSource,
data: data,
containerId: containerId
};
this.setDragCssClasses(this.dragItem.eDragSource, true);
};
OldToolPanelDragAndDropService.prototype.addDropTarget = function (eDropTarget, dropTargetCallback) {
var _this = this;
var mouseIn = false;
var acceptDrag = false;
eDropTarget.addEventListener('mouseover', function () {
if (!mouseIn) {
mouseIn = true;
if (_this.dragItem) {
acceptDrag = dropTargetCallback.acceptDrag(_this.dragItem);
}
else {
acceptDrag = false;
}
}
});
eDropTarget.addEventListener('mouseout', function () {
if (acceptDrag) {
dropTargetCallback.noDrop();
}
mouseIn = false;
acceptDrag = false;
});
eDropTarget.addEventListener('mouseup', function () {
// dragItem should never be null, checking just in case
if (acceptDrag && _this.dragItem) {
dropTargetCallback.drop(_this.dragItem);
}
});
};
__decorate([
__param(0, context_2.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], OldToolPanelDragAndDropService.prototype, "agWire", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], OldToolPanelDragAndDropService.prototype, "destroy", null);
OldToolPanelDragAndDropService = __decorate([
context_1.Bean('oldToolPanelDragAndDropService'),
__metadata('design:paramtypes', [])
], OldToolPanelDragAndDropService);
return OldToolPanelDragAndDropService;
})();
exports.OldToolPanelDragAndDropService = OldToolPanelDragAndDropService;
/***/ },
/* 79 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var filterManager_1 = __webpack_require__(43);
var utils_1 = __webpack_require__(7);
var context_2 = __webpack_require__(6);
var popupService_1 = __webpack_require__(44);
var gridOptionsWrapper_1 = __webpack_require__(3);
var StandardMenuFactory = (function () {
function StandardMenuFactory() {
}
StandardMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent) {
var _this = this;
this.showPopup(column, function (eMenu) {
_this.popupService.positionPopupUnderMouseEvent({
mouseEvent: mouseEvent,
ePopup: eMenu
});
});
};
StandardMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource) {
var _this = this;
this.showPopup(column, function (eMenu) {
_this.popupService.positionPopupUnderComponent({ eventSource: eventSource, ePopup: eMenu, keepWithinBounds: true });
});
};
StandardMenuFactory.prototype.showPopup = function (column, positionCallback) {
var filterWrapper = this.filterManager.getOrCreateFilterWrapper(column);
var eMenu = document.createElement('div');
utils_1.Utils.addCssClass(eMenu, 'ag-menu');
eMenu.appendChild(filterWrapper.gui);
// need to show filter before positioning, as only after filter
// is visible can we find out what the width of it is
var hidePopup = this.popupService.addAsModalPopup(eMenu, true);
positionCallback(eMenu);
if (filterWrapper.filter.afterGuiAttached) {
var params = {
hidePopup: hidePopup
};
filterWrapper.filter.afterGuiAttached(params);
}
};
StandardMenuFactory.prototype.isMenuEnabled = function (column) {
// for standard, we show menu if filter is enabled, and he menu is not suppressed
return this.gridOptionsWrapper.isEnableFilter();
};
__decorate([
context_2.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], StandardMenuFactory.prototype, "filterManager", void 0);
__decorate([
context_2.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], StandardMenuFactory.prototype, "popupService", void 0);
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], StandardMenuFactory.prototype, "gridOptionsWrapper", void 0);
StandardMenuFactory = __decorate([
context_1.Bean('menuFactory'),
__metadata('design:paramtypes', [])
], StandardMenuFactory);
return StandardMenuFactory;
})();
exports.StandardMenuFactory = StandardMenuFactory;
/***/ },
/* 80 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var context_2 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var filterManager_1 = __webpack_require__(43);
var FilterStage = (function () {
function FilterStage() {
}
FilterStage.prototype.execute = function (rowNode) {
var filterActive;
if (this.gridOptionsWrapper.isEnableServerSideFilter()) {
filterActive = false;
}
else {
filterActive = this.filterManager.isAnyFilterPresent();
}
this.recursivelyFilter(rowNode, filterActive);
};
FilterStage.prototype.recursivelyFilter = function (rowNode, filterActive) {
var _this = this;
// recursively get all children that are groups to also filter
rowNode.childrenAfterGroup.forEach(function (child) {
if (child.group) {
_this.recursivelyFilter(child, filterActive);
}
});
// result of filter for this node
var filterResult;
if (filterActive) {
filterResult = [];
rowNode.childrenAfterGroup.forEach(function (childNode) {
if (childNode.group) {
// a group is included in the result if it has any children of it's own.
// by this stage, the child groups are already filtered
if (childNode.childrenAfterFilter.length > 0) {
filterResult.push(childNode);
}
}
else {
// a leaf level node is included if it passes the filter
if (_this.filterManager.doesRowPassFilter(childNode)) {
filterResult.push(childNode);
}
}
});
}
else {
// if not filtering, the result is the original list
filterResult = rowNode.childrenAfterGroup;
}
rowNode.childrenAfterFilter = filterResult;
this.setAllChildrenCount(rowNode);
};
FilterStage.prototype.setAllChildrenCount = function (rowNode) {
var allChildrenCount = 0;
rowNode.childrenAfterFilter.forEach(function (child) {
if (child.group) {
allChildrenCount += child.allChildrenCount;
}
else {
allChildrenCount++;
}
});
rowNode.allChildrenCount = allChildrenCount;
};
__decorate([
context_2.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], FilterStage.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_2.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], FilterStage.prototype, "filterManager", void 0);
FilterStage = __decorate([
context_1.Bean('filterStage'),
__metadata('design:paramtypes', [])
], FilterStage);
return FilterStage;
})();
exports.FilterStage = FilterStage;
/***/ },
/* 81 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var sortController_1 = __webpack_require__(42);
var valueService_1 = __webpack_require__(29);
var utils_1 = __webpack_require__(7);
var SortStage = (function () {
function SortStage() {
}
SortStage.prototype.execute = function (rowNode) {
var sortOptions;
// if the sorting is already done by the server, then we should not do it here
if (!this.gridOptionsWrapper.isEnableServerSideSorting()) {
sortOptions = this.sortController.getSortForRowController();
}
this.sortRowNode(rowNode, sortOptions);
};
SortStage.prototype.sortRowNode = function (rowNode, sortOptions) {
var _this = this;
// sort any groups recursively
rowNode.childrenAfterFilter.forEach(function (child) {
if (child.group) {
_this.sortRowNode(child, sortOptions);
}
});
rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0);
var sortActive = utils_1.Utils.exists(sortOptions) && sortOptions.length > 0;
if (sortActive) {
rowNode.childrenAfterSort.sort(this.compareRowNodes.bind(this, sortOptions));
}
this.updateChildIndexes(rowNode);
};
SortStage.prototype.compareRowNodes = function (sortOptions, nodeA, nodeB) {
// Iterate columns, return the first that doesn't match
for (var i = 0, len = sortOptions.length; i < len; i++) {
var sortOption = sortOptions[i];
// var compared = compare(nodeA, nodeB, sortOption.column, sortOption.inverter === -1);
var isInverted = sortOption.inverter === -1;
var valueA = this.valueService.getValue(sortOption.column, nodeA);
var valueB = this.valueService.getValue(sortOption.column, nodeB);
var comparatorResult;
if (sortOption.column.getColDef().comparator) {
//if comparator provided, use it
comparatorResult = sortOption.column.getColDef().comparator(valueA, valueB, nodeA, nodeB, isInverted);
}
else {
//otherwise do our own comparison
comparatorResult = utils_1.Utils.defaultComparator(valueA, valueB);
}
if (comparatorResult !== 0) {
return comparatorResult * sortOption.inverter;
}
}
// All matched, these are identical as far as the sort is concerned:
return 0;
};
SortStage.prototype.updateChildIndexes = function (rowNode) {
if (utils_1.Utils.missing(rowNode.childrenAfterSort)) {
return;
}
rowNode.childrenAfterSort.forEach(function (child, index) {
child.firstChild = index === 0;
child.lastChild = index === rowNode.childrenAfterSort.length - 1;
child.childIndex = index;
});
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], SortStage.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('sortController'),
__metadata('design:type', sortController_1.SortController)
], SortStage.prototype, "sortController", void 0);
__decorate([
context_1.Autowired('valueService'),
__metadata('design:type', valueService_1.ValueService)
], SortStage.prototype, "valueService", void 0);
SortStage = __decorate([
context_1.Bean('sortStage'),
__metadata('design:paramtypes', [])
], SortStage);
return SortStage;
})();
exports.SortStage = SortStage;
/***/ },
/* 82 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var context_1 = __webpack_require__(6);
var rowNode_1 = __webpack_require__(27);
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var selectionController_1 = __webpack_require__(28);
var eventService_1 = __webpack_require__(4);
var columnController_1 = __webpack_require__(13);
var FlattenStage = (function () {
function FlattenStage() {
}
FlattenStage.prototype.execute = function (rootNode) {
// even if not doing grouping, we do the mapping, as the client might
// of passed in data that already has a grouping in it somewhere
var result = [];
// putting value into a wrapper so it's passed by reference
var nextRowTop = { value: 0 };
var pivotMode = this.columnController.isPivotMode();
// if we are reducing, and not grouping, then we want to show the root node, as that
// is where the pivot values are
var showRootNode = pivotMode && rootNode.leafGroup;
var topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort;
this.recursivelyAddToRowsToDisplay(topList, result, nextRowTop, pivotMode);
return result;
};
FlattenStage.prototype.recursivelyAddToRowsToDisplay = function (rowsToFlatten, result, nextRowTop, reduce) {
if (utils_1.Utils.missingOrEmpty(rowsToFlatten)) {
return;
}
var groupSuppressRow = this.gridOptionsWrapper.isGroupSuppressRow();
for (var i = 0; i < rowsToFlatten.length; i++) {
var rowNode = rowsToFlatten[i];
var skipBecauseSuppressRow = groupSuppressRow && rowNode.group;
var skipBecauseReduce = reduce && !rowNode.group;
var skipGroupNode = skipBecauseReduce || skipBecauseSuppressRow;
if (!skipGroupNode) {
this.addRowNodeToRowsToDisplay(rowNode, result, nextRowTop);
}
if (rowNode.group && rowNode.expanded) {
this.recursivelyAddToRowsToDisplay(rowNode.childrenAfterSort, result, nextRowTop, reduce);
// put a footer in if user is looking for it
if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
var footerNode = this.createFooterNode(rowNode);
this.addRowNodeToRowsToDisplay(footerNode, result, nextRowTop);
}
}
}
};
// duplicated method, it's also in floatingRowModel
FlattenStage.prototype.addRowNodeToRowsToDisplay = function (rowNode, result, nextRowTop) {
result.push(rowNode);
rowNode.rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode);
rowNode.rowTop = nextRowTop.value;
nextRowTop.value += rowNode.rowHeight;
};
FlattenStage.prototype.createFooterNode = function (groupNode) {
var footerNode = new rowNode_1.RowNode();
this.context.wireBean(footerNode);
Object.keys(groupNode).forEach(function (key) {
footerNode[key] = groupNode[key];
});
footerNode.footer = true;
// get both header and footer to reference each other as siblings. this is never undone,
// only overwritten. so if a group is expanded, then contracted, it will have a ghost
// sibling - but that's fine, as we can ignore this if the header is contracted.
footerNode.sibling = groupNode;
groupNode.sibling = footerNode;
return footerNode;
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], FlattenStage.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], FlattenStage.prototype, "selectionController", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], FlattenStage.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], FlattenStage.prototype, "context", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], FlattenStage.prototype, "columnController", void 0);
FlattenStage = __decorate([
context_1.Bean('flattenStage'),
__metadata('design:paramtypes', [])
], FlattenStage);
return FlattenStage;
})();
exports.FlattenStage = FlattenStage;
/***/ },
/* 83 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var gridOptionsWrapper_1 = __webpack_require__(3);
var rowNode_1 = __webpack_require__(27);
var context_1 = __webpack_require__(6);
var eventService_1 = __webpack_require__(4);
var selectionController_1 = __webpack_require__(28);
var events_1 = __webpack_require__(10);
var sortController_1 = __webpack_require__(42);
var filterManager_1 = __webpack_require__(43);
var constants_1 = __webpack_require__(8);
/*
* This row controller is used for infinite scrolling only. For normal 'in memory' table,
* or standard pagination, the inMemoryRowController is used.
*/
var logging = false;
var VirtualPageRowModel = (function () {
function VirtualPageRowModel() {
this.datasourceVersion = 0;
}
VirtualPageRowModel.prototype.init = function () {
var _this = this;
this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
var virtualEnabled = this.gridOptionsWrapper.isRowModelVirtual();
this.eventService.addEventListener(events_1.Events.EVENT_FILTER_CHANGED, function () {
if (virtualEnabled && _this.gridOptionsWrapper.isEnableServerSideFilter()) {
_this.reset();
}
});
this.eventService.addEventListener(events_1.Events.EVENT_SORT_CHANGED, function () {
if (virtualEnabled && _this.gridOptionsWrapper.isEnableServerSideSorting()) {
_this.reset();
}
});
if (virtualEnabled && this.gridOptionsWrapper.getDatasource()) {
this.setDatasource(this.gridOptionsWrapper.getDatasource());
}
};
VirtualPageRowModel.prototype.getType = function () {
return constants_1.Constants.ROW_MODEL_TYPE_VIRTUAL;
};
VirtualPageRowModel.prototype.setDatasource = function (datasource) {
this.datasource = datasource;
if (!datasource) {
// only continue if we have a valid datasource to working with
return;
}
this.reset();
};
VirtualPageRowModel.prototype.isEmpty = function () {
return !this.datasource;
};
VirtualPageRowModel.prototype.isRowsToRender = function () {
return utils_1.Utils.exists(this.datasource);
};
VirtualPageRowModel.prototype.reset = function () {
// important to return here, as the user could be setting filter or sort before
// data-source is set
if (utils_1.Utils.missing(this.datasource)) {
return;
}
this.selectionController.reset();
// see if datasource knows how many rows there are
if (typeof this.datasource.rowCount === 'number' && this.datasource.rowCount >= 0) {
this.virtualRowCount = this.datasource.rowCount;
this.foundMaxRow = true;
}
else {
this.virtualRowCount = 0;
this.foundMaxRow = false;
}
// in case any daemon requests coming from datasource, we know it ignore them
this.datasourceVersion++;
// map of page numbers to rows in that page
this.pageCache = {};
this.pageCacheSize = 0;
// if a number is in this array, it means we are pending a load from it
this.pageLoadsInProgress = [];
this.pageLoadsQueued = [];
this.pageAccessTimes = {}; // keeps a record of when each page was last viewed, used for LRU cache
this.accessTime = 0; // rather than using the clock, we use this counter
// the number of concurrent loads we are allowed to the server
if (typeof this.datasource.maxConcurrentRequests === 'number' && this.datasource.maxConcurrentRequests > 0) {
this.maxConcurrentDatasourceRequests = this.datasource.maxConcurrentRequests;
}
else {
this.maxConcurrentDatasourceRequests = 2;
}
// the number of pages to keep in browser cache
if (typeof this.datasource.maxPagesInCache === 'number' && this.datasource.maxPagesInCache > 0) {
this.maxPagesInCache = this.datasource.maxPagesInCache;
}
else {
// null is default, means don't have any max size on the cache
this.maxPagesInCache = null;
}
this.pageSize = this.datasource.pageSize; // take a copy of page size, we don't want it changing
this.overflowSize = this.datasource.overflowSize; // take a copy of page size, we don't want it changing
this.doLoadOrQueue(0);
this.rowRenderer.refreshView();
};
VirtualPageRowModel.prototype.createNodesFromRows = function (pageNumber, rows) {
var nodes = [];
if (rows) {
for (var i = 0, j = rows.length; i < j; i++) {
var virtualRowIndex = (pageNumber * this.pageSize) + i;
var node = this.createNode(rows[i], virtualRowIndex, true);
nodes.push(node);
}
}
return nodes;
};
VirtualPageRowModel.prototype.createNode = function (data, virtualRowIndex, realNode) {
var rowHeight = this.rowHeight;
var top = rowHeight * virtualRowIndex;
var rowNode;
if (realNode) {
// if a real node, then always create a new one
rowNode = new rowNode_1.RowNode();
this.context.wireBean(rowNode);
rowNode.id = virtualRowIndex;
rowNode.data = data;
// and see if the previous one was selected, and if yes, swap it out
this.selectionController.syncInRowNode(rowNode);
}
else {
// if creating a proxy node, see if there is a copy in selected memory that we can use
var rowNode = this.selectionController.getNodeForIdIfSelected(virtualRowIndex);
if (!rowNode) {
rowNode = new rowNode_1.RowNode();
this.context.wireBean(rowNode);
rowNode.id = virtualRowIndex;
rowNode.data = data;
}
}
rowNode.rowTop = top;
rowNode.rowHeight = rowHeight;
return rowNode;
};
VirtualPageRowModel.prototype.removeFromLoading = function (pageNumber) {
var index = this.pageLoadsInProgress.indexOf(pageNumber);
this.pageLoadsInProgress.splice(index, 1);
};
VirtualPageRowModel.prototype.pageLoadFailed = function (pageNumber) {
this.removeFromLoading(pageNumber);
this.checkQueueForNextLoad();
};
VirtualPageRowModel.prototype.pageLoaded = function (pageNumber, rows, lastRow) {
this.putPageIntoCacheAndPurge(pageNumber, rows);
this.checkMaxRowAndInformRowRenderer(pageNumber, lastRow);
this.removeFromLoading(pageNumber);
this.checkQueueForNextLoad();
};
VirtualPageRowModel.prototype.putPageIntoCacheAndPurge = function (pageNumber, rows) {
this.pageCache[pageNumber] = this.createNodesFromRows(pageNumber, rows);
this.pageCacheSize++;
if (logging) {
console.log('adding page ' + pageNumber);
}
var needToPurge = this.maxPagesInCache && this.maxPagesInCache < this.pageCacheSize;
if (needToPurge) {
// find the LRU page
var youngestPageIndex = this.findLeastRecentlyAccessedPage(Object.keys(this.pageCache));
if (logging) {
console.log('purging page ' + youngestPageIndex + ' from cache ' + Object.keys(this.pageCache));
}
delete this.pageCache[youngestPageIndex];
this.pageCacheSize--;
}
};
VirtualPageRowModel.prototype.checkMaxRowAndInformRowRenderer = function (pageNumber, lastRow) {
if (!this.foundMaxRow) {
// if we know the last row, use if
if (typeof lastRow === 'number' && lastRow >= 0) {
this.virtualRowCount = lastRow;
this.foundMaxRow = true;
}
else {
// otherwise, see if we need to add some virtual rows
var thisPagePlusBuffer = ((pageNumber + 1) * this.pageSize) + this.overflowSize;
if (this.virtualRowCount < thisPagePlusBuffer) {
this.virtualRowCount = thisPagePlusBuffer;
}
}
// if rowCount changes, refreshView, otherwise just refreshAllVirtualRows
this.rowRenderer.refreshView();
}
else {
this.rowRenderer.refreshAllVirtualRows();
}
};
VirtualPageRowModel.prototype.isPageAlreadyLoading = function (pageNumber) {
var result = this.pageLoadsInProgress.indexOf(pageNumber) >= 0 || this.pageLoadsQueued.indexOf(pageNumber) >= 0;
return result;
};
VirtualPageRowModel.prototype.doLoadOrQueue = function (pageNumber) {
// if we already tried to load this page, then ignore the request,
// otherwise server would be hit 50 times just to display one page, the
// first row to find the page missing is enough.
if (this.isPageAlreadyLoading(pageNumber)) {
return;
}
// try the page load - if not already doing a load, then we can go ahead
if (this.pageLoadsInProgress.length < this.maxConcurrentDatasourceRequests) {
// go ahead, load the page
this.loadPage(pageNumber);
}
else {
// otherwise, queue the request
this.addToQueueAndPurgeQueue(pageNumber);
}
};
VirtualPageRowModel.prototype.addToQueueAndPurgeQueue = function (pageNumber) {
if (logging) {
console.log('queueing ' + pageNumber + ' - ' + this.pageLoadsQueued);
}
this.pageLoadsQueued.push(pageNumber);
// see if there are more pages queued that are actually in our cache, if so there is
// no point in loading them all as some will be purged as soon as loaded
var needToPurge = this.maxPagesInCache && this.maxPagesInCache < this.pageLoadsQueued.length;
if (needToPurge) {
// find the LRU page
var youngestPageIndex = this.findLeastRecentlyAccessedPage(this.pageLoadsQueued);
if (logging) {
console.log('de-queueing ' + pageNumber + ' - ' + this.pageLoadsQueued);
}
var indexToRemove = this.pageLoadsQueued.indexOf(youngestPageIndex);
this.pageLoadsQueued.splice(indexToRemove, 1);
}
};
VirtualPageRowModel.prototype.findLeastRecentlyAccessedPage = function (pageIndexes) {
var youngestPageIndex = -1;
var youngestPageAccessTime = Number.MAX_VALUE;
var that = this;
pageIndexes.forEach(function (pageIndex) {
var accessTimeThisPage = that.pageAccessTimes[pageIndex];
if (accessTimeThisPage < youngestPageAccessTime) {
youngestPageAccessTime = accessTimeThisPage;
youngestPageIndex = pageIndex;
}
});
return youngestPageIndex;
};
VirtualPageRowModel.prototype.checkQueueForNextLoad = function () {
if (this.pageLoadsQueued.length > 0) {
// take from the front of the queue
var pageToLoad = this.pageLoadsQueued[0];
this.pageLoadsQueued.splice(0, 1);
if (logging) {
console.log('dequeueing ' + pageToLoad + ' - ' + this.pageLoadsQueued);
}
this.loadPage(pageToLoad);
}
};
VirtualPageRowModel.prototype.loadPage = function (pageNumber) {
var _this = this;
this.pageLoadsInProgress.push(pageNumber);
var startRow = pageNumber * this.pageSize;
var endRow = (pageNumber + 1) * this.pageSize;
var that = this;
var datasourceVersionCopy = this.datasourceVersion;
var sortModel;
if (this.gridOptionsWrapper.isEnableServerSideSorting()) {
sortModel = this.sortController.getSortModel();
}
var filterModel;
if (this.gridOptionsWrapper.isEnableServerSideFilter()) {
filterModel = this.filterManager.getFilterModel();
}
var params = {
startRow: startRow,
endRow: endRow,
successCallback: successCallback,
failCallback: failCallback,
sortModel: sortModel,
filterModel: filterModel,
context: this.gridOptionsWrapper.getContext()
};
// check if old version of datasource used
var getRowsParams = utils_1.Utils.getFunctionParameters(this.datasource.getRows);
if (getRowsParams.length > 1) {
console.warn('ag-grid: It looks like your paging datasource is of the old type, taking more than one parameter.');
console.warn('ag-grid: From ag-grid 1.9.0, now the getRows takes one parameter. See the documentation for details.');
}
// put in timeout, to force result to be async
setTimeout(function () {
_this.datasource.getRows(params);
}, 0);
function successCallback(rows, lastRowIndex) {
if (that.requestIsDaemon(datasourceVersionCopy)) {
return;
}
that.pageLoaded(pageNumber, rows, lastRowIndex);
}
function failCallback() {
if (that.requestIsDaemon(datasourceVersionCopy)) {
return;
}
that.pageLoadFailed(pageNumber);
}
};
VirtualPageRowModel.prototype.expandOrCollapseAll = function (expand) {
console.warn('ag-Grid: can not expand or collapse all when doing virtual pagination');
};
// check that the datasource has not changed since the lats time we did a request
VirtualPageRowModel.prototype.requestIsDaemon = function (datasourceVersionCopy) {
return this.datasourceVersion !== datasourceVersionCopy;
};
VirtualPageRowModel.prototype.getRow = function (rowIndex) {
if (rowIndex > this.virtualRowCount) {
return null;
}
var pageNumber = Math.floor(rowIndex / this.pageSize);
var page = this.pageCache[pageNumber];
// for LRU cache, track when this page was last hit
this.pageAccessTimes[pageNumber] = this.accessTime++;
if (!page) {
this.doLoadOrQueue(pageNumber);
// return back an empty row, so table can at least render empty cells
var dummyNode = this.createNode(null, rowIndex, false);
return dummyNode;
}
else {
var indexInThisPage = rowIndex % this.pageSize;
return page[indexInThisPage];
}
};
VirtualPageRowModel.prototype.forEachNode = function (callback) {
var pageKeys = Object.keys(this.pageCache);
for (var i = 0; i < pageKeys.length; i++) {
var pageKey = pageKeys[i];
var page = this.pageCache[pageKey];
for (var j = 0; j < page.length; j++) {
var node = page[j];
callback(node);
}
}
};
VirtualPageRowModel.prototype.getRowCombinedHeight = function () {
return this.virtualRowCount * this.rowHeight;
};
VirtualPageRowModel.prototype.getRowIndexAtPixel = function (pixel) {
if (this.rowHeight !== 0) {
return Math.floor(pixel / this.rowHeight);
}
else {
return 0;
}
};
VirtualPageRowModel.prototype.getRowCount = function () {
return this.virtualRowCount;
};
VirtualPageRowModel.prototype.setRowData = function (rows, refresh, firstId) {
console.warn('setRowData - does not work with virtual pagination');
};
VirtualPageRowModel.prototype.forEachNodeAfterFilter = function (callback) {
console.warn('forEachNodeAfterFilter - does not work with virtual pagination');
};
VirtualPageRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback) {
console.warn('forEachNodeAfterFilter - does not work with virtual pagination');
};
VirtualPageRowModel.prototype.refreshModel = function () {
console.warn('forEachNodeAfterFilter - does not work with virtual pagination');
};
VirtualPageRowModel.prototype.getTopLevelNodes = function () {
console.warn('getTopLevelNodes - does not work with virtual pagination');
return null;
};
__decorate([
context_1.Autowired('rowRenderer'),
__metadata('design:type', Object)
], VirtualPageRowModel.prototype, "rowRenderer", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], VirtualPageRowModel.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], VirtualPageRowModel.prototype, "filterManager", void 0);
__decorate([
context_1.Autowired('sortController'),
__metadata('design:type', sortController_1.SortController)
], VirtualPageRowModel.prototype, "sortController", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], VirtualPageRowModel.prototype, "selectionController", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], VirtualPageRowModel.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], VirtualPageRowModel.prototype, "context", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], VirtualPageRowModel.prototype, "init", null);
VirtualPageRowModel = __decorate([
context_1.Bean('rowModel'),
__metadata('design:paramtypes', [])
], VirtualPageRowModel);
return VirtualPageRowModel;
})();
exports.VirtualPageRowModel = VirtualPageRowModel;
/***/ },
/* 84 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var utils_1 = __webpack_require__(7);
var constants_1 = __webpack_require__(8);
var gridOptionsWrapper_1 = __webpack_require__(3);
var columnController_1 = __webpack_require__(13);
var filterManager_1 = __webpack_require__(43);
var rowNode_1 = __webpack_require__(27);
var eventService_1 = __webpack_require__(4);
var events_1 = __webpack_require__(10);
var context_1 = __webpack_require__(6);
var selectionController_1 = __webpack_require__(28);
var RecursionType;
(function (RecursionType) {
RecursionType[RecursionType["Normal"] = 0] = "Normal";
RecursionType[RecursionType["AfterFilter"] = 1] = "AfterFilter";
RecursionType[RecursionType["AfterFilterAndSort"] = 2] = "AfterFilterAndSort";
RecursionType[RecursionType["PivotNodes"] = 3] = "PivotNodes";
})(RecursionType || (RecursionType = {}));
;
var InMemoryRowModel = (function () {
function InMemoryRowModel() {
}
InMemoryRowModel.prototype.init = function () {
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.refreshModel.bind(this, constants_1.Constants.STEP_EVERYTHING));
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.refreshModel.bind(this, constants_1.Constants.STEP_EVERYTHING));
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this));
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, constants_1.Constants.STEP_PIVOT));
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_FILTER_CHANGED, this.refreshModel.bind(this, constants_1.Constants.STEP_FILTER));
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_SORT_CHANGED, this.refreshModel.bind(this, constants_1.Constants.STEP_SORT));
this.eventService.addModalPriorityEventListener(events_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.refreshModel.bind(this, constants_1.Constants.STEP_PIVOT));
this.rootNode = new rowNode_1.RowNode();
this.rootNode.group = true;
this.rootNode.level = -1;
this.rootNode.allLeafChildren = [];
this.rootNode.childrenAfterGroup = [];
this.rootNode.childrenAfterSort = [];
this.rootNode.childrenAfterFilter = [];
this.context.wireBean(this.rootNode);
if (this.gridOptionsWrapper.isRowModelDefault()) {
this.setRowData(this.gridOptionsWrapper.getRowData(), this.columnController.isReady());
}
};
InMemoryRowModel.prototype.getType = function () {
return constants_1.Constants.ROW_MODEL_TYPE_NORMAL;
};
InMemoryRowModel.prototype.onValueChanged = function () {
if (this.columnController.isPivotActive()) {
this.refreshModel(constants_1.Constants.STEP_PIVOT);
}
else {
this.refreshModel(constants_1.Constants.STEP_AGGREGATE);
}
};
InMemoryRowModel.prototype.refreshModel = function (step, fromIndex, groupState) {
// this goes through the pipeline of stages. what's in my head is similar
// to the diagram on this page:
// http://commons.apache.org/sandbox/commons-pipeline/pipeline_basics.html
// however we want to keep the results of each stage, hence we manually call
// each step rather than have them chain each other.
var _this = this;
// fallthrough in below switch is on purpose,
// eg if STEP_FILTER, then all steps below this
// step get done
// var start: number;
// console.log('======= start =======');
switch (step) {
case constants_1.Constants.STEP_EVERYTHING:
// start = new Date().getTime();
this.doRowGrouping(groupState);
// console.log('rowGrouping = ' + (new Date().getTime() - start));
case constants_1.Constants.STEP_FILTER:
// start = new Date().getTime();
this.doFilter();
// console.log('filter = ' + (new Date().getTime() - start));
case constants_1.Constants.STEP_PIVOT:
this.doPivot();
case constants_1.Constants.STEP_AGGREGATE:
// start = new Date().getTime();
this.doAggregate();
// console.log('aggregation = ' + (new Date().getTime() - start));
case constants_1.Constants.STEP_SORT:
// start = new Date().getTime();
this.doSort();
// console.log('sort = ' + (new Date().getTime() - start));
case constants_1.Constants.STEP_MAP:
// start = new Date().getTime();
this.doRowsToDisplay();
}
this.eventService.dispatchEvent(events_1.Events.EVENT_MODEL_UPDATED, { fromIndex: fromIndex });
if (this.$scope) {
setTimeout(function () {
_this.$scope.$apply();
}, 0);
}
};
InMemoryRowModel.prototype.isEmpty = function () {
return utils_1.Utils.missing(this.rootNode) || utils_1.Utils.missing(this.rootNode.allLeafChildren)
|| this.rootNode.allLeafChildren.length === 0 || !this.columnController.isReady();
};
InMemoryRowModel.prototype.isRowsToRender = function () {
return utils_1.Utils.exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0;
};
InMemoryRowModel.prototype.setDatasource = function (datasource) {
console.error('ag-Grid: should never call setDatasource on inMemoryRowController');
};
InMemoryRowModel.prototype.getTopLevelNodes = function () {
return this.rootNode ? this.rootNode.childrenAfterGroup : null;
};
InMemoryRowModel.prototype.getRow = function (index) {
return this.rowsToDisplay[index];
};
InMemoryRowModel.prototype.getVirtualRowCount = function () {
console.warn('ag-Grid: rowModel.getVirtualRowCount() is not longer a function, use rowModel.getRowCount() instead');
return this.getRowCount();
};
InMemoryRowModel.prototype.getRowCount = function () {
if (this.rowsToDisplay) {
return this.rowsToDisplay.length;
}
else {
return 0;
}
};
InMemoryRowModel.prototype.getRowIndexAtPixel = function (pixelToMatch) {
if (this.isEmpty()) {
return -1;
}
// do binary search of tree
// http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/
var bottomPointer = 0;
var topPointer = this.rowsToDisplay.length - 1;
// quick check, if the pixel is out of bounds, then return last row
if (pixelToMatch <= 0) {
// if pixel is less than or equal zero, it's always the first row
return 0;
}
var lastNode = this.rowsToDisplay[this.rowsToDisplay.length - 1];
if (lastNode.rowTop <= pixelToMatch) {
return this.rowsToDisplay.length - 1;
}
while (true) {
var midPointer = Math.floor((bottomPointer + topPointer) / 2);
var currentRowNode = this.rowsToDisplay[midPointer];
if (this.isRowInPixel(currentRowNode, pixelToMatch)) {
return midPointer;
}
else if (currentRowNode.rowTop < pixelToMatch) {
bottomPointer = midPointer + 1;
}
else if (currentRowNode.rowTop > pixelToMatch) {
topPointer = midPointer - 1;
}
}
};
InMemoryRowModel.prototype.isRowInPixel = function (rowNode, pixelToMatch) {
var topPixel = rowNode.rowTop;
var bottomPixel = rowNode.rowTop + rowNode.rowHeight;
var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch;
return pixelInRow;
};
InMemoryRowModel.prototype.getRowCombinedHeight = function () {
if (this.rowsToDisplay && this.rowsToDisplay.length > 0) {
var lastRow = this.rowsToDisplay[this.rowsToDisplay.length - 1];
var lastPixel = lastRow.rowTop + lastRow.rowHeight;
return lastPixel;
}
else {
return 0;
}
};
InMemoryRowModel.prototype.forEachLeafNode = function (callback) {
if (this.rootNode.allLeafChildren) {
this.rootNode.allLeafChildren.forEach(function (rowNode, index) { return callback(rowNode, index); });
}
};
InMemoryRowModel.prototype.forEachNode = function (callback) {
this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup, callback, RecursionType.Normal, 0);
};
InMemoryRowModel.prototype.forEachNodeAfterFilter = function (callback) {
this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterFilter, callback, RecursionType.AfterFilter, 0);
};
InMemoryRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback) {
this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort, callback, RecursionType.AfterFilterAndSort, 0);
};
InMemoryRowModel.prototype.forEachPivotNode = function (callback) {
this.recursivelyWalkNodesAndCallback([this.rootNode], callback, RecursionType.PivotNodes, 0);
};
// iterates through each item in memory, and calls the callback function
// nodes - the rowNodes to traverse
// callback - the user provided callback
// recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc
// index - works similar to the index in forEach in javascripts array function
InMemoryRowModel.prototype.recursivelyWalkNodesAndCallback = function (nodes, callback, recursionType, index) {
if (nodes) {
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
callback(node, index++);
// go to the next level if it is a group
if (node.group) {
// depending on the recursion type, we pick a difference set of children
var nodeChildren;
switch (recursionType) {
case RecursionType.Normal:
nodeChildren = node.childrenAfterGroup;
break;
case RecursionType.AfterFilter:
nodeChildren = node.childrenAfterFilter;
break;
case RecursionType.AfterFilterAndSort:
nodeChildren = node.childrenAfterSort;
break;
case RecursionType.PivotNodes:
// for pivot, we don't go below leafGroup levels
nodeChildren = !node.leafGroup ? node.childrenAfterSort : null;
break;
}
if (nodeChildren) {
index = this.recursivelyWalkNodesAndCallback(nodeChildren, callback, recursionType, index);
}
}
}
}
return index;
};
// it's possible to recompute the aggregate without doing the other parts
// + gridApi.recomputeAggregates()
InMemoryRowModel.prototype.doAggregate = function () {
if (this.aggregationStage) {
this.aggregationStage.execute(this.rootNode);
}
};
// + gridApi.expandAll()
// + gridApi.collapseAll()
InMemoryRowModel.prototype.expandOrCollapseAll = function (expand) {
if (this.rootNode) {
recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup);
}
function recursiveExpandOrCollapse(rowNodes) {
if (!rowNodes) {
return;
}
rowNodes.forEach(function (rowNode) {
if (rowNode.group) {
rowNode.expanded = expand;
recursiveExpandOrCollapse(rowNode.childrenAfterGroup);
}
});
}
this.refreshModel(constants_1.Constants.STEP_MAP);
};
InMemoryRowModel.prototype.doSort = function () {
this.sortStage.execute(this.rootNode);
};
InMemoryRowModel.prototype.doRowGrouping = function (groupState) {
// grouping is enterprise only, so if service missing, skip the step
var rowsAlreadyGrouped = utils_1.Utils.exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
if (rowsAlreadyGrouped) {
return;
}
if (this.groupStage) {
// remove old groups from the selection model, as we are about to replace them
// with new groups
this.selectionController.removeGroupsFromSelection();
this.groupStage.execute(this.rootNode);
this.restoreGroupState(groupState);
if (this.gridOptionsWrapper.isGroupSelectsChildren()) {
this.selectionController.updateGroupsFromChildrenSelections();
}
}
else {
this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren;
}
};
InMemoryRowModel.prototype.restoreGroupState = function (groupState) {
if (!groupState) {
return;
}
utils_1.Utils.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) {
// if the group was open last time, then open it this time. however
// if was not open last time, then don't touch the group, so the 'groupDefaultExpanded'
// setting will take effect.
if (typeof groupState[key] === 'boolean') {
node.expanded = groupState[key];
}
});
};
InMemoryRowModel.prototype.doFilter = function () {
this.filterStage.execute(this.rootNode);
};
InMemoryRowModel.prototype.doPivot = function () {
if (this.pivotStage) {
this.pivotStage.execute(this.rootNode);
}
};
// rows: the rows to put into the model
// firstId: the first id to use, used for paging, where we are not on the first page
InMemoryRowModel.prototype.setRowData = function (rowData, refresh, firstId) {
// remember group state, so we can expand groups that should be expanded
var groupState = this.getGroupState();
// place each row into a wrapper
this.createRowNodesFromData(rowData, firstId);
// this event kicks off:
// - clears selection
// - updates filters
// - shows 'no rows' overlay if needed
this.eventService.dispatchEvent(events_1.Events.EVENT_ROW_DATA_CHANGED);
if (refresh) {
this.refreshModel(constants_1.Constants.STEP_EVERYTHING, null, groupState);
}
};
InMemoryRowModel.prototype.getGroupState = function () {
if (!this.rootNode.childrenAfterGroup || !this.gridOptionsWrapper.isRememberGroupStateWhenNewData()) {
return null;
}
var result = {};
utils_1.Utils.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; });
return result;
};
InMemoryRowModel.prototype.createRowNodesFromData = function (rowData, firstId) {
this.rootNode.childrenAfterFilter = null;
this.rootNode.childrenAfterGroup = null;
this.rootNode.childrenAfterSort = null;
this.rootNode.childrenMapped = null;
var context = this.context;
if (!rowData) {
this.rootNode.allLeafChildren = [];
this.rootNode.childrenAfterGroup = [];
return;
}
var rowNodeId = utils_1.Utils.exists(firstId) ? firstId : 0;
// func below doesn't have 'this' pointer, so need to pull out these bits
var nodeChildDetailsFunc = this.gridOptionsWrapper.getNodeChildDetailsFunc();
var suppressParentsInRowNodes = this.gridOptionsWrapper.isSuppressParentsInRowNodes();
var rowsAlreadyGrouped = utils_1.Utils.exists(nodeChildDetailsFunc);
// kick off recursion
var result = recursiveFunction(rowData, null, 0);
if (rowsAlreadyGrouped) {
this.rootNode.childrenAfterGroup = result;
setLeafChildren(this.rootNode);
}
else {
this.rootNode.allLeafChildren = result;
}
function setLeafChildren(node) {
node.allLeafChildren = [];
if (node.childrenAfterGroup) {
node.childrenAfterGroup.forEach(function (childAfterGroup) {
if (childAfterGroup.group) {
if (childAfterGroup.allLeafChildren) {
childAfterGroup.allLeafChildren.forEach(function (leafChild) { return node.allLeafChildren.push(leafChild); });
}
}
else {
node.allLeafChildren.push(childAfterGroup);
}
});
}
}
function recursiveFunction(rowData, parent, level) {
var rowNodes = [];
rowData.forEach(function (dataItem) {
var node = new rowNode_1.RowNode();
context.wireBean(node);
var nodeChildDetails = nodeChildDetailsFunc ? nodeChildDetailsFunc(dataItem) : null;
if (nodeChildDetails && nodeChildDetails.group) {
node.group = true;
node.childrenAfterGroup = recursiveFunction(nodeChildDetails.children, node, level + 1);
node.expanded = nodeChildDetails.expanded === true;
node.field = nodeChildDetails.field;
node.key = nodeChildDetails.key;
// pull out all the leaf children and add to our node
setLeafChildren(node);
}
if (parent && !suppressParentsInRowNodes) {
node.parent = parent;
}
node.level = level;
node.id = rowNodeId++;
node.data = dataItem;
rowNodes.push(node);
});
return rowNodes;
}
};
InMemoryRowModel.prototype.doRowsToDisplay = function () {
// this.rowsToDisplay = this.flattenStage.execute(this.rowsAfterSort);
this.rowsToDisplay = this.flattenStage.execute(this.rootNode);
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], InMemoryRowModel.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], InMemoryRowModel.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('filterManager'),
__metadata('design:type', filterManager_1.FilterManager)
], InMemoryRowModel.prototype, "filterManager", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "$scope", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], InMemoryRowModel.prototype, "selectionController", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], InMemoryRowModel.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], InMemoryRowModel.prototype, "context", void 0);
__decorate([
context_1.Autowired('filterStage'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "filterStage", void 0);
__decorate([
context_1.Autowired('sortStage'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "sortStage", void 0);
__decorate([
context_1.Autowired('flattenStage'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "flattenStage", void 0);
__decorate([
context_1.Optional('groupStage'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "groupStage", void 0);
__decorate([
context_1.Optional('aggregationStage'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "aggregationStage", void 0);
__decorate([
context_1.Optional('pivotStage'),
__metadata('design:type', Object)
], InMemoryRowModel.prototype, "pivotStage", void 0);
__decorate([
// the rows mapped to rows to display
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], InMemoryRowModel.prototype, "init", null);
InMemoryRowModel = __decorate([
context_1.Bean('rowModel'),
__metadata('design:paramtypes', [])
], InMemoryRowModel);
return InMemoryRowModel;
})();
exports.InMemoryRowModel = InMemoryRowModel;
/***/ },
/* 85 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var component_1 = __webpack_require__(47);
var componentAnnotations_1 = __webpack_require__(86);
var utils_1 = __webpack_require__(7);
var context_1 = __webpack_require__(6);
var gridOptionsWrapper_1 = __webpack_require__(3);
var svgFactory_1 = __webpack_require__(59);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var AgCheckbox = (function (_super) {
__extends(AgCheckbox, _super);
function AgCheckbox() {
_super.call(this, AgCheckbox.TEMPLATE);
this.selected = false;
}
AgCheckbox.prototype.init = function () {
this.eChecked.appendChild(utils_1.Utils.createIconNoSpan('checkboxChecked', this.gridOptionsWrapper, null, svgFactory.createCheckboxCheckedIcon));
this.eUnchecked.appendChild(utils_1.Utils.createIconNoSpan('checkboxUnchecked', this.gridOptionsWrapper, null, svgFactory.createCheckboxUncheckedIcon));
this.eIndeterminate.appendChild(utils_1.Utils.createIconNoSpan('checkboxIndeterminate', this.gridOptionsWrapper, null, svgFactory.createCheckboxIndeterminateIcon));
this.updateIcons();
var label = this.getAttribute('label');
if (label) {
this.eLabel.innerText = label;
}
};
AgCheckbox.prototype.onClick = function () {
if (this.selected === undefined) {
this.setSelected(true);
}
else {
this.setSelected(!this.selected);
}
};
AgCheckbox.prototype.isSelected = function () {
return this.selected;
};
AgCheckbox.prototype.toggle = function () {
this.setSelected(!this.selected);
};
AgCheckbox.prototype.setSelected = function (selected) {
if (this.selected === selected) {
return;
}
if (selected === true) {
this.selected = true;
}
else if (selected === false) {
this.selected = false;
}
else {
this.selected = undefined;
}
this.updateIcons();
this.dispatchEvent(AgCheckbox.EVENT_CHANGED, { selected: this.selected });
};
AgCheckbox.prototype.updateIcons = function () {
utils_1.Utils.setVisible(this.eChecked, this.selected === true);
utils_1.Utils.setVisible(this.eUnchecked, this.selected === false);
utils_1.Utils.setVisible(this.eIndeterminate, this.selected === undefined);
};
AgCheckbox.EVENT_CHANGED = 'change';
AgCheckbox.TEMPLATE = '<span class="ag-checkbox">' +
' <span class="ag-checkbox-checked"></span>' +
' <span class="ag-checkbox-unchecked"></span>' +
' <span class="ag-checkbox-indeterminate"></span>' +
' <span class="ag-checkbox-label"></span>' +
'</span>';
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], AgCheckbox.prototype, "gridOptionsWrapper", void 0);
__decorate([
componentAnnotations_1.QuerySelector('.ag-checkbox-checked'),
__metadata('design:type', HTMLElement)
], AgCheckbox.prototype, "eChecked", void 0);
__decorate([
componentAnnotations_1.QuerySelector('.ag-checkbox-unchecked'),
__metadata('design:type', HTMLElement)
], AgCheckbox.prototype, "eUnchecked", void 0);
__decorate([
componentAnnotations_1.QuerySelector('.ag-checkbox-indeterminate'),
__metadata('design:type', HTMLElement)
], AgCheckbox.prototype, "eIndeterminate", void 0);
__decorate([
componentAnnotations_1.QuerySelector('.ag-checkbox-label'),
__metadata('design:type', HTMLElement)
], AgCheckbox.prototype, "eLabel", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], AgCheckbox.prototype, "init", null);
__decorate([
componentAnnotations_1.Listener('click'),
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], AgCheckbox.prototype, "onClick", null);
return AgCheckbox;
})(component_1.Component);
exports.AgCheckbox = AgCheckbox;
/***/ },
/* 86 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
function QuerySelector(selector) {
return querySelectorFunc.bind(this, selector);
}
exports.QuerySelector = QuerySelector;
function querySelectorFunc(selector, classPrototype, methodOrAttributeName, index) {
if (selector === null) {
console.error('ag-Grid: QuerySelector selector should not be null');
return;
}
if (typeof index === 'number') {
console.error('ag-Grid: QuerySelector should be on an attribute');
return;
}
// it's an attribute on the class
var props = getOrCreateProps(classPrototype);
if (!props.querySelectors) {
props.querySelectors = [];
}
props.querySelectors.push({
attributeName: methodOrAttributeName,
querySelector: selector
});
}
function Listener(eventName) {
return listenerFunc.bind(this, eventName);
}
exports.Listener = Listener;
function listenerFunc(eventName, target, methodName, descriptor) {
if (eventName === null) {
console.error('ag-Grid: EventListener eventName should not be null');
return;
}
// it's an attribute on the class
var props = getOrCreateProps(target);
if (!props.listenerMethods) {
props.listenerMethods = [];
}
props.listenerMethods.push({
methodName: methodName,
eventName: eventName
});
}
function getOrCreateProps(target) {
var props = target.__agComponentMetaData;
if (!props) {
props = {};
target.__agComponentMetaData = props;
}
return props;
}
/***/ },
/* 87 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var component_1 = __webpack_require__(47);
var constants_1 = __webpack_require__(8);
var LargeTextCellEditor = (function (_super) {
__extends(LargeTextCellEditor, _super);
function LargeTextCellEditor() {
_super.call(this, LargeTextCellEditor.TEMPLATE);
}
LargeTextCellEditor.prototype.init = function (params) {
this.params = params;
this.textarea = document.createElement("textarea");
this.textarea.maxLength = params.maxLength ? params.maxLength : "200";
this.textarea.cols = params.cols ? params.cols : "60";
this.textarea.rows = params.rows ? params.rows : "10";
this.textarea.value = params.value;
this.getGui().querySelector('.ag-large-textarea').appendChild(this.textarea);
this.addGuiEventListener('keydown', this.onKeyDown.bind(this));
};
LargeTextCellEditor.prototype.onKeyDown = function (event) {
var key = event.which || event.keyCode;
if (key == constants_1.Constants.KEY_LEFT ||
key == constants_1.Constants.KEY_UP ||
key == constants_1.Constants.KEY_RIGHT ||
key == constants_1.Constants.KEY_DOWN ||
(event.shiftKey && key == constants_1.Constants.KEY_ENTER)) {
event.stopPropagation();
}
};
LargeTextCellEditor.prototype.afterGuiAttached = function () {
this.textarea.focus();
};
LargeTextCellEditor.prototype.getValue = function () {
return this.textarea.value;
};
LargeTextCellEditor.prototype.isPopup = function () {
return true;
};
LargeTextCellEditor.TEMPLATE =
// tab index is needed so we can focus, which is needed for keyboard events
'<div class="ag-large-text" tabindex="0">' +
'<div class="ag-large-textarea"></div>' +
'</div>';
return LargeTextCellEditor;
})(component_1.Component);
exports.LargeTextCellEditor = LargeTextCellEditor;
/***/ },
/* 88 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var grid_1 = __webpack_require__(2);
function initialiseAgGridWithAngular1(angular) {
var angularModule = angular.module("agGrid", []);
angularModule.directive("agGrid", function () {
return {
restrict: "A",
controller: ['$element', '$scope', '$compile', '$attrs', AngularDirectiveController],
scope: true
};
});
}
exports.initialiseAgGridWithAngular1 = initialiseAgGridWithAngular1;
function AngularDirectiveController($element, $scope, $compile, $attrs) {
var gridOptions;
var quickFilterOnScope;
var keyOfGridInScope = $attrs.agGrid;
quickFilterOnScope = keyOfGridInScope + '.quickFilterText';
gridOptions = $scope.$eval(keyOfGridInScope);
if (!gridOptions) {
console.warn("WARNING - grid options for ag-Grid not found. Please ensure the attribute ag-grid points to a valid object on the scope");
return;
}
var eGridDiv = $element[0];
var grid = new grid_1.Grid(eGridDiv, gridOptions, null, $scope, $compile, quickFilterOnScope);
$scope.$on("$destroy", function () {
grid.destroy();
});
}
/***/ },
/* 89 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var componentUtil_1 = __webpack_require__(9);
var grid_1 = __webpack_require__(2);
var registered = false;
function initialiseAgGridWithWebComponents() {
// only register to WebComponents once
if (registered) {
return;
}
registered = true;
if (typeof document === 'undefined' || !document.registerElement) {
console.error('ag-Grid: unable to find document.registerElement() function, unable to initialise ag-Grid as a Web Component');
}
// i don't think this type of extension is possible in TypeScript, so back to
// plain Javascript to create this object
var AgileGridProto = Object.create(HTMLElement.prototype);
// wrap each property with a get and set method, so we can track when changes are done
componentUtil_1.ComponentUtil.ALL_PROPERTIES.forEach(function (key) {
Object.defineProperty(AgileGridProto, key, {
set: function (v) {
this.__agGridSetProperty(key, v);
},
get: function () {
return this.__agGridGetProperty(key);
}
});
});
AgileGridProto.__agGridSetProperty = function (key, value) {
if (!this.__attributes) {
this.__attributes = {};
}
this.__attributes[key] = value;
// keeping this consistent with the ng2 onChange, so I can reuse the handling code
var changeObject = {};
changeObject[key] = { currentValue: value };
this.onChange(changeObject);
};
AgileGridProto.onChange = function (changes) {
if (this._initialised) {
componentUtil_1.ComponentUtil.processOnChange(changes, this._gridOptions, this.api, this.columnApi);
}
};
AgileGridProto.__agGridGetProperty = function (key) {
if (!this.__attributes) {
this.__attributes = {};
}
return this.__attributes[key];
};
AgileGridProto.setGridOptions = function (options) {
var globalEventListener = this.globalEventListener.bind(this);
this._gridOptions = componentUtil_1.ComponentUtil.copyAttributesToGridOptions(options, this);
this._agGrid = new grid_1.Grid(this, this._gridOptions, globalEventListener);
this.api = options.api;
this.columnApi = options.columnApi;
this._initialised = true;
};
// copies all the attributes into this object
AgileGridProto.createdCallback = function () {
for (var i = 0; i < this.attributes.length; i++) {
var attribute = this.attributes[i];
this.setPropertyFromAttribute(attribute);
}
};
AgileGridProto.setPropertyFromAttribute = function (attribute) {
var name = toCamelCase(attribute.nodeName);
var value = attribute.nodeValue;
if (componentUtil_1.ComponentUtil.ALL_PROPERTIES.indexOf(name) >= 0) {
this[name] = value;
}
};
AgileGridProto.attachedCallback = function (params) { };
AgileGridProto.detachedCallback = function (params) { };
AgileGridProto.attributeChangedCallback = function (attributeName) {
var attribute = this.attributes[attributeName];
this.setPropertyFromAttribute(attribute);
};
AgileGridProto.globalEventListener = function (eventType, event) {
var eventLowerCase = eventType.toLowerCase();
var browserEvent = new Event(eventLowerCase);
var browserEventNoType = browserEvent;
browserEventNoType.agGridDetails = event;
this.dispatchEvent(browserEvent);
var callbackMethod = 'on' + eventLowerCase;
if (typeof this[callbackMethod] === 'function') {
this[callbackMethod](browserEvent);
}
};
// finally, register
document.registerElement('ag-grid', { prototype: AgileGridProto });
}
exports.initialiseAgGridWithWebComponents = initialiseAgGridWithWebComponents;
function toCamelCase(myString) {
if (typeof myString === 'string') {
var result = myString.replace(/-([a-z])/g, function (g) {
return g[1].toUpperCase();
});
return result;
}
else {
return myString;
}
}
/***/ },
/* 90 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var utils_1 = __webpack_require__(7);
var TabbedLayout = (function () {
function TabbedLayout(params) {
var _this = this;
this.items = [];
this.params = params;
this.eGui = document.createElement('div');
this.eGui.innerHTML = TabbedLayout.TEMPLATE;
this.eHeader = this.eGui.querySelector('#tabHeader');
this.eBody = this.eGui.querySelector('#tabBody');
utils_1.Utils.addCssClass(this.eGui, params.cssClass);
if (params.items) {
params.items.forEach(function (item) { return _this.addItem(item); });
}
}
TabbedLayout.prototype.setAfterAttachedParams = function (params) {
this.afterAttachedParams = params;
};
TabbedLayout.prototype.getMinWidth = function () {
var eDummyContainer = document.createElement('span');
// position fixed, so it isn't restricted to the boundaries of the parent
eDummyContainer.style.position = 'fixed';
// we put the dummy into the body container, so it will inherit all the
// css styles that the real cells are inheriting
this.eGui.appendChild(eDummyContainer);
var minWidth = 0;
this.items.forEach(function (itemWrapper) {
utils_1.Utils.removeAllChildren(eDummyContainer);
var eClone = itemWrapper.tabbedItem.body.cloneNode(true);
eDummyContainer.appendChild(eClone);
if (minWidth < eDummyContainer.offsetWidth) {
minWidth = eDummyContainer.offsetWidth;
}
});
this.eGui.removeChild(eDummyContainer);
return minWidth;
};
TabbedLayout.prototype.showFirstItem = function () {
if (this.items.length > 0) {
this.showItemWrapper(this.items[0]);
}
};
TabbedLayout.prototype.addItem = function (item) {
var eHeaderButton = document.createElement('span');
eHeaderButton.appendChild(item.title);
utils_1.Utils.addCssClass(eHeaderButton, 'ag-tab');
this.eHeader.appendChild(eHeaderButton);
var wrapper = {
tabbedItem: item,
eHeaderButton: eHeaderButton
};
this.items.push(wrapper);
eHeaderButton.addEventListener('click', this.showItemWrapper.bind(this, wrapper));
};
TabbedLayout.prototype.showItem = function (tabbedItem) {
var itemWrapper = utils_1.Utils.find(this.items, function (itemWrapper) {
return itemWrapper.tabbedItem === tabbedItem;
});
if (itemWrapper) {
this.showItemWrapper(itemWrapper);
}
};
TabbedLayout.prototype.showItemWrapper = function (wrapper) {
if (this.params.onItemClicked) {
this.params.onItemClicked({ item: wrapper.tabbedItem });
}
if (this.activeItem === wrapper) {
utils_1.Utils.callIfPresent(this.params.onActiveItemClicked);
return;
}
utils_1.Utils.removeAllChildren(this.eBody);
this.eBody.appendChild(wrapper.tabbedItem.body);
if (this.activeItem) {
utils_1.Utils.removeCssClass(this.activeItem.eHeaderButton, 'ag-tab-selected');
}
utils_1.Utils.addCssClass(wrapper.eHeaderButton, 'ag-tab-selected');
this.activeItem = wrapper;
if (wrapper.tabbedItem.afterAttachedCallback) {
wrapper.tabbedItem.afterAttachedCallback(this.afterAttachedParams);
}
};
TabbedLayout.prototype.getGui = function () {
return this.eGui;
};
TabbedLayout.TEMPLATE = '<div>' +
'<div id="tabHeader" class="ag-tab-header"></div>' +
'<div id="tabBody" class="ag-tab-body"></div>' +
'</div>';
return TabbedLayout;
})();
exports.TabbedLayout = TabbedLayout;
/***/ },
/* 91 */
/***/ function(module, exports) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var VerticalStack = (function () {
function VerticalStack() {
this.isLayoutPanel = true;
this.childPanels = [];
this.eGui = document.createElement('div');
this.eGui.style.height = '100%';
}
VerticalStack.prototype.addPanel = function (panel, height) {
var component;
if (panel.isLayoutPanel) {
this.childPanels.push(panel);
component = panel.getGui();
}
else {
component = panel;
}
if (height) {
component.style.height = height;
}
this.eGui.appendChild(component);
};
VerticalStack.prototype.getGui = function () {
return this.eGui;
};
VerticalStack.prototype.doLayout = function () {
for (var i = 0; i < this.childPanels.length; i++) {
this.childPanels[i].doLayout();
}
};
return VerticalStack;
})();
exports.VerticalStack = VerticalStack;
/***/ },
/* 92 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var component_1 = __webpack_require__(47);
var context_1 = __webpack_require__(6);
var utils_1 = __webpack_require__(7);
var popupService_1 = __webpack_require__(44);
var menuItemComponent_1 = __webpack_require__(93);
var MenuList = (function (_super) {
__extends(MenuList, _super);
function MenuList() {
_super.call(this, MenuList.TEMPLATE);
this.timerCount = 0;
}
MenuList.prototype.clearActiveItem = function () {
this.removeActiveItem();
this.removeOldChildPopup();
};
MenuList.prototype.addMenuItems = function (menuItems, defaultMenuItems) {
var _this = this;
if (utils_1.Utils.missing(menuItems)) {
return;
}
menuItems.forEach(function (listItem) {
if (listItem === 'separator') {
_this.addSeparator();
}
else {
var menuItem;
if (typeof listItem === 'string') {
menuItem = defaultMenuItems[listItem];
}
else {
menuItem = listItem;
}
_this.addItem(menuItem);
}
});
};
MenuList.prototype.addItem = function (params) {
var _this = this;
var cMenuItem = new menuItemComponent_1.MenuItemComponent(params);
this.context.wireBean(cMenuItem);
this.getGui().appendChild(cMenuItem.getGui());
cMenuItem.addEventListener(menuItemComponent_1.MenuItemComponent.EVENT_ITEM_SELECTED, function (event) {
if (params.childMenu) {
_this.showChildMenu(params, cMenuItem);
}
else {
_this.dispatchEvent(menuItemComponent_1.MenuItemComponent.EVENT_ITEM_SELECTED, event);
}
});
cMenuItem.addGuiEventListener('mouseenter', this.mouseEnterItem.bind(this, params, cMenuItem));
cMenuItem.addGuiEventListener('mouseleave', function () { return _this.timerCount++; });
if (params.childMenu) {
this.addDestroyFunc(function () { return params.childMenu.destroy(); });
}
};
MenuList.prototype.mouseEnterItem = function (menuItemParams, menuItem) {
if (menuItemParams.disabled) {
return;
}
if (this.activeMenuItemParams !== menuItemParams) {
this.removeOldChildPopup();
}
this.removeActiveItem();
this.activeMenuItemParams = menuItemParams;
this.activeMenuItem = menuItem;
utils_1.Utils.addCssClass(this.activeMenuItem.getGui(), 'ag-menu-option-active');
if (menuItemParams.childMenu) {
this.addHoverForChildPopup(menuItemParams, menuItem);
}
};
MenuList.prototype.removeActiveItem = function () {
if (this.activeMenuItem) {
utils_1.Utils.removeCssClass(this.activeMenuItem.getGui(), 'ag-menu-option-active');
this.activeMenuItem = null;
this.activeMenuItemParams = null;
}
};
MenuList.prototype.addHoverForChildPopup = function (menuItemParams, menuItem) {
var _this = this;
var timerCountCopy = this.timerCount;
setTimeout(function () {
var shouldShow = timerCountCopy === _this.timerCount;
var showingThisMenu = _this.showingChildMenu === menuItemParams.childMenu;
if (shouldShow && !showingThisMenu) {
_this.showChildMenu(menuItemParams, menuItem);
}
}, 500);
};
MenuList.prototype.showChildMenu = function (menuItemParams, menuItem) {
this.removeOldChildPopup();
var ePopup = utils_1.Utils.loadTemplate('<div class="ag-menu"></div>');
ePopup.appendChild(menuItemParams.childMenu.getGui());
this.childPopupRemoveFunc = this.popupService.addAsModalPopup(ePopup, true);
this.popupService.positionPopupForMenu({
eventSource: menuItem.getGui(),
ePopup: ePopup
});
this.showingChildMenu = menuItemParams.childMenu;
};
MenuList.prototype.addSeparator = function () {
this.getGui().appendChild(utils_1.Utils.loadTemplate(MenuList.SEPARATOR_TEMPLATE));
};
MenuList.prototype.removeOldChildPopup = function () {
if (this.childPopupRemoveFunc) {
this.showingChildMenu.clearActiveItem();
this.childPopupRemoveFunc();
this.childPopupRemoveFunc = null;
this.showingChildMenu = null;
}
};
MenuList.prototype.destroy = function () {
this.removeOldChildPopup();
_super.prototype.destroy.call(this);
};
MenuList.TEMPLATE = '<div class="ag-menu-list"></div>';
MenuList.SEPARATOR_TEMPLATE = '<div class="ag-menu-separator">' +
' <span class="ag-menu-separator-cell"></span>' +
' <span class="ag-menu-separator-cell"></span>' +
' <span class="ag-menu-separator-cell"></span>' +
' <span class="ag-menu-separator-cell"></span>' +
'</div>';
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], MenuList.prototype, "context", void 0);
__decorate([
context_1.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], MenuList.prototype, "popupService", void 0);
return MenuList;
})(component_1.Component);
exports.MenuList = MenuList;
/***/ },
/* 93 */
/***/ function(module, exports, __webpack_require__) {
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.0-alpha.4
* @link http://www.ag-grid.com/
* @license MIT
*/
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var component_1 = __webpack_require__(47);
var context_1 = __webpack_require__(6);
var popupService_1 = __webpack_require__(44);
var utils_1 = __webpack_require__(7);
var svgFactory_1 = __webpack_require__(59);
var svgFactory = svgFactory_1.SvgFactory.getInstance();
var MenuItemComponent = (function (_super) {
__extends(MenuItemComponent, _super);
function MenuItemComponent(params) {
_super.call(this, MenuItemComponent.TEMPLATE);
this.params = params;
if (params.checked) {
this.queryForHtmlElement('#eIcon').innerHTML = '✔';
}
else if (params.icon) {
if (utils_1.Utils.isNodeOrElement(params.icon)) {
this.queryForHtmlElement('#eIcon').appendChild(params.icon);
}
else if (typeof params.icon === 'string') {
this.queryForHtmlElement('#eIcon').innerHTML = params.icon;
}
else {
console.log('ag-Grid: menu item icon must be DOM node or string');
}
}
else {
// if i didn't put space here, the alignment was messed up, probably
// fixable with CSS but i was spending to much time trying to figure
// it out.
this.queryForHtmlElement('#eIcon').innerHTML = ' ';
}
if (params.shortcut) {
this.queryForHtmlElement('#eShortcut').innerHTML = params.shortcut;
}
if (params.childMenu) {
this.queryForHtmlElement('#ePopupPointer').appendChild(svgFactory.createSmallArrowRightSvg());
}
else {
this.queryForHtmlElement('#ePopupPointer').innerHTML = ' ';
}
this.queryForHtmlElement('#eName').innerHTML = params.name;
if (params.disabled) {
utils_1.Utils.addCssClass(this.getGui(), 'ag-menu-option-disabled');
}
else {
this.addGuiEventListener('click', this.onOptionSelected.bind(this));
}
}
MenuItemComponent.prototype.onOptionSelected = function () {
this.dispatchEvent(MenuItemComponent.EVENT_ITEM_SELECTED, this.params);
if (this.params.action) {
this.params.action();
}
};
MenuItemComponent.TEMPLATE = '<div class="ag-menu-option">' +
' <span id="eIcon" class="ag-menu-option-icon"></span>' +
' <span id="eName" class="ag-menu-option-text"></span>' +
' <span id="eShortcut" class="ag-menu-option-shortcut"></span>' +
' <span id="ePopupPointer" class="ag-menu-option-popup-pointer"></span>' +
'</div>';
MenuItemComponent.EVENT_ITEM_SELECTED = 'itemSelected';
__decorate([
context_1.Autowired('popupService'),
__metadata('design:type', popupService_1.PopupService)
], MenuItemComponent.prototype, "popupService", void 0);
return MenuItemComponent;
})(component_1.Component);
exports.MenuItemComponent = MenuItemComponent;
/***/ },
/* 94 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(95);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(97)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!./../../node_modules/css-loader/index.js!./ag-grid.css", function() {
var newContent = require("!!./../../node_modules/css-loader/index.js!./ag-grid.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 95 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(96)();
// imports
// module
exports.push([module.id, "ag-grid-ng2 {\n display: inline-block;\n}\n.ag-select-agg-func-popup {\n position: absolute;\n}\n.ag-body-no-select {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ag-root {\n/* set to relative, so absolute popups appear relative to this */\n position: relative;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n/* was getting some 'should be there' scrolls, this sorts it out */\n overflow: hidden;\n}\n.ag-font-style {\n cursor: default;\n/* disable user mouse selection */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ag-no-scrolls {\n white-space: nowrap;\n display: inline-block;\n}\n.ag-scrolls {\n height: 100%;\n}\n.ag-popup-backdrop {\n position: fixed;\n left: 0px;\n top: 0px;\n width: 100%;\n height: 100%;\n}\n.ag-header {\n position: absolute;\n top: 0px;\n left: 0px;\n white-space: nowrap;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n width: 100%;\n}\n.ag-pinned-left-header {\n float: left;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n overflow: hidden;\n height: 100%;\n}\n.ag-pinned-right-header {\n float: right;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n overflow: hidden;\n height: 100%;\n}\n.ag-header-viewport {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n height: 100%;\n}\n.ag-scrolls .ag-header-row {\n position: absolute;\n}\n.ag-scrolls .ag-header-container {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n position: relative;\n white-space: nowrap;\n height: 100%;\n}\n.ag-no-scrolls .ag-header-container {\n white-space: nowrap;\n}\n.ag-header-overlay {\n display: block;\n position: absolute;\n}\n.ag-header-cell {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n vertical-align: bottom;\n text-align: center;\n display: inline-block;\n height: 100%;\n position: absolute;\n}\n.ag-dnd-ghost {\n font-size: 14px;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n position: absolute;\n background: #e5e5e5;\n border: 1px solid #000;\n cursor: move;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n padding: 3px;\n line-height: 1.4;\n}\n.ag-dnd-ghost-icon {\n display: inline-block;\n float: left;\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-dnd-ghost-label {\n display: inline-block;\n}\n.ag-header-group-cell {\n height: 100%;\n display: inline-block;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n position: absolute;\n}\n.ag-header-group-cell-label {\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ag-header-cell-label {\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ag-header-cell-resize {\n height: 100%;\n width: 4px;\n float: right;\n cursor: col-resize;\n}\n.ag-header-expand-icon {\n padding-left: 4px;\n}\n.ag-header-cell-menu-button {\n float: right;\n}\n.ag-overlay-panel {\n display: table;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.ag-overlay-wrapper {\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n}\n.ag-body {\n height: 100%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n.ag-floating-top {\n position: absolute;\n left: 0px;\n width: 100%;\n white-space: nowrap;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n}\n.ag-pinned-left-floating-top {\n float: left;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n overflow: hidden;\n height: 100%;\n}\n.ag-pinned-right-floating-top {\n float: right;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n overflow: hidden;\n height: 100%;\n}\n.ag-floating-top-viewport {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n height: 100%;\n}\n.ag-floating-top-container {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n position: relative;\n white-space: nowrap;\n}\n.ag-floating-bottom {\n position: absolute;\n left: 0px;\n width: 100%;\n white-space: nowrap;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n}\n.ag-pinned-left-floating-bottom {\n float: left;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n overflow: hidden;\n height: 100%;\n}\n.ag-pinned-right-floating-bottom {\n float: right;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n overflow: hidden;\n height: 100%;\n}\n.ag-floating-bottom-viewport {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n height: 100%;\n}\n.ag-floating-bottom-container {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n position: relative;\n white-space: nowrap;\n}\n.ag-pinned-left-cols-viewport {\n float: left;\n overflow: hidden;\n}\n.ag-pinned-left-cols-container {\n display: inline-block;\n position: relative;\n}\n.ag-pinned-right-cols-viewport {\n float: right;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.ag-pinned-right-cols-container {\n display: inline-block;\n position: relative;\n}\n.ag-body-viewport-wrapper {\n height: 100%;\n}\n.ag-body-viewport {\n overflow-x: auto;\n overflow-y: auto;\n height: 100%;\n}\n.ag-scrolls .ag-body-container {\n position: relative;\n display: inline-block;\n}\n.ag-scrolls .ag-row {\n white-space: nowrap;\n position: absolute;\n width: 100%;\n}\n.ag-no-scrolls .ag-row {\n position: relative;\n}\n.agile-gird-row:hover {\n background-color: #f0f8ff;\n}\n.ag-column-drop {\n width: 100%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n.ag-column-drop-vertical .ag-column-drop-cell {\n display: block;\n}\n.ag-column-drop-vertical .ag-column-drop-empty-message {\n display: block;\n}\n.ag-column-drop-vertical .ag-column-drop-cell-button {\n float: right;\n line-height: 16px;\n}\n.ag-cell {\n display: inline-block;\n white-space: nowrap;\n height: 100%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n position: absolute;\n}\n.ag-fade-out {\n opacity: 1;\n -ms-filter: none;\n filter: none;\n margin-right: 5px;\n -webkit-transition: opacity 3s, margin-right 3s;\n -moz-transition: opacity 3s, margin-right 3s;\n -o-transition: opacity 3s, margin-right 3s;\n -ms-transition: opacity 3s, margin-right 3s;\n transition: opacity 3s, margin-right 3s;\n -webkit-transition-timing-function: linear;\n -moz-transition-timing-function: linear;\n -o-transition-timing-function: linear;\n -ms-transition-timing-function: linear;\n transition-timing-function: linear;\n}\n.ag-fade-out-end {\n opacity: 0;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)\";\n filter: alpha(opacity=0);\n margin-right: 10px;\n}\n.ag-cell-edit-input {\n width: 100%;\n height: 100%;\n}\n.ag-group-cell-entire-row {\n width: 100%;\n display: inline-block;\n white-space: nowrap;\n height: 100%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ag-footer-cell-entire-row {\n width: 100%;\n display: inline-block;\n white-space: nowrap;\n height: 100%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ag-large .ag-root {\n font-size: 20px;\n}\n.ag-popup-editor {\n position: absolute;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ag-menu {\n position: absolute;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ag-menu-column-select-wrapper {\n width: 200px;\n height: 300px;\n overflow: auto;\n}\n.ag-menu-list {\n display: table;\n border-collapse: collapse;\n}\n.ag-menu-option {\n display: table-row;\n}\n.ag-menu-option-text {\n display: table-cell;\n}\n.ag-menu-option-shortcut {\n display: table-cell;\n}\n.ag-menu-option-icon {\n display: table-cell;\n}\n.ag-menu-option-popup-pointer {\n display: table-cell;\n}\n.ag-menu-separator {\n display: table-row;\n}\n.ag-menu-separator-cell {\n display: table-cell;\n}\n.ag-virtual-list-viewport {\n overflow-x: auto;\n height: 100%;\n width: 100%;\n}\n.ag-virtual-list-container {\n position: relative;\n overflow: hidden;\n}\n.ag-rich-select {\n outline: none;\n}\n.ag-rich-select-list {\n width: 200px;\n height: 200px;\n}\n.ag-set-filter-list {\n width: 200px;\n height: 200px;\n}\n.ag-set-filter-item {\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.ag-virtual-list-item {\n position: absolute;\n width: 100%;\n}\n.ag-filter-filter {\n width: 170px;\n margin: 4px;\n}\n.ag-filter-select {\n width: 110px;\n margin: 4px 4px 0px 4px;\n}\n.ag-no-vertical-scroll .ag-scrolls {\n height: unset;\n}\n.ag-no-vertical-scroll .ag-body {\n height: unset;\n}\n.ag-no-vertical-scroll .ag-body-viewport-wrapper {\n height: unset;\n}\n.ag-no-vertical-scroll .ag-body-viewport {\n height: unset;\n}\n.ag-list-selection {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n}\n.ag-tool-panel {\n width: 200px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n height: 100%;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n overflow: auto;\n}\n.ag-column-select-indent {\n display: inline-block;\n}\n.ag-column-select-column {\n margin-left: 14px;\n white-space: nowrap;\n}\n.ag-column-select-column-group {\n white-space: nowrap;\n}\n.ag-hidden {\n display: none;\n}\n.ag-faded {\n opacity: 0.3;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)\";\n filter: alpha(opacity=30);\n}\n.ag-shake-left-to-right {\n -webkit-animation-name: ag-shake-left-to-right;\n -moz-animation-name: ag-shake-left-to-right;\n -o-animation-name: ag-shake-left-to-right;\n -ms-animation-name: ag-shake-left-to-right;\n animation-name: ag-shake-left-to-right;\n -webkit-animation-duration: 0.2s;\n -moz-animation-duration: 0.2s;\n -o-animation-duration: 0.2s;\n -ms-animation-duration: 0.2s;\n animation-duration: 0.2s;\n -webkit-animation-iteration-count: infinite;\n -moz-animation-iteration-count: infinite;\n -o-animation-iteration-count: infinite;\n -ms-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-direction: alternate;\n -moz-animation-direction: alternate;\n -o-animation-direction: alternate;\n -ms-animation-direction: alternate;\n animation-direction: alternate;\n}\n@-moz-keyframes ag-shake-left-to-right {\n from {\n padding-left: 6px;\n padding-right: 2px;\n }\n to {\n padding-left: 2px;\n padding-right: 6px;\n }\n}\n@-webkit-keyframes ag-shake-left-to-right {\n from {\n padding-left: 6px;\n padding-right: 2px;\n }\n to {\n padding-left: 2px;\n padding-right: 6px;\n }\n}\n@-o-keyframes ag-shake-left-to-right {\n from {\n padding-left: 6px;\n padding-right: 2px;\n }\n to {\n padding-left: 2px;\n padding-right: 6px;\n }\n}\n@keyframes ag-shake-left-to-right {\n from {\n padding-left: 6px;\n padding-right: 2px;\n }\n to {\n padding-left: 2px;\n padding-right: 6px;\n }\n}\n", ""]);
// exports
/***/ },
/* 96 */
/***/ function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function() {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
var result = [];
for(var i = 0; i < this.length; i++) {
var item = this[i];
if(item[2]) {
result.push("@media " + item[2] + "{" + item[1] + "}");
} else {
result.push(item[1]);
}
}
return result.join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
/***/ },
/* 97 */
/***/ function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var stylesInDom = {},
memoize = function(fn) {
var memo;
return function () {
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
return memo;
};
},
isOldIE = memoize(function() {
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
}),
getHeadElement = memoize(function () {
return document.head || document.getElementsByTagName("head")[0];
}),
singletonElement = null,
singletonCounter = 0,
styleElementsInsertedAtTop = [];
module.exports = function(list, options) {
if(false) {
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
}
options = options || {};
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
// By default, add <style> tags to the bottom of <head>.
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
var styles = listToStyles(list);
addStylesToDom(styles, options);
return function update(newList) {
var mayRemove = [];
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
domStyle.refs--;
mayRemove.push(domStyle);
}
if(newList) {
var newStyles = listToStyles(newList);
addStylesToDom(newStyles, options);
}
for(var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i];
if(domStyle.refs === 0) {
for(var j = 0; j < domStyle.parts.length; j++)
domStyle.parts[j]();
delete stylesInDom[domStyle.id];
}
}
};
}
function addStylesToDom(styles, options) {
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
if(domStyle) {
domStyle.refs++;
for(var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j]);
}
for(; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j], options));
}
} else {
var parts = [];
for(var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j], options));
}
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
}
}
}
function listToStyles(list) {
var styles = [];
var newStyles = {};
for(var i = 0; i < list.length; i++) {
var item = list[i];
var id = item[0];
var css = item[1];
var media = item[2];
var sourceMap = item[3];
var part = {css: css, media: media, sourceMap: sourceMap};
if(!newStyles[id])
styles.push(newStyles[id] = {id: id, parts: [part]});
else
newStyles[id].parts.push(part);
}
return styles;
}
function insertStyleElement(options, styleElement) {
var head = getHeadElement();
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
if (options.insertAt === "top") {
if(!lastStyleElementInsertedAtTop) {
head.insertBefore(styleElement, head.firstChild);
} else if(lastStyleElementInsertedAtTop.nextSibling) {
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
} else {
head.appendChild(styleElement);
}
styleElementsInsertedAtTop.push(styleElement);
} else if (options.insertAt === "bottom") {
head.appendChild(styleElement);
} else {
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
}
}
function removeStyleElement(styleElement) {
styleElement.parentNode.removeChild(styleElement);
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
if(idx >= 0) {
styleElementsInsertedAtTop.splice(idx, 1);
}
}
function createStyleElement(options) {
var styleElement = document.createElement("style");
styleElement.type = "text/css";
insertStyleElement(options, styleElement);
return styleElement;
}
function createLinkElement(options) {
var linkElement = document.createElement("link");
linkElement.rel = "stylesheet";
insertStyleElement(options, linkElement);
return linkElement;
}
function addStyle(obj, options) {
var styleElement, update, remove;
if (options.singleton) {
var styleIndex = singletonCounter++;
styleElement = singletonElement || (singletonElement = createStyleElement(options));
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
} else if(obj.sourceMap &&
typeof URL === "function" &&
typeof URL.createObjectURL === "function" &&
typeof URL.revokeObjectURL === "function" &&
typeof Blob === "function" &&
typeof btoa === "function") {
styleElement = createLinkElement(options);
update = updateLink.bind(null, styleElement);
remove = function() {
removeStyleElement(styleElement);
if(styleElement.href)
URL.revokeObjectURL(styleElement.href);
};
} else {
styleElement = createStyleElement(options);
update = applyToTag.bind(null, styleElement);
remove = function() {
removeStyleElement(styleElement);
};
}
update(obj);
return function updateStyle(newObj) {
if(newObj) {
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
return;
update(obj = newObj);
} else {
remove();
}
};
}
var replaceText = (function () {
var textStore = [];
return function (index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join('\n');
};
})();
function applyToSingletonTag(styleElement, index, remove, obj) {
var css = remove ? "" : obj.css;
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css);
} else {
var cssNode = document.createTextNode(css);
var childNodes = styleElement.childNodes;
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index]);
} else {
styleElement.appendChild(cssNode);
}
}
}
function applyToTag(styleElement, obj) {
var css = obj.css;
var media = obj.media;
var sourceMap = obj.sourceMap;
if(media) {
styleElement.setAttribute("media", media)
}
if(styleElement.styleSheet) {
styleElement.styleSheet.cssText = css;
} else {
while(styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild);
}
styleElement.appendChild(document.createTextNode(css));
}
}
function updateLink(linkElement, obj) {
var css = obj.css;
var media = obj.media;
var sourceMap = obj.sourceMap;
if(sourceMap) {
// http://stackoverflow.com/a/26603875
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
}
var blob = new Blob([css], { type: "text/css" });
var oldSrc = linkElement.href;
linkElement.href = URL.createObjectURL(blob);
if(oldSrc)
URL.revokeObjectURL(oldSrc);
}
/***/ },
/* 98 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(99);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(97)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!./../../node_modules/css-loader/index.js!./theme-blue.css", function() {
var newContent = require("!!./../../node_modules/css-loader/index.js!./theme-blue.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 99 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(96)();
// imports
// module
exports.push([module.id, ".ag-blue {\n line-height: 1.4;\n font-family: Calibri, \"Segoe UI\", Thonburi, Arial, Verdana, sans-serif;\n font-size: 10pt;\n color: #222;\n/* this is for the rowGroupPanel, that appears along the top of the grid */\n/* this is for the column drops that appear in the toolPanel */\n}\n.ag-blue img {\n vertical-align: middle;\n border: 0;\n}\n.ag-blue .ag-root {\n border: 1px solid #9bc2e6;\n}\n.ag-blue .ag-cell-not-inline-editing {\n padding: 2px;\n}\n.ag-blue .ag-cell-range-selected-1:not(.ag-cell-focus) {\n background-color: rgba(120,120,120,0.4);\n}\n.ag-blue .ag-cell-range-selected-2:not(.ag-cell-focus) {\n background-color: rgba(80,80,80,0.4);\n}\n.ag-blue .ag-cell-range-selected-3:not(.ag-cell-focus) {\n background-color: rgba(40,40,40,0.4);\n}\n.ag-blue .ag-cell-range-selected-4:not(.ag-cell-focus) {\n background-color: rgba(0,0,0,0.4);\n}\n.ag-blue .ag-column-moving .ag-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-blue .ag-column-moving .ag-header-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-blue .ag-column-moving .ag-header-group-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-blue .ag-cell-focus {\n border: 2px solid #217346;\n}\n.ag-blue .ag-cell-no-focus {\n border-right: 1px dotted #9bc2e6;\n border-top: 2px solid transparent;\n border-left: 2px solid transparent;\n border-bottom: 1px dotted #9bc2e6;\n}\n.ag-blue .ag-cell-first-right-pinned {\n border-left: 1px solid #9bc2e6;\n}\n.ag-blue .ag-cell-last-left-pinned {\n border-right: 1px solid #9bc2e6;\n}\n.ag-blue .ag-cell-highlight {\n border: 1px solid #006400;\n}\n.ag-blue .ag-cell-highlight-animation {\n -webkit-transition: border 1s;\n -moz-transition: border 1s;\n -o-transition: border 1s;\n -ms-transition: border 1s;\n transition: border 1s;\n}\n.ag-blue .ag-value-change-delta {\n padding-right: 2px;\n}\n.ag-blue .ag-value-change-delta-up {\n color: #006400;\n}\n.ag-blue .ag-value-change-delta-down {\n color: #8b0000;\n}\n.ag-blue .ag-value-change-value {\n background-color: transparent;\n -webkit-border-radius: 1px;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n -webkit-transition: background-color 1s;\n -moz-transition: background-color 1s;\n -o-transition: background-color 1s;\n -ms-transition: background-color 1s;\n transition: background-color 1s;\n}\n.ag-blue .ag-value-change-value-highlight {\n background-color: #cec;\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-blue .ag-rich-select {\n font-size: 14px;\n border: 1px solid #9bc2e6;\n background-color: #fff;\n}\n.ag-blue .ag-rich-select-value {\n padding: 2px;\n}\n.ag-blue .ag-rich-select-list {\n border-top: 1px solid #d3d3d3;\n}\n.ag-blue .ag-rich-select-row {\n padding: 2px;\n}\n.ag-blue .ag-rich-select-row-selected {\n background-color: #c7c7c7;\n}\n.ag-blue .ag-large-text {\n border: 1px solid #9bc2e6;\n}\n.ag-blue .ag-header {\n color: #fff;\n background: #5b9bd5;\n border-bottom: 1px solid #9bc2e6;\n font-weight: 600;\n}\n.ag-blue .ag-header-icon {\n color: #fff;\n stroke: none;\n fill: #fff;\n}\n.ag-blue .ag-no-scrolls .ag-header-container {\n background: #5b9bd5;\n border-bottom: 1px solid #9bc2e6;\n}\n.ag-blue .ag-header-cell {\n border-right: 1px solid #9bc2e6;\n}\n.ag-blue .ag-header-cell-moving .ag-header-cell-label {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-blue .ag-header-cell-moving {\n background-color: #bebebe;\n}\n.ag-blue .ag-header-group-cell {\n border-right: 1px solid #9bc2e6;\n}\n.ag-blue .ag-header-group-cell-with-group {\n border-bottom: 1px solid #9bc2e6;\n}\n.ag-blue .ag-header-cell-label {\n padding: 4px 2px 4px 2px;\n}\n.ag-blue .ag-header-cell-text {\n padding-left: 2px;\n}\n.ag-blue .ag-header-group-cell-label {\n padding: 4px;\n padding-left: 10px;\n}\n.ag-blue .ag-header-group-text {\n margin-right: 2px;\n}\n.ag-blue .ag-header-cell-menu-button {\n padding: 2px;\n margin-top: 4px;\n border: 1px solid transparent;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n -webkit-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n -moz-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n line-height: 0px /* normal line height, a space was appearing below the menu button */;\n}\n.ag-blue .ag-pinned-right-header {\n border-left: 1px solid #9bc2e6;\n}\n.ag-blue .ag-header-cell-menu-button:hover {\n border: 1px solid #9bc2e6;\n}\n.ag-blue .ag-body {\n background-color: #f6f6f6;\n}\n.ag-blue .ag-row {\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-blue .ag-row-odd {\n background-color: #ddebf7;\n}\n.ag-blue .ag-row-even {\n background-color: #fff;\n}\n.ag-blue .ag-row-selected {\n background-color: #c7c7c7;\n}\n.ag-blue .ag-floating-top .ag-row {\n background-color: #f0f0f0;\n}\n.ag-blue .ag-floating-bottom .ag-row {\n background-color: #f0f0f0;\n}\n.ag-blue .ag-overlay-loading-wrapper {\n background-color: rgba(255,255,255,0.5);\n}\n.ag-blue .ag-overlay-loading-center {\n background-color: #fff;\n border: 1px solid #9bc2e6;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n color: #000;\n}\n.ag-blue .ag-overlay-no-rows-center {\n background-color: #fff;\n border: 1px solid #9bc2e6;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n}\n.ag-blue .ag-group-cell-entire-row {\n background-color: #f6f6f6;\n padding: 2px;\n}\n.ag-blue .ag-footer-cell-entire-row {\n background-color: #f6f6f6;\n padding: 2px;\n}\n.ag-blue .ag-group-cell {\n font-style: italic;\n}\n.ag-blue .ag-group-expanded {\n padding-right: 4px;\n}\n.ag-blue .ag-group-contracted {\n padding-right: 4px;\n}\n.ag-blue .ag-group-value {\n padding-right: 2px;\n}\n.ag-blue .ag-group-checkbox {\n padding-right: 2px;\n}\n.ag-blue .ag-footer-cell {\n font-style: italic;\n}\n.ag-blue .ag-menu {\n border: 1px solid #808080;\n background-color: #f6f6f6;\n cursor: default;\n font-family: Calibri, \"Segoe UI\", Thonburi, Arial, Verdana, sans-serif;\n font-size: 10pt;\n}\n.ag-blue .ag-menu .ag-tab-header {\n background-color: #5b9bd5;\n}\n.ag-blue .ag-menu .ag-tab {\n padding: 6px 8px 6px 8px;\n margin: 2px 2px 0px 2px;\n display: inline-block;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n}\n.ag-blue .ag-menu .ag-tab-selected {\n background-color: #9bc2e6;\n border-right: 1px solid #d3d3d3;\n border-left: 1px solid #d3d3d3;\n border-top: 1px solid #d3d3d3;\n}\n.ag-blue .ag-menu-separator {\n border-top: 1px solid #d3d3d3;\n}\n.ag-blue .ag-menu-option-active {\n background-color: #c7c7c7;\n}\n.ag-blue .ag-menu-option-icon {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-blue .ag-menu-option-text {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-blue .ag-menu-option-shortcut {\n padding: 2px 2px 2px 20px;\n vertical-align: middle;\n}\n.ag-blue .ag-menu-option-popup-pointer {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-blue .ag-menu-option-disabled {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-blue .ag-menu-column-select-wrapper {\n margin: 2px;\n}\n.ag-blue .ag-filter-checkbox {\n position: relative;\n top: 2px;\n left: 2px;\n}\n.ag-blue .ag-filter-header-container {\n border-bottom: 1px solid #d3d3d3;\n}\n.ag-blue .ag-filter-apply-panel {\n border-top: 1px solid #d3d3d3;\n padding: 2px;\n}\n.ag-blue .ag-filter-value {\n margin-left: 4px;\n}\n.ag-blue .ag-selection-checkbox {\n padding-right: 4px;\n}\n.ag-blue .ag-paging-panel {\n padding: 4px;\n}\n.ag-blue .ag-paging-button {\n margin-left: 4px;\n margin-right: 4px;\n}\n.ag-blue .ag-paging-row-summary-panel {\n display: inline-block;\n width: 300px;\n}\n.ag-blue .ag-tool-panel {\n background-color: #f6f6f6;\n border-right: 1px solid #9bc2e6;\n border-bottom: 1px solid #9bc2e6;\n border-top: 1px solid #9bc2e6;\n color: #222;\n}\n.ag-blue .ag-status-bar {\n color: #222;\n background-color: #f6f6f6;\n font-size: 10pt;\n height: 22px;\n border-bottom: 1px solid #9bc2e6;\n border-left: 1px solid #9bc2e6;\n border-right: 1px solid #9bc2e6;\n padding: 2px;\n}\n.ag-blue .ag-status-bar-aggregations {\n float: right;\n}\n.ag-blue .ag-status-bar-item {\n padding-left: 10px;\n}\n.ag-blue .ag-column-drop-cell {\n background: #ddebf7;\n color: #000;\n border: 1px solid #808080;\n}\n.ag-blue .ag-column-drop-cell-ghost {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-blue .ag-column-drop-cell-text {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-blue .ag-column-drop-cell-button {\n border: 1px solid transparent;\n padding-left: 2px;\n padding-right: 2px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n}\n.ag-blue .ag-column-drop-cell-button:hover {\n border: 1px solid #9bc2e6;\n}\n.ag-blue .ag-column-drop-empty-message {\n padding-left: 2px;\n padding-right: 2px;\n color: #808080;\n}\n.ag-blue .ag-column-drop-icon {\n padding-right: 4px;\n}\n.ag-blue .ag-column-drop {\n background-color: #f6f6f6;\n}\n.ag-blue .ag-column-drop-horizontal {\n padding: 4px 4px 4px 4px;\n border-top: 1px solid #9bc2e6;\n border-left: 1px solid #9bc2e6;\n border-right: 1px solid #9bc2e6;\n}\n.ag-blue .ag-column-drop-horizontal .ag-column-drop-cell {\n padding: 2px;\n}\n.ag-blue .ag-column-drop-vertical {\n padding: 4px 4px 10px 4px;\n border-bottom: 1px solid #9bc2e6;\n}\n.ag-blue .ag-column-drop-vertical .ag-column-drop-cell {\n margin-top: 2px;\n}\n.ag-blue .ag-column-drop-vertical .ag-column-drop-empty-message {\n text-align: center;\n padding: 5px;\n}\n.ag-blue .ag-pivot-mode {\n border-bottom: 1px solid #9bc2e6;\n padding: 4px;\n background-color: #f6f6f6;\n}\n.ag-blue .ag-tool-panel .ag-column-select-panel {\n border-bottom: 1px solid #9bc2e6;\n}\n.ag-blue .ag-select-agg-func-popup {\n cursor: default;\n position: absolute;\n font-size: 14px;\n background-color: #fff;\n border: 1px solid #9bc2e6;\n}\n.ag-blue .ag-select-agg-func-item {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-blue .ag-select-agg-func-item:hover {\n background-color: #c7c7c7;\n}\n", ""]);
// exports
/***/ },
/* 100 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(101);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(97)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!./../../node_modules/css-loader/index.js!./theme-dark.css", function() {
var newContent = require("!!./../../node_modules/css-loader/index.js!./theme-dark.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 101 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(96)();
// imports
// module
exports.push([module.id, ".ag-dark {\n line-height: 1.4;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n color: #ccc;\n/* this is for the rowGroupPanel, that appears along the top of the grid */\n/* this is for the column drops that appear in the toolPanel */\n}\n.ag-dark img {\n vertical-align: middle;\n border: 0;\n}\n.ag-dark .ag-root {\n border: 1px solid #808080;\n}\n.ag-dark .ag-cell-not-inline-editing {\n padding: 2px;\n}\n.ag-dark .ag-cell-range-selected-1:not(.ag-cell-focus) {\n background-color: rgba(100,160,160,0.4);\n}\n.ag-dark .ag-cell-range-selected-2:not(.ag-cell-focus) {\n background-color: rgba(100,190,190,0.4);\n}\n.ag-dark .ag-cell-range-selected-3:not(.ag-cell-focus) {\n background-color: rgba(100,220,220,0.4);\n}\n.ag-dark .ag-cell-range-selected-4:not(.ag-cell-focus) {\n background-color: rgba(100,250,250,0.4);\n}\n.ag-dark .ag-column-moving .ag-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-dark .ag-column-moving .ag-header-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-dark .ag-column-moving .ag-header-group-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-dark .ag-cell-focus {\n border: 1px solid #a9a9a9;\n}\n.ag-dark .ag-cell-no-focus {\n border-right: 1px dotted #808080;\n border-top: 1px solid transparent;\n border-left: 1px solid transparent;\n border-bottom: 1px solid transparent;\n}\n.ag-dark .ag-cell-first-right-pinned {\n border-left: 1px solid #808080;\n}\n.ag-dark .ag-cell-last-left-pinned {\n border-right: 1px solid #808080;\n}\n.ag-dark .ag-cell-highlight {\n border: 1px solid #90ee90;\n}\n.ag-dark .ag-cell-highlight-animation {\n -webkit-transition: border 1s;\n -moz-transition: border 1s;\n -o-transition: border 1s;\n -ms-transition: border 1s;\n transition: border 1s;\n}\n.ag-dark .ag-value-change-delta {\n padding-right: 2px;\n}\n.ag-dark .ag-value-change-delta-up {\n color: #adff2f;\n}\n.ag-dark .ag-value-change-delta-down {\n color: #f00;\n}\n.ag-dark .ag-value-change-value {\n background-color: transparent;\n -webkit-border-radius: 1px;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n -webkit-transition: background-color 1s;\n -moz-transition: background-color 1s;\n -o-transition: background-color 1s;\n -ms-transition: background-color 1s;\n transition: background-color 1s;\n}\n.ag-dark .ag-value-change-value-highlight {\n background-color: #d2691e;\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-dark .ag-rich-select {\n font-size: 14px;\n border: 1px solid #808080;\n background-color: #302e2e;\n}\n.ag-dark .ag-rich-select-value {\n padding: 2px;\n}\n.ag-dark .ag-rich-select-list {\n border-top: 1px solid #555;\n}\n.ag-dark .ag-rich-select-row {\n padding: 2px;\n}\n.ag-dark .ag-rich-select-row-selected {\n background-color: #4a708b;\n}\n.ag-dark .ag-large-text {\n border: 1px solid #808080;\n}\n.ag-dark .ag-header {\n color: #e0e0e0;\n background: #626262;\n border-bottom: 1px solid #808080;\n font-weight: normal;\n}\n.ag-dark .ag-header-icon {\n color: #e0e0e0;\n stroke: none;\n fill: #e0e0e0;\n}\n.ag-dark .ag-no-scrolls .ag-header-container {\n background: #626262;\n border-bottom: 1px solid #808080;\n}\n.ag-dark .ag-header-cell {\n border-right: 1px solid #808080;\n}\n.ag-dark .ag-header-cell-moving .ag-header-cell-label {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-dark .ag-header-cell-moving {\n background-color: #bebebe;\n}\n.ag-dark .ag-header-group-cell {\n border-right: 1px solid #808080;\n}\n.ag-dark .ag-header-group-cell-with-group {\n border-bottom: 1px solid #808080;\n}\n.ag-dark .ag-header-cell-label {\n padding: 4px 2px 4px 2px;\n}\n.ag-dark .ag-header-cell-text {\n padding-left: 2px;\n}\n.ag-dark .ag-header-group-cell-label {\n padding: 4px;\n padding-left: 10px;\n}\n.ag-dark .ag-header-group-text {\n margin-right: 2px;\n}\n.ag-dark .ag-header-cell-menu-button {\n padding: 2px;\n margin-top: 4px;\n border: 1px solid transparent;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n -webkit-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n -moz-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n line-height: 0px /* normal line height, a space was appearing below the menu button */;\n}\n.ag-dark .ag-pinned-right-header {\n border-left: 1px solid #808080;\n}\n.ag-dark .ag-header-cell-menu-button:hover {\n border: 1px solid #808080;\n}\n.ag-dark .ag-body {\n background-color: #302e2e;\n}\n.ag-dark .ag-row {\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-dark .ag-row-odd {\n background-color: #302e2e;\n}\n.ag-dark .ag-row-even {\n background-color: #403e3e;\n}\n.ag-dark .ag-row-selected {\n background-color: #4a708b;\n}\n.ag-dark .ag-floating-top .ag-row {\n background-color: #333;\n}\n.ag-dark .ag-floating-bottom .ag-row {\n background-color: #333;\n}\n.ag-dark .ag-overlay-loading-wrapper {\n background-color: rgba(255,255,255,0.5);\n}\n.ag-dark .ag-overlay-loading-center {\n background-color: #fff;\n border: 1px solid #808080;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n color: #000;\n}\n.ag-dark .ag-overlay-no-rows-center {\n background-color: #fff;\n border: 1px solid #808080;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n}\n.ag-dark .ag-group-cell-entire-row {\n background-color: #302e2e;\n padding: 2px;\n}\n.ag-dark .ag-footer-cell-entire-row {\n background-color: #302e2e;\n padding: 2px;\n}\n.ag-dark .ag-group-cell {\n font-style: italic;\n}\n.ag-dark .ag-group-expanded {\n padding-right: 4px;\n}\n.ag-dark .ag-group-contracted {\n padding-right: 4px;\n}\n.ag-dark .ag-group-value {\n padding-right: 2px;\n}\n.ag-dark .ag-group-checkbox {\n padding-right: 2px;\n}\n.ag-dark .ag-footer-cell {\n font-style: italic;\n}\n.ag-dark .ag-menu {\n border: 1px solid #555;\n background-color: #302e2e;\n cursor: default;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n}\n.ag-dark .ag-menu .ag-tab-header {\n background-color: #626262;\n}\n.ag-dark .ag-menu .ag-tab {\n padding: 6px 8px 6px 8px;\n margin: 2px 2px 0px 2px;\n display: inline-block;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n}\n.ag-dark .ag-menu .ag-tab-selected {\n background-color: #302e2e;\n border-right: 1px solid #555;\n border-left: 1px solid #555;\n border-top: 1px solid #555;\n}\n.ag-dark .ag-menu-separator {\n border-top: 1px solid #555;\n}\n.ag-dark .ag-menu-option-active {\n background-color: #4a708b;\n}\n.ag-dark .ag-menu-option-icon {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-dark .ag-menu-option-text {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-dark .ag-menu-option-shortcut {\n padding: 2px 2px 2px 20px;\n vertical-align: middle;\n}\n.ag-dark .ag-menu-option-popup-pointer {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-dark .ag-menu-option-disabled {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-dark .ag-menu-column-select-wrapper {\n margin: 2px;\n}\n.ag-dark .ag-filter-checkbox {\n position: relative;\n top: 2px;\n left: 2px;\n}\n.ag-dark .ag-filter-header-container {\n border-bottom: 1px solid #555;\n}\n.ag-dark .ag-filter-apply-panel {\n border-top: 1px solid #555;\n padding: 2px;\n}\n.ag-dark .ag-filter-value {\n margin-left: 4px;\n}\n.ag-dark .ag-selection-checkbox {\n padding-right: 4px;\n}\n.ag-dark .ag-paging-panel {\n padding: 4px;\n}\n.ag-dark .ag-paging-button {\n margin-left: 4px;\n margin-right: 4px;\n}\n.ag-dark .ag-paging-row-summary-panel {\n display: inline-block;\n width: 300px;\n}\n.ag-dark .ag-tool-panel {\n background-color: #302e2e;\n border-right: 1px solid #808080;\n border-bottom: 1px solid #808080;\n border-top: 1px solid #808080;\n color: #ccc;\n}\n.ag-dark .ag-status-bar {\n color: #ccc;\n background-color: #302e2e;\n font-size: 14px;\n height: 22px;\n border-bottom: 1px solid #808080;\n border-left: 1px solid #808080;\n border-right: 1px solid #808080;\n padding: 2px;\n}\n.ag-dark .ag-status-bar-aggregations {\n float: right;\n}\n.ag-dark .ag-status-bar-item {\n padding-left: 10px;\n}\n.ag-dark .ag-column-drop-cell {\n background: #403e3e;\n color: #e0e0e0;\n border: 1px solid #666;\n}\n.ag-dark .ag-column-drop-cell-ghost {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-dark .ag-column-drop-cell-text {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-dark .ag-column-drop-cell-button {\n border: 1px solid transparent;\n padding-left: 2px;\n padding-right: 2px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n}\n.ag-dark .ag-column-drop-cell-button:hover {\n border: 1px solid #808080;\n}\n.ag-dark .ag-column-drop-empty-message {\n padding-left: 2px;\n padding-right: 2px;\n color: #808080;\n}\n.ag-dark .ag-column-drop-icon {\n padding-right: 4px;\n}\n.ag-dark .ag-column-drop {\n background-color: #302e2e;\n}\n.ag-dark .ag-column-drop-horizontal {\n padding: 4px 4px 4px 4px;\n border-top: 1px solid #808080;\n border-left: 1px solid #808080;\n border-right: 1px solid #808080;\n}\n.ag-dark .ag-column-drop-horizontal .ag-column-drop-cell {\n padding: 2px;\n}\n.ag-dark .ag-column-drop-vertical {\n padding: 4px 4px 10px 4px;\n border-bottom: 1px solid #808080;\n}\n.ag-dark .ag-column-drop-vertical .ag-column-drop-cell {\n margin-top: 2px;\n}\n.ag-dark .ag-column-drop-vertical .ag-column-drop-empty-message {\n text-align: center;\n padding: 5px;\n}\n.ag-dark .ag-pivot-mode {\n border-bottom: 1px solid #808080;\n padding: 4px;\n background-color: #302e2e;\n}\n.ag-dark .ag-tool-panel .ag-column-select-panel {\n border-bottom: 1px solid #808080;\n}\n.ag-dark .ag-select-agg-func-popup {\n cursor: default;\n position: absolute;\n font-size: 14px;\n background-color: #302e2e;\n border: 1px solid #808080;\n}\n.ag-dark .ag-select-agg-func-item {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-dark .ag-select-agg-func-item:hover {\n background-color: #4a708b;\n}\n.ag-dark ::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n background: #302e2e;\n}\n.ag-dark ::-webkit-scrollbar-thumb {\n background-color: #626262;\n}\n.ag-dark ::-webkit-scrollbar-corner {\n background: #302e2e;\n}\n.ag-dark select {\n background-color: #302e2e;\n color: #ccc;\n}\n.ag-dark input {\n background-color: #302e2e;\n color: #ccc;\n}\n", ""]);
// exports
/***/ },
/* 102 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(103);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(97)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!./../../node_modules/css-loader/index.js!./theme-fresh.css", function() {
var newContent = require("!!./../../node_modules/css-loader/index.js!./theme-fresh.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 103 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(96)();
// imports
// module
exports.push([module.id, ".ag-fresh {\n line-height: 1.4;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n color: #222;\n/* this is for the rowGroupPanel, that appears along the top of the grid */\n/* this is for the column drops that appear in the toolPanel */\n}\n.ag-fresh img {\n vertical-align: middle;\n border: 0;\n}\n.ag-fresh .ag-root {\n border: 1px solid #808080;\n}\n.ag-fresh .ag-cell-not-inline-editing {\n padding: 2px;\n}\n.ag-fresh .ag-cell-range-selected-1:not(.ag-cell-focus) {\n background-color: rgba(120,120,120,0.4);\n}\n.ag-fresh .ag-cell-range-selected-2:not(.ag-cell-focus) {\n background-color: rgba(80,80,80,0.4);\n}\n.ag-fresh .ag-cell-range-selected-3:not(.ag-cell-focus) {\n background-color: rgba(40,40,40,0.4);\n}\n.ag-fresh .ag-cell-range-selected-4:not(.ag-cell-focus) {\n background-color: rgba(0,0,0,0.4);\n}\n.ag-fresh .ag-column-moving .ag-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-fresh .ag-column-moving .ag-header-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-fresh .ag-column-moving .ag-header-group-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-fresh .ag-cell-focus {\n border: 1px solid #a9a9a9;\n}\n.ag-fresh .ag-cell-no-focus {\n border-right: 1px dotted #808080;\n border-top: 1px solid transparent;\n border-left: 1px solid transparent;\n border-bottom: 1px solid transparent;\n}\n.ag-fresh .ag-cell-first-right-pinned {\n border-left: 1px solid #808080;\n}\n.ag-fresh .ag-cell-last-left-pinned {\n border-right: 1px solid #808080;\n}\n.ag-fresh .ag-cell-highlight {\n border: 1px solid #006400;\n}\n.ag-fresh .ag-cell-highlight-animation {\n -webkit-transition: border 1s;\n -moz-transition: border 1s;\n -o-transition: border 1s;\n -ms-transition: border 1s;\n transition: border 1s;\n}\n.ag-fresh .ag-value-change-delta {\n padding-right: 2px;\n}\n.ag-fresh .ag-value-change-delta-up {\n color: #006400;\n}\n.ag-fresh .ag-value-change-delta-down {\n color: #8b0000;\n}\n.ag-fresh .ag-value-change-value {\n background-color: transparent;\n -webkit-border-radius: 1px;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n -webkit-transition: background-color 1s;\n -moz-transition: background-color 1s;\n -o-transition: background-color 1s;\n -ms-transition: background-color 1s;\n transition: background-color 1s;\n}\n.ag-fresh .ag-value-change-value-highlight {\n background-color: #cec;\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-fresh .ag-rich-select {\n font-size: 14px;\n border: 1px solid #808080;\n background-color: #fff;\n}\n.ag-fresh .ag-rich-select-value {\n padding: 2px;\n}\n.ag-fresh .ag-rich-select-list {\n border-top: 1px solid #d3d3d3;\n}\n.ag-fresh .ag-rich-select-row {\n padding: 2px;\n}\n.ag-fresh .ag-rich-select-row-selected {\n background-color: #bde2e5;\n}\n.ag-fresh .ag-large-text {\n border: 1px solid #808080;\n}\n.ag-fresh .ag-header {\n color: #000;\n background: -webkit-linear-gradient(#fff, #d3d3d3);\n background: -moz-linear-gradient(#fff, #d3d3d3);\n background: -o-linear-gradient(#fff, #d3d3d3);\n background: -ms-linear-gradient(#fff, #d3d3d3);\n background: linear-gradient(#fff, #d3d3d3);\n border-bottom: 1px solid #808080;\n font-weight: normal;\n}\n.ag-fresh .ag-header-icon {\n color: #000;\n stroke: none;\n fill: #000;\n}\n.ag-fresh .ag-no-scrolls .ag-header-container {\n background: -webkit-linear-gradient(#fff, #d3d3d3);\n background: -moz-linear-gradient(#fff, #d3d3d3);\n background: -o-linear-gradient(#fff, #d3d3d3);\n background: -ms-linear-gradient(#fff, #d3d3d3);\n background: linear-gradient(#fff, #d3d3d3);\n border-bottom: 1px solid #808080;\n}\n.ag-fresh .ag-header-cell {\n border-right: 1px solid #808080;\n}\n.ag-fresh .ag-header-cell-moving .ag-header-cell-label {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-fresh .ag-header-cell-moving {\n background-color: #bebebe;\n}\n.ag-fresh .ag-header-group-cell {\n border-right: 1px solid #808080;\n}\n.ag-fresh .ag-header-group-cell-with-group {\n border-bottom: 1px solid #808080;\n}\n.ag-fresh .ag-header-cell-label {\n padding: 4px 2px 4px 2px;\n}\n.ag-fresh .ag-header-cell-text {\n padding-left: 2px;\n}\n.ag-fresh .ag-header-group-cell-label {\n padding: 4px;\n padding-left: 10px;\n}\n.ag-fresh .ag-header-group-text {\n margin-right: 2px;\n}\n.ag-fresh .ag-header-cell-menu-button {\n padding: 2px;\n margin-top: 4px;\n border: 1px solid transparent;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n -webkit-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n -moz-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n line-height: 0px /* normal line height, a space was appearing below the menu button */;\n}\n.ag-fresh .ag-pinned-right-header {\n border-left: 1px solid #808080;\n}\n.ag-fresh .ag-header-cell-menu-button:hover {\n border: 1px solid #808080;\n}\n.ag-fresh .ag-body {\n background-color: #f6f6f6;\n}\n.ag-fresh .ag-row {\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-fresh .ag-row-odd {\n background-color: #f6f6f6;\n}\n.ag-fresh .ag-row-even {\n background-color: #fff;\n}\n.ag-fresh .ag-row-selected {\n background-color: #b0e0e6;\n}\n.ag-fresh .ag-floating-top .ag-row {\n background-color: #f0f0f0;\n}\n.ag-fresh .ag-floating-bottom .ag-row {\n background-color: #f0f0f0;\n}\n.ag-fresh .ag-overlay-loading-wrapper {\n background-color: rgba(255,255,255,0.5);\n}\n.ag-fresh .ag-overlay-loading-center {\n background-color: #fff;\n border: 1px solid #808080;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n color: #000;\n}\n.ag-fresh .ag-overlay-no-rows-center {\n background-color: #fff;\n border: 1px solid #808080;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n}\n.ag-fresh .ag-group-cell-entire-row {\n background-color: #f6f6f6;\n padding: 2px;\n}\n.ag-fresh .ag-footer-cell-entire-row {\n background-color: #f6f6f6;\n padding: 2px;\n}\n.ag-fresh .ag-group-cell {\n font-style: italic;\n}\n.ag-fresh .ag-group-expanded {\n padding-right: 4px;\n}\n.ag-fresh .ag-group-contracted {\n padding-right: 4px;\n}\n.ag-fresh .ag-group-value {\n padding-right: 2px;\n}\n.ag-fresh .ag-group-checkbox {\n padding-right: 2px;\n}\n.ag-fresh .ag-footer-cell {\n font-style: italic;\n}\n.ag-fresh .ag-menu {\n border: 1px solid #808080;\n background-color: #f6f6f6;\n cursor: default;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n}\n.ag-fresh .ag-menu .ag-tab-header {\n background-color: #e6e6e6;\n}\n.ag-fresh .ag-menu .ag-tab {\n padding: 6px 8px 6px 8px;\n margin: 2px 2px 0px 2px;\n display: inline-block;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n}\n.ag-fresh .ag-menu .ag-tab-selected {\n background-color: #f6f6f6;\n border-right: 1px solid #d3d3d3;\n border-left: 1px solid #d3d3d3;\n border-top: 1px solid #d3d3d3;\n}\n.ag-fresh .ag-menu-separator {\n border-top: 1px solid #d3d3d3;\n}\n.ag-fresh .ag-menu-option-active {\n background-color: #bde2e5;\n}\n.ag-fresh .ag-menu-option-icon {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-fresh .ag-menu-option-text {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-fresh .ag-menu-option-shortcut {\n padding: 2px 2px 2px 20px;\n vertical-align: middle;\n}\n.ag-fresh .ag-menu-option-popup-pointer {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-fresh .ag-menu-option-disabled {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-fresh .ag-menu-column-select-wrapper {\n margin: 2px;\n}\n.ag-fresh .ag-filter-checkbox {\n position: relative;\n top: 2px;\n left: 2px;\n}\n.ag-fresh .ag-filter-header-container {\n border-bottom: 1px solid #d3d3d3;\n}\n.ag-fresh .ag-filter-apply-panel {\n border-top: 1px solid #d3d3d3;\n padding: 2px;\n}\n.ag-fresh .ag-filter-value {\n margin-left: 4px;\n}\n.ag-fresh .ag-selection-checkbox {\n padding-right: 4px;\n}\n.ag-fresh .ag-paging-panel {\n padding: 4px;\n}\n.ag-fresh .ag-paging-button {\n margin-left: 4px;\n margin-right: 4px;\n}\n.ag-fresh .ag-paging-row-summary-panel {\n display: inline-block;\n width: 300px;\n}\n.ag-fresh .ag-tool-panel {\n background-color: #f6f6f6;\n border-right: 1px solid #808080;\n border-bottom: 1px solid #808080;\n border-top: 1px solid #808080;\n color: #222;\n}\n.ag-fresh .ag-status-bar {\n color: #222;\n background-color: #f6f6f6;\n font-size: 14px;\n height: 22px;\n border-bottom: 1px solid #808080;\n border-left: 1px solid #808080;\n border-right: 1px solid #808080;\n padding: 2px;\n}\n.ag-fresh .ag-status-bar-aggregations {\n float: right;\n}\n.ag-fresh .ag-status-bar-item {\n padding-left: 10px;\n}\n.ag-fresh .ag-column-drop-cell {\n background: -webkit-linear-gradient(#fff, #d3d3d3);\n background: -moz-linear-gradient(#fff, #d3d3d3);\n background: -o-linear-gradient(#fff, #d3d3d3);\n background: -ms-linear-gradient(#fff, #d3d3d3);\n background: linear-gradient(#fff, #d3d3d3);\n color: #000;\n border: 1px solid #808080;\n}\n.ag-fresh .ag-column-drop-cell-ghost {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-fresh .ag-column-drop-cell-text {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-fresh .ag-column-drop-cell-button {\n border: 1px solid transparent;\n padding-left: 2px;\n padding-right: 2px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n}\n.ag-fresh .ag-column-drop-cell-button:hover {\n border: 1px solid #808080;\n}\n.ag-fresh .ag-column-drop-empty-message {\n padding-left: 2px;\n padding-right: 2px;\n color: #808080;\n}\n.ag-fresh .ag-column-drop-icon {\n padding-right: 4px;\n}\n.ag-fresh .ag-column-drop {\n background-color: #f6f6f6;\n}\n.ag-fresh .ag-column-drop-horizontal {\n padding: 4px 4px 4px 4px;\n border-top: 1px solid #808080;\n border-left: 1px solid #808080;\n border-right: 1px solid #808080;\n}\n.ag-fresh .ag-column-drop-horizontal .ag-column-drop-cell {\n padding: 2px;\n}\n.ag-fresh .ag-column-drop-vertical {\n padding: 4px 4px 10px 4px;\n border-bottom: 1px solid #808080;\n}\n.ag-fresh .ag-column-drop-vertical .ag-column-drop-cell {\n margin-top: 2px;\n}\n.ag-fresh .ag-column-drop-vertical .ag-column-drop-empty-message {\n text-align: center;\n padding: 5px;\n}\n.ag-fresh .ag-pivot-mode {\n border-bottom: 1px solid #808080;\n padding: 4px;\n background-color: #f6f6f6;\n}\n.ag-fresh .ag-tool-panel .ag-column-select-panel {\n border-bottom: 1px solid #808080;\n}\n.ag-fresh .ag-select-agg-func-popup {\n cursor: default;\n position: absolute;\n font-size: 14px;\n background-color: #fff;\n border: 1px solid #808080;\n}\n.ag-fresh .ag-select-agg-func-item {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-fresh .ag-select-agg-func-item:hover {\n background-color: #bde2e5;\n}\n", ""]);
// exports
/***/ },
/* 104 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(105);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(97)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!./../../node_modules/css-loader/index.js!./theme-material.css", function() {
var newContent = require("!!./../../node_modules/css-loader/index.js!./theme-material.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 105 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(96)();
// imports
// module
exports.push([module.id, ".ag-material {\n line-height: 1.4;\n font-family: Roboto;\n font-size: 14px;\n color: #666;\n/* this is for the rowGroupPanel, that appears along the top of the grid */\n/* this is for the column drops that appear in the toolPanel */\n}\n.ag-material img {\n vertical-align: middle;\n border: 0;\n}\n.ag-material .ag-root {\n border: none;\n}\n.ag-material .ag-cell-not-inline-editing {\n padding: 2px;\n}\n.ag-material .ag-cell-range-selected-1:not(.ag-cell-focus) {\n background-color: rgba(120,120,120,0.4);\n}\n.ag-material .ag-cell-range-selected-2:not(.ag-cell-focus) {\n background-color: rgba(80,80,80,0.4);\n}\n.ag-material .ag-cell-range-selected-3:not(.ag-cell-focus) {\n background-color: rgba(40,40,40,0.4);\n}\n.ag-material .ag-cell-range-selected-4:not(.ag-cell-focus) {\n background-color: rgba(0,0,0,0.4);\n}\n.ag-material .ag-column-moving .ag-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-material .ag-column-moving .ag-header-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-material .ag-column-moving .ag-header-group-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-material .ag-cell-focus {\n border: 1px solid #d3d3d3;\n}\n.ag-material .ag-cell-no-focus {\n border-right: 1px solid transparent;\n border-top: 1px solid transparent;\n border-left: 1px solid transparent;\n border-bottom: 1px solid #d3d3d3;\n}\n.ag-material .ag-cell-first-right-pinned {\n border-left: none;\n}\n.ag-material .ag-cell-last-left-pinned {\n border-right: none;\n}\n.ag-material .ag-cell-highlight {\n border: 1px solid #006400;\n}\n.ag-material .ag-cell-highlight-animation {\n -webkit-transition: border 1s;\n -moz-transition: border 1s;\n -o-transition: border 1s;\n -ms-transition: border 1s;\n transition: border 1s;\n}\n.ag-material .ag-value-change-delta {\n padding-right: 2px;\n}\n.ag-material .ag-value-change-delta-up {\n color: #006400;\n}\n.ag-material .ag-value-change-delta-down {\n color: #8b0000;\n}\n.ag-material .ag-value-change-value {\n background-color: transparent;\n -webkit-border-radius: 1px;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n -webkit-transition: background-color 1s;\n -moz-transition: background-color 1s;\n -o-transition: background-color 1s;\n -ms-transition: background-color 1s;\n transition: background-color 1s;\n}\n.ag-material .ag-value-change-value-highlight {\n background-color: #cec;\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-material .ag-rich-select {\n font-size: 14px;\n border: none;\n background-color: #fff;\n}\n.ag-material .ag-rich-select-value {\n padding: 2px;\n}\n.ag-material .ag-rich-select-list {\n border-top: 1px solid #d3d3d3;\n}\n.ag-material .ag-rich-select-row {\n padding: 2px;\n}\n.ag-material .ag-rich-select-row-selected {\n background-color: #bde2e5;\n}\n.ag-material .ag-large-text {\n border: none;\n}\n.ag-material .ag-header {\n color: #666;\n background: none;\n border-bottom: none;\n font-weight: bold;\n}\n.ag-material .ag-header-icon {\n color: #666;\n stroke: none;\n fill: #666;\n}\n.ag-material .ag-no-scrolls .ag-header-container {\n background: none;\n border-bottom: none;\n}\n.ag-material .ag-header-cell {\n border-right: none;\n}\n.ag-material .ag-header-cell-moving .ag-header-cell-label {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-material .ag-header-cell-moving {\n background-color: #bebebe;\n}\n.ag-material .ag-header-group-cell {\n border-right: none;\n}\n.ag-material .ag-header-group-cell-with-group {\n border-bottom: none;\n}\n.ag-material .ag-header-cell-label {\n padding: 4px 2px 4px 2px;\n}\n.ag-material .ag-header-cell-text {\n padding-left: 2px;\n}\n.ag-material .ag-header-group-cell-label {\n padding: 4px;\n padding-left: 10px;\n}\n.ag-material .ag-header-group-text {\n margin-right: 2px;\n}\n.ag-material .ag-header-cell-menu-button {\n padding: 2px;\n margin-top: 4px;\n border: 1px solid transparent;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n -webkit-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n -moz-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n line-height: 0px /* normal line height, a space was appearing below the menu button */;\n}\n.ag-material .ag-pinned-right-header {\n border-left: none;\n}\n.ag-material .ag-header-cell-menu-button:hover {\n border: none;\n}\n.ag-material .ag-body {\n background-color: #fff;\n}\n.ag-material .ag-row {\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-material .ag-row-odd {\n background-color: #fff;\n}\n.ag-material .ag-row-even {\n background-color: #fff;\n}\n.ag-material .ag-row-selected {\n background-color: #f5f5f5;\n}\n.ag-material .ag-floating-top .ag-row {\n background-color: #f0f0f0;\n}\n.ag-material .ag-floating-bottom .ag-row {\n background-color: #f0f0f0;\n}\n.ag-material .ag-overlay-loading-wrapper {\n background-color: rgba(255,255,255,0.5);\n}\n.ag-material .ag-overlay-loading-center {\n background-color: #fff;\n border: none;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n color: #000;\n}\n.ag-material .ag-overlay-no-rows-center {\n background-color: #fff;\n border: none;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n}\n.ag-material .ag-group-cell-entire-row {\n background-color: #fff;\n padding: 2px;\n}\n.ag-material .ag-footer-cell-entire-row {\n background-color: #fff;\n padding: 2px;\n}\n.ag-material .ag-group-cell {\n font-style: italic;\n}\n.ag-material .ag-group-expanded {\n padding-right: 4px;\n}\n.ag-material .ag-group-contracted {\n padding-right: 4px;\n}\n.ag-material .ag-group-value {\n padding-right: 2px;\n}\n.ag-material .ag-group-checkbox {\n padding-right: 2px;\n}\n.ag-material .ag-footer-cell {\n font-style: italic;\n}\n.ag-material .ag-menu {\n border: 1px solid #808080;\n background-color: #fff;\n cursor: default;\n font-family: Roboto;\n font-size: 14px;\n}\n.ag-material .ag-menu .ag-tab-header {\n background-color: #f6f6f6;\n}\n.ag-material .ag-menu .ag-tab {\n padding: 6px 16px 6px 16px;\n margin: 2px 2px 0px 2px;\n display: inline-block;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n}\n.ag-material .ag-menu .ag-tab-selected {\n background-color: #fff;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n}\n.ag-material .ag-menu-separator {\n border-top: 1px solid #d3d3d3;\n}\n.ag-material .ag-menu-option-active {\n background-color: #bde2e5;\n}\n.ag-material .ag-menu-option-icon {\n padding: 10px 6px 10px 6px;\n vertical-align: middle;\n}\n.ag-material .ag-menu-option-text {\n padding: 10px 6px 10px 6px;\n vertical-align: middle;\n}\n.ag-material .ag-menu-option-shortcut {\n padding: 10px 6px 10px 20px;\n vertical-align: middle;\n}\n.ag-material .ag-menu-option-popup-pointer {\n padding: 10px 6px 10px 6px;\n vertical-align: middle;\n}\n.ag-material .ag-menu-option-disabled {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-material .ag-menu-column-select-wrapper {\n margin: 2px;\n}\n.ag-material .ag-filter-checkbox {\n position: relative;\n top: 2px;\n left: 2px;\n}\n.ag-material .ag-filter-header-container {\n border-bottom: 1px solid #d3d3d3;\n}\n.ag-material .ag-filter-apply-panel {\n border-top: 1px solid #d3d3d3;\n padding: 2px;\n}\n.ag-material .ag-filter-value {\n margin-left: 4px;\n}\n.ag-material .ag-selection-checkbox {\n padding-right: 4px;\n}\n.ag-material .ag-paging-panel {\n padding: 4px;\n}\n.ag-material .ag-paging-button {\n margin-left: 4px;\n margin-right: 4px;\n}\n.ag-material .ag-paging-row-summary-panel {\n display: inline-block;\n width: 300px;\n}\n.ag-material .ag-tool-panel {\n background-color: #fff;\n border-right: none;\n border-bottom: none;\n border-top: none;\n color: #666;\n}\n.ag-material .ag-status-bar {\n color: #666;\n background-color: #fff;\n font-size: 14px;\n height: 22px;\n border-bottom: none;\n border-left: none;\n border-right: none;\n padding: 2px;\n}\n.ag-material .ag-status-bar-aggregations {\n float: right;\n}\n.ag-material .ag-status-bar-item {\n padding-left: 10px;\n}\n.ag-material .ag-column-drop-cell {\n background: none;\n color: #000;\n border: 1px solid #808080;\n}\n.ag-material .ag-column-drop-cell-ghost {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-material .ag-column-drop-cell-text {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-material .ag-column-drop-cell-button {\n border: 1px solid transparent;\n padding-left: 2px;\n padding-right: 2px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n}\n.ag-material .ag-column-drop-cell-button:hover {\n border: none;\n}\n.ag-material .ag-column-drop-empty-message {\n padding-left: 2px;\n padding-right: 2px;\n color: #808080;\n}\n.ag-material .ag-column-drop-icon {\n padding-right: 4px;\n}\n.ag-material .ag-column-drop {\n background-color: #fff;\n}\n.ag-material .ag-column-drop-horizontal {\n padding: 4px 4px 4px 4px;\n border-top: none;\n border-left: none;\n border-right: none;\n}\n.ag-material .ag-column-drop-horizontal .ag-column-drop-cell {\n padding: 2px;\n}\n.ag-material .ag-column-drop-vertical {\n padding: 4px 4px 10px 4px;\n border-bottom: none;\n}\n.ag-material .ag-column-drop-vertical .ag-column-drop-cell {\n margin-top: 2px;\n}\n.ag-material .ag-column-drop-vertical .ag-column-drop-empty-message {\n text-align: center;\n padding: 5px;\n}\n.ag-material .ag-pivot-mode {\n border-bottom: none;\n padding: 4px;\n background-color: #fff;\n}\n.ag-material .ag-tool-panel .ag-column-select-panel {\n border-bottom: none;\n}\n.ag-material .ag-select-agg-func-popup {\n cursor: default;\n position: absolute;\n font-size: 14px;\n background-color: #fff;\n border: none;\n}\n.ag-material .ag-select-agg-func-item {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-material .ag-select-agg-func-item:hover {\n background-color: #bde2e5;\n}\n.ag-material .ag-row-hover {\n background-color: #eee !important;\n}\n.ag-material .ag-cell-not-inline-editing {\n padding-top: 15px;\n}\n.ag-material .ag-header-cell-menu-button:hover {\n border: 1px solid #808080;\n}\n.ag-material .ag-header-cell-label {\n text-align: left;\n}\n.ag-material .ag-header {\n border-bottom: 1px solid #808080;\n}\n.ag-material .ag-selection-checkbox {\n padding-right: 12px;\n padding-left: 12px;\n}\n", ""]);
// exports
/***/ },
/* 106 */
/***/ function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(107);
if(typeof content === 'string') content = [[module.id, content, '']];
// add the styles to the DOM
var update = __webpack_require__(97)(content, {});
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!./../../node_modules/css-loader/index.js!./theme-bootstrap.css", function() {
var newContent = require("!!./../../node_modules/css-loader/index.js!./theme-bootstrap.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ },
/* 107 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(96)();
// imports
// module
exports.push([module.id, ".ag-bootstrap {\n line-height: 1.4;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n color: #000;\n/* this is for the rowGroupPanel, that appears along the top of the grid */\n/* this is for the column drops that appear in the toolPanel */\n}\n.ag-bootstrap img {\n vertical-align: middle;\n border: 0;\n}\n.ag-bootstrap .ag-root {\n border: none;\n}\n.ag-bootstrap .ag-cell-not-inline-editing {\n padding: 4px;\n}\n.ag-bootstrap .ag-cell-range-selected-1:not(.ag-cell-focus) {\n background-color: rgba(120,120,120,0.4);\n}\n.ag-bootstrap .ag-cell-range-selected-2:not(.ag-cell-focus) {\n background-color: rgba(80,80,80,0.4);\n}\n.ag-bootstrap .ag-cell-range-selected-3:not(.ag-cell-focus) {\n background-color: rgba(40,40,40,0.4);\n}\n.ag-bootstrap .ag-cell-range-selected-4:not(.ag-cell-focus) {\n background-color: rgba(0,0,0,0.4);\n}\n.ag-bootstrap .ag-column-moving .ag-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-bootstrap .ag-column-moving .ag-header-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-bootstrap .ag-column-moving .ag-header-group-cell {\n -webkit-transition: left 0.2s;\n -moz-transition: left 0.2s;\n -o-transition: left 0.2s;\n -ms-transition: left 0.2s;\n transition: left 0.2s;\n}\n.ag-bootstrap .ag-cell-focus {\n border: 2px solid #217346;\n}\n.ag-bootstrap .ag-cell-no-focus {\n border-right: none;\n border-top: 1px solid transparent;\n border-left: 1px solid transparent;\n border-bottom: 1px solid transparent;\n}\n.ag-bootstrap .ag-cell-first-right-pinned {\n border-left: none;\n}\n.ag-bootstrap .ag-cell-last-left-pinned {\n border-right: none;\n}\n.ag-bootstrap .ag-cell-highlight {\n border: 1px solid #006400;\n}\n.ag-bootstrap .ag-cell-highlight-animation {\n -webkit-transition: border 1s;\n -moz-transition: border 1s;\n -o-transition: border 1s;\n -ms-transition: border 1s;\n transition: border 1s;\n}\n.ag-bootstrap .ag-value-change-delta {\n padding-right: 2px;\n}\n.ag-bootstrap .ag-value-change-delta-up {\n color: #006400;\n}\n.ag-bootstrap .ag-value-change-delta-down {\n color: #8b0000;\n}\n.ag-bootstrap .ag-value-change-value {\n background-color: transparent;\n -webkit-border-radius: 1px;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n -webkit-transition: background-color 1s;\n -moz-transition: background-color 1s;\n -o-transition: background-color 1s;\n -ms-transition: background-color 1s;\n transition: background-color 1s;\n}\n.ag-bootstrap .ag-value-change-value-highlight {\n background-color: #cec;\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-bootstrap .ag-rich-select {\n font-size: 14px;\n border: none;\n background-color: #fff;\n}\n.ag-bootstrap .ag-rich-select-value {\n padding: 2px;\n}\n.ag-bootstrap .ag-rich-select-list {\n border-top: 1px solid #d3d3d3;\n}\n.ag-bootstrap .ag-rich-select-row {\n padding: 2px;\n}\n.ag-bootstrap .ag-rich-select-row-selected {\n background-color: #bde2e5;\n}\n.ag-bootstrap .ag-large-text {\n border: none;\n}\n.ag-bootstrap .ag-header {\n color: #000;\n background: none;\n border-bottom: none;\n font-weight: 600;\n}\n.ag-bootstrap .ag-header-icon {\n color: #000;\n stroke: none;\n fill: #000;\n}\n.ag-bootstrap .ag-no-scrolls .ag-header-container {\n background: none;\n border-bottom: none;\n}\n.ag-bootstrap .ag-header-cell {\n border-right: none;\n}\n.ag-bootstrap .ag-header-cell-moving .ag-header-cell-label {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-bootstrap .ag-header-cell-moving {\n background-color: #bebebe;\n}\n.ag-bootstrap .ag-header-group-cell {\n border-right: none;\n}\n.ag-bootstrap .ag-header-group-cell-with-group {\n border-bottom: none;\n}\n.ag-bootstrap .ag-header-cell-label {\n padding: 4px 2px 4px 2px;\n}\n.ag-bootstrap .ag-header-cell-text {\n padding-left: 2px;\n}\n.ag-bootstrap .ag-header-group-cell-label {\n padding: 4px;\n padding-left: 10px;\n}\n.ag-bootstrap .ag-header-group-text {\n margin-right: 2px;\n}\n.ag-bootstrap .ag-header-cell-menu-button {\n padding: 2px;\n margin-top: 4px;\n border: 1px solid transparent;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n -webkit-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n -moz-box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n box-sizing: content-box /* When using bootstrap, box-sizing was set to 'border-box' */;\n line-height: 0px /* normal line height, a space was appearing below the menu button */;\n}\n.ag-bootstrap .ag-pinned-right-header {\n border-left: none;\n}\n.ag-bootstrap .ag-header-cell-menu-button:hover {\n border: none;\n}\n.ag-bootstrap .ag-body {\n background-color: #f6f6f6;\n}\n.ag-bootstrap .ag-row {\n -webkit-transition: background-color 0.1s;\n -moz-transition: background-color 0.1s;\n -o-transition: background-color 0.1s;\n -ms-transition: background-color 0.1s;\n transition: background-color 0.1s;\n}\n.ag-bootstrap .ag-row-odd {\n background-color: #f6f6f6;\n}\n.ag-bootstrap .ag-row-even {\n background-color: #fff;\n}\n.ag-bootstrap .ag-row-selected {\n background-color: #b0e0e6;\n}\n.ag-bootstrap .ag-floating-top .ag-row {\n background-color: #f0f0f0;\n}\n.ag-bootstrap .ag-floating-bottom .ag-row {\n background-color: #f0f0f0;\n}\n.ag-bootstrap .ag-overlay-loading-wrapper {\n background-color: rgba(255,255,255,0.5);\n}\n.ag-bootstrap .ag-overlay-loading-center {\n background-color: #fff;\n border: none;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n color: #000;\n}\n.ag-bootstrap .ag-overlay-no-rows-center {\n background-color: #fff;\n border: none;\n -webkit-border-radius: 10px;\n border-radius: 10px;\n padding: 10px;\n}\n.ag-bootstrap .ag-group-cell-entire-row {\n background-color: #f6f6f6;\n padding: 4px;\n}\n.ag-bootstrap .ag-footer-cell-entire-row {\n background-color: #f6f6f6;\n padding: 4px;\n}\n.ag-bootstrap .ag-group-cell {\n font-style: italic;\n}\n.ag-bootstrap .ag-group-expanded {\n padding-right: 4px;\n}\n.ag-bootstrap .ag-group-contracted {\n padding-right: 4px;\n}\n.ag-bootstrap .ag-group-value {\n padding-right: 2px;\n}\n.ag-bootstrap .ag-group-checkbox {\n padding-right: 2px;\n}\n.ag-bootstrap .ag-footer-cell {\n font-style: italic;\n}\n.ag-bootstrap .ag-menu {\n border: 1px solid #808080;\n background-color: #f6f6f6;\n cursor: default;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n}\n.ag-bootstrap .ag-menu .ag-tab-header {\n background-color: #e6e6e6;\n}\n.ag-bootstrap .ag-menu .ag-tab {\n padding: 6px 8px 6px 8px;\n margin: 2px 2px 0px 2px;\n display: inline-block;\n border-right: 1px solid transparent;\n border-left: 1px solid transparent;\n border-top: 1px solid transparent;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n}\n.ag-bootstrap .ag-menu .ag-tab-selected {\n background-color: #f6f6f6;\n border-right: 1px solid #d3d3d3;\n border-left: 1px solid #d3d3d3;\n border-top: 1px solid #d3d3d3;\n}\n.ag-bootstrap .ag-menu-separator {\n border-top: 1px solid #d3d3d3;\n}\n.ag-bootstrap .ag-menu-option-active {\n background-color: #bde2e5;\n}\n.ag-bootstrap .ag-menu-option-icon {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-bootstrap .ag-menu-option-text {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-bootstrap .ag-menu-option-shortcut {\n padding: 2px 2px 2px 20px;\n vertical-align: middle;\n}\n.ag-bootstrap .ag-menu-option-popup-pointer {\n padding: 2px 4px 2px 4px;\n vertical-align: middle;\n}\n.ag-bootstrap .ag-menu-option-disabled {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-bootstrap .ag-menu-column-select-wrapper {\n margin: 2px;\n}\n.ag-bootstrap .ag-filter-checkbox {\n position: relative;\n top: 2px;\n left: 2px;\n}\n.ag-bootstrap .ag-filter-header-container {\n border-bottom: 1px solid #d3d3d3;\n}\n.ag-bootstrap .ag-filter-apply-panel {\n border-top: 1px solid #d3d3d3;\n padding: 2px;\n}\n.ag-bootstrap .ag-filter-value {\n margin-left: 4px;\n}\n.ag-bootstrap .ag-selection-checkbox {\n padding-right: 4px;\n}\n.ag-bootstrap .ag-paging-panel {\n padding: 4px;\n}\n.ag-bootstrap .ag-paging-button {\n margin-left: 4px;\n margin-right: 4px;\n}\n.ag-bootstrap .ag-paging-row-summary-panel {\n display: inline-block;\n width: 300px;\n}\n.ag-bootstrap .ag-tool-panel {\n background-color: #f6f6f6;\n border-right: none;\n border-bottom: none;\n border-top: none;\n color: #000;\n}\n.ag-bootstrap .ag-status-bar {\n color: #000;\n background-color: #f6f6f6;\n font-size: 14px;\n height: 22px;\n border-bottom: none;\n border-left: none;\n border-right: none;\n padding: 2px;\n}\n.ag-bootstrap .ag-status-bar-aggregations {\n float: right;\n}\n.ag-bootstrap .ag-status-bar-item {\n padding-left: 10px;\n}\n.ag-bootstrap .ag-column-drop-cell {\n background: none;\n color: #000;\n border: 1px solid #808080;\n}\n.ag-bootstrap .ag-column-drop-cell-ghost {\n opacity: 0.5;\n -ms-filter: \"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";\n filter: alpha(opacity=50);\n}\n.ag-bootstrap .ag-column-drop-cell-text {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-bootstrap .ag-column-drop-cell-button {\n border: 1px solid transparent;\n padding-left: 2px;\n padding-right: 2px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n}\n.ag-bootstrap .ag-column-drop-cell-button:hover {\n border: none;\n}\n.ag-bootstrap .ag-column-drop-empty-message {\n padding-left: 2px;\n padding-right: 2px;\n color: #808080;\n}\n.ag-bootstrap .ag-column-drop-icon {\n padding-right: 4px;\n}\n.ag-bootstrap .ag-column-drop {\n background-color: #f6f6f6;\n}\n.ag-bootstrap .ag-column-drop-horizontal {\n padding: 4px 4px 4px 4px;\n border-top: none;\n border-left: none;\n border-right: none;\n}\n.ag-bootstrap .ag-column-drop-horizontal .ag-column-drop-cell {\n padding: 2px;\n}\n.ag-bootstrap .ag-column-drop-vertical {\n padding: 4px 4px 10px 4px;\n border-bottom: none;\n}\n.ag-bootstrap .ag-column-drop-vertical .ag-column-drop-cell {\n margin-top: 2px;\n}\n.ag-bootstrap .ag-column-drop-vertical .ag-column-drop-empty-message {\n text-align: center;\n padding: 5px;\n}\n.ag-bootstrap .ag-pivot-mode {\n border-bottom: none;\n padding: 4px;\n background-color: #f6f6f6;\n}\n.ag-bootstrap .ag-tool-panel .ag-column-select-panel {\n border-bottom: none;\n}\n.ag-bootstrap .ag-select-agg-func-popup {\n cursor: default;\n position: absolute;\n font-size: 14px;\n background-color: #fff;\n border: none;\n}\n.ag-bootstrap .ag-select-agg-func-item {\n padding-left: 2px;\n padding-right: 2px;\n}\n.ag-bootstrap .ag-select-agg-func-item:hover {\n background-color: #bde2e5;\n}\n", ""]);
// exports
/***/ }
/******/ ])
});
; |
test/HelpBlockSpec.js | apkiernan/react-bootstrap | import React from 'react';
import $ from 'teaspoon';
import HelpBlock from '../src/HelpBlock';
describe('<HelpBlock>', () => {
it('should render correctly', () => {
expect(
$(
<HelpBlock id="foo" className="my-help-block">
Help contents
</HelpBlock>
)
.shallowRender()
.single('#foo.help-block.my-help-block')
.text()
).to.equal('Help contents');
});
});
|
src/components/pages/grocerylist/myGrocerylists.js | emilmannfeldt/ettkilomjol | import React, { Component } from 'react';
import './grocerylist.css';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContentText from '@material-ui/core/DialogContentText';
import PropTypes from 'prop-types';
import Grid from '@material-ui/core/Grid';
import GrocerylistDetails from './grocerylistDetails';
import GrocerylistCard from './grocerylistCard';
import { fire } from '../../../base';
import Utils from '../../../util';
class MyGrocerylists extends Component {
constructor(props) {
super(props);
this.state = {
currentList: null,
showNewListDialog: false,
newName: '',
errorText: '',
listToDelete: null,
};
this.setCurrentList = this.setCurrentList.bind(this);
this.openDialog = this.openDialog.bind(this);
this.createList = this.createList.bind(this);
this.validateName = this.validateName.bind(this);
this.deleteList = this.deleteList.bind(this);
this.resetCurrentList = this.resetCurrentList.bind(this);
this.undoDeletion = this.undoDeletion.bind(this);
}
getError() {
const { errorText } = this.state;
return errorText;
}
setCurrentList(list) {
this.setState({
currentList: list,
});
}
handleChange = name => (event) => {
this.setState({
[name]: event.target.value,
});
};
closeDialog = () => {
this.setState({
showNewListDialog: false,
newName: '',
errorText: '',
});
};
deleteList(list) {
this.setState({
listToDelete: list,
});
const deletetion = {};
deletetion[list.name] = null;
const that = this;
fire.database().ref(`users/${fire.auth().currentUser.uid}/grocerylists`).update(deletetion, (error) => {
if (error) {
// console.log('Error has occured during saving process');
} else {
that.props.setSnackbar('grocerylist_delete', that.undoDeletion);
}
});
}
resetCurrentList() {
this.setState({
currentList: null,
});
}
openDialog() {
const { setSnackbar, grocerylists } = this.props;
if (fire.auth().currentUser.isAnonymous) {
setSnackbar('login_required');
return;
}
let newName = `Att handla ${Utils.getDayAndMonthString(new Date())}`;
const nameIsTaken = grocerylists.some(x => x.name === newName);
if (nameIsTaken) {
newName = '';
}
this.setState({
showNewListDialog: true,
newName,
});
}
validateName(name) {
const { grocerylists } = this.props;
if (name.trim().length < 1) {
this.setState({
errorText: 'Namnet måste vara minst 1 tecken',
});
return false;
}
if (name.trim().length > 64) {
this.setState({
errorText: 'Namnet får max vara 64 tecken',
});
return false;
}
const nameIsTaken = grocerylists.some(x => x.name === name);
if (nameIsTaken) {
this.setState({
errorText: 'Du har redan en inköpslista med det namnet',
});
return false;
}
return true;
}
createList() {
const { newName } = this.state;
const grocerylist = {
name: newName,
created: Date.now(),
};
if (!this.validateName(grocerylist.name)) {
return;
}
const that = this;
fire.database().ref(`users/${fire.auth().currentUser.uid}/grocerylists/${grocerylist.name}`).set(grocerylist, (error) => {
if (error) {
that.setState({
errorText: `Error: ${error}`,
});
} else {
that.setState({
showNewListDialog: false,
currentList: grocerylist,
errorText: '',
});
}
});
}
undoDeletion() {
const { listToDelete } = this.state;
fire.database().ref(`users/${fire.auth().currentUser.uid}/grocerylists/${listToDelete.name}`).set(listToDelete);
}
render() {
const {
currentList, showNewListDialog, helptext, newName,
} = this.state;
const {
grocerylists, foods, units, recipes, closeDialog, setSnackbar,
} = this.props;
if (currentList) {
const activeGrocerylist = grocerylists.find(x => x.name === currentList.name);
return (
<div className="container my_recipes-container">
<div className="row">
<GrocerylistDetails returnFunc={this.resetCurrentList} grocerylist={activeGrocerylist} foods={foods} units={units} recipes={recipes} />
</div>
</div>
);
}
return (
<div className="container my_recipes-container">
<Grid item container xs={12} className="list-item">
<Grid item xs={12}>
<h2 className="page-title">Mina inköpslistor</h2>
</Grid>
<Grid item xs={12}>
<Button onClick={this.openDialog} color="primary" variant="contained">Ny lista</Button>
</Grid>
</Grid>
{grocerylists.map((grocerylist, index) => (
<GrocerylistCard
key={grocerylist.name}
setCurrentList={this.setCurrentList}
grocerylist={grocerylist}
transitionDelay={index}
setSnackbar={setSnackbar}
deleteList={this.deleteList}
/>
))}
<Dialog
open={showNewListDialog}
onClose={closeDialog}
aria-labelledby="form-dialog-title"
>
<DialogTitle id="simple-dialog-title">Ny inköpslista</DialogTitle>
<DialogContent className="dialog-content">
<DialogContentText>
{helptext}
</DialogContentText>
<TextField
className="contact-field"
label="Namn"
name="name"
value={newName}
onChange={this.handleChange('newName')}
margin="normal"
/>
<DialogContentText>
{this.getError()}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={this.closeDialog} color="secondary" variant="contained">stäng</Button>
<Button onClick={this.createList} color="primary" variant="contained">skapa</Button>
</DialogActions>
</Dialog>
</div>
);
}
}
MyGrocerylists.propTypes = {
closeDialog: PropTypes.func,
grocerylists: PropTypes.array.isRequired,
foods: PropTypes.array.isRequired,
recipes: PropTypes.array.isRequired,
units: PropTypes.any.isRequired,
setSnackbar: PropTypes.func.isRequired,
};
export default MyGrocerylists;
|
src/routes/login/index.js | SgtRock91/FantasyOptimizer | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import Layout from '../../components/Layout';
import Login from './Login';
const title = 'Log In';
function action() {
return {
chunks: ['login'],
title,
component: (
<Layout>
<Login title={title} />
</Layout>
),
};
}
export default action;
|
reports/js/plugins/jquery.js | NathanAhlstrom/CORAL | /*! jQuery [email protected] jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bX(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bV.length;while(e--){b=bV[e]+c;if(b in a)return b}return d}function bY(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function bZ(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bY(c)&&(e[f]=p._data(c,"olddisplay",cb(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b$(a,b,c){var d=bO.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function b_(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bU[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bU[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bU[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bU[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bU[e]+"Width"))||0));return f}function ca(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bP.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+b_(a,b,c||(f?"border":"content"),e)+"px"}function cb(a){if(bR[a])return bR[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cz(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cu;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cz(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cz(a,c,d,e,"*",g)),h}function cA(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cB(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cC(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cK(){try{return new a.XMLHttpRequest}catch(b){}}function cL(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cT(){return setTimeout(function(){cM=b},0),cM=p.now()}function cU(a,b){p.each(b,function(b,c){var d=(cS[b]||[]).concat(cS["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cV(a,b,c){var d,e=0,f=0,g=cR.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cM||cT(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cM||cT(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cW(k,j.opts.specialEasing);for(;e<g;e++){d=cR[e].call(j,a,k,j.opts);if(d)return d}return cU(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cW(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(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 cX(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bY(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cb(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cO.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cY(a,b,c,d,e){return new cY.prototype.init(a,b,c,d,e)}function cZ(a,b){var c,d={height:a},e=0;for(;e<4;e+=2-b)c=bU[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function c_(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=r.test(" ")?/^[\s\xA0]+|[\s\xA0]+$/g:/^\s+|\s+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":a.toString().replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||f.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete"||e.readyState!=="loading"&&e.addEventListener)setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){p.isFunction(c)&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,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%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")===0&&(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)(d=p._data(g[h],a+"queueHooks"))&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,k,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=[].slice.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click")){g=p(this),g.context=this;for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){i={},k=[],g[0]=f;for(d=0;d<q;d++)l=o[d],m=l.selector,i[m]===b&&(i[m]=g.is(m)),i[m]&&k.push(l);k.length&&u.push({elem:f,matches:k})}}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){j=u[d],c.currentTarget=j.elem;for(e=0;e<j.matches.length&&!c.isImmediatePropagationStopped();e++){l=j.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,h=((p.event.special[l.origType]||{}).handle||l.handler).apply(j.elem,r),h!==b&&(c.result=h,h===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},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(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{ready:{setup:p.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.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]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.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){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)Z(a,b[e],c,d)}function be(a,b,c,d,e,f){var g,h=$.setFilters[b.toLowerCase()];return h||Z.error(b),(a||!(g=e))&&bd(a||"*",d,g=[],e),g.length>0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;a<c;a++)arguments[a]===b&&(g[a]=b)};for(;p<q;p++){s.exec(""),a=f[p],j=[],i=0,k=e;while(g=s.exec(a)){n=s.lastIndex=g.index+g[0].length;if(n>i){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="<a name='"+q+"'></a><div name='"+q+"'></div>",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},odd:function(a,b,c){var d=[],e=c?0:1,f=a.length;for(;e<f;e=e+2)d.push(a[e]);return d},lt:function(a,b,c){return c?a.slice(+b):a.slice(0,+b)},gt:function(a,b,c){return c?a.slice(0,+b+1):a.slice(+b+1)},eq:function(a,b,c){var d=a.splice(+b,1);return c?a:d}}};$.setFilters.nth=$.setFilters.eq,$.filters=$.pseudos,X||($.attrHandle={href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}}),V&&($.order.push("NAME"),$.find.NAME=function(a,b){if(typeof b.getElementsByName!==j)return b.getElementsByName(a)}),Y&&($.order.splice(1,0,"CLASS"),$.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!==j&&!c)return b.getElementsByClassName(a)});try{n.call(i.childNodes,0)[0].nodeType}catch(_){n=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}var ba=Z.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},bb=Z.contains=i.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc=Z.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=bc(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=bc(b);return c};Z.attr=function(a,b){var c,d=ba(a);return d||(b=b.toLowerCase()),$.attrHandle[b]?$.attrHandle[b](a):U||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},Z.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},[0,0].sort(function(){return l=0}),i.compareDocumentPosition?e=function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:(e=function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return f(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)g.unshift(j),j=j.parentNode;c=e.length,d=g.length;for(var l=0;l<c&&l<d;l++)if(e[l]!==g[l])return f(e[l],g[l]);return l===c?f(a,g[l],-1):f(e[l],b,1)},f=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),Z.uniqueSort=function(a){var b,c=1;if(e){k=l,a.sort(e);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1)}return a};var bl=Z.compile=function(a,b,c){var d,e,f,g=O[a];if(g&&g.context===b)return g;e=bg(a,b,c);for(f=0;d=e[f];f++)e[f]=bj(d,b,c);return g=O[a]=bk(e),g.context=b,g.runs=g.dirruns=0,P.push(a),P.length>$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j<k;j++){p=$.order[j];if(s=L[p].exec(m)){h=$.find[p]((s[1]||"").replace(K,""),q,g);if(h==null)continue;m===r&&(a=a.slice(0,a.length-r.length)+m.replace(L[p],""),a||o.apply(e,n.call(h,0)));break}}}if(a){i=bl(a,b,g),d=i.dirruns++,h==null&&(h=$.find.TAG("*",G.test(a)&&b.parentNode||b));for(j=0;l=h[j];j++)c=i.runs++,i(l,b)&&e.push(l)}return e};h.querySelectorAll&&function(){var a,b=bm,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[],f=[":active"],g=i.matchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector||i.msMatchesSelector;T(function(a){a.innerHTML="<select><option selected></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={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,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.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=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cS[c]=cS[c]||[],cS[c].unshift(b)},prefilter:function(a,b){b?cR.unshift(a):cR.push(a)}}),p.Tween=cY,cY.prototype={constructor:cY,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||(p.cssNumber[c]?"":"px")},cur:function(){var a=cY.propHooks[this.prop];return a&&a.get?a.get(this):cY.propHooks._default.get(this)},run:function(a){var b,c=cY.propHooks[this.prop];return this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration),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):cY.propHooks._default.set(this),this}},cY.prototype.init.prototype=cY.prototype,cY.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cY.propHooks.scrollTop=cY.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(cZ(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bY).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cV(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cQ.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:cZ("show"),slideUp:cZ("hide"),slideToggle:cZ("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cY.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cN&&(cN=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cN),cN=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c$=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j,k,l,m=this[0],n=m&&m.ownerDocument;if(!n)return;return(e=n.body)===m?p.offset.bodyOffset(m):(d=n.documentElement,p.contains(d,m)?(c=m.getBoundingClientRect(),f=c_(n),g=d.clientTop||e.clientTop||0,h=d.clientLeft||e.clientLeft||0,i=f.pageYOffset||d.scrollTop,j=f.pageXOffset||d.scrollLeft,k=c.top+i-g,l=c.left+j-h,{top:k,left:l}):{top:0,left:0})},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); |
src/organisms/cards/SimplePolicyCard/Premium.js | policygenius/athenaeum | import React from 'react';
import PropTypes from 'prop-types';
import accounting from 'accounting';
import Text from 'atoms/Text';
import styles from './policy_card.module.scss';
export const Premium = ({ premium }) => {
const formattedPremium = accounting.formatMoney(premium.price);
return (
<div className={styles['premium']}>
{
premium.price ? (
<Text
size={4}
font='a'
className={styles['premium-text']}
>
{formattedPremium}
{' '}
<Text tag='span' size={11} font='a' spaced color='neutral-2'>{`/${premium.format.toUpperCase()}`}</Text>
</Text>
)
:
<Text size={7} font='a'>{premium.defaultText}</Text>
}
{premium.tooltip}
</div>
);
};
Premium.propTypes = {
premium: PropTypes.object
};
export default Premium;
|
src/svg-icons/maps/satellite.js | spiermar/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let MapsSatellite = (props) => (
<SvgIcon {...props}>
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.99h3C8 6.65 6.66 8 5 8V4.99zM5 12v-2c2.76 0 5-2.25 5-5.01h2C12 8.86 8.87 12 5 12zm0 6l3.5-4.5 2.5 3.01L14.5 12l4.5 6H5z"/>
</SvgIcon>
);
MapsSatellite = pure(MapsSatellite);
MapsSatellite.displayName = 'MapsSatellite';
MapsSatellite.muiName = 'SvgIcon';
export default MapsSatellite;
|
ajax/libs/react-intl/1.2.2/react-intl-with-locales.min.js | stefanneculai/cdnjs | (function(){"use strict";function a(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(b=0,c=f.length;c>b;b+=1)if(d=f[b])for(e in d)o.call(d,e)&&(a[e]=d[e]);return a}function b(a,b,c){this.locales=a,this.formats=b,this.pluralFn=c}function c(a){this.id=a}function d(a,b,c,d,e){this.id=a,this.useOrdinal=b,this.offset=c,this.options=d,this.pluralFn=e}function e(a,b,c,d){this.id=a,this.offset=b,this.numberFormat=c,this.string=d}function f(a,b){this.id=a,this.options=b}function g(a,b,c){var d="string"==typeof a?g.__parse(a):a;if(!d||"messageFormatPattern"!==d.type)throw new TypeError("A message must be provided as a String or AST.");c=this._mergeFormats(g.formats,c),q(this,"_locale",{value:this._resolveLocale(b)});var e=this._findPluralRuleFunction(this._locale),f=this._compilePattern(d,b,c,e),h=this;this.format=function(a){return h._format(f,a)}}function h(a){return 400*a/146097}function i(a,b){b=b||{},F(a)&&(a=a.concat()),C(this,"_locale",{value:this._resolveLocale(a)}),C(this,"_options",{value:{style:this._resolveStyle(b.style),units:this._isValidUnits(b.units)&&b.units}}),C(this,"_locales",{value:a}),C(this,"_fields",{value:this._findFields(this._locale)}),C(this,"_messages",{value:D(null)});var c=this;this.format=function(a,b){return c._format(a,b)}}function j(a){var b=S(null);return function(){var c=Array.prototype.slice.call(arguments),d=k(c),e=d&&b[d];return e||(e=new(O.apply(a,[null].concat(c))),d&&(b[d]=e)),e}}function k(a){if("undefined"!=typeof JSON){var b,c,d,e=[];for(b=0,c=a.length;c>b;b+=1)d=a[b],e.push(d&&"object"==typeof d?l(d):d);return JSON.stringify(e)}}function l(a){var b,c,d,e,f=[],g=[];for(b in a)a.hasOwnProperty(b)&&g.push(b);var h=g.sort();for(c=0,d=h.length;d>c;c+=1)b=h[c],e={},e[b]=a[b],f[c]=e;return f}function m(a,b){if(!isFinite(a))throw new TypeError(b)}function n(a){w.__addLocaleData(a),L.__addLocaleData(a)}var o=Object.prototype.hasOwnProperty,p=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),q=(!p&&!Object.prototype.__defineGetter__,p?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!o.call(a,b)||"value"in c)&&(a[b]=c.value)}),r=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)o.call(b,e)&&q(d,e,b[e]);return d},s=b;b.prototype.compile=function(a){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(a)},b.prototype.compileMessage=function(a){if(!a||"messageFormatPattern"!==a.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var b,c,d,e=a.elements,f=[];for(b=0,c=e.length;c>b;b+=1)switch(d=e[b],d.type){case"messageTextElement":f.push(this.compileMessageText(d));break;case"argumentElement":f.push(this.compileArgument(d));break;default:throw new Error("Message element does not have a valid type")}return f},b.prototype.compileMessageText=function(a){return this.currentPlural&&/(^|[^\\])#/g.test(a.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new e(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,a.value)):a.value.replace(/\\#/g,"#")},b.prototype.compileArgument=function(a){var b=a.format;if(!b)return new c(a.id);var e,g=this.formats,h=this.locales,i=this.pluralFn;switch(b.type){case"numberFormat":return e=g.number[b.style],{id:a.id,format:new Intl.NumberFormat(h,e).format};case"dateFormat":return e=g.date[b.style],{id:a.id,format:new Intl.DateTimeFormat(h,e).format};case"timeFormat":return e=g.time[b.style],{id:a.id,format:new Intl.DateTimeFormat(h,e).format};case"pluralFormat":return e=this.compileOptions(a),new d(a.id,b.ordinal,b.offset,e,i);case"selectFormat":return e=this.compileOptions(a),new f(a.id,e);default:throw new Error("Message element does not have a valid format type")}},b.prototype.compileOptions=function(a){var b=a.format,c=b.options,d={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===b.type?a:null;var e,f,g;for(e=0,f=c.length;f>e;e+=1)g=c[e],d[g.selector]=this.compileMessage(g.value);return this.currentPlural=this.pluralStack.pop(),d},c.prototype.format=function(a){return a?"string"==typeof a?a:String(a):""},d.prototype.getOption=function(a){var b=this.options,c=b["="+a]||b[this.pluralFn(a-this.offset,this.useOrdinal)];return c||b.other},e.prototype.format=function(a){var b=this.numberFormat.format(a-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+b).replace(/\\#/g,"#")},f.prototype.getOption=function(a){var b=this.options;return b[a]||b.other};var t=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Ua!==b&&(Ua>b&&(Ua=0,Va={line:1,column:1,seenCR:!1}),c(Va,Ua,b),Ua=b),Va}function d(a){Wa>Sa||(Sa>Wa&&(Wa=Sa,Xa=[]),Xa.push(a))}function e(d,e,f){function g(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function h(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var d,e,f,g=new Array(a.length);for(f=0;f<a.length;f++)g[f]=a[f].description;return d=a.length>1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=c(f),j=f<a.length?a.charAt(f):null;return null!==e&&g(e),new b(null!==d?d:h(e,j),e,j,f,i.line,i.column)}function f(){var a;return a=g()}function g(){var a,b,c;for(a=Sa,b=[],c=h();c!==E;)b.push(c),c=h();return b!==E&&(Ta=a,b=H(b)),a=b}function h(){var a;return a=j(),a===E&&(a=l()),a}function i(){var b,c,d,e,f,g;if(b=Sa,c=[],d=Sa,e=w(),e!==E?(f=B(),f!==E?(g=w(),g!==E?(e=[e,f,g],d=e):(Sa=d,d=I)):(Sa=d,d=I)):(Sa=d,d=I),d!==E)for(;d!==E;)c.push(d),d=Sa,e=w(),e!==E?(f=B(),f!==E?(g=w(),g!==E?(e=[e,f,g],d=e):(Sa=d,d=I)):(Sa=d,d=I)):(Sa=d,d=I);else c=I;return c!==E&&(Ta=b,c=J(c)),b=c,b===E&&(b=Sa,c=v(),c!==E&&(c=a.substring(b,Sa)),b=c),b}function j(){var a,b;return a=Sa,b=i(),b!==E&&(Ta=a,b=K(b)),a=b}function k(){var b,c,e;if(b=z(),b===E){if(b=Sa,c=[],L.test(a.charAt(Sa))?(e=a.charAt(Sa),Sa++):(e=E,0===Ya&&d(M)),e!==E)for(;e!==E;)c.push(e),L.test(a.charAt(Sa))?(e=a.charAt(Sa),Sa++):(e=E,0===Ya&&d(M));else c=I;c!==E&&(c=a.substring(b,Sa)),b=c}return b}function l(){var b,c,e,f,g,h,i,j,l;return b=Sa,123===a.charCodeAt(Sa)?(c=N,Sa++):(c=E,0===Ya&&d(O)),c!==E?(e=w(),e!==E?(f=k(),f!==E?(g=w(),g!==E?(h=Sa,44===a.charCodeAt(Sa)?(i=Q,Sa++):(i=E,0===Ya&&d(R)),i!==E?(j=w(),j!==E?(l=m(),l!==E?(i=[i,j,l],h=i):(Sa=h,h=I)):(Sa=h,h=I)):(Sa=h,h=I),h===E&&(h=P),h!==E?(i=w(),i!==E?(125===a.charCodeAt(Sa)?(j=S,Sa++):(j=E,0===Ya&&d(T)),j!==E?(Ta=b,c=U(f,h),b=c):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I),b}function m(){var a;return a=n(),a===E&&(a=o(),a===E&&(a=p(),a===E&&(a=q()))),a}function n(){var b,c,e,f,g,h,i;return b=Sa,a.substr(Sa,6)===V?(c=V,Sa+=6):(c=E,0===Ya&&d(W)),c===E&&(a.substr(Sa,4)===X?(c=X,Sa+=4):(c=E,0===Ya&&d(Y)),c===E&&(a.substr(Sa,4)===Z?(c=Z,Sa+=4):(c=E,0===Ya&&d($)))),c!==E?(e=w(),e!==E?(f=Sa,44===a.charCodeAt(Sa)?(g=Q,Sa++):(g=E,0===Ya&&d(R)),g!==E?(h=w(),h!==E?(i=B(),i!==E?(g=[g,h,i],f=g):(Sa=f,f=I)):(Sa=f,f=I)):(Sa=f,f=I),f===E&&(f=P),f!==E?(Ta=b,c=_(c,f),b=c):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I),b}function o(){var b,c,e,f,g,h;return b=Sa,a.substr(Sa,6)===aa?(c=aa,Sa+=6):(c=E,0===Ya&&d(ba)),c!==E?(e=w(),e!==E?(44===a.charCodeAt(Sa)?(f=Q,Sa++):(f=E,0===Ya&&d(R)),f!==E?(g=w(),g!==E?(h=u(),h!==E?(Ta=b,c=ca(h),b=c):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I),b}function p(){var b,c,e,f,g,h;return b=Sa,a.substr(Sa,13)===da?(c=da,Sa+=13):(c=E,0===Ya&&d(ea)),c!==E?(e=w(),e!==E?(44===a.charCodeAt(Sa)?(f=Q,Sa++):(f=E,0===Ya&&d(R)),f!==E?(g=w(),g!==E?(h=u(),h!==E?(Ta=b,c=fa(h),b=c):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I),b}function q(){var b,c,e,f,g,h,i;if(b=Sa,a.substr(Sa,6)===ga?(c=ga,Sa+=6):(c=E,0===Ya&&d(ha)),c!==E)if(e=w(),e!==E)if(44===a.charCodeAt(Sa)?(f=Q,Sa++):(f=E,0===Ya&&d(R)),f!==E)if(g=w(),g!==E){if(h=[],i=s(),i!==E)for(;i!==E;)h.push(i),i=s();else h=I;h!==E?(Ta=b,c=ia(h),b=c):(Sa=b,b=I)}else Sa=b,b=I;else Sa=b,b=I;else Sa=b,b=I;else Sa=b,b=I;return b}function r(){var b,c,e,f;return b=Sa,c=Sa,61===a.charCodeAt(Sa)?(e=ja,Sa++):(e=E,0===Ya&&d(ka)),e!==E?(f=z(),f!==E?(e=[e,f],c=e):(Sa=c,c=I)):(Sa=c,c=I),c!==E&&(c=a.substring(b,Sa)),b=c,b===E&&(b=B()),b}function s(){var b,c,e,f,h,i,j,k,l;return b=Sa,c=w(),c!==E?(e=r(),e!==E?(f=w(),f!==E?(123===a.charCodeAt(Sa)?(h=N,Sa++):(h=E,0===Ya&&d(O)),h!==E?(i=w(),i!==E?(j=g(),j!==E?(k=w(),k!==E?(125===a.charCodeAt(Sa)?(l=S,Sa++):(l=E,0===Ya&&d(T)),l!==E?(Ta=b,c=la(e,j),b=c):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I),b}function t(){var b,c,e,f;return b=Sa,a.substr(Sa,7)===ma?(c=ma,Sa+=7):(c=E,0===Ya&&d(na)),c!==E?(e=w(),e!==E?(f=z(),f!==E?(Ta=b,c=oa(f),b=c):(Sa=b,b=I)):(Sa=b,b=I)):(Sa=b,b=I),b}function u(){var a,b,c,d,e;if(a=Sa,b=t(),b===E&&(b=P),b!==E)if(c=w(),c!==E){if(d=[],e=s(),e!==E)for(;e!==E;)d.push(e),e=s();else d=I;d!==E?(Ta=a,b=pa(b,d),a=b):(Sa=a,a=I)}else Sa=a,a=I;else Sa=a,a=I;return a}function v(){var b,c;if(Ya++,b=[],ra.test(a.charAt(Sa))?(c=a.charAt(Sa),Sa++):(c=E,0===Ya&&d(sa)),c!==E)for(;c!==E;)b.push(c),ra.test(a.charAt(Sa))?(c=a.charAt(Sa),Sa++):(c=E,0===Ya&&d(sa));else b=I;return Ya--,b===E&&(c=E,0===Ya&&d(qa)),b}function w(){var b,c,e;for(Ya++,b=Sa,c=[],e=v();e!==E;)c.push(e),e=v();return c!==E&&(c=a.substring(b,Sa)),b=c,Ya--,b===E&&(c=E,0===Ya&&d(ta)),b}function x(){var b;return ua.test(a.charAt(Sa))?(b=a.charAt(Sa),Sa++):(b=E,0===Ya&&d(va)),b}function y(){var b;return wa.test(a.charAt(Sa))?(b=a.charAt(Sa),Sa++):(b=E,0===Ya&&d(xa)),b}function z(){var b,c,e,f,g,h;if(b=Sa,48===a.charCodeAt(Sa)?(c=ya,Sa++):(c=E,0===Ya&&d(za)),c===E){if(c=Sa,e=Sa,Aa.test(a.charAt(Sa))?(f=a.charAt(Sa),Sa++):(f=E,0===Ya&&d(Ba)),f!==E){for(g=[],h=x();h!==E;)g.push(h),h=x();g!==E?(f=[f,g],e=f):(Sa=e,e=I)}else Sa=e,e=I;e!==E&&(e=a.substring(c,Sa)),c=e}return c!==E&&(Ta=b,c=Ca(c)),b=c}function A(){var b,c,e,f,g,h,i,j;return Da.test(a.charAt(Sa))?(b=a.charAt(Sa),Sa++):(b=E,0===Ya&&d(Ea)),b===E&&(b=Sa,a.substr(Sa,2)===Fa?(c=Fa,Sa+=2):(c=E,0===Ya&&d(Ga)),c!==E&&(Ta=b,c=Ha()),b=c,b===E&&(b=Sa,a.substr(Sa,2)===Ia?(c=Ia,Sa+=2):(c=E,0===Ya&&d(Ja)),c!==E&&(Ta=b,c=Ka()),b=c,b===E&&(b=Sa,a.substr(Sa,2)===La?(c=La,Sa+=2):(c=E,0===Ya&&d(Ma)),c!==E&&(Ta=b,c=Na()),b=c,b===E&&(b=Sa,a.substr(Sa,2)===Oa?(c=Oa,Sa+=2):(c=E,0===Ya&&d(Pa)),c!==E?(e=Sa,f=Sa,g=y(),g!==E?(h=y(),h!==E?(i=y(),i!==E?(j=y(),j!==E?(g=[g,h,i,j],f=g):(Sa=f,f=I)):(Sa=f,f=I)):(Sa=f,f=I)):(Sa=f,f=I),f!==E&&(f=a.substring(e,Sa)),e=f,e!==E?(Ta=b,c=Qa(e),b=c):(Sa=b,b=I)):(Sa=b,b=I))))),b}function B(){var a,b,c;if(a=Sa,b=[],c=A(),c!==E)for(;c!==E;)b.push(c),c=A();else b=I;return b!==E&&(Ta=a,b=Ra(b)),a=b}var C,D=arguments.length>1?arguments[1]:{},E={},F={start:f},G=f,H=function(a){return{type:"messageFormatPattern",elements:a}},I=E,J=function(a){var b,c,d,e,f,g="";for(b=0,d=a.length;d>b;b+=1)for(e=a[b],c=0,f=e.length;f>c;c+=1)g+=e[c];return g},K=function(a){return{type:"messageTextElement",value:a}},L=/^[^ \t\n\r,.+={}#]/,M={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},N="{",O={type:"literal",value:"{",description:'"{"'},P=null,Q=",",R={type:"literal",value:",",description:'","'},S="}",T={type:"literal",value:"}",description:'"}"'},U=function(a,b){return{type:"argumentElement",id:a,format:b&&b[2]}},V="number",W={type:"literal",value:"number",description:'"number"'},X="date",Y={type:"literal",value:"date",description:'"date"'},Z="time",$={type:"literal",value:"time",description:'"time"'},_=function(a,b){return{type:a+"Format",style:b&&b[2]}},aa="plural",ba={type:"literal",value:"plural",description:'"plural"'},ca=function(a){return{type:a.type,ordinal:!1,offset:a.offset||0,options:a.options}},da="selectordinal",ea={type:"literal",value:"selectordinal",description:'"selectordinal"'},fa=function(a){return{type:a.type,ordinal:!0,offset:a.offset||0,options:a.options}},ga="select",ha={type:"literal",value:"select",description:'"select"'},ia=function(a){return{type:"selectFormat",options:a}},ja="=",ka={type:"literal",value:"=",description:'"="'},la=function(a,b){return{type:"optionalFormatPattern",selector:a,value:b}},ma="offset:",na={type:"literal",value:"offset:",description:'"offset:"'},oa=function(a){return a},pa=function(a,b){return{type:"pluralFormat",offset:a,options:b}},qa={type:"other",description:"whitespace"},ra=/^[ \t\n\r]/,sa={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},ta={type:"other",description:"optionalWhitespace"},ua=/^[0-9]/,va={type:"class",value:"[0-9]",description:"[0-9]"},wa=/^[0-9a-f]/i,xa={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},ya="0",za={type:"literal",value:"0",description:'"0"'},Aa=/^[1-9]/,Ba={type:"class",value:"[1-9]",description:"[1-9]"},Ca=function(a){return parseInt(a,10)},Da=/^[^{}\\\0-\x1F \t\n\r]/,Ea={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Fa="\\#",Ga={type:"literal",value:"\\#",description:'"\\\\#"'},Ha=function(){return"\\#"},Ia="\\{",Ja={type:"literal",value:"\\{",description:'"\\\\{"'},Ka=function(){return"{"},La="\\}",Ma={type:"literal",value:"\\}",description:'"\\\\}"'},Na=function(){return"}"},Oa="\\u",Pa={type:"literal",value:"\\u",description:'"\\\\u"'},Qa=function(a){return String.fromCharCode(parseInt(a,16))},Ra=function(a){return a.join("")},Sa=0,Ta=0,Ua=0,Va={line:1,column:1,seenCR:!1},Wa=0,Xa=[],Ya=0;if("startRule"in D){if(!(D.startRule in F))throw new Error("Can't start parsing from rule \""+D.startRule+'".');G=F[D.startRule]}if(C=G(),C!==E&&Sa===a.length)return C;throw C!==E&&Sa<a.length&&d({type:"end",description:"end of input"}),e(null,Xa,Wa)}return a(b,Error),{SyntaxError:b,parse:c}}(),u=g;q(g,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{"short":{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},"long":{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{"short":{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},"long":{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),q(g,"__localeData__",{value:r(null)}),q(g,"__addLocaleData",{value:function(a){if(!a||!a.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");g.__localeData__[a.locale.toLowerCase()]=a}}),q(g,"__parse",{value:t.parse}),q(g,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),g.prototype.resolvedOptions=function(){return{locale:this._locale}},g.prototype._compilePattern=function(a,b,c,d){var e=new s(b,c,d);return e.compile(a)},g.prototype._findPluralRuleFunction=function(a){for(var b=g.__localeData__,c=b[a.toLowerCase()];c;){if(c.pluralRuleFunction)return c.pluralRuleFunction;c=c.parentLocale&&b[c.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+a)},g.prototype._format=function(a,b){var c,d,e,f,g,h="";for(c=0,d=a.length;d>c;c+=1)if(e=a[c],"string"!=typeof e){if(f=e.id,!b||!o.call(b,f))throw new Error("A value must be provided for: "+f);g=b[f],h+=e.options?this._format(e.getOption(g),b):e.format(g)}else h+=e;return h},g.prototype._mergeFormats=function(b,c){var d,e,f={};for(d in b)o.call(b,d)&&(f[d]=e=r(b[d]),c&&o.call(c,d)&&a(e,c[d]));return f},g.prototype._resolveLocale=function(a){"string"==typeof a&&(a=[a]),a=(a||[]).concat(g.defaultLocale);var b,c,d,e,f=g.__localeData__;for(b=0,c=a.length;c>b;b+=1)for(d=a[b].toLowerCase().split("-");d.length;){if(e=f[d.join("-")])return e.locale;d.pop()}var h=a.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+a.join(", ")+", or the default locale: "+h)};var v={locale:"en",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-1),g=e&&c[0].slice(-2);return b?1==f&&11!=g?"one":2==f&&12!=g?"two":3==f&&13!=g?"few":"other":1==a&&d?"one":"other"}};u.__addLocaleData(v),u.defaultLocale="en";var w=u,x=Math.round,y=function(a,b){a=+a,b=+b;var c=x(b-a),d=x(c/1e3),e=x(d/60),f=x(e/60),g=x(f/24),i=x(g/7),j=h(g),k=x(12*j),l=x(j);return{millisecond:c,second:d,minute:e,hour:f,day:g,week:i,month:k,year:l}},z=Object.prototype.hasOwnProperty,A=Object.prototype.toString,B=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),C=(!B&&!Object.prototype.__defineGetter__,B?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!z.call(a,b)||"value"in c)&&(a[b]=c.value)}),D=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)z.call(b,e)&&C(d,e,b[e]);return d},E=Array.prototype.indexOf||function(a,b){var c=this;if(!c.length)return-1;for(var d=b||0,e=c.length;e>d;d++)if(c[d]===a)return d;return-1},F=Array.isArray||function(a){return"[object Array]"===A.call(a)},G=Date.now||function(){return(new Date).getTime()},H=i,I=["second","minute","hour","day","month","year"],J=["best fit","numeric"];C(i,"__localeData__",{value:D(null)}),C(i,"__addLocaleData",{value:function(a){if(!a||!a.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");i.__localeData__[a.locale.toLowerCase()]=a,w.__addLocaleData(a)}}),C(i,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),C(i,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),i.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},i.prototype._compileMessage=function(a){var b,c=this._locales,d=(this._locale,this._fields[a]),e=d.relativeTime,f="",g="";for(b in e.future)e.future.hasOwnProperty(b)&&(f+=" "+b+" {"+e.future[b].replace("{0}","#")+"}");for(b in e.past)e.past.hasOwnProperty(b)&&(g+=" "+b+" {"+e.past[b].replace("{0}","#")+"}");var h="{when, select, future {{0, plural, "+f+"}}past {{0, plural, "+g+"}}}";return new w(h,c)},i.prototype._getMessage=function(a){var b=this._messages;return b[a]||(b[a]=this._compileMessage(a)),b[a]},i.prototype._getRelativeUnits=function(a,b){var c=this._fields[b];return c.relative?c.relative[a]:void 0},i.prototype._findFields=function(a){for(var b=i.__localeData__,c=b[a.toLowerCase()];c;){if(c.fields)return c.fields;c=c.parentLocale&&b[c.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlRelativeFormat is missing `fields` for :"+a)},i.prototype._format=function(a,b){var c=b&&void 0!==b.now?b.now:G();if(void 0===a&&(a=c),!isFinite(c))throw new RangeError("The `now` option provided to IntlRelativeFormat#format() is not in valid range.");if(!isFinite(a))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var d=y(c,a),e=this._options.units||this._selectUnits(d),f=d[e];if("numeric"!==this._options.style){var g=this._getRelativeUnits(f,e);if(g)return g}return this._getMessage(e).format({0:Math.abs(f),when:0>f?"past":"future"})},i.prototype._isValidUnits=function(a){if(!a||E.call(I,a)>=0)return!0;if("string"==typeof a){var b=/s$/.test(a)&&a.substr(0,a.length-1);if(b&&E.call(I,b)>=0)throw new Error('"'+a+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+b)}throw new Error('"'+a+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+I.join('", "')+'"')},i.prototype._resolveLocale=function(a){"string"==typeof a&&(a=[a]),a=(a||[]).concat(i.defaultLocale);var b,c,d,e,f=i.__localeData__;for(b=0,c=a.length;c>b;b+=1)for(d=a[b].toLowerCase().split("-");d.length;){if(e=f[d.join("-")])return e.locale;d.pop()}var g=a.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+a.join(", ")+", or the default locale: "+g)},i.prototype._resolveStyle=function(a){if(!a)return J[0];if(E.call(J,a)>=0)return a;throw new Error('"'+a+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+J.join('", "')+'"')},i.prototype._selectUnits=function(a){var b,c,d;for(b=0,c=I.length;c>b&&(d=I[b],!(Math.abs(a[d])<i.thresholds[d]));b+=1);return d};var K={locale:"en",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-1),g=e&&c[0].slice(-2);return b?1==f&&11!=g?"one":2==f&&12!=g?"two":3==f&&13!=g?"few":"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}};H.__addLocaleData(K),H.defaultLocale="en";var L=H,M={locale:"en",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-1),g=e&&c[0].slice(-2);return b?1==f&&11!=g?"one":2==f&&12!=g?"two":3==f&&13!=g?"few":"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}},N=React,O=Function.prototype.bind||function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(d.prototype=this.prototype),e.prototype=new d,e},P=Object.prototype.hasOwnProperty,Q=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),R=(!Q&&!Object.prototype.__defineGetter__,Q?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!P.call(a,b)||"value"in c)&&(a[b]=c.value)}),S=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)P.call(b,e)&&R(d,e,b[e]);return d},T=j,U={locales:N.PropTypes.oneOfType([N.PropTypes.string,N.PropTypes.array]),formats:N.PropTypes.object,messages:N.PropTypes.object},V={statics:{filterFormatOptions:function(a,b){return b||(b={}),(this.formatOptions||[]).reduce(function(c,d){return a.hasOwnProperty(d)?c[d]=a[d]:b.hasOwnProperty(d)&&(c[d]=b[d]),c},{})}},propTypes:U,contextTypes:U,childContextTypes:U,getNumberFormat:T(Intl.NumberFormat),getDateTimeFormat:T(Intl.DateTimeFormat),getMessageFormat:T(w),getRelativeFormat:T(L),getChildContext:function(){var a=this.context,b=this.props;return{locales:b.locales||a.locales,formats:b.formats||a.formats,messages:b.messages||a.messages}},formatDate:function(a,b){return a=new Date(a),m(a,"A date or timestamp must be provided to formatDate()"),this._format("date",a,b)},formatTime:function(a,b){return a=new Date(a),m(a,"A date or timestamp must be provided to formatTime()"),this._format("time",a,b)},formatRelative:function(a,b,c){return a=new Date(a),m(a,"A date or timestamp must be provided to formatRelative()"),this._format("relative",a,b,c)},formatNumber:function(a,b){return this._format("number",a,b)},formatMessage:function(a,b){var c=this.props.locales||this.context.locales,d=this.props.formats||this.context.formats;return"function"==typeof a?a(b):("string"==typeof a&&(a=this.getMessageFormat(a,c,d)),a.format(b))},getIntlMessage:function(a){var b,c=this.props.messages||this.context.messages,d=a.split(".");try{b=d.reduce(function(a,b){return a[b]},c)}finally{if(void 0===b)throw new ReferenceError("Could not find Intl message: "+a)}return b},getNamedFormat:function(a,b){var c=this.props.formats||this.context.formats,d=null;try{d=c[a][b]}finally{if(!d)throw new ReferenceError("No "+a+" format named: "+b)}return d},_format:function(a,b,c,d){var e=this.props.locales||this.context.locales;switch(c&&"string"==typeof c&&(c=this.getNamedFormat(a,c)),a){case"date":case"time":return this.getDateTimeFormat(e,c).format(b);case"number":return this.getNumberFormat(e,c).format(b);case"relative":return this.getRelativeFormat(e,c).format(b,d);default:throw new Error("Unrecognized format type: "+a)}}},W=N.createClass({displayName:"FormattedDate",mixins:[V],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:N.PropTypes.string,value:N.PropTypes.any.isRequired},render:function(){var a=this.props,b=a.value,c=a.format,d=c&&this.getNamedFormat("date",c),e=W.filterFormatOptions(a,d);return N.DOM.span(null,this.formatDate(b,e))}}),X=W,Y=N.createClass({displayName:"FormattedTime",mixins:[V],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},propTypes:{format:N.PropTypes.string,value:N.PropTypes.any.isRequired},render:function(){var a=this.props,b=a.value,c=a.format,d=c&&this.getNamedFormat("time",c),e=Y.filterFormatOptions(a,d);return N.DOM.span(null,this.formatTime(b,e))}}),Z=Y,$=N.createClass({displayName:"FormattedRelative",mixins:[V],statics:{formatOptions:["style","units"]},propTypes:{format:N.PropTypes.string,value:N.PropTypes.any.isRequired,now:N.PropTypes.any},render:function(){var a=this.props,b=a.value,c=a.format,d=c&&this.getNamedFormat("relative",c),e=$.filterFormatOptions(a,d),f=this.formatRelative(b,e,{now:a.now});return N.DOM.span(null,f)}}),_=$,aa=N.createClass({displayName:"FormattedNumber",mixins:[V],statics:{formatOptions:["localeMatcher","style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"]},propTypes:{format:N.PropTypes.string,value:N.PropTypes.any.isRequired},render:function(){var a=this.props,b=a.value,c=a.format,d=c&&this.getNamedFormat("number",c),e=aa.filterFormatOptions(a,d);return N.DOM.span(null,this.formatNumber(b,e))}}),ba=aa,ca=N.createClass({displayName:"FormattedMessage",mixins:[V],propTypes:{tagName:N.PropTypes.string,message:N.PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var a=this.props,b=a.tagName,c=a.message,d=Math.floor(1099511627776*Math.random()).toString(16),e=new RegExp("(@__ELEMENT-"+d+"-\\d+__@)","g"),f={},g=function(){var a=0;return function(){return"@__ELEMENT-"+d+"-"+(a+=1)+"__@"}}(),h=Object.keys(a).reduce(function(b,c){var d,e=a[c];return N.isValidElement(e)?(d=g(),b[c]=d,f[d]=e):b[c]=e,b},{}),i=this.formatMessage(c,h),j=i.split(e).filter(function(a){return!!a}).map(function(a){return f[a]||a}),k=[b,null].concat(j);return N.createElement.apply(null,k)}}),da=ca,ea={"&":"&",">":">","<":"<",'"':""","'":"'"},fa=/[&><"']/g,ga=function(a){return(""+a).replace(fa,function(a){return ea[a]})},ha=N.createClass({displayName:"FormattedHTMLMessage",mixins:[V],propTypes:{tagName:N.PropTypes.string,message:N.PropTypes.string.isRequired},getDefaultProps:function(){return{tagName:"span"}},render:function(){var a=this.props,b=a.tagName,c=a.message,d=Object.keys(a).reduce(function(b,c){var d=a[c];return"string"==typeof d?d=ga(d):N.isValidElement(d)&&(d=N.renderToStaticMarkup(d)),b[c]=d,b},{});return N.DOM[b]({dangerouslySetInnerHTML:{__html:this.formatMessage(c,d)}})}}),ia=ha;n(M);var ja={IntlMixin:V,FormattedDate:X,FormattedTime:Z,FormattedRelative:_,FormattedNumber:ba,FormattedMessage:da,FormattedHTMLMessage:ia,__addLocaleData:n};"undefined"!=typeof window&&(window.ReactIntlMixin=V,V.__addLocaleData=n),this.ReactIntl=ja}).call(this),ReactIntl.__addLocaleData({locale:"aa",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"aa-DJ",parentLocale:"aa"}),ReactIntl.__addLocaleData({locale:"aa-ER",parentLocale:"aa"}),ReactIntl.__addLocaleData({locale:"aa-ET",parentLocale:"aa"}),ReactIntl.__addLocaleData({locale:"af",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Jaar",relative:{0:"hierdie jaar",1:"volgende jaar","-1":"verlede jaar"},relativeTime:{future:{one:"Oor {0} jaar",other:"Oor {0} jaar"},past:{one:"{0} jaar gelede",other:"{0} jaar gelede"}}},month:{displayName:"Maand",relative:{0:"vandeesmaand",1:"volgende maand","-1":"verlede maand"},relativeTime:{future:{one:"Oor {0} maand",other:"Oor {0} maande"},past:{one:"{0} maand gelede",other:"{0} maande gelede"}}},day:{displayName:"Dag",relative:{0:"vandag",1:"môre",2:"oormôre","-1":"gister","-2":"eergister"},relativeTime:{future:{one:"Oor {0} dag",other:"Oor {0} dae"},past:{one:"{0} dag gelede",other:"{0} dae gelede"}}},hour:{displayName:"Uur",relativeTime:{future:{one:"Oor {0} uur",other:"Oor {0} uur"},past:{one:"{0} uur gelede",other:"{0} uur gelede"}}},minute:{displayName:"Minuut",
relativeTime:{future:{one:"Oor {0} minuut",other:"Oor {0} minute"},past:{one:"{0} minuut gelede",other:"{0} minute gelede"}}},second:{displayName:"Sekonde",relative:{0:"nou"},relativeTime:{future:{one:"Oor {0} sekonde",other:"Oor {0} sekondes"},past:{one:"{0} sekonde gelede",other:"{0} sekondes gelede"}}}}}),ReactIntl.__addLocaleData({locale:"af-NA",parentLocale:"af"}),ReactIntl.__addLocaleData({locale:"af-ZA",parentLocale:"af"}),ReactIntl.__addLocaleData({locale:"agq",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"kɨnûm",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ndzɔŋ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"utsuʔ",relative:{0:"nɛ",1:"tsʉtsʉ","-1":"ā zūɛɛ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"tàm",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"menè",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"sɛkɔ̀n",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"agq-CM",parentLocale:"agq"}),ReactIntl.__addLocaleData({locale:"ak",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Afe",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Bosome",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Da",relative:{0:"Ndɛ",1:"Ɔkyena","-1":"Ndeda"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Dɔnhwer",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Sema",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sɛkɛnd",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ak-GH",parentLocale:"ak"}),ReactIntl.__addLocaleData({locale:"am",pluralRuleFunction:function(a,b){return b?"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"ዓመት",relative:{0:"በዚህ ዓመት",1:"የሚቀጥለው ዓመት","-1":"ያለፈው ዓመት"},relativeTime:{future:{one:"በ{0} ዓመታት ውስጥ",other:"በ{0} ዓመታት ውስጥ"},past:{one:"ከ{0} ዓመት በፊት",other:"ከ{0} ዓመታት በፊት"}}},month:{displayName:"ወር",relative:{0:"በዚህ ወር",1:"የሚቀጥለው ወር","-1":"ያለፈው ወር"},relativeTime:{future:{one:"በ{0} ወር ውስጥ",other:"በ{0} ወራት ውስጥ"},past:{one:"ከ{0} ወር በፊት",other:"ከ{0} ወራት በፊት"}}},day:{displayName:"ቀን",relative:{0:"ዛሬ",1:"ነገ",2:"ከነገ ወዲያ","-1":"ትናንት","-2":"ከትናንት ወዲያ"},relativeTime:{future:{one:"በ{0} ቀን ውስጥ",other:"በ{0} ቀናት ውስጥ"},past:{one:"ከ{0} ቀን በፊት",other:"ከ{0} ቀናት በፊት"}}},hour:{displayName:"ሰዓት",relativeTime:{future:{one:"በ{0} ሰዓት ውስጥ",other:"በ{0} ሰዓቶች ውስጥ"},past:{one:"ከ{0} ሰዓት በፊት",other:"ከ{0} ሰዓቶች በፊት"}}},minute:{displayName:"ደቂቃ",relativeTime:{future:{one:"በ{0} ደቂቃ ውስጥ",other:"በ{0} ደቂቃዎች ውስጥ"},past:{one:"ከ{0} ደቂቃ በፊት",other:"ከ{0} ደቂቃዎች በፊት"}}},second:{displayName:"ሰከንድ",relative:{0:"አሁን"},relativeTime:{future:{one:"በ{0} ሰከንድ ውስጥ",other:"በ{0} ሰከንዶች ውስጥ"},past:{one:"ከ{0} ሰከንድ በፊት",other:"ከ{0} ሰከንዶች በፊት"}}}}}),ReactIntl.__addLocaleData({locale:"am-ET",parentLocale:"am"}),ReactIntl.__addLocaleData({locale:"ar",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a,e=d&&c[0].slice(-2);return b?"other":0==a?"zero":1==a?"one":2==a?"two":e>=3&&10>=e?"few":e>=11&&99>=e?"many":"other"},fields:{year:{displayName:"السنة",relative:{0:"السنة الحالية",1:"السنة التالية","-1":"السنة الماضية"},relativeTime:{future:{zero:"خلال {0} من السنوات",one:"خلال {0} من السنوات",two:"خلال سنتين",few:"خلال {0} سنوات",many:"خلال {0} سنة",other:"خلال {0} من السنوات"},past:{zero:"قبل {0} من السنوات",one:"قبل {0} من السنوات",two:"قبل سنتين",few:"قبل {0} سنوات",many:"قبل {0} سنة",other:"قبل {0} من السنوات"}}},month:{displayName:"الشهر",relative:{0:"هذا الشهر",1:"الشهر التالي","-1":"الشهر الماضي"},relativeTime:{future:{zero:"خلال {0} من الشهور",one:"خلال {0} من الشهور",two:"خلال شهرين",few:"خلال {0} شهور",many:"خلال {0} شهرًا",other:"خلال {0} من الشهور"},past:{zero:"قبل {0} من الشهور",one:"قبل {0} من الشهور",two:"قبل شهرين",few:"قبل {0} أشهر",many:"قبل {0} شهرًا",other:"قبل {0} من الشهور"}}},day:{displayName:"يوم",relative:{0:"اليوم",1:"غدًا",2:"بعد الغد","-1":"أمس","-2":"أول أمس"},relativeTime:{future:{zero:"خلال {0} من الأيام",one:"خلال {0} من الأيام",two:"خلال يومين",few:"خلال {0} أيام",many:"خلال {0} يومًا",other:"خلال {0} من الأيام"},past:{zero:"قبل {0} من الأيام",one:"قبل {0} من الأيام",two:"قبل يومين",few:"قبل {0} أيام",many:"قبل {0} يومًا",other:"قبل {0} من الأيام"}}},hour:{displayName:"الساعات",relativeTime:{future:{zero:"خلال {0} من الساعات",one:"خلال {0} من الساعات",two:"خلال ساعتين",few:"خلال {0} ساعات",many:"خلال {0} ساعة",other:"خلال {0} من الساعات"},past:{zero:"قبل {0} من الساعات",one:"قبل {0} من الساعات",two:"قبل ساعتين",few:"قبل {0} ساعات",many:"قبل {0} ساعة",other:"قبل {0} من الساعات"}}},minute:{displayName:"الدقائق",relativeTime:{future:{zero:"خلال {0} من الدقائق",one:"خلال {0} من الدقائق",two:"خلال دقيقتين",few:"خلال {0} دقائق",many:"خلال {0} دقيقة",other:"خلال {0} من الدقائق"},past:{zero:"قبل {0} من الدقائق",one:"قبل {0} من الدقائق",two:"قبل دقيقتين",few:"قبل {0} دقائق",many:"قبل {0} دقيقة",other:"قبل {0} من الدقائق"}}},second:{displayName:"الثواني",relative:{0:"الآن"},relativeTime:{future:{zero:"خلال {0} من الثواني",one:"خلال {0} من الثواني",two:"خلال ثانيتين",few:"خلال {0} ثوانِ",many:"خلال {0} ثانية",other:"خلال {0} من الثواني"},past:{zero:"قبل {0} من الثواني",one:"قبل {0} من الثواني",two:"قبل ثانيتين",few:"قبل {0} ثوانِ",many:"قبل {0} ثانية",other:"قبل {0} من الثواني"}}}}}),ReactIntl.__addLocaleData({locale:"ar-001",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-AE",parentLocale:"ar",fields:{year:{displayName:"السنة",relative:{0:"هذه السنة",1:"السنة التالية","-1":"السنة الماضية"},relativeTime:{future:{zero:"خلال {0} من السنوات",one:"خلال {0} من السنوات",two:"خلال سنتين",few:"خلال {0} سنوات",many:"خلال {0} سنة",other:"خلال {0} من السنوات"},past:{zero:"قبل {0} من السنوات",one:"قبل {0} من السنوات",two:"قبل سنتين",few:"قبل {0} سنوات",many:"قبل {0} سنة",other:"قبل {0} من السنوات"}}},month:{displayName:"الشهر",relative:{0:"هذا الشهر",1:"الشهر التالي","-1":"الشهر الماضي"},relativeTime:{future:{zero:"خلال {0} من الشهور",one:"خلال {0} من الشهور",two:"خلال شهرين",few:"خلال {0} شهور",many:"خلال {0} شهرًا",other:"خلال {0} من الشهور"},past:{zero:"قبل {0} من الشهور",one:"قبل {0} من الشهور",two:"قبل شهرين",few:"قبل {0} أشهر",many:"قبل {0} شهرًا",other:"قبل {0} من الشهور"}}},day:{displayName:"يوم",relative:{0:"اليوم",1:"غدًا",2:"بعد الغد","-1":"أمس","-2":"أول أمس"},relativeTime:{future:{zero:"خلال {0} من الأيام",one:"خلال {0} من الأيام",two:"خلال يومين",few:"خلال {0} أيام",many:"خلال {0} يومًا",other:"خلال {0} من الأيام"},past:{zero:"قبل {0} من الأيام",one:"قبل {0} من الأيام",two:"قبل يومين",few:"قبل {0} أيام",many:"قبل {0} يومًا",other:"قبل {0} من الأيام"}}},hour:{displayName:"الساعات",relativeTime:{future:{zero:"خلال {0} من الساعات",one:"خلال {0} من الساعات",two:"خلال ساعتين",few:"خلال {0} ساعات",many:"خلال {0} ساعة",other:"خلال {0} من الساعات"},past:{zero:"قبل {0} من الساعات",one:"قبل {0} من الساعات",two:"قبل ساعتين",few:"قبل {0} ساعات",many:"قبل {0} ساعة",other:"قبل {0} من الساعات"}}},minute:{displayName:"الدقائق",relativeTime:{future:{zero:"خلال {0} من الدقائق",one:"خلال {0} من الدقائق",two:"خلال دقيقتين",few:"خلال {0} دقائق",many:"خلال {0} دقيقة",other:"خلال {0} من الدقائق"},past:{zero:"قبل {0} من الدقائق",one:"قبل {0} من الدقائق",two:"قبل دقيقتين",few:"قبل {0} دقائق",many:"قبل {0} دقيقة",other:"قبل {0} من الدقائق"}}},second:{displayName:"الثواني",relative:{0:"الآن"},relativeTime:{future:{zero:"خلال {0} من الثواني",one:"خلال {0} من الثواني",two:"خلال ثانيتين",few:"خلال {0} ثوانِ",many:"خلال {0} ثانية",other:"خلال {0} من الثواني"},past:{zero:"قبل {0} من الثواني",one:"قبل {0} من الثواني",two:"قبل ثانيتين",few:"قبل {0} ثوانِ",many:"قبل {0} ثانية",other:"قبل {0} من الثواني"}}}}}),ReactIntl.__addLocaleData({locale:"ar-BH",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-DJ",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-DZ",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-EG",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-EH",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-ER",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-IL",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-IQ",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-JO",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-KM",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-KW",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-LB",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-LY",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-MA",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-MR",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-OM",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-PS",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-QA",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-SA",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-SD",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-SO",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-SS",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-SY",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-TD",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-TN",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"ar-YE",parentLocale:"ar"}),ReactIntl.__addLocaleData({locale:"as",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"বছৰ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"মাহ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"দিন",relative:{0:"today",1:"কাইলৈ",2:"পৰহিলৈ","-1":"কালি","-2":"পৰহি"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ঘণ্টা",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"মিনিট",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ছেকেণ্ড",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"as-IN",parentLocale:"as"}),ReactIntl.__addLocaleData({locale:"asa",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweji",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Thiku",relative:{0:"Iyoo",1:"Yavo","-1":"Ighuo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Thaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Thekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"asa-TZ",parentLocale:"asa"}),ReactIntl.__addLocaleData({locale:"ast",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"añu",relative:{0:"esti añu",1:"l’añu viniente","-1":"l’añu pasáu"},relativeTime:{future:{one:"En {0} añu",other:"En {0} años"},past:{one:"Hai {0} añu",other:"Hai {0} años"}}},month:{displayName:"mes",relative:{0:"esti mes",1:"el mes viniente","-1":"el mes pasáu"},relativeTime:{future:{one:"En {0} mes",other:"En {0} meses"},past:{one:"Hai {0} mes",other:"Hai {0} meses"}}},day:{displayName:"día",relative:{0:"güei",1:"mañana",2:"pasao mañana","-1":"ayeri","-2":"antayeri"},relativeTime:{future:{one:"En {0} dia",other:"En {0} díes"},past:{one:"Hai {0} dia",other:"Hai {0} díes"}}},hour:{displayName:"hora",relativeTime:{future:{one:"En {0} hora",other:"En {0} hores"},past:{one:"Hai {0} hora",other:"Hai {0} hores"}}},minute:{displayName:"minutu",relativeTime:{future:{one:"En {0} minutu",other:"En {0} minutos"},past:{one:"Hai {0} minutu",other:"Hai {0} minutos"}}},second:{displayName:"segundu",relative:{0:"now"},relativeTime:{future:{one:"En {0} segundu",other:"En {0} segundos"},past:{one:"Hai {0} segundu",other:"Hai {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"ast-ES",parentLocale:"ast"}),ReactIntl.__addLocaleData({locale:"az",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=d.slice(-1),f=d.slice(-2),g=d.slice(-3);return b?1==e||2==e||5==e||7==e||8==e||20==f||50==f||70==f||80==f?"one":3==e||4==e||100==g||200==g||300==g||400==g||500==g||600==g||700==g||800==g||900==g?"few":0==d||6==e||40==f||60==f||90==f?"many":"other":1==a?"one":"other"},fields:{year:{displayName:"İl",relative:{0:"bu il",1:"gələn il","-1":"keçən il"},relativeTime:{future:{one:"{0} il ərzində",other:"{0} il ərzində"},past:{one:"{0} il öncə",other:"{0} il öncə"}}},month:{displayName:"Ay",relative:{0:"bu ay",1:"gələn ay","-1":"keçən ay"},relativeTime:{future:{one:"{0} ay ərzində",other:"{0} ay ərzində"},past:{one:"{0} ay öncə",other:"{0} ay öncə"}}},day:{displayName:"Gün",relative:{0:"bu gün",1:"sabah","-1":"dünən"},relativeTime:{future:{one:"{0} gün ərzində",other:"{0} gün ərzində"},past:{one:"{0} gün öncə",other:"{0} gün öncə"}}},hour:{displayName:"Saat",relativeTime:{future:{one:"{0} saat ərzində",other:"{0} saat ərzində"},past:{one:"{0} saat öncə",other:"{0} saat öncə"}}},minute:{displayName:"Dəqiqə",relativeTime:{future:{one:"{0} dəqiqə ərzində",other:"{0} dəqiqə ərzində"},past:{one:"{0} dəqiqə öncə",other:"{0} dəqiqə öncə"}}},second:{displayName:"Saniyə",relative:{0:"indi"},relativeTime:{future:{one:"{0} saniyə ərzində",other:"{0} saniyə ərzində"},past:{one:"{0} saniyə öncə",other:"{0} saniyə öncə"}}}}}),ReactIntl.__addLocaleData({locale:"az-Cyrl",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"az-Cyrl-AZ",parentLocale:"az-Cyrl"}),ReactIntl.__addLocaleData({locale:"az-Latn",parentLocale:"az"}),ReactIntl.__addLocaleData({locale:"az-Latn-AZ",parentLocale:"az-Latn"}),ReactIntl.__addLocaleData({locale:"bas",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ŋwìi",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"soŋ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"kɛl",relative:{0:"lɛ̀n",1:"yàni","-1":"yààni"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ŋgɛŋ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ŋget",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"hìŋgeŋget",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bas-CM",parentLocale:"bas"}),ReactIntl.__addLocaleData({locale:"be",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a,e=d&&c[0].slice(-1),f=d&&c[0].slice(-2);return b?"other":1==e&&11!=f?"one":e>=2&&4>=e&&(12>f||f>14)?"few":d&&0==e||e>=5&&9>=e||f>=11&&14>=f?"many":"other"},fields:{year:{displayName:"год",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"месяц",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"дзень",relative:{0:"сёння",1:"заўтра",2:"паслязаўтра","-1":"учора","-2":"пазаўчора"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"гадзіна",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"хвіліна",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"секунда",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"be-BY",parentLocale:"be"}),ReactIntl.__addLocaleData({locale:"bem",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Umwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Umweshi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ubushiku",relative:{0:"Lelo",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Insa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Mineti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bem-ZM",parentLocale:"bem"}),ReactIntl.__addLocaleData({locale:"bez",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Mwaha",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwedzi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Sihu",relative:{0:"Neng’u ni",1:"Hilawu","-1":"Igolo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bez-TZ",parentLocale:"bez"}),ReactIntl.__addLocaleData({locale:"bg",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"година",relative:{0:"тази година",1:"следващата година","-1":"миналата година"},relativeTime:{future:{one:"след {0} година",other:"след {0} години"},past:{one:"преди {0} година",other:"преди {0} години"}}},month:{displayName:"месец",relative:{0:"този месец",1:"следващият месец","-1":"миналият месец"},relativeTime:{future:{one:"след {0} месец",other:"след {0} месеца"},past:{one:"преди {0} месец",other:"преди {0} месеца"}}},day:{displayName:"ден",relative:{0:"днес",1:"утре",2:"вдругиден","-1":"вчера","-2":"онзи ден"},relativeTime:{future:{one:"след {0} ден",other:"след {0} дни"},past:{one:"преди {0} ден",other:"преди {0} дни"}}},hour:{displayName:"час",relativeTime:{future:{one:"след {0} час",other:"след {0} часа"},past:{one:"преди {0} час",other:"преди {0} часа"}}},minute:{displayName:"минута",relativeTime:{future:{one:"след {0} минута",other:"след {0} минути"},past:{one:"преди {0} минута",other:"преди {0} минути"}}},second:{displayName:"секунда",relative:{0:"сега"},relativeTime:{future:{one:"след {0} секунда",other:"след {0} секунди"},past:{one:"преди {0} секунда",other:"преди {0} секунди"}}}}}),ReactIntl.__addLocaleData({locale:"bg-BG",parentLocale:"bg"}),ReactIntl.__addLocaleData({locale:"bh",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bm",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"san",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"kalo",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"don",relative:{0:"bi",1:"sini","-1":"kunu"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"lɛrɛ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bm-Latn",parentLocale:"bm"}),ReactIntl.__addLocaleData({locale:"bm-Latn-ML",parentLocale:"bm-Latn"}),ReactIntl.__addLocaleData({locale:"bm-Nkoo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bn",pluralRuleFunction:function(a,b){return b?1==a||5==a||7==a||8==a||9==a||10==a?"one":2==a||3==a?"two":4==a?"few":6==a?"many":"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"বছর",relative:{0:"এই বছর",1:"পরের বছর","-1":"গত বছর"},relativeTime:{future:{one:"{0} বছরে",other:"{0} বছরে"},past:{one:"{0} বছর পূর্বে",other:"{0} বছর পূর্বে"}}},month:{displayName:"মাস",relative:{0:"এই মাস",1:"পরের মাস","-1":"গত মাস"},relativeTime:{future:{one:"{0} মাসে",other:"{0} মাসে"},past:{one:"{0} মাস পূর্বে",other:"{0} মাস পূর্বে"}}},day:{displayName:"দিন",relative:{0:"আজ",1:"আগামীকাল",2:"আগামী পরশু","-1":"গতকাল","-2":"গত পরশু"},relativeTime:{future:{one:"{0} দিনের মধ্যে",other:"{0} দিনের মধ্যে"},past:{one:"{0} দিন পূর্বে",other:"{0} দিন পূর্বে"}}},hour:{displayName:"ঘন্টা",relativeTime:{future:{one:"{0} ঘন্টায়",other:"{0} ঘন্টায়"},past:{one:"{0} ঘন্টা আগে",other:"{0} ঘন্টা আগে"}}},minute:{displayName:"মিনিট",relativeTime:{future:{one:"{0} মিনিটে",other:"{0} মিনিটে"},past:{one:"{0} মিনিট পূর্বে",other:"{0} মিনিট পূর্বে"}}},second:{displayName:"সেকেন্ড",relative:{0:"এখন"},relativeTime:{future:{one:"{0} সেকেন্ডে",other:"{0} সেকেন্ডে"},past:{one:"{0} সেকেন্ড পূর্বে",other:"{0} সেকেন্ড পূর্বে"}}}}}),ReactIntl.__addLocaleData({locale:"bn-BD",parentLocale:"bn"}),ReactIntl.__addLocaleData({locale:"bn-IN",parentLocale:"bn"}),ReactIntl.__addLocaleData({locale:"bo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ལོ།",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ཟླ་བ་",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ཉིན།",relative:{0:"དེ་རིང་",1:"སང་ཉིན་",2:"གནངས་ཉིན་ཀ་","-1":"ཁས་ས་","-2":"ཁས་ཉིན་ཀ་"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ཆུ་ཙོ་",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"སྐར་མ།",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"སྐར་ཆ།",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"bo-CN",parentLocale:"bo"}),ReactIntl.__addLocaleData({locale:"bo-IN",parentLocale:"bo"}),ReactIntl.__addLocaleData({locale:"br",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a,e=d&&c[0].slice(-1),f=d&&c[0].slice(-2),g=d&&c[0].slice(-6);return b?"other":1==e&&11!=f&&71!=f&&91!=f?"one":2==e&&12!=f&&72!=f&&92!=f?"two":(3==e||4==e||9==e)&&(10>f||f>19)&&(70>f||f>79)&&(90>f||f>99)?"few":0!=a&&d&&0==g?"many":"other"},fields:{year:{displayName:"bloaz",relative:{0:"this year",1:"next year","-1":"warlene"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"miz",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"deiz",relative:{0:"hiziv",1:"warcʼhoazh","-1":"decʼh","-2":"dercʼhent-decʼh"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"eur",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"munut",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"eilenn",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"br-FR",parentLocale:"br"}),ReactIntl.__addLocaleData({locale:"brx",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"बोसोर",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"दान",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"सान",relative:{0:"दिनै",1:"गाबोन","-1":"मैया"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"रिंगा",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"मिनिथ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"सेखेन्द",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"brx-IN",parentLocale:"brx"}),ReactIntl.__addLocaleData({locale:"bs",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=d.slice(-2),i=e.slice(-1),j=e.slice(-2);return b?"other":f&&1==g&&11!=h||1==i&&11!=j?"one":f&&g>=2&&4>=g&&(12>h||h>14)||i>=2&&4>=i&&(12>j||j>14)?"few":"other"},fields:{year:{displayName:"godina",relative:{0:"ove godine",1:"sljedeće godine","-1":"prošle godine"},relativeTime:{future:{one:"za {0} godinu",few:"za {0} godine",other:"za {0} godina"},past:{one:"prije {0} godinu",few:"prije {0} godine",other:"prije {0} godina"}}},month:{displayName:"mjesec",relative:{0:"ovaj mjesec",1:"sljedeći mjesec","-1":"prošli mjesec"},relativeTime:{future:{one:"za {0} mjesec",few:"za {0} mjeseca",other:"za {0} mjeseci"},past:{one:"prije {0} mjesec",few:"prije {0} mjeseca",other:"prije {0} mjeseci"}}},day:{displayName:"dan",relative:{0:"danas",1:"sutra",2:"prekosutra","-1":"juče","-2":"prekjuče"},relativeTime:{future:{one:"za {0} dan",few:"za {0} dana",other:"za {0} dana"},past:{one:"prije {0} dan",few:"prije {0} dana",other:"prije {0} dana"}}},hour:{displayName:"sat",relativeTime:{future:{one:"za {0} sat",few:"za {0} sata",other:"za {0} sati"},past:{one:"prije {0} sat",few:"prije {0} sata",other:"prije {0} sati"}}},minute:{displayName:"minut",relativeTime:{future:{one:"za {0} minutu",few:"za {0} minute",other:"za {0} minuta"},past:{one:"prije {0} minutu",few:"prije {0} minute",other:"prije {0} minuta"}}},second:{displayName:"sekund",relative:{0:"sada"},relativeTime:{future:{one:"za {0} sekundu",few:"za {0} sekunde",other:"za {0} sekundi"},past:{one:"prije {0} sekundu",few:"prije {0} sekunde",other:"prije {0} sekundi"}}}}}),ReactIntl.__addLocaleData({locale:"bs-Cyrl",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"година",relative:{0:"Ове године",1:"Следеће године","-1":"Прошле године"},relativeTime:{future:{one:"за {0} годину",few:"за {0} године",other:"за {0} година"},past:{one:"пре {0} годину",few:"пре {0} године",other:"пре {0} година"}}},month:{displayName:"месец",relative:{0:"Овог месеца",1:"Следећег месеца","-1":"Прошлог месеца"},relativeTime:{future:{one:"за {0} месец",few:"за {0} месеца",other:"за {0} месеци"},past:{one:"пре {0} месец",few:"пре {0} месеца",other:"пре {0} месеци"}}},day:{displayName:"дан",relative:{0:"данас",1:"сутра",2:"прекосутра","-1":"јуче","-2":"прекјуче"},relativeTime:{future:{one:"за {0} дан",few:"за {0} дана",other:"за {0} дана"},past:{one:"пре {0} дан",few:"пре {0} дана",other:"пре {0} дана"}}},hour:{displayName:"час",relativeTime:{future:{one:"за {0} сат",few:"за {0} сата",other:"за {0} сати"},past:{one:"пре {0} сат",few:"пре {0} сата",other:"пре {0} сати"}}},minute:{displayName:"минут",relativeTime:{future:{one:"за {0} минут",few:"за {0} минута",other:"за {0} минута"},past:{one:"пре {0} минут",few:"пре {0} минута",other:"пре {0} минута"}}},second:{displayName:"секунд",relative:{0:"now"},relativeTime:{future:{one:"за {0} секунд",few:"за {0} секунде",other:"за {0} секунди"},past:{one:"пре {0} секунд",few:"пре {0} секунде",other:"пре {0} секунди"}}}}}),ReactIntl.__addLocaleData({locale:"bs-Cyrl-BA",parentLocale:"bs-Cyrl"}),ReactIntl.__addLocaleData({locale:"bs-Latn",parentLocale:"bs"}),ReactIntl.__addLocaleData({locale:"bs-Latn-BA",parentLocale:"bs-Latn"}),ReactIntl.__addLocaleData({locale:"ca",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?1==a||3==a?"one":2==a?"two":4==a?"few":"other":1==a&&d?"one":"other"},fields:{year:{displayName:"any",relative:{0:"enguany",1:"l’any que ve","-1":"l’any passat"},relativeTime:{future:{one:"d’aquí a {0} any",other:"d’aquí a {0} anys"},past:{one:"fa {0} any",other:"fa {0} anys"}}},month:{displayName:"mes",relative:{0:"aquest mes",1:"el mes que ve","-1":"el mes passat"},relativeTime:{future:{one:"d’aquí a {0} mes",other:"d’aquí a {0} mesos"},past:{one:"fa {0} mes",other:"fa {0} mesos"}}},day:{displayName:"dia",relative:{0:"avui",1:"demà",2:"demà passat","-1":"ahir","-2":"abans-d’ahir"},relativeTime:{future:{one:"d’aquí a {0} dia",other:"d’aquí a {0} dies"},past:{one:"fa {0} dia",other:"fa {0} dies"}}},hour:{displayName:"hora",relativeTime:{future:{one:"d’aquí a {0} hora",other:"d’aquí {0} hores"},past:{one:"fa {0} hora",other:"fa {0} hores"}}},minute:{displayName:"minut",relativeTime:{future:{one:"d’aquí a {0} minut",other:"d’aquí a {0} minuts"},past:{one:"fa {0} minut",other:"fa {0} minuts"}}},second:{displayName:"segon",relative:{0:"ara"},relativeTime:{future:{one:"d’aquí a {0} segon",other:"d’aquí a {0} segons"
},past:{one:"fa {0} segon",other:"fa {0} segons"}}}}}),ReactIntl.__addLocaleData({locale:"ca-AD",parentLocale:"ca"}),ReactIntl.__addLocaleData({locale:"ca-ES",parentLocale:"ca"}),ReactIntl.__addLocaleData({locale:"ca-ES-VALENCIA",parentLocale:"ca-ES"}),ReactIntl.__addLocaleData({locale:"ca-FR",parentLocale:"ca"}),ReactIntl.__addLocaleData({locale:"ca-IT",parentLocale:"ca"}),ReactIntl.__addLocaleData({locale:"cgg",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Omwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Eizooba",relative:{0:"Erizooba",1:"Nyenkyakare","-1":"Nyomwabazyo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Shaaha",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Edakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Obucweka/Esekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"cgg-UG",parentLocale:"cgg"}),ReactIntl.__addLocaleData({locale:"chr",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ᏑᏕᏘᏴᏓ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ᏏᏅᏓ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ᏏᎦ",relative:{0:"ᎪᎯ ᎢᎦ",1:"ᏌᎾᎴᎢ","-1":"ᏒᎯ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ᏑᏣᎶᏓ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ᎢᏯᏔᏬᏍᏔᏅ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ᎠᏎᏢ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"chr-US",parentLocale:"chr"}),ReactIntl.__addLocaleData({locale:"ckb",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"cs",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1];return b?"other":1==a&&e?"one":d>=2&&4>=d&&e?"few":e?"other":"many"},fields:{year:{displayName:"Rok",relative:{0:"tento rok",1:"příští rok","-1":"minulý rok"},relativeTime:{future:{one:"za {0} rok",few:"za {0} roky",many:"za {0} roku",other:"za {0} let"},past:{one:"před {0} rokem",few:"před {0} lety",many:"před {0} rokem",other:"před {0} lety"}}},month:{displayName:"Měsíc",relative:{0:"tento měsíc",1:"příští měsíc","-1":"minulý měsíc"},relativeTime:{future:{one:"za {0} měsíc",few:"za {0} měsíce",many:"za {0} měsíce",other:"za {0} měsíců"},past:{one:"před {0} měsícem",few:"před {0} měsíci",many:"před {0} měsícem",other:"před {0} měsíci"}}},day:{displayName:"Den",relative:{0:"dnes",1:"zítra",2:"pozítří","-1":"včera","-2":"předevčírem"},relativeTime:{future:{one:"za {0} den",few:"za {0} dny",many:"za {0} dne",other:"za {0} dní"},past:{one:"před {0} dnem",few:"před {0} dny",many:"před {0} dnem",other:"před {0} dny"}}},hour:{displayName:"Hodina",relativeTime:{future:{one:"za {0} hodinu",few:"za {0} hodiny",many:"za {0} hodiny",other:"za {0} hodin"},past:{one:"před {0} hodinou",few:"před {0} hodinami",many:"před {0} hodinou",other:"před {0} hodinami"}}},minute:{displayName:"Minuta",relativeTime:{future:{one:"za {0} minutu",few:"za {0} minuty",many:"za {0} minuty",other:"za {0} minut"},past:{one:"před {0} minutou",few:"před {0} minutami",many:"před {0} minutou",other:"před {0} minutami"}}},second:{displayName:"Sekunda",relative:{0:"nyní"},relativeTime:{future:{one:"za {0} sekundu",few:"za {0} sekundy",many:"za {0} sekundy",other:"za {0} sekund"},past:{one:"před {0} sekundou",few:"před {0} sekundami",many:"před {0} sekundou",other:"před {0} sekundami"}}}}}),ReactIntl.__addLocaleData({locale:"cs-CZ",parentLocale:"cs"}),ReactIntl.__addLocaleData({locale:"cy",pluralRuleFunction:function(a,b){return b?0==a||7==a||8==a||9==a?"zero":1==a?"one":2==a?"two":3==a||4==a?"few":5==a||6==a?"many":"other":0==a?"zero":1==a?"one":2==a?"two":3==a?"few":6==a?"many":"other"},fields:{year:{displayName:"Blwyddyn",relative:{0:"eleni",1:"blwyddyn nesaf","-1":"llynedd"},relativeTime:{future:{zero:"Ymhen {0} mlynedd",one:"Ymhen blwyddyn",two:"Ymhen {0} flynedd",few:"Ymhen {0} blynedd",many:"Ymhen {0} blynedd",other:"Ymhen {0} mlynedd"},past:{zero:"{0} o flynyddoedd yn ôl",one:"blwyddyn yn ôl",two:"{0} flynedd yn ôl",few:"{0} blynedd yn ôl",many:"{0} blynedd yn ôl",other:"{0} o flynyddoedd yn ôl"}}},month:{displayName:"Mis",relative:{0:"y mis hwn",1:"mis nesaf","-1":"mis diwethaf"},relativeTime:{future:{zero:"Ymhen {0} mis",one:"Ymhen mis",two:"Ymhen deufis",few:"Ymhen {0} mis",many:"Ymhen {0} mis",other:"Ymhen {0} mis"},past:{zero:"{0} mis yn ôl",one:"{0} mis yn ôl",two:"{0} fis yn ôl",few:"{0} mis yn ôl",many:"{0} mis yn ôl",other:"{0} mis yn ôl"}}},day:{displayName:"Dydd",relative:{0:"heddiw",1:"yfory",2:"drennydd","-1":"ddoe","-2":"echdoe"},relativeTime:{future:{zero:"Ymhen {0} diwrnod",one:"Ymhen diwrnod",two:"Ymhen deuddydd",few:"Ymhen tridiau",many:"Ymhen {0} diwrnod",other:"Ymhen {0} diwrnod"},past:{zero:"{0} diwrnod yn ôl",one:"{0} diwrnod yn ôl",two:"{0} ddiwrnod yn ôl",few:"{0} diwrnod yn ôl",many:"{0} diwrnod yn ôl",other:"{0} diwrnod yn ôl"}}},hour:{displayName:"Awr",relativeTime:{future:{zero:"Ymhen {0} awr",one:"Ymhen {0} awr",two:"Ymhen {0} awr",few:"Ymhen {0} awr",many:"Ymhen {0} awr",other:"Ymhen {0} awr"},past:{zero:"{0} awr yn ôl",one:"awr yn ôl",two:"{0} awr yn ôl",few:"{0} awr yn ôl",many:"{0} awr yn ôl",other:"{0} awr yn ôl"}}},minute:{displayName:"Munud",relativeTime:{future:{zero:"Ymhen {0} munud",one:"Ymhen munud",two:"Ymhen {0} funud",few:"Ymhen {0} munud",many:"Ymhen {0} munud",other:"Ymhen {0} munud"},past:{zero:"{0} munud yn ôl",one:"{0} munud yn ôl",two:"{0} funud yn ôl",few:"{0} munud yn ôl",many:"{0} munud yn ôl",other:"{0} munud yn ôl"}}},second:{displayName:"Eiliad",relative:{0:"nawr"},relativeTime:{future:{zero:"Ymhen {0} eiliad",one:"Ymhen eiliad",two:"Ymhen {0} eiliad",few:"Ymhen {0} eiliad",many:"Ymhen {0} eiliad",other:"Ymhen {0} eiliad"},past:{zero:"{0} eiliad yn ôl",one:"eiliad yn ôl",two:"{0} eiliad yn ôl",few:"{0} eiliad yn ôl",many:"{0} eiliad yn ôl",other:"{0} eiliad yn ôl"}}}}}),ReactIntl.__addLocaleData({locale:"cy-GB",parentLocale:"cy"}),ReactIntl.__addLocaleData({locale:"da",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=Number(c[0])==a;return b?"other":1!=a&&(e||0!=d&&1!=d)?"other":"one"},fields:{year:{displayName:"År",relative:{0:"i år",1:"næste år","-1":"sidste år"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"for {0} år siden",other:"for {0} år siden"}}},month:{displayName:"Måned",relative:{0:"denne måned",1:"næste måned","-1":"sidste måned"},relativeTime:{future:{one:"om {0} måned",other:"om {0} måneder"},past:{one:"for {0} måned siden",other:"for {0} måneder siden"}}},day:{displayName:"Dag",relative:{0:"i dag",1:"i morgen",2:"i overmorgen","-1":"i går","-2":"i forgårs"},relativeTime:{future:{one:"om {0} dag",other:"om {0} dage"},past:{one:"for {0} dag siden",other:"for {0} dage siden"}}},hour:{displayName:"Time",relativeTime:{future:{one:"om {0} time",other:"om {0} timer"},past:{one:"for {0} time siden",other:"for {0} timer siden"}}},minute:{displayName:"Minut",relativeTime:{future:{one:"om {0} minut",other:"om {0} minutter"},past:{one:"for {0} minut siden",other:"for {0} minutter siden"}}},second:{displayName:"Sekund",relative:{0:"nu"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"for {0} sekund siden",other:"for {0} sekunder siden"}}}}}),ReactIntl.__addLocaleData({locale:"da-DK",parentLocale:"da"}),ReactIntl.__addLocaleData({locale:"da-GL",parentLocale:"da"}),ReactIntl.__addLocaleData({locale:"dav",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ituku",relative:{0:"Idime",1:"Kesho","-1":"Iguo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"dav-KE",parentLocale:"dav"}),ReactIntl.__addLocaleData({locale:"de",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Jahr",relative:{0:"dieses Jahr",1:"nächstes Jahr","-1":"letztes Jahr"},relativeTime:{future:{one:"in {0} Jahr",other:"in {0} Jahren"},past:{one:"vor {0} Jahr",other:"vor {0} Jahren"}}},month:{displayName:"Monat",relative:{0:"diesen Monat",1:"nächsten Monat","-1":"letzten Monat"},relativeTime:{future:{one:"in {0} Monat",other:"in {0} Monaten"},past:{one:"vor {0} Monat",other:"vor {0} Monaten"}}},day:{displayName:"Tag",relative:{0:"heute",1:"morgen",2:"übermorgen","-1":"gestern","-2":"vorgestern"},relativeTime:{future:{one:"in {0} Tag",other:"in {0} Tagen"},past:{one:"vor {0} Tag",other:"vor {0} Tagen"}}},hour:{displayName:"Stunde",relativeTime:{future:{one:"in {0} Stunde",other:"in {0} Stunden"},past:{one:"vor {0} Stunde",other:"vor {0} Stunden"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} Minute",other:"in {0} Minuten"},past:{one:"vor {0} Minute",other:"vor {0} Minuten"}}},second:{displayName:"Sekunde",relative:{0:"jetzt"},relativeTime:{future:{one:"in {0} Sekunde",other:"in {0} Sekunden"},past:{one:"vor {0} Sekunde",other:"vor {0} Sekunden"}}}}}),ReactIntl.__addLocaleData({locale:"de-AT",parentLocale:"de"}),ReactIntl.__addLocaleData({locale:"de-BE",parentLocale:"de"}),ReactIntl.__addLocaleData({locale:"de-CH",parentLocale:"de"}),ReactIntl.__addLocaleData({locale:"de-DE",parentLocale:"de"}),ReactIntl.__addLocaleData({locale:"de-LI",parentLocale:"de"}),ReactIntl.__addLocaleData({locale:"de-LU",parentLocale:"de"}),ReactIntl.__addLocaleData({locale:"dje",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Jiiri",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Handu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Zaari",relative:{0:"Hõo",1:"Suba","-1":"Bi"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Guuru",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Miti",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"dje-NE",parentLocale:"dje"}),ReactIntl.__addLocaleData({locale:"dsb",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-2),h=e.slice(-2);return b?"other":f&&1==g||1==h?"one":f&&2==g||2==h?"two":f&&(3==g||4==g)||3==h||4==h?"few":"other"},fields:{year:{displayName:"lěto",relative:{0:"lětosa",1:"znowa","-1":"łoni"},relativeTime:{future:{one:"za {0} lěto",two:"za {0} lěśe",few:"za {0} lěta",other:"za {0} lět"},past:{one:"pśed {0} lětom",two:"pśed {0} lětoma",few:"pśed {0} lětami",other:"pśed {0} lětami"}}},month:{displayName:"mjasec",relative:{0:"ten mjasec",1:"pśiducy mjasec","-1":"slědny mjasec"},relativeTime:{future:{one:"za {0} mjasec",two:"za {0} mjaseca",few:"za {0} mjasecy",other:"za {0} mjasecow"},past:{one:"pśed {0} mjasecom",two:"pśed {0} mjasecoma",few:"pśed {0} mjasecami",other:"pśed {0} mjasecami"}}},day:{displayName:"źeń",relative:{0:"źinsa",1:"witśe","-1":"cora"},relativeTime:{future:{one:"za {0} źeń",two:"za {0} dnja",few:"za {0} dny",other:"za {0} dnjow"},past:{one:"pśed {0} dnjom",two:"pśed {0} dnjoma",few:"pśed {0} dnjami",other:"pśed {0} dnjami"}}},hour:{displayName:"góźina",relativeTime:{future:{one:"za {0} góźinu",two:"za {0} góźinje",few:"za {0} góźiny",other:"za {0} góźin"},past:{one:"pśed {0} góźinu",two:"pśed {0} góźinoma",few:"pśed {0} góźinami",other:"pśed {0} góźinami"}}},minute:{displayName:"minuta",relativeTime:{future:{one:"za {0} minutu",two:"za {0} minuśe",few:"za {0} minuty",other:"za {0} minutow"},past:{one:"pśed {0} minutu",two:"pśed {0} minutoma",few:"pśed {0} minutami",other:"pśed {0} minutami"}}},second:{displayName:"sekunda",relative:{0:"now"},relativeTime:{future:{one:"za {0} sekundu",two:"za {0} sekunźe",few:"za {0} sekundy",other:"za {0} sekundow"},past:{one:"pśed {0} sekundu",two:"pśed {0} sekundoma",few:"pśed {0} sekundami",other:"pśed {0} sekundami"}}}}}),ReactIntl.__addLocaleData({locale:"dsb-DE",parentLocale:"dsb"}),ReactIntl.__addLocaleData({locale:"dua",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"mbú",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"mɔ́di",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"búnyá",relative:{0:"wɛ́ŋgɛ̄",1:"kíɛlɛ","-1":"kíɛlɛ nítómb́í"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ŋgandɛ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ndɔkɔ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"píndí",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"dua-CM",parentLocale:"dua"}),ReactIntl.__addLocaleData({locale:"dv",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"dyo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Emit",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Fuleeŋ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Funak",relative:{0:"Jaat",1:"Kajom","-1":"Fucen"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"dyo-SN",parentLocale:"dyo"}),ReactIntl.__addLocaleData({locale:"dz",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ལོ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"ལོ་འཁོར་ {0} ནང་"},past:{other:"ལོ་འཁོར་ {0} ཧེ་མ་"}}},month:{displayName:"ཟླ་ཝ་",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"ཟླཝ་ {0} ནང་"},past:{other:"ཟླཝ་ {0} ཧེ་མ་"}}},day:{displayName:"ཚེས་",relative:{0:"ད་རིས་",1:"ནངས་པ་",2:"གནངས་ཚེ","-1":"ཁ་ཙ་","-2":"ཁ་ཉིམ"},relativeTime:{future:{other:"ཉིནམ་ {0} ནང་"},past:{other:"ཉིནམ་ {0} ཧེ་མ་"}}},hour:{displayName:"ཆུ་ཚོད",relativeTime:{future:{other:"ཆུ་ཚོད་ {0} ནང་"},past:{other:"ཆུ་ཚོད་ {0} ཧེ་མ་"}}},minute:{displayName:"སྐར་མ",relativeTime:{future:{other:"སྐར་མ་ {0} ནང་"},past:{other:"སྐར་མ་ {0} ཧེ་མ་"}}},second:{displayName:"སྐར་ཆཱ་",relative:{0:"now"},relativeTime:{future:{other:"སྐར་ཆ་ {0} ནང་"},past:{other:"སྐར་ཆ་ {0} ཧེ་མ་"}}}}}),ReactIntl.__addLocaleData({locale:"dz-BT",parentLocale:"dz"}),ReactIntl.__addLocaleData({locale:"ebu",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mũthenya",relative:{0:"Ũmũnthĩ",1:"Rũciũ","-1":"Ĩgoro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ithaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ndagĩka",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ebu-KE",parentLocale:"ebu"}),ReactIntl.__addLocaleData({locale:"ee",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ƒe",relative:{0:"ƒe sia",1:"ƒe si gbɔ na","-1":"ƒe si va yi"},relativeTime:{future:{one:"le ƒe {0} me",other:"le ƒe {0} wo me"},past:{one:"ƒe {0} si va yi",other:"ƒe {0} si wo va yi"}}},month:{displayName:"ɣleti",relative:{0:"ɣleti sia",1:"ɣleti si gbɔ na","-1":"ɣleti si va yi"},relativeTime:{future:{one:"le ɣleti {0} me",other:"le ɣleti {0} wo me"},past:{one:"ɣleti {0} si va yi",other:"ɣleti {0} si wo va yi"}}},day:{displayName:"ŋkeke",relative:{0:"egbe",1:"etsɔ si gbɔna",2:"nyitsɔ si gbɔna","-1":"etsɔ si va yi","-2":"nyitsɔ si va yi"},relativeTime:{future:{one:"le ŋkeke {0} me",other:"le ŋkeke {0} wo me"},past:{one:"ŋkeke {0} si va yi",other:"ŋkeke {0} si wo va yi"}}},hour:{displayName:"gaƒoƒo",relativeTime:{future:{one:"le gaƒoƒo {0} me",other:"le gaƒoƒo {0} wo me"},past:{one:"gaƒoƒo {0} si va yi",other:"gaƒoƒo {0} si wo va yi"}}},minute:{displayName:"aɖabaƒoƒo",relativeTime:{future:{one:"le aɖabaƒoƒo {0} me",other:"le aɖabaƒoƒo {0} wo me"},past:{one:"aɖabaƒoƒo {0} si va yi",other:"aɖabaƒoƒo {0} si wo va yi"}}},second:{displayName:"sekend",relative:{0:"fifi"},relativeTime:{future:{one:"le sekend {0} me",other:"le sekend {0} wo me"},past:{one:"sekend {0} si va yi",other:"sekend {0} si wo va yi"}}}}}),ReactIntl.__addLocaleData({locale:"ee-GH",parentLocale:"ee"}),ReactIntl.__addLocaleData({locale:"ee-TG",parentLocale:"ee"}),ReactIntl.__addLocaleData({locale:"el",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Έτος",relative:{0:"φέτος",1:"επόμενο έτος","-1":"προηγούμενο έτος"},relativeTime:{future:{one:"σε {0} έτος",other:"σε {0} έτη"},past:{one:"πριν από {0} έτος",other:"πριν από {0} έτη"}}},month:{displayName:"Μήνας",relative:{0:"τρέχων μήνας",1:"επόμενος μήνας","-1":"προηγούμενος μήνας"},relativeTime:{future:{one:"σε {0} μήνα",other:"σε {0} μήνες"},past:{one:"πριν από {0} μήνα",other:"πριν από {0} μήνες"}}},day:{displayName:"Ημέρα",relative:{0:"σήμερα",1:"αύριο",2:"μεθαύριο","-1":"χθες","-2":"προχθές"},relativeTime:{future:{one:"σε {0} ημέρα",other:"σε {0} ημέρες"},past:{one:"πριν από {0} ημέρα",other:"πριν από {0} ημέρες"}}},hour:{displayName:"Ώρα",relativeTime:{future:{one:"σε {0} ώρα",other:"σε {0} ώρες"},past:{one:"πριν από {0} ώρα",other:"πριν από {0} ώρες"}}},minute:{displayName:"Λεπτό",relativeTime:{future:{one:"σε {0} λεπτό",other:"σε {0} λεπτά"},past:{one:"πριν από {0} λεπτό",other:"πριν από {0} λεπτά"}}},second:{displayName:"Δευτερόλεπτο",relative:{0:"τώρα"},relativeTime:{future:{one:"σε {0} δευτερόλεπτο",other:"σε {0} δευτερόλεπτα"},past:{one:"πριν από {0} δευτερόλεπτο",other:"πριν από {0} δευτερόλεπτα"}}}}}),ReactIntl.__addLocaleData({locale:"el-CY",parentLocale:"el"}),ReactIntl.__addLocaleData({locale:"el-GR",parentLocale:"el"}),ReactIntl.__addLocaleData({locale:"en",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-1),g=e&&c[0].slice(-2);return b?1==f&&11!=g?"one":2==f&&12!=g?"two":3==f&&13!=g?"few":"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}}),ReactIntl.__addLocaleData({locale:"en-001",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-150",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-GB",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-AG",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-AI",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-AS",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-AU",parentLocale:"en-GB",fields:{year:{displayName:"Year",relative:{0:"This year",1:"Next year","-1":"Last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"Month",relative:{0:"This month",1:"Next month","-1":"Last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}}),ReactIntl.__addLocaleData({locale:"en-BB",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-BE",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-BM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-BS",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-BW",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-BZ",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-CA",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-CC",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-CK",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-CM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-CX",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-DG",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-DM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-Dsrt",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"en-ER",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-FJ",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-FK",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-FM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-GD",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-GG",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-GH",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-GI",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-GM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-GU",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-GY",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-HK",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-IE",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-IM",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-IN",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-IO",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-JE",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-JM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-KE",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-KI",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-KN",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-KY",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-LC",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-LR",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-LS",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-MG",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-MH",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-MO",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-MP",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-MS",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-MT",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-MU",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-MW",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-MY",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-NA",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-NF",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-NG",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-NR",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-NU",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-NZ",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-PG",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-PH",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-PK",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-PN",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-PR",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-PW",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-RW",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SB",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SC",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SD",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SG",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-SH",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-SL",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SS",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SX",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-SZ",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-TC",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-TK",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-TO",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-TT",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-TV",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-TZ",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-UG",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-UM",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-US",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-US-POSIX",parentLocale:"en-US"}),ReactIntl.__addLocaleData({locale:"en-VC",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-VG",parentLocale:"en-GB"}),ReactIntl.__addLocaleData({locale:"en-VI",parentLocale:"en"}),ReactIntl.__addLocaleData({locale:"en-VU",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-WS",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-ZA",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-ZM",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"en-ZW",parentLocale:"en-001"}),ReactIntl.__addLocaleData({locale:"eo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"jaro",relative:{0:"nuna jaro",1:"venonta jaro","-1":"pasinta jaro"},relativeTime:{future:{one:"post {0} jaro",other:"post {0} jaroj"},past:{one:"antaŭ {0} jaro",other:"antaŭ {0} jaroj"}}},month:{displayName:"monato",relative:{0:"nuna monato",1:"venonta monato","-1":"pasinta monato"},relativeTime:{future:{one:"post {0} monato",other:"post {0} monatoj"},past:{one:"antaŭ {0} monato",other:"antaŭ {0} monatoj"}}},day:{displayName:"tago",relative:{0:"hodiaŭ",1:"morgaŭ","-1":"hieraŭ"},relativeTime:{future:{one:"post {0} tago",other:"post {0} tagoj"},past:{one:"antaŭ {0} tago",other:"antaŭ {0} tagoj"}}},hour:{displayName:"horo",relativeTime:{future:{one:"post {0} horo",other:"post {0} horoj"},past:{one:"antaŭ {0} horo",other:"antaŭ {0} horoj"}}},minute:{displayName:"minuto",relativeTime:{future:{one:"post {0} minuto",other:"post {0} minutoj"},past:{one:"antaŭ {0} minuto",other:"antaŭ {0} minutoj"}}},second:{displayName:"sekundo",relative:{0:"now"},relativeTime:{future:{one:"post {0} sekundo",other:"post {0} sekundoj"},past:{one:"antaŭ {0} sekundo",other:"antaŭ {0} sekundoj"
}}}}}),ReactIntl.__addLocaleData({locale:"eo-001",parentLocale:"eo"}),ReactIntl.__addLocaleData({locale:"es",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Año",relative:{0:"este año",1:"el próximo año","-1":"el año pasado"},relativeTime:{future:{one:"dentro de {0} año",other:"dentro de {0} años"},past:{one:"hace {0} año",other:"hace {0} años"}}},month:{displayName:"Mes",relative:{0:"este mes",1:"el próximo mes","-1":"el mes pasado"},relativeTime:{future:{one:"dentro de {0} mes",other:"dentro de {0} meses"},past:{one:"hace {0} mes",other:"hace {0} meses"}}},day:{displayName:"Día",relative:{0:"hoy",1:"mañana",2:"pasado mañana","-1":"ayer","-2":"antes de ayer"},relativeTime:{future:{one:"dentro de {0} día",other:"dentro de {0} días"},past:{one:"hace {0} día",other:"hace {0} días"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"dentro de {0} hora",other:"dentro de {0} horas"},past:{one:"hace {0} hora",other:"hace {0} horas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"dentro de {0} minuto",other:"dentro de {0} minutos"},past:{one:"hace {0} minuto",other:"hace {0} minutos"}}},second:{displayName:"Segundo",relative:{0:"ahora"},relativeTime:{future:{one:"dentro de {0} segundo",other:"dentro de {0} segundos"},past:{one:"hace {0} segundo",other:"hace {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"es-419",parentLocale:"es",fields:{year:{displayName:"Año",relative:{0:"Este año",1:"Año próximo","-1":"Año pasado"},relativeTime:{future:{one:"En {0} año",other:"En {0} años"},past:{one:"hace {0} año",other:"hace {0} años"}}},month:{displayName:"Mes",relative:{0:"Este mes",1:"Mes próximo","-1":"El mes pasado"},relativeTime:{future:{one:"En {0} mes",other:"En {0} meses"},past:{one:"hace {0} mes",other:"hace {0} meses"}}},day:{displayName:"Día",relative:{0:"hoy",1:"mañana",2:"pasado mañana","-1":"ayer","-2":"antes de ayer"},relativeTime:{future:{one:"En {0} día",other:"En {0} días"},past:{one:"hace {0} día",other:"hace {0} días"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"En {0} hora",other:"En {0} horas"},past:{one:"hace {0} hora",other:"hace {0} horas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"En {0} minuto",other:"En {0} minutos"},past:{one:"hace {0} minuto",other:"hace {0} minutos"}}},second:{displayName:"Segundo",relative:{0:"ahora"},relativeTime:{future:{one:"En {0} segundo",other:"En {0} segundos"},past:{one:"hace {0} segundo",other:"hace {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"es-AR",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-BO",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-CL",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-CO",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-CR",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-CU",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-DO",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-EA",parentLocale:"es"}),ReactIntl.__addLocaleData({locale:"es-EC",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-ES",parentLocale:"es"}),ReactIntl.__addLocaleData({locale:"es-GQ",parentLocale:"es"}),ReactIntl.__addLocaleData({locale:"es-GT",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-HN",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-IC",parentLocale:"es"}),ReactIntl.__addLocaleData({locale:"es-MX",parentLocale:"es-419",fields:{year:{displayName:"Año",relative:{0:"este año",1:"el año próximo","-1":"el año pasado"},relativeTime:{future:{one:"En {0} año",other:"En {0} años"},past:{one:"hace {0} año",other:"hace {0} años"}}},month:{displayName:"Mes",relative:{0:"este mes",1:"el mes próximo","-1":"el mes pasado"},relativeTime:{future:{one:"en {0} mes",other:"en {0} meses"},past:{one:"hace {0} mes",other:"hace {0} meses"}}},day:{displayName:"Día",relative:{0:"hoy",1:"mañana",2:"pasado mañana","-1":"ayer","-2":"antes de ayer"},relativeTime:{future:{one:"En {0} día",other:"En {0} días"},past:{one:"hace {0} día",other:"hace {0} días"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"En {0} hora",other:"En {0} horas"},past:{one:"hace {0} hora",other:"hace {0} horas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"En {0} minuto",other:"En {0} minutos"},past:{one:"hace {0} minuto",other:"hace {0} minutos"}}},second:{displayName:"Segundo",relative:{0:"ahora"},relativeTime:{future:{one:"En {0} segundo",other:"En {0} segundos"},past:{one:"hace {0} segundo",other:"hace {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"es-NI",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-PA",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-PE",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-PH",parentLocale:"es"}),ReactIntl.__addLocaleData({locale:"es-PR",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-PY",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-SV",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-US",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-UY",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"es-VE",parentLocale:"es-419"}),ReactIntl.__addLocaleData({locale:"et",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"aasta",relative:{0:"käesolev aasta",1:"järgmine aasta","-1":"eelmine aasta"},relativeTime:{future:{one:"{0} aasta pärast",other:"{0} aasta pärast"},past:{one:"{0} aasta eest",other:"{0} aasta eest"}}},month:{displayName:"kuu",relative:{0:"käesolev kuu",1:"järgmine kuu","-1":"eelmine kuu"},relativeTime:{future:{one:"{0} kuu pärast",other:"{0} kuu pärast"},past:{one:"{0} kuu eest",other:"{0} kuu eest"}}},day:{displayName:"päev",relative:{0:"täna",1:"homme",2:"ülehomme","-1":"eile","-2":"üleeile"},relativeTime:{future:{one:"{0} päeva pärast",other:"{0} päeva pärast"},past:{one:"{0} päeva eest",other:"{0} päeva eest"}}},hour:{displayName:"tund",relativeTime:{future:{one:"{0} tunni pärast",other:"{0} tunni pärast"},past:{one:"{0} tunni eest",other:"{0} tunni eest"}}},minute:{displayName:"minut",relativeTime:{future:{one:"{0} minuti pärast",other:"{0} minuti pärast"},past:{one:"{0} minuti eest",other:"{0} minuti eest"}}},second:{displayName:"sekund",relative:{0:"nüüd"},relativeTime:{future:{one:"{0} sekundi pärast",other:"{0} sekundi pärast"},past:{one:"{0} sekundi eest",other:"{0} sekundi eest"}}}}}),ReactIntl.__addLocaleData({locale:"et-EE",parentLocale:"et"}),ReactIntl.__addLocaleData({locale:"eu",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Urtea",relative:{0:"aurten",1:"hurrengo urtea","-1":"aurreko urtea"},relativeTime:{future:{one:"{0} urte barru",other:"{0} urte barru"},past:{one:"Duela {0} urte",other:"Duela {0} urte"}}},month:{displayName:"Hilabetea",relative:{0:"hilabete hau",1:"hurrengo hilabetea","-1":"aurreko hilabetea"},relativeTime:{future:{one:"{0} hilabete barru",other:"{0} hilabete barru"},past:{one:"Duela {0} hilabete",other:"Duela {0} hilabete"}}},day:{displayName:"Eguna",relative:{0:"gaur",1:"bihar",2:"etzi","-1":"atzo","-2":"herenegun"},relativeTime:{future:{one:"{0} egun barru",other:"{0} egun barru"},past:{one:"Duela {0} egun",other:"Duela {0} egun"}}},hour:{displayName:"Ordua",relativeTime:{future:{one:"{0} ordu barru",other:"{0} ordu barru"},past:{one:"Duela {0} ordu",other:"Duela {0} ordu"}}},minute:{displayName:"Minutua",relativeTime:{future:{one:"{0} minutu barru",other:"{0} minutu barru"},past:{one:"Duela {0} minutu",other:"Duela {0} minutu"}}},second:{displayName:"Segundoa",relative:{0:"orain"},relativeTime:{future:{one:"{0} segundo barru",other:"{0} segundo barru"},past:{one:"Duela {0} segundo",other:"Duela {0} segundo"}}}}}),ReactIntl.__addLocaleData({locale:"eu-ES",parentLocale:"eu"}),ReactIntl.__addLocaleData({locale:"ewo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"M̀bú",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ngɔn",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Amǒs",relative:{0:"Aná",1:"Okírí","-1":"Angogé"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Awola",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Enútɛn",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Akábəga",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ewo-CM",parentLocale:"ewo"}),ReactIntl.__addLocaleData({locale:"fa",pluralRuleFunction:function(a,b){return b?"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"سال",relative:{0:"امسال",1:"سال آینده","-1":"سال گذشته"},relativeTime:{future:{one:"{0} سال بعد",other:"{0} سال بعد"},past:{one:"{0} سال پیش",other:"{0} سال پیش"}}},month:{displayName:"ماه",relative:{0:"این ماه",1:"ماه آینده","-1":"ماه گذشته"},relativeTime:{future:{one:"{0} ماه بعد",other:"{0} ماه بعد"},past:{one:"{0} ماه پیش",other:"{0} ماه پیش"}}},day:{displayName:"روز",relative:{0:"امروز",1:"فردا",2:"پسفردا","-1":"دیروز","-2":"پریروز"},relativeTime:{future:{one:"{0} روز بعد",other:"{0} روز بعد"},past:{one:"{0} روز پیش",other:"{0} روز پیش"}}},hour:{displayName:"ساعت",relativeTime:{future:{one:"{0} ساعت بعد",other:"{0} ساعت بعد"},past:{one:"{0} ساعت پیش",other:"{0} ساعت پیش"}}},minute:{displayName:"دقیقه",relativeTime:{future:{one:"{0} دقیقه بعد",other:"{0} دقیقه بعد"},past:{one:"{0} دقیقه پیش",other:"{0} دقیقه پیش"}}},second:{displayName:"ثانیه",relative:{0:"اکنون"},relativeTime:{future:{one:"{0} ثانیه بعد",other:"{0} ثانیه بعد"},past:{one:"{0} ثانیه پیش",other:"{0} ثانیه پیش"}}}}}),ReactIntl.__addLocaleData({locale:"fa-AF",parentLocale:"fa"}),ReactIntl.__addLocaleData({locale:"fa-IR",parentLocale:"fa"}),ReactIntl.__addLocaleData({locale:"ff",pluralRuleFunction:function(a,b){return b?"other":a>=0&&2>a?"one":"other"},fields:{year:{displayName:"Hitaande",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Lewru",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ñalnde",relative:{0:"Hannde",1:"Jaŋngo","-1":"Haŋki"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Waktu",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Hoƴom",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Majaango",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ff-CM",parentLocale:"ff"}),ReactIntl.__addLocaleData({locale:"ff-GN",parentLocale:"ff"}),ReactIntl.__addLocaleData({locale:"ff-MR",parentLocale:"ff"}),ReactIntl.__addLocaleData({locale:"ff-SN",parentLocale:"ff"}),ReactIntl.__addLocaleData({locale:"fi",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"vuosi",relative:{0:"tänä vuonna",1:"ensi vuonna","-1":"viime vuonna"},relativeTime:{future:{one:"{0} vuoden päästä",other:"{0} vuoden päästä"},past:{one:"{0} vuosi sitten",other:"{0} vuotta sitten"}}},month:{displayName:"kuukausi",relative:{0:"tässä kuussa",1:"ensi kuussa","-1":"viime kuussa"},relativeTime:{future:{one:"{0} kuukauden päästä",other:"{0} kuukauden päästä"},past:{one:"{0} kuukausi sitten",other:"{0} kuukautta sitten"}}},day:{displayName:"päivä",relative:{0:"tänään",1:"huomenna",2:"ylihuomenna","-1":"eilen","-2":"toissa päivänä"},relativeTime:{future:{one:"{0} päivän päästä",other:"{0} päivän päästä"},past:{one:"{0} päivä sitten",other:"{0} päivää sitten"}}},hour:{displayName:"tunti",relativeTime:{future:{one:"{0} tunnin päästä",other:"{0} tunnin päästä"},past:{one:"{0} tunti sitten",other:"{0} tuntia sitten"}}},minute:{displayName:"minuutti",relativeTime:{future:{one:"{0} minuutin päästä",other:"{0} minuutin päästä"},past:{one:"{0} minuutti sitten",other:"{0} minuuttia sitten"}}},second:{displayName:"sekunti",relative:{0:"nyt"},relativeTime:{future:{one:"{0} sekunnin päästä",other:"{0} sekunnin päästä"},past:{one:"{0} sekunti sitten",other:"{0} sekuntia sitten"}}}}}),ReactIntl.__addLocaleData({locale:"fi-FI",parentLocale:"fi"}),ReactIntl.__addLocaleData({locale:"fil",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=e.slice(-1);return b?1==a?"one":"other":f&&(1==d||2==d||3==d)||f&&4!=g&&6!=g&&9!=g||!f&&4!=h&&6!=h&&9!=h?"one":"other"},fields:{year:{displayName:"Taon",relative:{0:"ngayong taon",1:"susunod na taon","-1":"nakaraang taon"},relativeTime:{future:{one:"sa {0} taon",other:"sa {0} (na) taon"},past:{one:"{0} taon ang nakalipas",other:"{0} (na) taon ang nakalipas"}}},month:{displayName:"Buwan",relative:{0:"ngayong buwan",1:"susunod na buwan","-1":"nakaraang buwan"},relativeTime:{future:{one:"sa {0} buwan",other:"sa {0} (na) buwan"},past:{one:"{0} buwan ang nakalipas",other:"{0} (na) buwan ang nakalipas"}}},day:{displayName:"Araw",relative:{0:"ngayong araw",1:"bukas",2:"Samakalawa","-1":"kahapon","-2":"Araw bago ang kahapon"},relativeTime:{future:{one:"sa {0} araw",other:"sa {0} (na) araw"},past:{one:"{0} araw ang nakalipas",other:"{0} (na) araw ang nakalipas"}}},hour:{displayName:"Oras",relativeTime:{future:{one:"sa {0} oras",other:"sa {0} (na) oras"},past:{one:"{0} oras ang nakalipas",other:"{0} (na) oras ang nakalipas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"sa {0} minuto",other:"sa {0} (na) minuto"},past:{one:"{0} minuto ang nakalipas",other:"sa {0} (na) minuto"}}},second:{displayName:"Segundo",relative:{0:"ngayon"},relativeTime:{future:{one:"sa {0} segundo",other:"sa {0} (na) segundo"},past:{one:"{0} segundo ang nakalipas",other:"{0} (na) segundo ang nakalipas"}}}}}),ReactIntl.__addLocaleData({locale:"fil-PH",parentLocale:"fil"}),ReactIntl.__addLocaleData({locale:"fo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ár",relative:{0:"hetta ár",1:"næstu ár","-1":"síðstu ár"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"mánuður",relative:{0:"henda mánuður",1:"næstu mánuður","-1":"síðstu mánuður"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"dagur",relative:{0:"í dag",1:"á morgunn",2:"á yfirmorgunn","-1":"í gær","-2":"í fyrradag"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"klukkustund",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"mínúta",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"sekund",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"fo-FO",parentLocale:"fo"}),ReactIntl.__addLocaleData({locale:"fr",pluralRuleFunction:function(a,b){return b?1==a?"one":"other":a>=0&&2>a?"one":"other"},fields:{year:{displayName:"année",relative:{0:"cette année",1:"l’année prochaine","-1":"l’année dernière"},relativeTime:{future:{one:"dans {0} an",other:"dans {0} ans"},past:{one:"il y a {0} an",other:"il y a {0} ans"}}},month:{displayName:"mois",relative:{0:"ce mois-ci",1:"le mois prochain","-1":"le mois dernier"},relativeTime:{future:{one:"dans {0} mois",other:"dans {0} mois"},past:{one:"il y a {0} mois",other:"il y a {0} mois"}}},day:{displayName:"jour",relative:{0:"aujourd’hui",1:"demain",2:"après-demain","-1":"hier","-2":"avant-hier"},relativeTime:{future:{one:"dans {0} jour",other:"dans {0} jours"},past:{one:"il y a {0} jour",other:"il y a {0} jours"}}},hour:{displayName:"heure",relativeTime:{future:{one:"dans {0} heure",other:"dans {0} heures"},past:{one:"il y a {0} heure",other:"il y a {0} heures"}}},minute:{displayName:"minute",relativeTime:{future:{one:"dans {0} minute",other:"dans {0} minutes"},past:{one:"il y a {0} minute",other:"il y a {0} minutes"}}},second:{displayName:"seconde",relative:{0:"maintenant"},relativeTime:{future:{one:"dans {0} seconde",other:"dans {0} secondes"},past:{one:"il y a {0} seconde",other:"il y a {0} secondes"}}}}}),ReactIntl.__addLocaleData({locale:"fr-BE",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-BF",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-BI",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-BJ",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-BL",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-CA",parentLocale:"fr",fields:{year:{displayName:"année",relative:{0:"cette année",1:"l’année prochaine","-1":"l’année dernière"},relativeTime:{future:{one:"Dans {0} an",other:"Dans {0} ans"},past:{one:"Il y a {0} an",other:"Il y a {0} ans"}}},month:{displayName:"mois",relative:{0:"ce mois-ci",1:"le mois prochain","-1":"le mois dernier"},relativeTime:{future:{one:"Dans {0} mois",other:"Dans {0} mois"},past:{one:"Il y a {0} mois",other:"Il y a {0} mois"}}},day:{displayName:"jour",relative:{0:"aujourd’hui",1:"demain",2:"après-demain","-1":"hier","-2":"avant-hier"},relativeTime:{future:{one:"Dans {0} jour",other:"Dans {0} jours"},past:{one:"Il y a {0} jour",other:"Il y a {0} jours"}}},hour:{displayName:"heure",relativeTime:{future:{one:"Dans {0} heure",other:"Dans {0} heures"},past:{one:"Il y a {0} heure",other:"Il y a {0} heures"}}},minute:{displayName:"minute",relativeTime:{future:{one:"Dans {0} minute",other:"Dans {0} minutes"},past:{one:"Il y a {0} minute",other:"Il y a {0} minutes"}}},second:{displayName:"seconde",relative:{0:"maintenant"},relativeTime:{future:{one:"Dans {0} seconde",other:"Dans {0} secondes"},past:{one:"Il y a {0} seconde",other:"Il y a {0} secondes"}}}}}),ReactIntl.__addLocaleData({locale:"fr-CD",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-CF",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-CG",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-CH",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-CI",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-CM",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-DJ",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-DZ",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-FR",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-GA",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-GF",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-GN",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-GP",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-GQ",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-HT",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-KM",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-LU",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MA",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MC",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MF",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MG",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-ML",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MQ",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MR",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-MU",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-NC",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-NE",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-PF",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-PM",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-RE",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-RW",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-SC",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-SN",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-SY",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-TD",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-TG",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-TN",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-VU",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-WF",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fr-YT",parentLocale:"fr"}),ReactIntl.__addLocaleData({locale:"fur",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"an",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"ca di {0} an",other:"ca di {0} agns"},past:{one:"{0} an indaûr",other:"{0} agns indaûr"}}},month:{displayName:"mês",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"ca di {0} mês",other:"ca di {0} mês"},past:{one:"{0} mês indaûr",other:"{0} mês indaûr"}}},day:{displayName:"dì",relative:{0:"vuê",1:"doman",2:"passantdoman","-1":"îr","-2":"îr l’altri"},relativeTime:{future:{one:"ca di {0} zornade",other:"ca di {0} zornadis"},past:{one:"{0} zornade indaûr",other:"{0} zornadis indaûr"}}},hour:{displayName:"ore",relativeTime:{future:{one:"ca di {0} ore",other:"ca di {0} oris"},past:{one:"{0} ore indaûr",other:"{0} oris indaûr"}}},minute:{displayName:"minût",relativeTime:{future:{one:"ca di {0} minût",other:"ca di {0} minûts"},past:{one:"{0} minût indaûr",other:"{0} minûts indaûr"}}},second:{displayName:"secont",relative:{0:"now"},relativeTime:{future:{one:"ca di {0} secont",other:"ca di {0} seconts"},past:{one:"{0} secont indaûr",other:"{0} seconts indaûr"}}}}}),ReactIntl.__addLocaleData({locale:"fur-IT",parentLocale:"fur"}),ReactIntl.__addLocaleData({locale:"fy",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Jier",relative:{0:"dit jier",1:"folgjend jier","-1":"foarich jier"},relativeTime:{future:{one:"Oer {0} jier",other:"Oer {0} jier"},past:{one:"{0} jier lyn",other:"{0} jier lyn"}}},month:{displayName:"Moanne",relative:{0:"dizze moanne",1:"folgjende moanne","-1":"foarige moanne"},relativeTime:{future:{one:"Oer {0} moanne",other:"Oer {0} moannen"},past:{one:"{0} moanne lyn",other:"{0} moannen lyn"}}},day:{displayName:"dei",relative:{0:"vandaag",1:"morgen",2:"Oermorgen","-1":"gisteren","-2":"eergisteren"},relativeTime:{future:{one:"Oer {0} dei",other:"Oer {0} deien"},past:{one:"{0} dei lyn",other:"{0} deien lyn"}}},hour:{displayName:"oere",relativeTime:{future:{one:"Oer {0} oere",other:"Oer {0} oere"},past:{one:"{0} oere lyn",other:"{0} oere lyn"}}},minute:{displayName:"Minút",relativeTime:{future:{one:"Oer {0} minút",other:"Oer {0} minuten"},past:{one:"{0} minút lyn",other:"{0} minuten lyn"}}},second:{displayName:"Sekonde",relative:{0:"nu"},relativeTime:{future:{one:"Oer {0} sekonde",other:"Oer {0} sekonden"},past:{one:"{0} sekonde lyn",other:"{0} sekonden lyn"}}}}}),ReactIntl.__addLocaleData({locale:"fy-NL",parentLocale:"fy"}),ReactIntl.__addLocaleData({locale:"ga",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a;return b?"other":1==a?"one":2==a?"two":d&&a>=3&&6>=a?"few":d&&a>=7&&10>=a?"many":"other"},fields:{year:{displayName:"Bliain",relative:{0:"an bhliain seo",1:"an bhliain seo chugainn","-1":"anuraidh"},relativeTime:{future:{one:"i gceann {0} bhliain",two:"i gceann {0} bhliain",few:"i gceann {0} bliana",many:"i gceann {0} mbliana",other:"i gceann {0} bliain"},past:{one:"{0} bhliain ó shin",two:"{0} bhliain ó shin",few:"{0} bliana ó shin",many:"{0} mbliana ó shin",other:"{0} bliain ó shin"}}},month:{displayName:"Mí",relative:{0:"an mhí seo",1:"an mhí seo chugainn","-1":"an mhí seo caite"},relativeTime:{future:{one:"i gceann {0} mhí",two:"i gceann {0} mhí",few:"i gceann {0} mhí",many:"i gceann {0} mí",other:"i gceann {0} mí"},past:{one:"{0} mhí ó shin",two:"{0} mhí ó shin",few:"{0} mhí ó shin",many:"{0} mí ó shin",other:"{0} mí ó shin"}}},day:{displayName:"Lá",relative:{0:"inniu",1:"amárach",2:"arú amárach","-1":"inné","-2":"arú inné"},relativeTime:{future:{one:"i gceann {0} lá",two:"i gceann {0} lá",few:"i gceann {0} lá",many:"i gceann {0} lá",other:"i gceann {0} lá"},past:{one:"{0} lá ó shin",two:"{0} lá ó shin",few:"{0} lá ó shin",many:"{0} lá ó shin",other:"{0} lá ó shin"}}},hour:{displayName:"Uair",relativeTime:{future:{one:"i gceann {0} uair an chloig",two:"i gceann {0} uair an chloig",few:"i gceann {0} huaire an chloig",many:"i gceann {0} n-uaire an chloig",other:"i gceann {0} uair an chloig"},past:{one:"{0} uair an chloig ó shin",two:"{0} uair an chloig ó shin",few:"{0} huaire an chloig ó shin",many:"{0} n-uaire an chloig ó shin",other:"{0} uair an chloig ó shin"}}},minute:{displayName:"Nóiméad",relativeTime:{future:{one:"i gceann {0} nóiméad",two:"i gceann {0} nóiméad",few:"i gceann {0} nóiméad",many:"i gceann {0} nóiméad",other:"i gceann {0} nóiméad"},past:{one:"{0} nóiméad ó shin",two:"{0} nóiméad ó shin",few:"{0} nóiméad ó shin",many:"{0} nóiméad ó shin",other:"{0} nóiméad ó shin"}}},second:{displayName:"Soicind",relative:{0:"now"},relativeTime:{future:{one:"i gceann {0} soicind",two:"i gceann {0} shoicind",few:"i gceann {0} shoicind",many:"i gceann {0} soicind",other:"i gceann {0} soicind"},past:{one:"{0} soicind ó shin",two:"{0} shoicind ó shin",few:"{0} shoicind ó shin",many:"{0} soicind ó shin",other:"{0} soicind ó shin"}}}}}),ReactIntl.__addLocaleData({locale:"ga-IE",parentLocale:"ga"}),ReactIntl.__addLocaleData({locale:"gd",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a;return b?"other":1==a||11==a?"one":2==a||12==a?"two":d&&a>=3&&10>=a||d&&a>=13&&19>=a?"few":"other"},fields:{year:{displayName:"bliadhna",relative:{0:"am bliadhna",1:"an ath-bhliadhna","-1":"an-uiridh","-2":"a-bhòn-uiridh"},relativeTime:{future:{one:"an ceann {0} bhliadhna",two:"an ceann {0} bhliadhna",few:"an ceann {0} bliadhnaichean",other:"an ceann {0} bliadhna"},past:{one:"o chionn {0} bhliadhna",two:"o chionn {0} bhliadhna",few:"o chionn {0} bliadhnaichean",other:"o chionn {0} bliadhna"}}},month:{displayName:"mìos",relative:{0:"am mìos seo",1:"an ath-mhìos","-1":"am mìos seo chaidh"},relativeTime:{future:{one:"an ceann {0} mhìosa",two:"an ceann {0} mhìosa",few:"an ceann {0} mìosan",other:"an ceann {0} mìosa"},past:{one:"o chionn {0} mhìosa",two:"o chionn {0} mhìosa",few:"o chionn {0} mìosan",other:"o chionn {0} mìosa"}}},day:{displayName:"latha",relative:{0:"an-diugh",1:"a-màireach",2:"an-earar",3:"an-eararais","-1":"an-dè","-2":"a-bhòin-dè"},relativeTime:{future:{one:"an ceann {0} latha",two:"an ceann {0} latha",few:"an ceann {0} làithean",other:"an ceann {0} latha"},past:{one:"o chionn {0} latha",two:"o chionn {0} latha",few:"o chionn {0} làithean",other:"o chionn {0} latha"}}},hour:{displayName:"uair a thìde",relativeTime:{future:{one:"an ceann {0} uair a thìde",two:"an ceann {0} uair a thìde",few:"an ceann {0} uairean a thìde",other:"an ceann {0} uair a thìde"},past:{one:"o chionn {0} uair a thìde",two:"o chionn {0} uair a thìde",few:"o chionn {0} uairean a thìde",other:"o chionn {0} uair a thìde"}}},minute:{displayName:"mionaid",relativeTime:{future:{one:"an ceann {0} mhionaid",two:"an ceann {0} mhionaid",few:"an ceann {0} mionaidean",other:"an ceann {0} mionaid"},past:{one:"o chionn {0} mhionaid",two:"o chionn {0} mhionaid",few:"o chionn {0} mionaidean",other:"o chionn {0} mionaid"}}},second:{displayName:"diog",relative:{0:"now"},relativeTime:{future:{one:"an ceann {0} diog",two:"an ceann {0} dhiog",few:"an ceann {0} diogan",other:"an ceann {0} diog"},past:{one:"o chionn {0} diog",two:"o chionn {0} dhiog",few:"o chionn {0} diogan",other:"o chionn {0} diog"}}}}}),ReactIntl.__addLocaleData({locale:"gd-GB",parentLocale:"gd"}),ReactIntl.__addLocaleData({locale:"gl",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Ano",relative:{0:"este ano",1:"seguinte ano","-1":"ano pasado"},relativeTime:{future:{one:"En {0} ano",other:"En {0} anos"},past:{one:"Hai {0} ano",other:"Hai {0} anos"}}},month:{displayName:"Mes",relative:{0:"este mes",1:"mes seguinte","-1":"mes pasado"},relativeTime:{future:{one:"En {0} mes",other:"En {0} meses"},past:{one:"Hai {0} mes",other:"Hai {0} meses"}}},day:{displayName:"Día",relative:{0:"hoxe",1:"mañá",2:"pasadomañá","-1":"onte","-2":"antonte"},relativeTime:{future:{one:"En {0} día",other:"En {0} días"},past:{one:"Hai {0} día",other:"Hai {0} días"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"En {0} hora",other:"En {0} horas"},past:{one:"Hai {0} hora",other:"Hai {0} horas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"En {0} minuto",other:"En {0} minutos"},past:{one:"Hai {0} minuto",other:"Hai {0} minutos"}}},second:{displayName:"Segundo",relative:{0:"agora"},relativeTime:{future:{one:"En {0} segundo",other:"En {0} segundos"},past:{one:"Hai {0} segundo",other:"Hai {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"gl-ES",parentLocale:"gl"}),ReactIntl.__addLocaleData({locale:"gsw",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Jaar",relative:{0:"diese Jaar",1:"nächste Jaar","-1":"letzte Jaar"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Monet",relative:{0:"diese Monet",1:"nächste Monet","-1":"letzte Monet"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Tag",relative:{0:"hüt",1:"moorn",2:"übermoorn","-1":"geschter","-2":"vorgeschter"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Schtund",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minuute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"gsw-CH",parentLocale:"gsw"}),ReactIntl.__addLocaleData({locale:"gsw-FR",parentLocale:"gsw"}),ReactIntl.__addLocaleData({locale:"gsw-LI",parentLocale:"gsw"}),ReactIntl.__addLocaleData({locale:"gu",pluralRuleFunction:function(a,b){return b?1==a?"one":2==a||3==a?"two":4==a?"few":6==a?"many":"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"વર્ષ",relative:{0:"આ વર્ષે",1:"આવતા વર્ષે","-1":"ગયા વર્ષે"},relativeTime:{future:{one:"{0} વર્ષમાં",other:"{0} વર્ષમાં"},past:{one:"{0} વર્ષ પહેલા",other:"{0} વર્ષ પહેલા"}}},month:{displayName:"મહિનો",relative:{0:"આ મહિને",1:"આવતા મહિને","-1":"ગયા મહિને"},relativeTime:{future:{one:"{0} મહિનામાં",other:"{0} મહિનામાં"},past:{one:"{0} મહિના પહેલા",other:"{0} મહિના પહેલા"}}},day:{displayName:"દિવસ",relative:{0:"આજે",1:"આવતીકાલે",2:"પરમદિવસે","-1":"ગઈકાલે","-2":"ગયા પરમદિવસે"},relativeTime:{future:{one:"{0} દિવસમાં",other:"{0} દિવસમાં"},past:{one:"{0} દિવસ પહેલા",other:"{0} દિવસ પહેલા"}}},hour:{displayName:"કલાક",relativeTime:{future:{one:"{0} કલાકમાં",other:"{0} કલાકમાં"},past:{one:"{0} કલાક પહેલા",other:"{0} કલાક પહેલા"}}},minute:{displayName:"મિનિટ",relativeTime:{future:{one:"{0} મિનિટમાં",other:"{0} મિનિટમાં"},past:{one:"{0} મિનિટ પહેલા",other:"{0} મિનિટ પહેલા"}}},second:{displayName:"સેકન્ડ",relative:{0:"હમણાં"},relativeTime:{future:{one:"{0} સેકંડમાં",other:"{0} સેકંડમાં"},past:{one:"{0} સેકંડ પહેલા",other:"{0} સેકંડ પહેલા"}}}}}),ReactIntl.__addLocaleData({locale:"gu-IN",parentLocale:"gu"}),ReactIntl.__addLocaleData({locale:"guw",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"
}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"guz",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Omotienyi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Rituko",relative:{0:"Rero",1:"Mambia","-1":"Igoro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ensa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Edakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Esekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"guz-KE",parentLocale:"guz"}),ReactIntl.__addLocaleData({locale:"gv",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=d.slice(-1),g=d.slice(-2);return b?"other":e&&1==f?"one":e&&2==f?"two":!e||0!=g&&20!=g&&40!=g&&60!=g&&80!=g?e?"other":"many":"few"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"gv-IM",parentLocale:"gv"}),ReactIntl.__addLocaleData({locale:"ha",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Shekara",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Wata",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Kwana",relative:{0:"Yau",1:"Gobe","-1":"Jiya"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Awa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Daƙiƙa",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ha-Arab",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ha-Latn",parentLocale:"ha"}),ReactIntl.__addLocaleData({locale:"ha-Latn-GH",parentLocale:"ha-Latn"}),ReactIntl.__addLocaleData({locale:"ha-Latn-NE",parentLocale:"ha-Latn"}),ReactIntl.__addLocaleData({locale:"ha-Latn-NG",parentLocale:"ha-Latn"}),ReactIntl.__addLocaleData({locale:"haw",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"haw-US",parentLocale:"haw"}),ReactIntl.__addLocaleData({locale:"he",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=Number(c[0])==a,g=f&&c[0].slice(-1);return b?"other":1==a&&e?"one":2==d&&e?"two":e&&(0>a||a>10)&&f&&0==g?"many":"other"},fields:{year:{displayName:"שנה",relative:{0:"השנה",1:"השנה הבאה","-1":"השנה שעברה"},relativeTime:{future:{one:"בעוד שנה",two:"בעוד שנתיים",many:"בעוד {0} שנה",other:"בעוד {0} שנים"},past:{one:"לפני שנה",two:"לפני שנתיים",many:"לפני {0} שנה",other:"לפני {0} שנים"}}},month:{displayName:"חודש",relative:{0:"החודש",1:"החודש הבא","-1":"החודש שעבר"},relativeTime:{future:{one:"בעוד חודש",two:"בעוד חודשיים",many:"בעוד {0} חודשים",other:"בעוד {0} חודשים"},past:{one:"לפני חודש",two:"לפני חודשיים",many:"לפני {0} חודשים",other:"לפני {0} חודשים"}}},day:{displayName:"יום",relative:{0:"היום",1:"מחר",2:"מחרתיים","-1":"אתמול","-2":"שלשום"},relativeTime:{future:{one:"בעוד יום {0}",two:"בעוד יומיים",many:"בעוד {0} ימים",other:"בעוד {0} ימים"},past:{one:"לפני יום {0}",two:"לפני יומיים",many:"לפני {0} ימים",other:"לפני {0} ימים"}}},hour:{displayName:"שעה",relativeTime:{future:{one:"בעוד שעה",two:"בעוד שעתיים",many:"בעוד {0} שעות",other:"בעוד {0} שעות"},past:{one:"לפני שעה",two:"לפני שעתיים",many:"לפני {0} שעות",other:"לפני {0} שעות"}}},minute:{displayName:"דקה",relativeTime:{future:{one:"בעוד דקה",two:"בעוד שתי דקות",many:"בעוד {0} דקות",other:"בעוד {0} דקות"},past:{one:"לפני דקה",two:"לפני שתי דקות",many:"לפני {0} דקות",other:"לפני {0} דקות"}}},second:{displayName:"שנייה",relative:{0:"עכשיו"},relativeTime:{future:{one:"בעוד שנייה",two:"בעוד שתי שניות",many:"בעוד {0} שניות",other:"בעוד {0} שניות"},past:{one:"לפני שנייה",two:"לפני שתי שניות",many:"לפני {0} שניות",other:"לפני {0} שניות"}}}}}),ReactIntl.__addLocaleData({locale:"he-IL",parentLocale:"he"}),ReactIntl.__addLocaleData({locale:"hi",pluralRuleFunction:function(a,b){return b?1==a?"one":2==a||3==a?"two":4==a?"few":6==a?"many":"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"वर्ष",relative:{0:"इस वर्ष",1:"अगला वर्ष","-1":"पिछला वर्ष"},relativeTime:{future:{one:"{0} वर्ष में",other:"{0} वर्ष में"},past:{one:"{0} वर्ष पहले",other:"{0} वर्ष पहले"}}},month:{displayName:"माह",relative:{0:"इस माह",1:"अगला माह","-1":"पिछला माह"},relativeTime:{future:{one:"{0} माह में",other:"{0} माह में"},past:{one:"{0} माह पहले",other:"{0} माह पहले"}}},day:{displayName:"दिन",relative:{0:"आज",1:"कल",2:"परसों","-1":"कल","-2":"बीता परसों"},relativeTime:{future:{one:"{0} दिन में",other:"{0} दिन में"},past:{one:"{0} दिन पहले",other:"{0} दिन पहले"}}},hour:{displayName:"घंटा",relativeTime:{future:{one:"{0} घंटे में",other:"{0} घंटे में"},past:{one:"{0} घंटे पहले",other:"{0} घंटे पहले"}}},minute:{displayName:"मिनट",relativeTime:{future:{one:"{0} मिनट में",other:"{0} मिनट में"},past:{one:"{0} मिनट पहले",other:"{0} मिनट पहले"}}},second:{displayName:"सेकंड",relative:{0:"अब"},relativeTime:{future:{one:"{0} सेकंड में",other:"{0} सेकंड में"},past:{one:"{0} सेकंड पहले",other:"{0} सेकंड पहले"}}}}}),ReactIntl.__addLocaleData({locale:"hi-IN",parentLocale:"hi"}),ReactIntl.__addLocaleData({locale:"hr",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=d.slice(-2),i=e.slice(-1),j=e.slice(-2);return b?"other":f&&1==g&&11!=h||1==i&&11!=j?"one":f&&g>=2&&4>=g&&(12>h||h>14)||i>=2&&4>=i&&(12>j||j>14)?"few":"other"},fields:{year:{displayName:"Godina",relative:{0:"ove godine",1:"sljedeće godine","-1":"prošle godine"},relativeTime:{future:{one:"za {0} godinu",few:"za {0} godine",other:"za {0} godina"},past:{one:"prije {0} godinu",few:"prije {0} godine",other:"prije {0} godina"}}},month:{displayName:"Mjesec",relative:{0:"ovaj mjesec",1:"sljedeći mjesec","-1":"prošli mjesec"},relativeTime:{future:{one:"za {0} mjesec",few:"za {0} mjeseca",other:"za {0} mjeseci"},past:{one:"prije {0} mjesec",few:"prije {0} mjeseca",other:"prije {0} mjeseci"}}},day:{displayName:"Dan",relative:{0:"danas",1:"sutra",2:"prekosutra","-1":"jučer","-2":"prekjučer"},relativeTime:{future:{one:"za {0} dan",few:"za {0} dana",other:"za {0} dana"},past:{one:"prije {0} dan",few:"prije {0} dana",other:"prije {0} dana"}}},hour:{displayName:"Sat",relativeTime:{future:{one:"za {0} sat",few:"za {0} sata",other:"za {0} sati"},past:{one:"prije {0} sat",few:"prije {0} sata",other:"prije {0} sati"}}},minute:{displayName:"Minuta",relativeTime:{future:{one:"za {0} minutu",few:"za {0} minute",other:"za {0} minuta"},past:{one:"prije {0} minutu",few:"prije {0} minute",other:"prije {0} minuta"}}},second:{displayName:"Sekunda",relative:{0:"sada"},relativeTime:{future:{one:"za {0} sekundu",few:"za {0} sekunde",other:"za {0} sekundi"},past:{one:"prije {0} sekundu",few:"prije {0} sekunde",other:"prije {0} sekundi"}}}}}),ReactIntl.__addLocaleData({locale:"hr-BA",parentLocale:"hr"}),ReactIntl.__addLocaleData({locale:"hr-HR",parentLocale:"hr"}),ReactIntl.__addLocaleData({locale:"hsb",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-2),h=e.slice(-2);return b?"other":f&&1==g||1==h?"one":f&&2==g||2==h?"two":f&&(3==g||4==g)||3==h||4==h?"few":"other"},fields:{year:{displayName:"lěto",relative:{0:"lětsa",1:"klětu","-1":"loni"},relativeTime:{future:{one:"za {0} lěto",two:"za {0} lěće",few:"za {0} lěta",other:"za {0} lět"},past:{one:"před {0} lětom",two:"před {0} lětomaj",few:"před {0} lětami",other:"před {0} lětami"}}},month:{displayName:"měsac",relative:{0:"tutón měsac",1:"přichodny měsac","-1":"zašły měsac"},relativeTime:{future:{one:"za {0} měsac",two:"za {0} měsacaj",few:"za {0} měsacy",other:"za {0} měsacow"},past:{one:"před {0} měsacom",two:"před {0} měsacomaj",few:"před {0} měsacami",other:"před {0} měsacami"}}},day:{displayName:"dźeń",relative:{0:"dźensa",1:"jutře","-1":"wčera"},relativeTime:{future:{one:"za {0} dźeń",two:"za {0} dnjej",few:"za {0} dny",other:"za {0} dnjow"},past:{one:"před {0} dnjom",two:"před {0} dnjomaj",few:"před {0} dnjemi",other:"před {0} dnjemi"}}},hour:{displayName:"hodźina",relativeTime:{future:{one:"za {0} hodźinu",two:"za {0} hodźinje",few:"za {0} hodźiny",other:"za {0} hodźin"},past:{one:"před {0} hodźinu",two:"před {0} hodźinomaj",few:"před {0} hodźinami",other:"před {0} hodźinami"}}},minute:{displayName:"minuta",relativeTime:{future:{one:"za {0} minutu",two:"za {0} minuće",few:"za {0} minuty",other:"za {0} minutow"},past:{one:"před {0} minutu",two:"před {0} minutomaj",few:"před {0} minutami",other:"před {0} minutami"}}},second:{displayName:"sekunda",relative:{0:"now"},relativeTime:{future:{one:"za {0} sekundu",two:"za {0} sekundźe",few:"za {0} sekundy",other:"za {0} sekundow"},past:{one:"před {0} sekundu",two:"před {0} sekundomaj",few:"před {0} sekundami",other:"před {0} sekundami"}}}}}),ReactIntl.__addLocaleData({locale:"hsb-DE",parentLocale:"hsb"}),ReactIntl.__addLocaleData({locale:"hu",pluralRuleFunction:function(a,b){return b?1==a||5==a?"one":"other":1==a?"one":"other"},fields:{year:{displayName:"év",relative:{0:"ez az év",1:"következő év","-1":"előző év"},relativeTime:{future:{one:"{0} év múlva",other:"{0} év múlva"},past:{one:"{0} évvel ezelőtt",other:"{0} évvel ezelőtt"}}},month:{displayName:"hónap",relative:{0:"ez a hónap",1:"következő hónap","-1":"előző hónap"},relativeTime:{future:{one:"{0} hónap múlva",other:"{0} hónap múlva"},past:{one:"{0} hónappal ezelőtt",other:"{0} hónappal ezelőtt"}}},day:{displayName:"nap",relative:{0:"ma",1:"holnap",2:"holnapután","-1":"tegnap","-2":"tegnapelőtt"},relativeTime:{future:{one:"{0} nap múlva",other:"{0} nap múlva"},past:{one:"{0} nappal ezelőtt",other:"{0} nappal ezelőtt"}}},hour:{displayName:"óra",relativeTime:{future:{one:"{0} óra múlva",other:"{0} óra múlva"},past:{one:"{0} órával ezelőtt",other:"{0} órával ezelőtt"}}},minute:{displayName:"perc",relativeTime:{future:{one:"{0} perc múlva",other:"{0} perc múlva"},past:{one:"{0} perccel ezelőtt",other:"{0} perccel ezelőtt"}}},second:{displayName:"másodperc",relative:{0:"most"},relativeTime:{future:{one:"{0} másodperc múlva",other:"{0} másodperc múlva"},past:{one:"{0} másodperccel ezelőtt",other:"{0} másodperccel ezelőtt"}}}}}),ReactIntl.__addLocaleData({locale:"hu-HU",parentLocale:"hu"}),ReactIntl.__addLocaleData({locale:"hy",pluralRuleFunction:function(a,b){return b?1==a?"one":"other":a>=0&&2>a?"one":"other"},fields:{year:{displayName:"Տարի",relative:{0:"այս տարի",1:"հաջորդ տարի","-1":"անցյալ տարի"},relativeTime:{future:{one:"{0} տարի անց",other:"{0} տարի անց"},past:{one:"{0} տարի առաջ",other:"{0} տարի առաջ"}}},month:{displayName:"Ամիս",relative:{0:"այս ամիս",1:"հաջորդ ամիս","-1":"անցյալ ամիս"},relativeTime:{future:{one:"{0} ամիս անց",other:"{0} ամիս անց"},past:{one:"{0} ամիս առաջ",other:"{0} ամիս առաջ"}}},day:{displayName:"Օր",relative:{0:"այսօր",1:"վաղը",2:"վաղը չէ մյուս օրը","-1":"երեկ","-2":"երեկ չէ առաջի օրը"},relativeTime:{future:{one:"{0} օր անց",other:"{0} օր անց"},past:{one:"{0} օր առաջ",other:"{0} օր առաջ"}}},hour:{displayName:"Ժամ",relativeTime:{future:{one:"{0} ժամ անց",other:"{0} ժամ անց"},past:{one:"{0} ժամ առաջ",other:"{0} ժամ առաջ"}}},minute:{displayName:"Րոպե",relativeTime:{future:{one:"{0} րոպե անց",other:"{0} րոպե անց"},past:{one:"{0} րոպե առաջ",other:"{0} րոպե առաջ"}}},second:{displayName:"Վայրկյան",relative:{0:"այժմ"},relativeTime:{future:{one:"{0} վայրկյան անց",other:"{0} վայրկյան անց"},past:{one:"{0} վայրկյան առաջ",other:"{0} վայրկյան առաջ"}}}}}),ReactIntl.__addLocaleData({locale:"hy-AM",parentLocale:"hy"}),ReactIntl.__addLocaleData({locale:"ia",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ia-FR",parentLocale:"ia"}),ReactIntl.__addLocaleData({locale:"id",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Tahun",relative:{0:"tahun ini",1:"tahun depan","-1":"tahun lalu"},relativeTime:{future:{other:"Dalam {0} tahun"},past:{other:"{0} tahun yang lalu"}}},month:{displayName:"Bulan",relative:{0:"bulan ini",1:"Bulan berikutnya","-1":"bulan lalu"},relativeTime:{future:{other:"Dalam {0} bulan"},past:{other:"{0} bulan yang lalu"}}},day:{displayName:"Hari",relative:{0:"hari ini",1:"besok",2:"lusa","-1":"kemarin","-2":"kemarin lusa"},relativeTime:{future:{other:"Dalam {0} hari"},past:{other:"{0} hari yang lalu"}}},hour:{displayName:"Jam",relativeTime:{future:{other:"Dalam {0} jam"},past:{other:"{0} jam yang lalu"}}},minute:{displayName:"Menit",relativeTime:{future:{other:"Dalam {0} menit"},past:{other:"{0} menit yang lalu"}}},second:{displayName:"Detik",relative:{0:"sekarang"},relativeTime:{future:{other:"Dalam {0} detik"},past:{other:"{0} detik yang lalu"}}}}}),ReactIntl.__addLocaleData({locale:"id-ID",parentLocale:"id"}),ReactIntl.__addLocaleData({locale:"ig",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Afọ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ọnwa",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ụbọchị",relative:{0:"Taata",1:"Echi","-1":"Nnyaafụ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Elekere",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Nkeji",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Nkejinta",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ig-NG",parentLocale:"ig"}),ReactIntl.__addLocaleData({locale:"ii",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ꈎ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ꆪ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ꑍ",relative:{0:"ꀃꑍ",1:"ꃆꏂꑍ",2:"ꌕꀿꑍ","-1":"ꀋꅔꉈ","-2":"ꎴꂿꋍꑍ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ꄮꈉ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ꃏ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ꇙ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ii-CN",parentLocale:"ii"}),ReactIntl.__addLocaleData({locale:"in",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"is",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=Number(c[0])==a,f=d.slice(-1),g=d.slice(-2);return b?"other":e&&1==f&&11!=g||!e?"one":"other"},fields:{year:{displayName:"ár",relative:{0:"á þessu ári",1:"á næsta ári","-1":"á síðasta ári"},relativeTime:{future:{one:"eftir {0} ár",other:"eftir {0} ár"},past:{one:"fyrir {0} ári",other:"fyrir {0} árum"}}},month:{displayName:"mánuður",relative:{0:"í þessum mánuði",1:"í næsta mánuði","-1":"í síðasta mánuði"},relativeTime:{future:{one:"eftir {0} mánuð",other:"eftir {0} mánuði"},past:{one:"fyrir {0} mánuði",other:"fyrir {0} mánuðum"}}},day:{displayName:"dagur",relative:{0:"í dag",1:"á morgun",2:"eftir tvo daga","-1":"í gær","-2":"í fyrradag"},relativeTime:{future:{one:"eftir {0} dag",other:"eftir {0} daga"},past:{one:"fyrir {0} degi",other:"fyrir {0} dögum"}}},hour:{displayName:"klukkustund",relativeTime:{future:{one:"eftir {0} klukkustund",other:"eftir {0} klukkustundir"},past:{one:"fyrir {0} klukkustund",other:"fyrir {0} klukkustundum"}}},minute:{displayName:"mínúta",relativeTime:{future:{one:"eftir {0} mínútu",other:"eftir {0} mínútur"},past:{one:"fyrir {0} mínútu",other:"fyrir {0} mínútum"}}},second:{displayName:"sekúnda",relative:{0:"núna"},relativeTime:{future:{one:"eftir {0} sekúndu",other:"eftir {0} sekúndur"},past:{one:"fyrir {0} sekúndu",other:"fyrir {0} sekúndum"}}}}}),ReactIntl.__addLocaleData({locale:"is-IS",parentLocale:"is"}),ReactIntl.__addLocaleData({locale:"it",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?11==a||8==a||80==a||800==a?"many":"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Anno",relative:{0:"quest’anno",1:"anno prossimo","-1":"anno scorso"},relativeTime:{future:{one:"tra {0} anno",other:"tra {0} anni"},past:{one:"{0} anno fa",other:"{0} anni fa"}}},month:{displayName:"Mese",relative:{0:"questo mese",1:"mese prossimo","-1":"mese scorso"},relativeTime:{future:{one:"tra {0} mese",other:"tra {0} mesi"},past:{one:"{0} mese fa",other:"{0} mesi fa"}}},day:{displayName:"Giorno",relative:{0:"oggi",1:"domani",2:"dopodomani","-1":"ieri","-2":"l’altro ieri"},relativeTime:{future:{one:"tra {0} giorno",other:"tra {0} giorni"},past:{one:"{0} giorno fa",other:"{0} giorni fa"}}},hour:{displayName:"Ora",relativeTime:{future:{one:"tra {0} ora",other:"tra {0} ore"},past:{one:"{0} ora fa",other:"{0} ore fa"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"tra {0} minuto",other:"tra {0} minuti"},past:{one:"{0} minuto fa",other:"{0} minuti fa"}}},second:{displayName:"Secondo",relative:{0:"ora"},relativeTime:{future:{one:"tra {0} secondo",other:"tra {0} secondi"},past:{one:"{0} secondo fa",other:"{0} secondi fa"}}}}}),ReactIntl.__addLocaleData({locale:"it-CH",parentLocale:"it"}),ReactIntl.__addLocaleData({locale:"it-IT",parentLocale:"it"}),ReactIntl.__addLocaleData({locale:"it-SM",parentLocale:"it"}),ReactIntl.__addLocaleData({locale:"iu",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"iw",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=Number(c[0])==a,g=f&&c[0].slice(-1);return b?"other":1==a&&e?"one":2==d&&e?"two":e&&(0>a||a>10)&&f&&0==g?"many":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ja",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"年",relative:{0:"今年",1:"翌年","-1":"昨年"},relativeTime:{future:{other:"{0} 年後"},past:{other:"{0} 年前"}}},month:{displayName:"月",relative:{0:"今月",1:"翌月","-1":"先月"},relativeTime:{future:{other:"{0} か月後"},past:{other:"{0} か月前"}}},day:{displayName:"日",relative:{0:"今日",1:"明日",2:"明後日","-1":"昨日","-2":"一昨日"},relativeTime:{future:{other:"{0} 日後"},past:{other:"{0} 日前"}}},hour:{displayName:"時",relativeTime:{future:{other:"{0} 時間後"},past:{other:"{0} 時間前"}}},minute:{displayName:"分",relativeTime:{future:{other:"{0} 分後"},past:{other:"{0} 分前"}}},second:{displayName:"秒",relative:{0:"今すぐ"},relativeTime:{future:{other:"{0} 秒後"},past:{other:"{0} 秒前"}}}}}),ReactIntl.__addLocaleData({locale:"ja-JP",parentLocale:"ja"}),ReactIntl.__addLocaleData({locale:"jbo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"jgo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"Nǔu ŋguꞋ {0}",other:"Nǔu ŋguꞋ {0}"},past:{one:"Ɛ́gɛ́ mɔ́ ŋguꞋ {0}",other:"Ɛ́gɛ́ mɔ́ ŋguꞋ {0}"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"Nǔu {0} saŋ",other:"Nǔu {0} saŋ"},past:{one:"ɛ́ gɛ́ mɔ́ pɛsaŋ {0}",other:"ɛ́ gɛ́ mɔ́ pɛsaŋ {0}"}}},day:{displayName:"Day",relative:{0:"lɔꞋɔ",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"Nǔu lɛ́Ꞌ {0}",other:"Nǔu lɛ́Ꞌ {0}"},past:{one:"Ɛ́ gɛ́ mɔ́ lɛ́Ꞌ {0}",other:"Ɛ́ gɛ́ mɔ́ lɛ́Ꞌ {0}"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"nǔu háwa {0}",other:"nǔu háwa {0}"},past:{one:"ɛ́ gɛ mɔ́ {0} háwa",other:"ɛ́ gɛ mɔ́ {0} háwa"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"nǔu {0} minút",other:"nǔu {0} minút"},past:{one:"ɛ́ gɛ́ mɔ́ minút {0}",other:"ɛ́ gɛ́ mɔ́ minút {0}"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"jgo-CM",parentLocale:"jgo"}),ReactIntl.__addLocaleData({locale:"ji",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"jmc",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Maka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mfiri",relative:{0:"Inu",1:"Ngama","-1":"Ukou"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakyika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"jmc-TZ",parentLocale:"jmc"}),ReactIntl.__addLocaleData({locale:"jv",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"jw",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ka",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=d.slice(-2);return b?1==d?"one":0==d||e>=2&&20>=e||40==e||60==e||80==e?"many":"other":1==a?"one":"other"},fields:{year:{displayName:"წელი",relative:{0:"ამ წელს",1:"მომავალ წელს","-1":"გასულ წელს"},relativeTime:{future:{one:"{0} წელიწადში",other:"{0} წელიწადში"},past:{one:"{0} წლის წინ",other:"{0} წლის წინ"}}},month:{displayName:"თვე",relative:{0:"ამ თვეში",1:"მომავალ თვეს","-1":"გასულ თვეს"},relativeTime:{future:{one:"{0} თვეში",other:"{0} თვეში"},past:{one:"{0} თვის წინ",other:"{0} თვის წინ"}}},day:{displayName:"დღე",relative:{0:"დღეს",1:"ხვალ",2:"ზეგ","-1":"გუშინ","-2":"გუშინწინ"},relativeTime:{future:{one:"{0} დღეში",other:"{0} დღეში"},past:{one:"{0} დღის წინ",other:"{0} დღის წინ"}}},hour:{displayName:"საათი",relativeTime:{future:{one:"{0} საათში",other:"{0} საათში"},past:{one:"{0} საათის წინ",other:"{0} საათის წინ"}}},minute:{displayName:"წუთი",relativeTime:{future:{one:"{0} წუთში",other:"{0} წუთში"},past:{one:"{0} წუთის წინ",other:"{0} წუთის წინ"}}},second:{displayName:"წამი",relative:{0:"ახლა"},relativeTime:{future:{one:"{0} წამში",other:"{0} წამში"},past:{one:"{0} წამის წინ",other:"{0} წამის წინ"}}}}}),ReactIntl.__addLocaleData({locale:"ka-GE",parentLocale:"ka"}),ReactIntl.__addLocaleData({locale:"kab",pluralRuleFunction:function(a,b){return b?"other":a>=0&&2>a?"one":"other"},fields:{year:{displayName:"Aseggas",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Aggur",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ass",relative:{0:"Ass-a",1:"Azekka","-1":"Iḍelli"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Tamert",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Tamrect",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Tasint",relative:{
0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kab-DZ",parentLocale:"kab"}),ReactIntl.__addLocaleData({locale:"kaj",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kam",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwai",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mũthenya",relative:{0:"Ũmũnthĩ",1:"Ũnĩ","-1":"Ĩyoo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ndatĩka",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kam-KE",parentLocale:"kam"}),ReactIntl.__addLocaleData({locale:"kcg",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kde",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwedi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Lihiku",relative:{0:"Nelo",1:"Nundu","-1":"Lido"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kde-TZ",parentLocale:"kde"}),ReactIntl.__addLocaleData({locale:"kea",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Anu",relative:{0:"es anu li",1:"prósimu anu","-1":"anu pasadu"},relativeTime:{future:{other:"di li {0} anu"},past:{other:"a ten {0} anu"}}},month:{displayName:"Mes",relative:{0:"es mes li",1:"prósimu mes","-1":"mes pasadu"},relativeTime:{future:{other:"di li {0} mes"},past:{other:"a ten {0} mes"}}},day:{displayName:"Dia",relative:{0:"oji",1:"manha","-1":"onti"},relativeTime:{future:{other:"di li {0} dia"},past:{other:"a ten {0} dia"}}},hour:{displayName:"Ora",relativeTime:{future:{other:"di li {0} ora"},past:{other:"a ten {0} ora"}}},minute:{displayName:"Minutu",relativeTime:{future:{other:"di li {0} minutu"},past:{other:"a ten {0} minutu"}}},second:{displayName:"Sigundu",relative:{0:"now"},relativeTime:{future:{other:"di li {0} sigundu"},past:{other:"a ten {0} sigundu"}}}}}),ReactIntl.__addLocaleData({locale:"kea-CV",parentLocale:"kea"}),ReactIntl.__addLocaleData({locale:"khq",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Jiiri",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Handu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Jaari",relative:{0:"Hõo",1:"Suba","-1":"Bi"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Guuru",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Miti",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"khq-ML",parentLocale:"khq"}),ReactIntl.__addLocaleData({locale:"ki",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mũthenya",relative:{0:"Ũmũthĩ",1:"Rũciũ","-1":"Ira"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ithaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ndagĩka",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ki-KE",parentLocale:"ki"}),ReactIntl.__addLocaleData({locale:"kk",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a,e=d&&c[0].slice(-1);return b?6==e||9==e||d&&0==e&&0!=a?"many":"other":1==a?"one":"other"},fields:{year:{displayName:"Жыл",relative:{0:"биылғы жыл",1:"келесі жыл","-1":"былтырғы жыл"},relativeTime:{future:{one:"{0} жылдан кейін",other:"{0} жылдан кейін"},past:{one:"{0} жыл бұрын",other:"{0} жыл бұрын"}}},month:{displayName:"Ай",relative:{0:"осы ай",1:"келесі ай","-1":"өткен ай"},relativeTime:{future:{one:"{0} айдан кейін",other:"{0} айдан кейін"},past:{one:"{0} ай бұрын",other:"{0} ай бұрын"}}},day:{displayName:"күн",relative:{0:"бүгін",1:"ертең",2:"арғы күні","-1":"кеше","-2":"алдыңғы күні"},relativeTime:{future:{one:"{0} күннен кейін",other:"{0} күннен кейін"},past:{one:"{0} күн бұрын",other:"{0} күн бұрын"}}},hour:{displayName:"Сағат",relativeTime:{future:{one:"{0} сағаттан кейін",other:"{0} сағаттан кейін"},past:{one:"{0} сағат бұрын",other:"{0} сағат бұрын"}}},minute:{displayName:"Минут",relativeTime:{future:{one:"{0} минуттан кейін",other:"{0} минуттан кейін"},past:{one:"{0} минут бұрын",other:"{0} минут бұрын"}}},second:{displayName:"Секунд",relative:{0:"қазір"},relativeTime:{future:{one:"{0} секундтан кейін",other:"{0} секундтан кейін"},past:{one:"{0} секунд бұрын",other:"{0} секунд бұрын"}}}}}),ReactIntl.__addLocaleData({locale:"kk-Cyrl",parentLocale:"kk"}),ReactIntl.__addLocaleData({locale:"kk-Cyrl-KZ",parentLocale:"kk-Cyrl"}),ReactIntl.__addLocaleData({locale:"kkj",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"muka",1:"nɛmɛnɔ","-1":"kwey"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kkj-CM",parentLocale:"kkj"}),ReactIntl.__addLocaleData({locale:"kl",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ukioq",relative:{0:"manna ukioq",1:"tulleq ukioq","-1":"kingulleq ukioq"},relativeTime:{future:{one:"om {0} ukioq",other:"om {0} ukioq"},past:{one:"for {0} ukioq siden",other:"for {0} ukioq siden"}}},month:{displayName:"qaammat",relative:{0:"manna qaammat",1:"tulleq qaammat","-1":"kingulleq qaammat"},relativeTime:{future:{one:"om {0} qaammat",other:"om {0} qaammat"},past:{one:"for {0} qaammat siden",other:"for {0} qaammat siden"}}},day:{displayName:"ulloq",relative:{0:"ullumi",1:"aqagu",2:"aqaguagu","-1":"ippassaq","-2":"ippassaani"},relativeTime:{future:{one:"om {0} ulloq unnuarlu",other:"om {0} ulloq unnuarlu"},past:{one:"for {0} ulloq unnuarlu siden",other:"for {0} ulloq unnuarlu siden"}}},hour:{displayName:"nalunaaquttap-akunnera",relativeTime:{future:{one:"om {0} nalunaaquttap-akunnera",other:"om {0} nalunaaquttap-akunnera"},past:{one:"for {0} nalunaaquttap-akunnera siden",other:"for {0} nalunaaquttap-akunnera siden"}}},minute:{displayName:"minutsi",relativeTime:{future:{one:"om {0} minutsi",other:"om {0} minutsi"},past:{one:"for {0} minutsi siden",other:"for {0} minutsi siden"}}},second:{displayName:"sekundi",relative:{0:"now"},relativeTime:{future:{one:"om {0} sekundi",other:"om {0} sekundi"},past:{one:"for {0} sekundi siden",other:"for {0} sekundi siden"}}}}}),ReactIntl.__addLocaleData({locale:"kl-GL",parentLocale:"kl"}),ReactIntl.__addLocaleData({locale:"kln",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Kenyit",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Arawet",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Betut",relative:{0:"Raini",1:"Mutai","-1":"Amut"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Sait",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minitit",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekondit",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kln-KE",parentLocale:"kln"}),ReactIntl.__addLocaleData({locale:"km",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ឆ្នាំ",relative:{0:"ឆ្នាំនេះ",1:"ឆ្នាំក្រោយ","-1":"ឆ្នាំមុន"},relativeTime:{future:{other:"ក្នុងរយៈពេល {0} ឆ្នាំ"},past:{other:"{0} ឆ្នាំមុន"}}},month:{displayName:"ខែ",relative:{0:"ខែនេះ",1:"ខែក្រោយ","-1":"ខែមុន"},relativeTime:{future:{other:"ក្នុងរយៈពេល {0} ខែ"},past:{other:"{0} ខែមុន"}}},day:{displayName:"ថ្ងៃ",relative:{0:"ថ្ងៃនេះ",1:"ថ្ងៃស្អែក",2:"ខានស្អែក","-1":"ម្សិលមិញ","-2":"ម្សិលម៉្ងៃ"},relativeTime:{future:{other:"ក្នុងរយៈពេល {0} ថ្ងៃ"},past:{other:"{0} ថ្ងៃមុន"}}},hour:{displayName:"ម៉ោង",relativeTime:{future:{other:"ក្នុងរយៈពេល {0} ម៉ោង"},past:{other:"{0} ម៉ោងមុន"}}},minute:{displayName:"នាទី",relativeTime:{future:{other:"ក្នុងរយៈពេល {0} នាទី"},past:{other:"{0} នាទីមុន"}}},second:{displayName:"វិនាទី",relative:{0:"ឥឡូវ"},relativeTime:{future:{other:"ក្នុងរយៈពេល {0} វិនាទី"},past:{other:"{0} វិនាទីមុន"}}}}}),ReactIntl.__addLocaleData({locale:"km-KH",parentLocale:"km"}),ReactIntl.__addLocaleData({locale:"kn",pluralRuleFunction:function(a,b){return b?"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"ವರ್ಷ",relative:{0:"ಈ ವರ್ಷ",1:"ಮುಂದಿನ ವರ್ಷ","-1":"ಕಳೆದ ವರ್ಷ"},relativeTime:{future:{one:"{0} ವರ್ಷದಲ್ಲಿ",other:"{0} ವರ್ಷಗಳಲ್ಲಿ"},past:{one:"{0} ವರ್ಷದ ಹಿಂದೆ",other:"{0} ವರ್ಷಗಳ ಹಿಂದೆ"}}},month:{displayName:"ತಿಂಗಳು",relative:{0:"ಈ ತಿಂಗಳು",1:"ಮುಂದಿನ ತಿಂಗಳು","-1":"ಕಳೆದ ತಿಂಗಳು"},relativeTime:{future:{one:"{0} ತಿಂಗಳಲ್ಲಿ",other:"{0} ತಿಂಗಳುಗಳಲ್ಲಿ"},past:{one:"{0} ತಿಂಗಳುಗಳ ಹಿಂದೆ",other:"{0} ತಿಂಗಳುಗಳ ಹಿಂದೆ"}}},day:{displayName:"ದಿನ",relative:{0:"ಇಂದು",1:"ನಾಳೆ",2:"ನಾಡಿದ್ದು","-1":"ನಿನ್ನೆ","-2":"ಮೊನ್ನೆ"},relativeTime:{future:{one:"{0} ದಿನದಲ್ಲಿ",other:"{0} ದಿನಗಳಲ್ಲಿ"},past:{one:"{0} ದಿನದ ಹಿಂದೆ",other:"{0} ದಿನಗಳ ಹಿಂದೆ"}}},hour:{displayName:"ಗಂಟೆ",relativeTime:{future:{one:"{0} ಗಂಟೆಯಲ್ಲಿ",other:"{0} ಗಂಟೆಗಳಲ್ಲಿ"},past:{one:"{0} ಗಂಟೆ ಹಿಂದೆ",other:"{0} ಗಂಟೆಗಳ ಹಿಂದೆ"}}},minute:{displayName:"ನಿಮಿಷ",relativeTime:{future:{one:"{0} ನಿಮಿಷದಲ್ಲಿ",other:"{0} ನಿಮಿಷಗಳಲ್ಲಿ"},past:{one:"{0} ನಿಮಿಷಗಳ ಹಿಂದೆ",other:"{0} ನಿಮಿಷಗಳ ಹಿಂದೆ"}}},second:{displayName:"ಸೆಕೆಂಡ್",relative:{0:"ಇದೀಗ"},relativeTime:{future:{one:"{0} ಸೆಕೆಂಡ್ನಲ್ಲಿ",other:"{0} ಸೆಕೆಂಡ್ಗಳಲ್ಲಿ"},past:{one:"{0} ಸೆಕೆಂಡ್ ಹಿಂದೆ",other:"{0} ಸೆಕೆಂಡುಗಳ ಹಿಂದೆ"}}}}}),ReactIntl.__addLocaleData({locale:"kn-IN",parentLocale:"kn"}),ReactIntl.__addLocaleData({locale:"ko",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"년",relative:{0:"올해",1:"내년","-1":"작년"},relativeTime:{future:{other:"{0}년 후"},past:{other:"{0}년 전"}}},month:{displayName:"월",relative:{0:"이번 달",1:"다음 달","-1":"지난달"},relativeTime:{future:{other:"{0}개월 후"},past:{other:"{0}개월 전"}}},day:{displayName:"일",relative:{0:"오늘",1:"내일",2:"모레","-1":"어제","-2":"그저께"},relativeTime:{future:{other:"{0}일 후"},past:{other:"{0}일 전"}}},hour:{displayName:"시",relativeTime:{future:{other:"{0}시간 후"},past:{other:"{0}시간 전"}}},minute:{displayName:"분",relativeTime:{future:{other:"{0}분 후"},past:{other:"{0}분 전"}}},second:{displayName:"초",relative:{0:"지금"},relativeTime:{future:{other:"{0}초 후"},past:{other:"{0}초 전"}}}}}),ReactIntl.__addLocaleData({locale:"ko-KP",parentLocale:"ko"}),ReactIntl.__addLocaleData({locale:"ko-KR",parentLocale:"ko"}),ReactIntl.__addLocaleData({locale:"kok",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kok-IN",parentLocale:"kok"}),ReactIntl.__addLocaleData({locale:"ks",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ؤری",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"رٮ۪تھ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"دۄہ",relative:{0:"اَز",1:"پگاہ","-1":"راتھ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"گٲنٛٹہٕ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"مِنَٹ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"سٮ۪کَنڑ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ks-Arab",parentLocale:"ks"}),ReactIntl.__addLocaleData({locale:"ks-Arab-IN",parentLocale:"ks-Arab"}),ReactIntl.__addLocaleData({locale:"ksb",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Ng’waka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ng’ezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Siku",relative:{0:"Evi eo",1:"Keloi","-1":"Ghuo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ksb-TZ",parentLocale:"ksb"}),ReactIntl.__addLocaleData({locale:"ksf",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Bǝk",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ŋwíí",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ŋwós",relative:{0:"Gɛ́ɛnǝ",1:"Ridúrǝ́","-1":"Rinkɔɔ́"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Cámɛɛn",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Mǝnít",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Háu",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ksf-CM",parentLocale:"ksf"}),ReactIntl.__addLocaleData({locale:"ksh",pluralRuleFunction:function(a,b){return b?"other":0==a?"zero":1==a?"one":"other"},fields:{year:{displayName:"Johr",relative:{0:"diese Johr",1:"nächste Johr","-1":"läz Johr"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mohnd",relative:{0:"diese Mohnd",1:"nächste Mohnd","-1":"lätzde Mohnd"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Daach",relative:{0:"hück",1:"morje",2:"övvermorje","-1":"jestere","-2":"vörjestere"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Schtund",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Menutt",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekond",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ksh-DE",parentLocale:"ksh"}),ReactIntl.__addLocaleData({locale:"ku",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kw",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Bledhen",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mis",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Dedh",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Eur",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"kw-GB",parentLocale:"kw"}),ReactIntl.__addLocaleData({locale:"ky",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"жыл",relative:{0:"быйыл",1:"эмдиги жылы","-1":"былтыр"},relativeTime:{future:{one:"{0} жылдан кийин",other:"{0} жылдан кийин"},past:{one:"{0} жыл мурун",other:"{0} жыл мурун"}}},month:{displayName:"ай",relative:{0:"бул айда",1:"эмдиги айда","-1":"өткөн айда"},relativeTime:{future:{one:"{0} айдан кийин",other:"{0} айдан кийин"},past:{one:"{0} ай мурун",other:"{0} ай мурун"}}},day:{displayName:"күн",relative:{0:"бүгүн",1:"эртеӊ",2:"бүрсүгүнү","-1":"кечээ","-2":"мурдагы күнү"},relativeTime:{future:{one:"{0} күндөн кийин",other:"{0} күндөн кийин"},past:{one:"{0} күн мурун",other:"{0} күн мурун"}}},hour:{displayName:"саат",relativeTime:{future:{one:"{0} сааттан кийин",other:"{0} сааттан кийин"},past:{one:"{0} саат мурун",other:"{0} саат мурун"}}},minute:{displayName:"мүнөт",relativeTime:{future:{one:"{0} мүнөттөн кийин",other:"{0} мүнөттөн кийин"},past:{one:"{0} мүнөт мурун",other:"{0} мүнөт мурун"}}},second:{displayName:"секунд",relative:{0:"азыр"},relativeTime:{future:{one:"{0} секунддан кийин",other:"{0} секунддан кийин"},past:{one:"{0} секунд мурун",other:"{0} секунд мурун"}}}}}),ReactIntl.__addLocaleData({locale:"ky-Cyrl",parentLocale:"ky"}),ReactIntl.__addLocaleData({locale:"ky-Cyrl-KG",parentLocale:"ky-Cyrl"}),ReactIntl.__addLocaleData({locale:"lag",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0];return b?"other":0==a?"zero":0!=d&&1!=d||0==a?"other":"one"},fields:{year:{displayName:"Mwaáka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweéri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Sikʉ",relative:{0:"Isikʉ",1:"Lamʉtoondo","-1":"Niijo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Sáa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakíka",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekúunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"lag-TZ",parentLocale:"lag"}),ReactIntl.__addLocaleData({locale:"lb",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Joer",relative:{0:"dëst Joer",1:"nächst Joer","-1":"lescht Joer"},relativeTime:{future:{one:"an {0} Joer",other:"a(n) {0} Joer"},past:{one:"virun {0} Joer",other:"viru(n) {0} Joer"}}},month:{displayName:"Mount",relative:{0:"dëse Mount",1:"nächste Mount","-1":"leschte Mount"},relativeTime:{future:{one:"an {0} Mount",other:"a(n) {0} Méint"},past:{one:"virun {0} Mount",other:"viru(n) {0} Méint"}}},day:{displayName:"Dag",relative:{0:"haut",1:"muer","-1":"gëschter"},relativeTime:{future:{one:"an {0} Dag",other:"a(n) {0} Deeg"},past:{one:"virun {0} Dag",other:"viru(n) {0} Deeg"}}},hour:{displayName:"Stonn",relativeTime:{future:{one:"an {0} Stonn",other:"a(n) {0} Stonnen"},past:{one:"virun {0} Stonn",other:"viru(n) {0} Stonnen"}}},minute:{displayName:"Minutt",relativeTime:{future:{one:"an {0} Minutt",other:"a(n) {0} Minutten"},past:{one:"virun {0} Minutt",other:"viru(n) {0} Minutten"}}},second:{displayName:"Sekonn",relative:{0:"now"},relativeTime:{future:{one:"an {0} Sekonn",other:"a(n) {0} Sekonnen"},past:{one:"virun {0} Sekonn",other:"viru(n) {0} Sekonnen"}}}}}),ReactIntl.__addLocaleData({locale:"lb-LU",parentLocale:"lb"}),ReactIntl.__addLocaleData({locale:"lg",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Lunaku",relative:{0:"Lwaleero",1:"Nkya","-1":"Ggulo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saawa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Kasikonda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"lg-UG",parentLocale:"lg"}),ReactIntl.__addLocaleData({locale:"lkt",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Ómakȟa",relative:{0:"Lé ómakȟa kiŋ",1:"Tȟokáta ómakȟa kiŋháŋ","-1":"Ómakȟa kʼuŋ héhaŋ"},relativeTime:{future:{other:"Letáŋhaŋ ómakȟa {0} kiŋháŋ"},past:{other:"Hékta ómakȟa {0} kʼuŋ héhaŋ"}}},month:{displayName:"Wí",relative:{0:"Lé wí kiŋ",1:"Wí kiŋháŋ","-1":"Wí kʼuŋ héhaŋ"},relativeTime:{future:{other:"Letáŋhaŋ wíyawapi {0} kiŋháŋ"},past:{other:"Hékta wíyawapi {0} kʼuŋ héhaŋ"}}},day:{displayName:"Aŋpétu",relative:{0:"Lé aŋpétu kiŋ",1:"Híŋhaŋni kiŋháŋ","-1":"Lé aŋpétu kiŋ"},relativeTime:{future:{other:"Letáŋhaŋ {0}-čháŋ kiŋháŋ"},past:{other:"Hékta {0}-čháŋ k’uŋ héhaŋ"}}},hour:{displayName:"Owápȟe",relativeTime:{future:{other:"Letáŋhaŋ owápȟe {0} kiŋháŋ"},past:{other:"Hékta owápȟe {0} kʼuŋ héhaŋ"}}},minute:{displayName:"Owápȟe oȟʼáŋkȟo",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Okpí",relative:{0:"now"},relativeTime:{future:{other:"Letáŋhaŋ okpí {0} kiŋháŋ"},past:{other:"Hékta okpí {0} k’uŋ héhaŋ"}}}}}),ReactIntl.__addLocaleData({locale:"lkt-US",parentLocale:"lkt"}),ReactIntl.__addLocaleData({locale:"ln",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Mobú",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Sánzá",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mokɔlɔ",relative:{0:"Lɛlɔ́",1:"Lóbi ekoyâ","-1":"Lóbi elékí"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ngonga",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Monúti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sɛkɔ́ndɛ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ln-AO",parentLocale:"ln"}),ReactIntl.__addLocaleData({locale:"ln-CD",parentLocale:"ln"}),ReactIntl.__addLocaleData({locale:"ln-CF",parentLocale:"ln"}),ReactIntl.__addLocaleData({locale:"ln-CG",parentLocale:"ln"}),ReactIntl.__addLocaleData({locale:"lo",pluralRuleFunction:function(a,b){return b&&1==a?"one":"other"},fields:{year:{displayName:"ປີ",relative:{0:"ປີນີ້",1:"ປີໜ້າ","-1":"ປີກາຍ"},relativeTime:{future:{other:"ໃນອີກ {0} ປີ"},past:{other:"{0} ປີກ່ອນ"}}},month:{displayName:"ເດືອນ",relative:{0:"ເດືອນນີ້",1:"ເດືອນໜ້າ","-1":"ເດືອນແລ້ວ"},relativeTime:{future:{other:"ໃນອີກ {0} ເດືອນ"},past:{other:"{0} ເດືອນກ່ອນ"}}},day:{displayName:"ມື້",relative:{0:"ມື້ນີ້",1:"ມື້ອື່ນ",2:"ມື້ຮື","-1":"ມື້ວານ","-2":"ມື້ກ່ອນ"},relativeTime:{future:{other:"ໃນອີກ {0} ມື້"},past:{other:"{0} ມື້ກ່ອນ"}}},hour:{displayName:"ຊົ່ວໂມງ",relativeTime:{future:{other:"ໃນອີກ {0} ຊົ່ວໂມງ"},past:{other:"{0} ຊົ່ວໂມງກ່ອນ"}}},minute:{displayName:"ນາທີ",relativeTime:{future:{other:"{0} ໃນອີກ 0 ນາທີ"},past:{other:"{0} ນາທີກ່ອນ"}}},second:{displayName:"ວິນາທີ",relative:{0:"ຕອນນີ້"},relativeTime:{future:{other:"ໃນອີກ {0} ວິນາທີ"},past:{other:"{0} ວິນາທີກ່ອນ"}}}}}),ReactIntl.__addLocaleData({locale:"lo-LA",parentLocale:"lo"}),ReactIntl.__addLocaleData({locale:"lt",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[1]||"",e=Number(c[0])==a,f=e&&c[0].slice(-1),g=e&&c[0].slice(-2);return b?"other":1==f&&(11>g||g>19)?"one":f>=2&&9>=f&&(11>g||g>19)?"few":0!=d?"many":"other"},fields:{year:{displayName:"Metai",relative:{0:"šiais metais",1:"kitais metais","-1":"praėjusiais metais"},relativeTime:{future:{one:"po {0} metų",few:"po {0} metų",many:"po {0} metų",other:"po {0} metų"},past:{one:"prieš {0} metus",few:"prieš {0} metus",many:"prieš {0} metų",other:"prieš {0} metų"}}},month:{displayName:"Mėnuo",relative:{0:"šį mėnesį",1:"kitą mėnesį","-1":"praėjusį mėnesį"},relativeTime:{future:{one:"po {0} mėnesio",few:"po {0} mėnesių",many:"po {0} mėnesio",other:"po {0} mėnesių"},past:{one:"prieš {0} mėnesį",few:"prieš {0} mėnesius",many:"prieš {0} mėnesio",other:"prieš {0} mėnesių"}}},day:{displayName:"Diena",relative:{0:"šiandien",1:"rytoj",2:"poryt","-1":"vakar","-2":"užvakar"},relativeTime:{future:{one:"po {0} dienos",few:"po {0} dienų",many:"po {0} dienos",other:"po {0} dienų"},past:{one:"prieš {0} dieną",few:"prieš {0} dienas",many:"prieš {0} dienos",other:"prieš {0} dienų"}}},hour:{displayName:"Valanda",relativeTime:{future:{one:"po {0} valandos",few:"po {0} valandų",many:"po {0} valandos",other:"po {0} valandų"},past:{one:"prieš {0} valandą",few:"prieš {0} valandas",many:"prieš {0} valandos",other:"prieš {0} valandų"}}},minute:{displayName:"Minutė",relativeTime:{future:{one:"po {0} minutės",few:"po {0} minučių",many:"po {0} minutės",other:"po {0} minučių"},past:{one:"prieš {0} minutę",few:"prieš {0} minutes",many:"prieš {0} minutės",other:"prieš {0} minučių"}}},second:{displayName:"Sekundė",relative:{0:"dabar"},relativeTime:{future:{one:"po {0} sekundės",few:"po {0} sekundžių",many:"po {0} sekundės",other:"po {0} sekundžių"},past:{one:"prieš {0} sekundę",few:"prieš {0} sekundes",many:"prieš {0} sekundės",other:"prieš {0} sekundžių"}}}}}),ReactIntl.__addLocaleData({locale:"lt-LT",parentLocale:"lt"}),ReactIntl.__addLocaleData({locale:"lu",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Tshidimu",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ngondo",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Dituku",relative:{0:"Lelu",1:"Malaba","-1":"Makelela"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Diba",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Kasunsu",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Kasunsukusu",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"lu-CD",parentLocale:"lu"}),ReactIntl.__addLocaleData({locale:"luo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"higa",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"dwe",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"chieng’",relative:{0:"kawuono",1:"kiny","-1":"nyoro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"nyiriri mar saa",relative:{0:"now"},relativeTime:{
future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"luo-KE",parentLocale:"luo"}),ReactIntl.__addLocaleData({locale:"luy",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Muhiga",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ridiku",relative:{0:"Lero",1:"Mgamba","-1":"Mgorova"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Isaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Idagika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"luy-KE",parentLocale:"luy"}),ReactIntl.__addLocaleData({locale:"lv",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[1]||"",e=d.length,f=Number(c[0])==a,g=f&&c[0].slice(-1),h=f&&c[0].slice(-2),i=d.slice(-2),j=d.slice(-1);return b?"other":f&&0==g||h>=11&&19>=h||2==e&&i>=11&&19>=i?"zero":1==g&&11!=h||2==e&&1==j&&11!=i||2!=e&&1==j?"one":"other"},fields:{year:{displayName:"Gads",relative:{0:"šajā gadā",1:"nākamajā gadā","-1":"pagājušajā gadā"},relativeTime:{future:{zero:"pēc {0} gadiem",one:"pēc {0} gada",other:"pēc {0} gadiem"},past:{zero:"pirms {0} gadiem",one:"pirms {0} gada",other:"pirms {0} gadiem"}}},month:{displayName:"Mēnesis",relative:{0:"šajā mēnesī",1:"nākamajā mēnesī","-1":"pagājušajā mēnesī"},relativeTime:{future:{zero:"pēc {0} mēnešiem",one:"pēc {0} mēneša",other:"pēc {0} mēnešiem"},past:{zero:"pirms {0} mēnešiem",one:"pirms {0} mēneša",other:"pirms {0} mēnešiem"}}},day:{displayName:"diena",relative:{0:"šodien",1:"rīt",2:"parīt","-1":"vakar","-2":"aizvakar"},relativeTime:{future:{zero:"pēc {0} dienām",one:"pēc {0} dienas",other:"pēc {0} dienām"},past:{zero:"pirms {0} dienām",one:"pirms {0} dienas",other:"pirms {0} dienām"}}},hour:{displayName:"Stundas",relativeTime:{future:{zero:"pēc {0} stundām",one:"pēc {0} stundas",other:"pēc {0} stundām"},past:{zero:"pirms {0} stundām",one:"pirms {0} stundas",other:"pirms {0} stundām"}}},minute:{displayName:"Minūtes",relativeTime:{future:{zero:"pēc {0} minūtēm",one:"pēc {0} minūtes",other:"pēc {0} minūtēm"},past:{zero:"pirms {0} minūtēm",one:"pirms {0} minūtes",other:"pirms {0} minūtēm"}}},second:{displayName:"Sekundes",relative:{0:"tagad"},relativeTime:{future:{zero:"pēc {0} sekundēm",one:"pēc {0} sekundes",other:"pēc {0} sekundēm"},past:{zero:"pirms {0} sekundēm",one:"pirms {0} sekundes",other:"pirms {0} sekundēm"}}}}}),ReactIntl.__addLocaleData({locale:"lv-LV",parentLocale:"lv"}),ReactIntl.__addLocaleData({locale:"mas",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Ɔlárì",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ɔlápà",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ɛnkɔlɔ́ŋ",relative:{0:"Táatá",1:"Tááisérè","-1":"Ŋolé"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ɛ́sáâ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Oldákikaè",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mas-KE",parentLocale:"mas"}),ReactIntl.__addLocaleData({locale:"mas-TZ",parentLocale:"mas"}),ReactIntl.__addLocaleData({locale:"mer",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ntukũ",relative:{0:"Narua",1:"Rũjũ","-1":"Ĩgoro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ĩthaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ndagika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mer-KE",parentLocale:"mer"}),ReactIntl.__addLocaleData({locale:"mfe",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Lane",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwa",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Zour",relative:{0:"Zordi",1:"Demin","-1":"Yer"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ler",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minit",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Segonn",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mfe-MU",parentLocale:"mfe"}),ReactIntl.__addLocaleData({locale:"mg",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Taona",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Volana",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Andro",relative:{0:"Anio",1:"Rahampitso","-1":"Omaly"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ora",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minitra",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Segondra",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mg-MG",parentLocale:"mg"}),ReactIntl.__addLocaleData({locale:"mgh",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"yaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"nihuku",relative:{0:"lel’lo",1:"me’llo","-1":"n’chana"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"isaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"idakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"isekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mgh-MZ",parentLocale:"mgh"}),ReactIntl.__addLocaleData({locale:"mgo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"fituʼ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"iməg",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"+{0} m",other:"+{0} m"},past:{one:"-{0} m",other:"-{0} m"}}},day:{displayName:"anəg",relative:{0:"tèchɔ̀ŋ",1:"isu",2:"isu ywi","-1":"ikwiri"},relativeTime:{future:{one:"+{0} d",other:"+{0} d"},past:{one:"-{0} d",other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"+{0} h",other:"+{0} h"},past:{one:"-{0} h",other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"+{0} min",other:"+{0} min"},past:{one:"-{0} min",other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"+{0} s",other:"+{0} s"},past:{one:"-{0} s",other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mgo-CM",parentLocale:"mgo"}),ReactIntl.__addLocaleData({locale:"mk",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=d.slice(-2),i=e.slice(-1);return b?1==g&&11!=h?"one":2==g&&12!=h?"two":7!=g&&8!=g||17==h||18==h?"other":"many":f&&1==g||1==i?"one":"other"},fields:{year:{displayName:"година",relative:{0:"оваа година",1:"следната година","-1":"минатата година"},relativeTime:{future:{one:"за {0} година",other:"за {0} години"},past:{one:"пред {0} година",other:"пред {0} години"}}},month:{displayName:"Месец",relative:{0:"овој месец",1:"следниот месец","-1":"минатиот месец"},relativeTime:{future:{one:"за {0} месец",other:"за {0} месеци"},past:{one:"пред {0} месец",other:"пред {0} месеци"}}},day:{displayName:"ден",relative:{0:"денес",1:"утре",2:"задутре","-1":"вчера","-2":"завчера"},relativeTime:{future:{one:"за {0} ден",other:"за {0} дена"},past:{one:"пред {0} ден",other:"пред {0} дена"}}},hour:{displayName:"Час",relativeTime:{future:{one:"за {0} час",other:"за {0} часа"},past:{one:"пред {0} час",other:"пред {0} часа"}}},minute:{displayName:"Минута",relativeTime:{future:{one:"за {0} минута",other:"за {0} минути"},past:{one:"пред {0} минута",other:"пред {0} минути"}}},second:{displayName:"Секунда",relative:{0:"сега"},relativeTime:{future:{one:"за {0} секунда",other:"за {0} секунди"},past:{one:"пред {0} секунда",other:"пред {0} секунди"}}}}}),ReactIntl.__addLocaleData({locale:"mk-MK",parentLocale:"mk"}),ReactIntl.__addLocaleData({locale:"ml",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"വർഷം",relative:{0:"ഈ വർഷം",1:"അടുത്തവർഷം","-1":"കഴിഞ്ഞ വർഷം"},relativeTime:{future:{one:"{0} വർഷത്തിൽ",other:"{0} വർഷത്തിൽ"},past:{one:"{0} വർഷം മുമ്പ്",other:"{0} വർഷം മുമ്പ്"}}},month:{displayName:"മാസം",relative:{0:"ഈ മാസം",1:"അടുത്ത മാസം","-1":"കഴിഞ്ഞ മാസം"},relativeTime:{future:{one:"{0} മാസത്തിൽ",other:"{0} മാസത്തിൽ"},past:{one:"{0} മാസം മുമ്പ്",other:"{0} മാസം മുമ്പ്"}}},day:{displayName:"ദിവസം",relative:{0:"ഇന്ന്",1:"നാളെ",2:"മറ്റന്നാൾ","-1":"ഇന്നലെ","-2":"മിനിഞ്ഞാന്ന്"},relativeTime:{future:{one:"{0} ദിവസത്തിൽ",other:"{0} ദിവസത്തിൽ"},past:{one:"{0} ദിവസം മുമ്പ്",other:"{0} ദിവസം മുമ്പ്"}}},hour:{displayName:"മണിക്കൂർ",relativeTime:{future:{one:"{0} മണിക്കൂറിൽ",other:"{0} മണിക്കൂറിൽ"},past:{one:"{0} മണിക്കൂർ മുമ്പ്",other:"{0} മണിക്കൂർ മുമ്പ്"}}},minute:{displayName:"മിനിട്ട്",relativeTime:{future:{one:"{0} മിനിറ്റിൽ",other:"{0} മിനിറ്റിൽ"},past:{one:"{0} മിനിറ്റ് മുമ്പ്",other:"{0} മിനിറ്റ് മുമ്പ്"}}},second:{displayName:"സെക്കൻറ്",relative:{0:"ഇപ്പോൾ"},relativeTime:{future:{one:"{0} സെക്കൻഡിൽ",other:"{0} സെക്കൻഡിൽ"},past:{one:"{0} സെക്കൻഡ് മുമ്പ്",other:"{0} സെക്കൻഡ് മുമ്പ്"}}}}}),ReactIntl.__addLocaleData({locale:"ml-IN",parentLocale:"ml"}),ReactIntl.__addLocaleData({locale:"mn",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Жил",relative:{0:"энэ жил",1:"ирэх жил","-1":"өнгөрсөн жил"},relativeTime:{future:{one:"{0} жилийн дараа",other:"{0} жилийн дараа"},past:{one:"{0} жилийн өмнө",other:"{0} жилийн өмнө"}}},month:{displayName:"Сар",relative:{0:"энэ сар",1:"ирэх сар","-1":"өнгөрсөн сар"},relativeTime:{future:{one:"{0} сарын дараа",other:"{0} сарын дараа"},past:{one:"{0} сарын өмнө",other:"{0} сарын өмнө"}}},day:{displayName:"Өдөр",relative:{0:"өнөөдөр",1:"маргааш",2:"нөгөөдөр","-1":"өчигдөр","-2":"уржигдар"},relativeTime:{future:{one:"{0} өдрийн дараа",other:"{0} өдрийн дараа"},past:{one:"{0} өдрийн өмнө",other:"{0} өдрийн өмнө"}}},hour:{displayName:"Цаг",relativeTime:{future:{one:"{0} цагийн дараа",other:"{0} цагийн дараа"},past:{one:"{0} цагийн өмнө",other:"{0} цагийн өмнө"}}},minute:{displayName:"Минут",relativeTime:{future:{one:"{0} минутын дараа",other:"{0} минутын дараа"},past:{one:"{0} минутын өмнө",other:"{0} минутын өмнө"}}},second:{displayName:"Секунд",relative:{0:"Одоо"},relativeTime:{future:{one:"{0} секундын дараа",other:"{0} секундын дараа"},past:{one:"{0} секундын өмнө",other:"{0} секундын өмнө"}}}}}),ReactIntl.__addLocaleData({locale:"mn-Cyrl",parentLocale:"mn"}),ReactIntl.__addLocaleData({locale:"mn-Cyrl-MN",parentLocale:"mn-Cyrl"}),ReactIntl.__addLocaleData({locale:"mn-Mong",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mo",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-2);return b?1==a?"one":"other":1==a&&d?"one":!d||0==a||1!=a&&f>=1&&19>=f?"few":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mr",pluralRuleFunction:function(a,b){return b?1==a?"one":2==a||3==a?"two":4==a?"few":"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"वर्ष",relative:{0:"हे वर्ष",1:"पुढील वर्ष","-1":"मागील वर्ष"},relativeTime:{future:{one:"{0} वर्षामध्ये",other:"{0} वर्षांमध्ये"},past:{one:"{0} वर्षापूर्वी",other:"{0} वर्षांपूर्वी"}}},month:{displayName:"महिना",relative:{0:"हा महिना",1:"पुढील महिना","-1":"मागील महिना"},relativeTime:{future:{one:"{0} महिन्यामध्ये",other:"{0} महिन्यांमध्ये"},past:{one:"{0} महिन्यापूर्वी",other:"{0} महिन्यांपूर्वी"}}},day:{displayName:"दिवस",relative:{0:"आज",1:"उद्या","-1":"काल"},relativeTime:{future:{one:"{0} दिवसामध्ये",other:"{0} दिवसांमध्ये"},past:{one:"{0} दिवसापूर्वी",other:"{0} दिवसांपूर्वी"}}},hour:{displayName:"तास",relativeTime:{future:{one:"{0} तासामध्ये",other:"{0} तासांमध्ये"},past:{one:"{0} तासापूर्वी",other:"{0} तासांपूर्वी"}}},minute:{displayName:"मिनिट",relativeTime:{future:{one:"{0} मिनिटामध्ये",other:"{0} मिनिटांमध्ये"},past:{one:"{0} मिनिटापूर्वी",other:"{0} मिनिटांपूर्वी"}}},second:{displayName:"सेकंद",relative:{0:"आत्ता"},relativeTime:{future:{one:"{0} सेकंदामध्ये",other:"{0} सेकंदांमध्ये"},past:{one:"{0} सेकंदापूर्वी",other:"{0} सेकंदांपूर्वी"}}}}}),ReactIntl.__addLocaleData({locale:"mr-IN",parentLocale:"mr"}),ReactIntl.__addLocaleData({locale:"ms",pluralRuleFunction:function(a,b){return b&&1==a?"one":"other"},fields:{year:{displayName:"Tahun",relative:{0:"tahun ini",1:"tahun depan","-1":"tahun lepas"},relativeTime:{future:{other:"dalam {0} saat"},past:{other:"{0} tahun lalu"}}},month:{displayName:"Bulan",relative:{0:"bulan ini",1:"bulan depan","-1":"bulan lalu"},relativeTime:{future:{other:"dalam {0} bulan"},past:{other:"{0} bulan lalu"}}},day:{displayName:"Hari",relative:{0:"hari ini",1:"esok",2:"lusa","-1":"semalam","-2":"kelmarin"},relativeTime:{future:{other:"dalam {0} hari"},past:{other:"{0} hari lalu"}}},hour:{displayName:"Jam",relativeTime:{future:{other:"dalam {0} jam"},past:{other:"{0} jam yang lalu"}}},minute:{displayName:"Minit",relativeTime:{future:{other:"dalam {0} minit"},past:{other:"{0} minit yang lalu"}}},second:{displayName:"Saat",relative:{0:"sekarang"},relativeTime:{future:{other:"dalam {0} saat"},past:{other:"{0} saat lalu"}}}}}),ReactIntl.__addLocaleData({locale:"ms-Arab",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ms-Latn",parentLocale:"ms"}),ReactIntl.__addLocaleData({locale:"ms-Latn-BN",parentLocale:"ms-Latn"}),ReactIntl.__addLocaleData({locale:"ms-Latn-MY",parentLocale:"ms-Latn"}),ReactIntl.__addLocaleData({locale:"ms-Latn-SG",parentLocale:"ms-Latn"}),ReactIntl.__addLocaleData({locale:"mt",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a,e=d&&c[0].slice(-2);return b?"other":1==a?"one":0==a||e>=2&&10>=e?"few":e>=11&&19>=e?"many":"other"},fields:{year:{displayName:"Sena",relative:{0:"Din is-sena",1:"Is-sena d-dieħla","-1":"Is-sena li għaddiet"},relativeTime:{future:{other:"+{0} y"},past:{one:"{0} sena ilu",few:"{0} snin ilu",many:"{0} snin ilu",other:"{0} snin ilu"}}},month:{displayName:"Xahar",relative:{0:"Dan ix-xahar",1:"Ix-xahar id-dieħel","-1":"Ix-xahar li għadda"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Jum",relative:{0:"Illum",1:"Għada","-1":"Ilbieraħ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Siegħa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minuta",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekonda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mt-MT",parentLocale:"mt"}),ReactIntl.__addLocaleData({locale:"mua",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Syii",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Fĩi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Zah’nane/ Comme",relative:{0:"Tǝ’nahko",1:"Tǝ’nane","-1":"Tǝsoo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Cok comme",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Cok comme ma laŋne",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Cok comme ma laŋ tǝ biŋ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"mua-CM",parentLocale:"mua"}),ReactIntl.__addLocaleData({locale:"my",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"နှစ်",relative:{0:"ယခုနှစ်",1:"နောက်နှစ်","-1":"ယမန်နှစ်"},relativeTime:{future:{other:"{0}နှစ်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}နှစ်"}}},month:{displayName:"လ",relative:{0:"ယခုလ",1:"နောက်လ","-1":"ယမန်လ"},relativeTime:{future:{other:"{0}လအတွင်း"},past:{other:"လွန်ခဲ့သော{0}လ"}}},day:{displayName:"ရက်",relative:{0:"ယနေ့",1:"မနက်ဖြန်",2:"သဘက်ခါ","-1":"မနေ့က","-2":"တနေ့က"},relativeTime:{future:{other:"{0}ရက်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}ရက်"}}},hour:{displayName:"နာရီ",relativeTime:{future:{other:"{0}နာရီအတွင်း"},past:{other:"လွန်ခဲ့သော{0}နာရီ"}}},minute:{displayName:"မိနစ်",relativeTime:{future:{other:"{0}မိနစ်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}မိနစ်"}}},second:{displayName:"စက္ကန့်",relative:{0:"ယခု"},relativeTime:{future:{other:"{0}စက္ကန့်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}စက္ကန့်"}}}}}),ReactIntl.__addLocaleData({locale:"my-MM",parentLocale:"my"}),ReactIntl.__addLocaleData({locale:"nah",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"naq",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Kurib",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ǁKhâb",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Tsees",relative:{0:"Neetsee",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Iiri",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Haib",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ǀGâub",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"naq-NA",parentLocale:"naq"}),ReactIntl.__addLocaleData({locale:"nb",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"År",relative:{0:"i år",1:"neste år","-1":"i fjor"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"for {0} år siden",other:"for {0} år siden"}}},month:{displayName:"Måned",relative:{0:"denne måneden",1:"neste måned","-1":"forrige måned"},relativeTime:{future:{one:"om {0} måned",other:"om {0} måneder"},past:{one:"for {0} måned siden",other:"for {0} måneder siden"}}},day:{displayName:"Dag",relative:{0:"i dag",1:"i morgen",2:"i overmorgen","-1":"i går","-2":"i forgårs"},relativeTime:{future:{one:"om {0} døgn",other:"om {0} døgn"},past:{one:"for {0} døgn siden",other:"for {0} døgn siden"}}},hour:{displayName:"Time",relativeTime:{future:{one:"om {0} time",other:"om {0} timer"},past:{one:"for {0} time siden",other:"for {0} timer siden"}}},minute:{displayName:"Minutt",relativeTime:{future:{one:"om {0} minutt",other:"om {0} minutter"},past:{one:"for {0} minutt siden",other:"for {0} minutter siden"}}},second:{displayName:"Sekund",relative:{0:"nå"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"for {0} sekund siden",other:"for {0} sekunder siden"}}}}}),ReactIntl.__addLocaleData({locale:"nb-NO",parentLocale:"nb"}),ReactIntl.__addLocaleData({locale:"nb-SJ",parentLocale:"nb"}),ReactIntl.__addLocaleData({locale:"nd",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Umnyaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Inyangacale",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ilanga",relative:{0:"Lamuhla",1:"Kusasa","-1":"Izolo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ihola",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Umuzuzu",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Isekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nd-ZW",parentLocale:"nd"}),ReactIntl.__addLocaleData({locale:"ne",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a;return b?d&&a>=1&&4>=a?"one":"other":1==a?"one":"other"},fields:{year:{displayName:"बर्ष",relative:{0:"यो वर्ष",1:"अर्को वर्ष","-1":"पहिलो वर्ष"},relativeTime:{future:{one:"{0} वर्षमा",other:"{0} वर्षमा"},past:{one:"{0} वर्ष अघि",other:"{0} वर्ष अघि"}}},month:{displayName:"महिना",relative:{0:"यो महिना",1:"अर्को महिना","-1":"गएको महिना"},relativeTime:{future:{one:"{0} महिनामा",other:"{0} महिनामा"},past:{one:"{0} महिना पहिले",other:"{0} महिना पहिले"}}},day:{displayName:"बार",relative:{0:"आज",1:"भोली","-1":"हिजो","-2":"अस्ति"},relativeTime:{future:{one:"{0} दिनमा",other:"{0} दिनमा"},past:{one:"{0} दिन पहिले",other:"{0} दिन पहिले"}}},hour:{displayName:"घण्टा",relativeTime:{future:{one:"{0} घण्टामा",other:"{0} घण्टामा"},past:{one:"{0} घण्टा पहिले",other:"{0} घण्टा पहिले"}}},minute:{displayName:"मिनेट",relativeTime:{future:{one:"{0} मिनेटमा",other:"{0} मिनेटमा"},past:{one:"{0} मिनेट पहिले",other:"{0} मिनेट पहिले"}}},second:{displayName:"दोस्रो",relative:{0:"अब"},relativeTime:{future:{one:"{0} सेकेण्डमा",other:"{0} सेकेण्डमा"},past:{one:"{0} सेकेण्ड पहिले",other:"{0} सेकेण्ड पहिले"}}}}}),ReactIntl.__addLocaleData({locale:"ne-IN",parentLocale:"ne",fields:{year:{displayName:"वर्ष",relative:{0:"यो वर्ष",1:"अर्को वर्ष","-1":"पहिलो वर्ष"},relativeTime:{future:{one:"{0} वर्षमा",other:"{0} वर्षमा"},past:{one:"{0} वर्ष अघि",other:"{0} वर्ष अघि"}}},month:{displayName:"महिना",relative:{0:"यो महिना",1:"अर्को महिना","-1":"गएको महिना"},relativeTime:{future:{one:"{0} महिनामा",other:"{0} महिनामा"},past:{one:"{0} महिना पहिले",other:"{0} महिना पहिले"}}},day:{displayName:"वार",relative:{0:"आज",1:"भोली",2:"पर्सि","-1":"हिजो","-2":"अस्ति"},relativeTime:{future:{one:"{0} दिनमा",other:"{0} दिनमा"},past:{one:"{0} दिन पहिले",other:"{0} दिन पहिले"}}},hour:{displayName:"घण्टा",relativeTime:{future:{one:"{0} घण्टामा",other:"{0} घण्टामा"},past:{one:"{0} घण्टा पहिले",other:"{0} घण्टा पहिले"}}},minute:{displayName:"मिनेट",relativeTime:{future:{one:"{0} मिनेटमा",other:"{0} मिनेटमा"},past:{one:"{0} मिनेट पहिले",other:"{0} मिनेट पहिले"}}},second:{displayName:"सेकेन्ड",relative:{0:"अब"},relativeTime:{future:{one:"{0} सेकेण्डमा",other:"{0} सेकेण्डमा"},past:{one:"{0} सेकेण्ड पहिले",other:"{0} सेकेण्ड पहिले"}}}}}),ReactIntl.__addLocaleData({locale:"ne-NP",parentLocale:"ne"}),ReactIntl.__addLocaleData({locale:"nl",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Jaar",relative:{0:"dit jaar",1:"volgend jaar","-1":"vorig jaar"},relativeTime:{future:{one:"over {0} jaar",other:"over {0} jaar"},past:{one:"{0} jaar geleden",other:"{0} jaar geleden"}}},month:{displayName:"Maand",relative:{0:"deze maand",1:"volgende maand","-1":"vorige maand"},relativeTime:{future:{one:"over {0} maand",other:"over {0} maanden"},past:{one:"{0} maand geleden",other:"{0} maanden geleden"}}},day:{displayName:"Dag",relative:{0:"vandaag",1:"morgen",2:"overmorgen","-1":"gisteren","-2":"eergisteren"},relativeTime:{future:{one:"over {0} dag",other:"over {0} dagen"},past:{one:"{0} dag geleden",other:"{0} dagen geleden"}}},hour:{displayName:"Uur",relativeTime:{future:{one:"over {0} uur",other:"over {0} uur"},past:{one:"{0} uur geleden",other:"{0} uur geleden"}}},minute:{displayName:"Minuut",relativeTime:{future:{one:"over {0} minuut",other:"over {0} minuten"},past:{one:"{0} minuut geleden",other:"{0} minuten geleden"}}},second:{displayName:"Seconde",relative:{0:"nu"},relativeTime:{future:{one:"over {0} seconde",other:"over {0} seconden"},past:{one:"{0} seconde geleden",other:"{0} seconden geleden"}}}}}),ReactIntl.__addLocaleData({locale:"nl-AW",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nl-BE",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nl-BQ",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nl-CW",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nl-NL",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nl-SR",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nl-SX",parentLocale:"nl"}),ReactIntl.__addLocaleData({locale:"nmg",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mbvu",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ngwɛn",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Duö",relative:{0:"Dɔl",1:"Namáná","-1":"Nakugú"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Wulā",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Mpálâ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Nyiɛl",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nmg-CM",parentLocale:"nmg"}),ReactIntl.__addLocaleData({locale:"nn",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"år",relative:{0:"dette år",1:"neste år","-1":"i fjor"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"for {0} år siden",other:"for {0} år siden"}}},month:{displayName:"månad",relative:{0:"denne månad",1:"neste månad","-1":"forrige månad"},relativeTime:{future:{one:"om {0} måned",other:"om {0} måneder"},past:{one:"for {0} måned siden",other:"for {0} måneder siden"}}},day:{displayName:"dag",relative:{0:"i dag",1:"i morgon",2:"i overmorgon","-1":"i går","-2":"i forgårs"},relativeTime:{future:{one:"om {0} døgn",other:"om {0} døgn"},past:{one:"for {0} døgn siden",other:"for {0} døgn siden"}}},hour:{displayName:"time",relativeTime:{future:{one:"om {0} time",other:"om {0} timer"},past:{one:"for {0} time siden",other:"for {0} timer siden"}}},minute:{displayName:"minutt",relativeTime:{future:{one:"om {0} minutt",other:"om {0} minutter"},past:{one:"for {0} minutt siden",other:"for {0} minutter siden"}}},second:{displayName:"sekund",relative:{0:"now"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"for {0} sekund siden",other:"for {0} sekunder siden"}}}}}),ReactIntl.__addLocaleData({locale:"nn-NO",parentLocale:"nn"}),ReactIntl.__addLocaleData({locale:"nnh",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ngùʼ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"lyɛ̌ʼ",relative:{0:"lyɛ̌ʼɔɔn",1:"jǔɔ gẅie à ne ntóo","-1":"jǔɔ gẅie à ka tɔ̌g"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"fʉ̀ʼ nèm",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nnh-CM",parentLocale:"nnh"}),ReactIntl.__addLocaleData({
locale:"no",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nqo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nr",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nr-ZA",parentLocale:"nr"}),ReactIntl.__addLocaleData({locale:"nso",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nso-ZA",parentLocale:"nso"}),ReactIntl.__addLocaleData({locale:"nus",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Ruɔ̱n",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Pay",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Cäŋ",relative:{0:"Walɛ",1:"Ruun","-1":"Pan"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Thaak",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minit",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Thɛkɛni",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nus-SD",parentLocale:"nus"}),ReactIntl.__addLocaleData({locale:"ny",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nyn",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Omwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Eizooba",relative:{0:"Erizooba",1:"Nyenkyakare","-1":"Nyomwabazyo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Shaaha",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Edakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Obucweka/Esekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"nyn-UG",parentLocale:"nyn"}),ReactIntl.__addLocaleData({locale:"om",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"om-ET",parentLocale:"om"}),ReactIntl.__addLocaleData({locale:"om-KE",parentLocale:"om"}),ReactIntl.__addLocaleData({locale:"or",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"or-IN",parentLocale:"or"}),ReactIntl.__addLocaleData({locale:"os",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Аз",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Мӕй",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Бон",relative:{0:"Абон",1:"Сом",2:"Иннӕбон","-1":"Знон","-2":"Ӕндӕрӕбон"},relativeTime:{future:{one:"{0} боны фӕстӕ",other:"{0} боны фӕстӕ"},past:{one:"{0} бон раздӕр",other:"{0} боны размӕ"}}},hour:{displayName:"Сахат",relativeTime:{future:{one:"{0} сахаты фӕстӕ",other:"{0} сахаты фӕстӕ"},past:{one:"{0} сахаты размӕ",other:"{0} сахаты размӕ"}}},minute:{displayName:"Минут",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Секунд",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"os-GE",parentLocale:"os"}),ReactIntl.__addLocaleData({locale:"os-RU",parentLocale:"os"}),ReactIntl.__addLocaleData({locale:"pa",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"ਸਾਲ",relative:{0:"ਇਹ ਸਾਲ",1:"ਅਗਲਾ ਸਾਲ","-1":"ਪਿਛਲਾ ਸਾਲ"},relativeTime:{future:{one:"{0} ਸਾਲ ਵਿੱਚ",other:"{0} ਸਾਲਾਂ ਵਿੱਚ"},past:{one:"{0} ਸਾਲ ਪਹਿਲਾਂ",other:"{0} ਸਾਲ ਪਹਿਲਾਂ"}}},month:{displayName:"ਮਹੀਨਾ",relative:{0:"ਇਹ ਮਹੀਨਾ",1:"ਅਗਲਾ ਮਹੀਨਾ","-1":"ਪਿਛਲਾ ਮਹੀਨਾ"},relativeTime:{future:{one:"{0} ਮਹੀਨੇ ਵਿੱਚ",other:"{0} ਮਹੀਨਿਆਂ ਵਿੱਚ"},past:{one:"{0} ਮਹੀਨੇ ਪਹਿਲਾਂ",other:"{0} ਮਹੀਨੇ ਪਹਿਲਾਂ"}}},day:{displayName:"ਦਿਨ",relative:{0:"ਅੱਜ",1:"ਭਲਕੇ","-1":"ਬੀਤਿਆ ਕੱਲ੍ਹ"},relativeTime:{future:{one:"{0} ਦਿਨ ਵਿੱਚ",other:"{0} ਦਿਨਾਂ ਵਿੱਚ"},past:{one:"{0} ਦਿਨ ਪਹਿਲਾਂ",other:"{0} ਦਿਨ ਪਹਿਲਾਂ"}}},hour:{displayName:"ਘੰਟਾ",relativeTime:{future:{one:"{0} ਘੰਟੇ ਵਿੱਚ",other:"{0} ਘੰਟਿਆਂ ਵਿੱਚ"},past:{one:"{0} ਘੰਟਾ ਪਹਿਲਾਂ",other:"{0} ਘੰਟੇ ਪਹਿਲਾਂ"}}},minute:{displayName:"ਮਿੰਟ",relativeTime:{future:{one:"{0} ਮਿੰਟ ਵਿੱਚ",other:"{0} ਮਿੰਟਾਂ ਵਿੱਚ"},past:{one:"{0} ਮਿੰਟ ਪਹਿਲਾਂ",other:"{0} ਮਿੰਟ ਪਹਿਲਾਂ"}}},second:{displayName:"ਸਕਿੰਟ",relative:{0:"ਹੁਣ"},relativeTime:{future:{one:"{0} ਸਕਿੰਟ ਵਿੱਚ",other:"{0} ਸਕਿੰਟਾਂ ਵਿੱਚ"},past:{one:"{0} ਸਕਿੰਟ ਪਹਿਲਾਂ",other:"{0} ਸਕਿੰਟ ਪਹਿਲਾਂ"}}}}}),ReactIntl.__addLocaleData({locale:"pa-Arab",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ورھا",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"مہينا",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"دئن",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"گھنٹا",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"منٹ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"pa-Arab-PK",parentLocale:"pa-Arab"}),ReactIntl.__addLocaleData({locale:"pa-Guru",parentLocale:"pa"}),ReactIntl.__addLocaleData({locale:"pa-Guru-IN",parentLocale:"pa-Guru"}),ReactIntl.__addLocaleData({locale:"pap",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"pl",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=d.slice(-1),g=d.slice(-2);return b?"other":1==a&&e?"one":e&&f>=2&&4>=f&&(12>g||g>14)?"few":e&&1!=d&&(0==f||1==f)||e&&f>=5&&9>=f||e&&g>=12&&14>=g?"many":"other"},fields:{year:{displayName:"rok",relative:{0:"w tym roku",1:"w przyszłym roku","-1":"w zeszłym roku"},relativeTime:{future:{one:"za {0} rok",few:"za {0} lata",many:"za {0} lat",other:"za {0} roku"},past:{one:"{0} rok temu",few:"{0} lata temu",many:"{0} lat temu",other:"{0} roku temu"}}},month:{displayName:"miesiąc",relative:{0:"w tym miesiącu",1:"w przyszłym miesiącu","-1":"w zeszłym miesiącu"},relativeTime:{future:{one:"za {0} miesiąc",few:"za {0} miesiące",many:"za {0} miesięcy",other:"za {0} miesiąca"},past:{one:"{0} miesiąc temu",few:"{0} miesiące temu",many:"{0} miesięcy temu",other:"{0} miesiąca temu"}}},day:{displayName:"dzień",relative:{0:"dzisiaj",1:"jutro",2:"pojutrze","-1":"wczoraj","-2":"przedwczoraj"},relativeTime:{future:{one:"za {0} dzień",few:"za {0} dni",many:"za {0} dni",other:"za {0} dnia"},past:{one:"{0} dzień temu",few:"{0} dni temu",many:"{0} dni temu",other:"{0} dnia temu"}}},hour:{displayName:"godzina",relativeTime:{future:{one:"za {0} godzinę",few:"za {0} godziny",many:"za {0} godzin",other:"za {0} godziny"},past:{one:"{0} godzinę temu",few:"{0} godziny temu",many:"{0} godzin temu",other:"{0} godziny temu"}}},minute:{displayName:"minuta",relativeTime:{future:{one:"za {0} minutę",few:"za {0} minuty",many:"za {0} minut",other:"za {0} minuty"},past:{one:"{0} minutę temu",few:"{0} minuty temu",many:"{0} minut temu",other:"{0} minuty temu"}}},second:{displayName:"sekunda",relative:{0:"teraz"},relativeTime:{future:{one:"za {0} sekundę",few:"za {0} sekundy",many:"za {0} sekund",other:"za {0} sekundy"},past:{one:"{0} sekundę temu",few:"{0} sekundy temu",many:"{0} sekund temu",other:"{0} sekundy temu"}}}}}),ReactIntl.__addLocaleData({locale:"pl-PL",parentLocale:"pl"}),ReactIntl.__addLocaleData({locale:"prg",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[1]||"",e=d.length,f=Number(c[0])==a,g=f&&c[0].slice(-1),h=f&&c[0].slice(-2),i=d.slice(-2),j=d.slice(-1);return b?"other":f&&0==g||h>=11&&19>=h||2==e&&i>=11&&19>=i?"zero":1==g&&11!=h||2==e&&1==j&&11!=i||2!=e&&1==j?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ps",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ps-AF",parentLocale:"ps"}),ReactIntl.__addLocaleData({locale:"pt",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a;return b?"other":d&&a>=0&&2>=a&&2!=a?"one":"other"},fields:{year:{displayName:"Ano",relative:{0:"este ano",1:"próximo ano","-1":"ano passado"},relativeTime:{future:{one:"Dentro de {0} ano",other:"Dentro de {0} anos"},past:{one:"Há {0} ano",other:"Há {0} anos"}}},month:{displayName:"Mês",relative:{0:"este mês",1:"próximo mês","-1":"mês passado"},relativeTime:{future:{one:"Dentro de {0} mês",other:"Dentro de {0} meses"},past:{one:"Há {0} mês",other:"Há {0} meses"}}},day:{displayName:"Dia",relative:{0:"hoje",1:"amanhã",2:"depois de amanhã","-1":"ontem","-2":"anteontem"},relativeTime:{future:{one:"Dentro de {0} dia",other:"Dentro de {0} dias"},past:{one:"Há {0} dia",other:"Há {0} dias"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"Dentro de {0} hora",other:"Dentro de {0} horas"},past:{one:"Há {0} hora",other:"Há {0} horas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"Dentro de {0} minuto",other:"Dentro de {0} minutos"},past:{one:"Há {0} minuto",other:"Há {0} minutos"}}},second:{displayName:"Segundo",relative:{0:"agora"},relativeTime:{future:{one:"Dentro de {0} segundo",other:"Dentro de {0} segundos"},past:{one:"Há {0} segundo",other:"Há {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"pt-AO",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"pt-PT",parentLocale:"pt",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Ano",relative:{0:"este ano",1:"próximo ano","-1":"ano passado"},relativeTime:{future:{one:"dentro de {0} ano",other:"dentro de {0} anos"},past:{one:"há {0} ano",other:"há {0} anos"}}},month:{displayName:"Mês",relative:{0:"este mês",1:"próximo mês","-1":"mês passado"},relativeTime:{future:{one:"dentro de {0} mês",other:"dentro de {0} meses"},past:{one:"há {0} mês",other:"há {0} meses"}}},day:{displayName:"Dia",relative:{0:"hoje",1:"amanhã",2:"depois de amanhã","-1":"ontem","-2":"anteontem"},relativeTime:{future:{one:"dentro de {0} dia",other:"dentro de {0} dias"},past:{one:"há {0} dia",other:"há {0} dias"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"dentro de {0} hora",other:"dentro de {0} horas"},past:{one:"há {0} hora",other:"há {0} horas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"dentro de {0} minuto",other:"dentro de {0} minutos"},past:{one:"há {0} minuto",other:"há {0} minutos"}}},second:{displayName:"Segundo",relative:{0:"agora"},relativeTime:{future:{one:"dentro de {0} segundo",other:"dentro de {0} segundos"},past:{one:"há {0} segundo",other:"há {0} segundos"}}}}}),ReactIntl.__addLocaleData({locale:"pt-BR",parentLocale:"pt"}),ReactIntl.__addLocaleData({locale:"pt-CV",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"pt-GW",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"pt-MO",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"pt-MZ",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"pt-ST",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"pt-TL",parentLocale:"pt-PT"}),ReactIntl.__addLocaleData({locale:"qu",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"qu-BO",parentLocale:"qu"}),ReactIntl.__addLocaleData({locale:"qu-EC",parentLocale:"qu"}),ReactIntl.__addLocaleData({locale:"qu-PE",parentLocale:"qu"}),ReactIntl.__addLocaleData({locale:"rm",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"onn",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"mais",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Tag",relative:{0:"oz",1:"damaun",2:"puschmaun","-1":"ier","-2":"stersas"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ura",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"minuta",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"secunda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"rm-CH",parentLocale:"rm"}),ReactIntl.__addLocaleData({locale:"rn",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Umwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ukwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Umusi",relative:{0:"Uyu musi",1:"Ejo (hazoza)","-1":"Ejo (haheze)"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Isaha",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Umunota",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Isegonda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"rn-BI",parentLocale:"rn"}),ReactIntl.__addLocaleData({locale:"ro",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-2);return b?1==a?"one":"other":1==a&&d?"one":!d||0==a||1!=a&&f>=1&&19>=f?"few":"other"},fields:{year:{displayName:"An",relative:{0:"anul acesta",1:"anul viitor","-1":"anul trecut"},relativeTime:{future:{one:"peste {0} an",few:"peste {0} ani",other:"peste {0} de ani"},past:{one:"acum {0} an",few:"acum {0} ani",other:"acum {0} de ani"}}},month:{displayName:"Lună",relative:{0:"luna aceasta",1:"luna viitoare","-1":"luna trecută"},relativeTime:{future:{one:"peste {0} lună",few:"peste {0} luni",other:"peste {0} de luni"},past:{one:"acum {0} lună",few:"acum {0} luni",other:"acum {0} de luni"}}},day:{displayName:"Zi",relative:{0:"azi",1:"mâine",2:"poimâine","-1":"ieri","-2":"alaltăieri"},relativeTime:{future:{one:"peste {0} zi",few:"peste {0} zile",other:"peste {0} de zile"},past:{one:"acum {0} zi",few:"acum {0} zile",other:"acum {0} de zile"}}},hour:{displayName:"Oră",relativeTime:{future:{one:"peste {0} oră",few:"peste {0} ore",other:"peste {0} de ore"},past:{one:"acum {0} oră",few:"acum {0} ore",other:"acum {0} de ore"}}},minute:{displayName:"Minut",relativeTime:{future:{one:"peste {0} minut",few:"peste {0} minute",other:"peste {0} de minute"},past:{one:"acum {0} minut",few:"acum {0} minute",other:"acum {0} de minute"}}},second:{displayName:"Secundă",relative:{0:"acum"},relativeTime:{future:{one:"peste {0} secundă",few:"peste {0} secunde",other:"peste {0} de secunde"},past:{one:"acum {0} secundă",few:"acum {0} secunde",other:"acum {0} de secunde"}}}}}),ReactIntl.__addLocaleData({locale:"ro-MD",parentLocale:"ro"}),ReactIntl.__addLocaleData({locale:"ro-RO",parentLocale:"ro"}),ReactIntl.__addLocaleData({locale:"rof",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Muaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mfiri",relative:{0:"Linu",1:"Ng’ama","-1":"Hiyo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Isaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"rof-TZ",parentLocale:"rof"}),ReactIntl.__addLocaleData({locale:"ru",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=d.slice(-1),g=d.slice(-2);return b?"other":e&&1==f&&11!=g?"one":e&&f>=2&&4>=f&&(12>g||g>14)?"few":e&&0==f||e&&f>=5&&9>=f||e&&g>=11&&14>=g?"many":"other"},fields:{year:{displayName:"Год",relative:{0:"в этому году",1:"в следующем году","-1":"в прошлом году"},relativeTime:{future:{one:"через {0} год",few:"через {0} года",many:"через {0} лет",other:"через {0} года"},past:{one:"{0} год назад",few:"{0} года назад",many:"{0} лет назад",other:"{0} года назад"}}},month:{displayName:"Месяц",relative:{0:"в этом месяце",1:"в следующем месяце","-1":"в прошлом месяце"},relativeTime:{future:{one:"через {0} месяц",few:"через {0} месяца",many:"через {0} месяцев",other:"через {0} месяца"},past:{one:"{0} месяц назад",few:"{0} месяца назад",many:"{0} месяцев назад",other:"{0} месяца назад"}}},day:{displayName:"День",relative:{0:"сегодня",1:"завтра",2:"послезавтра","-1":"вчера","-2":"позавчера"},relativeTime:{future:{one:"через {0} день",few:"через {0} дня",many:"через {0} дней",other:"через {0} дней"},past:{one:"{0} день назад",few:"{0} дня назад",many:"{0} дней назад",other:"{0} дня назад"}}},hour:{displayName:"Час",relativeTime:{future:{one:"через {0} час",few:"через {0} часа",many:"через {0} часов",other:"через {0} часа"},past:{one:"{0} час назад",few:"{0} часа назад",many:"{0} часов назад",other:"{0} часа назад"}}},minute:{displayName:"Минута",relativeTime:{future:{one:"через {0} минуту",few:"через {0} минуты",many:"через {0} минут",other:"через {0} минуты"},past:{one:"{0} минуту назад",few:"{0} минуты назад",many:"{0} минут назад",other:"{0} минуты назад"}}},second:{displayName:"Секунда",relative:{0:"сейчас"},relativeTime:{future:{one:"через {0} секунду",few:"через {0} секунды",many:"через {0} секунд",other:"через {0} секунды"},past:{one:"{0} секунду назад",few:"{0} секунды назад",many:"{0} секунд назад",other:"{0} секунды назад"}}}}}),ReactIntl.__addLocaleData({locale:"ru-BY",parentLocale:"ru"}),ReactIntl.__addLocaleData({locale:"ru-KG",parentLocale:"ru"}),ReactIntl.__addLocaleData({locale:"ru-KZ",parentLocale:"ru"}),ReactIntl.__addLocaleData({locale:"ru-MD",parentLocale:"ru"}),ReactIntl.__addLocaleData({locale:"ru-RU",parentLocale:"ru"}),ReactIntl.__addLocaleData({locale:"ru-UA",parentLocale:"ru"}),ReactIntl.__addLocaleData({locale:"rw",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"rw-RW",parentLocale:"rw"}),ReactIntl.__addLocaleData({locale:"rwk",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Maka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mfiri",relative:{0:"Inu",1:"Ngama","-1":"Ukou"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakyika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"rwk-TZ",parentLocale:"rwk"}),ReactIntl.__addLocaleData({locale:"sah",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Сыл",relative:{0:"бу сыл",1:"кэлэр сыл","-1":"ааспыт сыл"},relativeTime:{future:{other:"{0} сылынан"},past:{other:"{0} сыл ынараа өттүгэр"}}},month:{displayName:"Ый",relative:{0:"бу ый",1:"аныгыскы ый","-1":"ааспыт ый"},relativeTime:{future:{other:"{0} ыйынан"},past:{other:"{0} ый ынараа өттүгэр"}}},day:{displayName:"Күн",relative:{0:"Бүгүн",1:"Сарсын",2:"Өйүүн","-1":"Бэҕэһээ","-2":"Иллэрээ күн"},relativeTime:{future:{other:"{0} күнүнэн"},past:{other:"{0} күн ынараа өттүгэр"}}},hour:{displayName:"Чаас",relativeTime:{future:{other:"{0} чааһынан"},past:{other:"{0} чаас ынараа өттүгэр"}}},minute:{displayName:"Мүнүүтэ",relativeTime:{future:{other:"{0} мүнүүтэннэн"},past:{other:"{0} мүнүүтэ ынараа өттүгэр"}}},second:{displayName:"Сөкүүндэ",relative:{0:"now"},relativeTime:{future:{other:"{0} сөкүүндэннэн"},past:{other:"{0} сөкүүндэ ынараа өттүгэр"}}}}}),ReactIntl.__addLocaleData({locale:"sah-RU",parentLocale:"sah"}),ReactIntl.__addLocaleData({locale:"saq",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Lari",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Lapa",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mpari",relative:{0:"Duo",1:"Taisere","-1":"Ng’ole"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saai",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Idakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Isekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"saq-KE",parentLocale:"saq"}),ReactIntl.__addLocaleData({locale:"sbp",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwakha",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwesi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Lusiku",relative:{0:"Ineng’uni",1:"Pamulaawu","-1":"Imehe"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ilisala",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Idakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Isekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"sbp-TZ",parentLocale:"sbp"}),ReactIntl.__addLocaleData({locale:"se",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"jáhki",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"{0} jahki maŋŋilit",two:"{0} jahkki maŋŋilit",other:"{0} jahkki maŋŋilit"},past:{one:"{0} jahki árat",two:"{0} jahkki árat",other:"{0} jahkki árat"}}},month:{displayName:"mánnu",
relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"{0} mánotbadji maŋŋilit",two:"{0} mánotbadji maŋŋilit",other:"{0} mánotbadji maŋŋilit"},past:{one:"{0} mánotbadji árat",two:"{0} mánotbadji árat",other:"{0} mánotbadji árat"}}},day:{displayName:"beaivi",relative:{0:"odne",1:"ihttin",2:"paijeelittáá","-1":"ikte","-2":"oovdebpeivvi"},relativeTime:{future:{one:"{0} jándor maŋŋilit",two:"{0} jándor amaŋŋilit",other:"{0} jándora maŋŋilit"},past:{one:"{0} jándor árat",two:"{0} jándora árat",other:"{0} jándora árat"}}},hour:{displayName:"diibmu",relativeTime:{future:{one:"{0} diibmu maŋŋilit",two:"{0} diibmur maŋŋilit",other:"{0} diibmur maŋŋilit"},past:{one:"{0} diibmu árat",two:"{0} diibmur árat",other:"{0} diibmur árat"}}},minute:{displayName:"minuhtta",relativeTime:{future:{one:"{0} minuhta maŋŋilit",two:"{0} minuhtta maŋŋilit",other:"{0} minuhtta maŋŋilit"},past:{one:"{0} minuhta árat",two:"{0} minuhtta árat",other:"{0} minuhtta árat"}}},second:{displayName:"sekunda",relative:{0:"now"},relativeTime:{future:{one:"{0} sekunda maŋŋilit",two:"{0} sekundda maŋŋilit",other:"{0} sekundda maŋŋilit"},past:{one:"{0} sekunda árat",two:"{0} sekundda árat",other:"{0} sekundda árat"}}}}}),ReactIntl.__addLocaleData({locale:"se-FI",parentLocale:"se",fields:{year:{displayName:"jahki",relative:{0:"dán jagi",1:"boahtte jagi","-1":"mannan jagi"},relativeTime:{future:{one:"{0} jagi siste",two:"{0} jagi siste",other:"{0} jagi siste"},past:{one:"{0} jagi árat",two:"{0} jagi árat",other:"{0} jagi árat"}}},month:{displayName:"mánnu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"{0} mánotbadji maŋŋilit",two:"{0} mánotbadji maŋŋilit",other:"{0} mánotbadji maŋŋilit"},past:{one:"{0} mánotbadji árat",two:"{0} mánotbadji árat",other:"{0} mánotbadji árat"}}},day:{displayName:"beaivi",relative:{0:"odne",1:"ihttin",2:"paijeelittáá","-1":"ikte","-2":"oovdebpeivvi"},relativeTime:{future:{one:"{0} jándor maŋŋilit",two:"{0} jándor amaŋŋilit",other:"{0} jándora maŋŋilit"},past:{one:"{0} jándor árat",two:"{0} jándora árat",other:"{0} jándora árat"}}},hour:{displayName:"diibmu",relativeTime:{future:{one:"{0} diibmu maŋŋilit",two:"{0} diibmur maŋŋilit",other:"{0} diibmur maŋŋilit"},past:{one:"{0} diibmu árat",two:"{0} diibmur árat",other:"{0} diibmur árat"}}},minute:{displayName:"minuhtta",relativeTime:{future:{one:"{0} minuhta maŋŋilit",two:"{0} minuhtta maŋŋilit",other:"{0} minuhtta maŋŋilit"},past:{one:"{0} minuhta árat",two:"{0} minuhtta árat",other:"{0} minuhtta árat"}}},second:{displayName:"sekunda",relative:{0:"now"},relativeTime:{future:{one:"{0} sekunda maŋŋilit",two:"{0} sekundda maŋŋilit",other:"{0} sekundda maŋŋilit"},past:{one:"{0} sekunda árat",two:"{0} sekundda árat",other:"{0} sekundda árat"}}}}}),ReactIntl.__addLocaleData({locale:"se-NO",parentLocale:"se"}),ReactIntl.__addLocaleData({locale:"se-SE",parentLocale:"se"}),ReactIntl.__addLocaleData({locale:"seh",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Chaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ntsiku",relative:{0:"Lero",1:"Manguana","-1":"Zuro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hora",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minuto",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Segundo",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"seh-MZ",parentLocale:"seh"}),ReactIntl.__addLocaleData({locale:"ses",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Jiiri",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Handu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Zaari",relative:{0:"Hõo",1:"Suba","-1":"Bi"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Guuru",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Miti",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ses-ML",parentLocale:"ses"}),ReactIntl.__addLocaleData({locale:"sg",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Ngû",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Nze",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Lâ",relative:{0:"Lâsô",1:"Kêkerêke","-1":"Bîrï"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Ngbonga",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ndurü ngbonga",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Nzîna ngbonga",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"sg-CF",parentLocale:"sg"}),ReactIntl.__addLocaleData({locale:"sh",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=d.slice(-2),i=e.slice(-1),j=e.slice(-2);return b?"other":f&&1==g&&11!=h||1==i&&11!=j?"one":f&&g>=2&&4>=g&&(12>h||h>14)||i>=2&&4>=i&&(12>j||j>14)?"few":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"shi",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a;return b?"other":a>=0&&1>=a?"one":d&&a>=2&&10>=a?"few":"other"},fields:{year:{displayName:"ⴰⵙⴳⴳⵯⴰⵙ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ⴰⵢⵢⵓⵔ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ⴰⵙⵙ",relative:{0:"ⴰⵙⵙⴰ",1:"ⴰⵙⴽⴽⴰ","-1":"ⵉⴹⵍⵍⵉ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ⵜⴰⵙⵔⴰⴳⵜ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ⵜⵓⵙⴷⵉⴷⵜ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ⵜⴰⵙⵉⵏⵜ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"shi-Latn",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"asggʷas",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ayyur",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ass",relative:{0:"assa",1:"askka","-1":"iḍlli"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"tasragt",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"tusdidt",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"tasint",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"shi-Latn-MA",parentLocale:"shi-Latn"}),ReactIntl.__addLocaleData({locale:"shi-Tfng",parentLocale:"shi"}),ReactIntl.__addLocaleData({locale:"shi-Tfng-MA",parentLocale:"shi-Tfng"}),ReactIntl.__addLocaleData({locale:"si",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"";return b?"other":0==a||1==a||0==d&&1==e?"one":"other"},fields:{year:{displayName:"වර්ෂය",relative:{0:"මෙම වසර",1:"ඊළඟ වසර","-1":"පසුගිය වසර"},relativeTime:{future:{one:"වසර {0} කින්",other:"වසර {0} කින්"},past:{one:"වසර {0}ට පෙර",other:"වසර {0}ට පෙර"}}},month:{displayName:"මාසය",relative:{0:"මෙම මාසය",1:"ඊළඟ මාසය","-1":"පසුගිය මාසය"},relativeTime:{future:{one:"මාස {0}කින්",other:"මාස {0}කින්"},past:{one:"මාස {0}කට පෙර",other:"මාස {0}කට පෙර"}}},day:{displayName:"දිනය",relative:{0:"අද",1:"හෙට",2:"අනිද්දා","-1":"ඊයේ","-2":"පෙරේදා"},relativeTime:{future:{one:"දින {0}න්",other:"දින {0}න්"},past:{one:"දින {0} ට පෙර",other:"දින {0} ට පෙර"}}},hour:{displayName:"පැය",relativeTime:{future:{one:"පැය {0} කින්",other:"පැය {0} කින්"},past:{one:"පැය {0}ට පෙර",other:"පැය {0}ට පෙර"}}},minute:{displayName:"මිනිත්තුව",relativeTime:{future:{one:"මිනිත්තු {0} කින්",other:"මිනිත්තු {0} කින්"},past:{one:"මිනිත්තු {0}ට පෙර",other:"මිනිත්තු {0}ට පෙර"}}},second:{displayName:"තත්පරය",relative:{0:"දැන්"},relativeTime:{future:{one:"තත්පර {0} කින්",other:"තත්පර {0} කින්"},past:{one:"තත්පර {0}කට පෙර",other:"තත්පර {0}කට පෙර"}}}}}),ReactIntl.__addLocaleData({locale:"si-LK",parentLocale:"si"}),ReactIntl.__addLocaleData({locale:"sk",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1];return b?"other":1==a&&e?"one":d>=2&&4>=d&&e?"few":e?"other":"many"},fields:{year:{displayName:"rok",relative:{0:"tento rok",1:"budúci rok","-1":"minulý rok"},relativeTime:{future:{one:"o {0} rok",few:"o {0} roky",many:"o {0} roka",other:"o {0} rokov"},past:{one:"pred {0} rokom",few:"pred {0} rokmi",many:"pred {0} rokom",other:"pred {0} rokmi"}}},month:{displayName:"mesiac",relative:{0:"tento mesiac",1:"budúci mesiac","-1":"minulý mesiac"},relativeTime:{future:{one:"o {0} mesiac",few:"o {0} mesiace",many:"o {0} mesiaca",other:"o {0} mesiacov"},past:{one:"pred {0} mesiacom",few:"pred {0} mesiacmi",many:"pred {0} mesiacom",other:"pred {0} mesiacmi"}}},day:{displayName:"deň",relative:{0:"dnes",1:"zajtra",2:"pozajtra","-1":"včera","-2":"predvčerom"},relativeTime:{future:{one:"o {0} deň",few:"o {0} dni",many:"o {0} dňa",other:"o {0} dní"},past:{one:"pred {0} dňom",few:"pred {0} dňami",many:"pred {0} dňom",other:"pred {0} dňami"}}},hour:{displayName:"hodina",relativeTime:{future:{one:"o {0} hodinu",few:"o {0} hodiny",many:"o {0} hodiny",other:"o {0} hodín"},past:{one:"pred {0} hodinou",few:"pred {0} hodinami",many:"pred {0} hodinou",other:"pred {0} hodinami"}}},minute:{displayName:"minúta",relativeTime:{future:{one:"o {0} minútu",few:"o {0} minúty",many:"o {0} minúty",other:"o {0} minút"},past:{one:"pred {0} minútou",few:"pred {0} minútami",many:"pred {0} minútou",other:"pred {0} minútami"}}},second:{displayName:"sekunda",relative:{0:"teraz"},relativeTime:{future:{one:"o {0} sekundu",few:"o {0} sekundy",many:"o {0} sekundy",other:"o {0} sekúnd"},past:{one:"pred {0} sekundou",few:"pred {0} sekundami",many:"Pred {0} sekundami",other:"pred {0} sekundami"}}}}}),ReactIntl.__addLocaleData({locale:"sk-SK",parentLocale:"sk"}),ReactIntl.__addLocaleData({locale:"sl",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=d.slice(-2);return b?"other":e&&1==f?"one":e&&2==f?"two":e&&(3==f||4==f)||!e?"few":"other"},fields:{year:{displayName:"Leto",relative:{0:"letos",1:"naslednje leto","-1":"lani"},relativeTime:{future:{one:"čez {0} leto",two:"čez {0} leti",few:"čez {0} leta",other:"čez {0} let"},past:{one:"pred {0} letom",two:"pred {0} letoma",few:"pred {0} leti",other:"pred {0} leti"}}},month:{displayName:"Mesec",relative:{0:"ta mesec",1:"naslednji mesec","-1":"prejšnji mesec"},relativeTime:{future:{one:"čez {0} mesec",two:"čez {0} meseca",few:"čez {0} mesece",other:"čez {0} mesecev"},past:{one:"pred {0} mesecem",two:"pred {0} mesecema",few:"pred {0} meseci",other:"pred {0} meseci"}}},day:{displayName:"Dan",relative:{0:"danes",1:"jutri",2:"pojutrišnjem","-1":"včeraj","-2":"predvčerajšnjim"},relativeTime:{future:{one:"čez {0} dan",two:"čez {0} dneva",few:"čez {0} dni",other:"čez {0} dni"},past:{one:"pred {0} dnevom",two:"pred {0} dnevoma",few:"pred {0} dnevi",other:"pred {0} dnevi"}}},hour:{displayName:"Ura",relativeTime:{future:{one:"čez {0} h",two:"čez {0} h",few:"čez {0} h",other:"čez {0} h"},past:{one:"pred {0} h",two:"pred {0} h",few:"pred {0} h",other:"pred {0} h"}}},minute:{displayName:"Minuta",relativeTime:{future:{one:"čez {0} min.",two:"čez {0} min.",few:"čez {0} min.",other:"čez {0} min."},past:{one:"pred {0} min.",two:"pred {0} min.",few:"pred {0} min.",other:"pred {0} min."}}},second:{displayName:"Sekunda",relative:{0:"zdaj"},relativeTime:{future:{one:"čez {0} sekundo",two:"čez {0} sekundi",few:"čez {0} sekunde",other:"čez {0} sekund"},past:{one:"pred {0} sekundo",two:"pred {0} sekundama",few:"pred {0} sekundami",other:"pred {0} sekundami"}}}}}),ReactIntl.__addLocaleData({locale:"sl-SI",parentLocale:"sl"}),ReactIntl.__addLocaleData({locale:"sma",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"smi",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"smj",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"smn",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"smn-FI",parentLocale:"smn"}),ReactIntl.__addLocaleData({locale:"sms",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":2==a?"two":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"sn",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Gore",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwedzi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Zuva",relative:{0:"Nhasi",1:"Mangwana","-1":"Nezuro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Awa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Mineti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"sn-ZW",parentLocale:"sn"}),ReactIntl.__addLocaleData({locale:"so",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Sanad",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Bil",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Maalin",relative:{0:"Maanta",1:"Berri","-1":"Shalay"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saacad",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Daqiiqad",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Il biriqsi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"so-DJ",parentLocale:"so"}),ReactIntl.__addLocaleData({locale:"so-ET",parentLocale:"so"}),ReactIntl.__addLocaleData({locale:"so-KE",parentLocale:"so"}),ReactIntl.__addLocaleData({locale:"so-SO",parentLocale:"so"}),ReactIntl.__addLocaleData({locale:"sq",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a,e=d&&c[0].slice(-1),f=d&&c[0].slice(-2);return b?1==a?"one":4==e&&14!=f?"many":"other":1==a?"one":"other"},fields:{year:{displayName:"vit",relative:{0:"këtë vit",1:"vitin e ardhshëm","-1":"vitin e kaluar"},relativeTime:{future:{one:"pas {0} viti",other:"pas {0} vjetësh"},past:{one:"para {0} viti",other:"para {0} vjetësh"}}},month:{displayName:"muaj",relative:{0:"këtë muaj",1:"muajin e ardhshëm","-1":"muajin e kaluar"},relativeTime:{future:{one:"pas {0} muaji",other:"pas {0} muajsh"},past:{one:"para {0} muaji",other:"para {0} muajsh"}}},day:{displayName:"ditë",relative:{0:"sot",1:"nesër","-1":"dje"},relativeTime:{future:{one:"pas {0} dite",other:"pas {0} ditësh"},past:{one:"para {0} dite",other:"para {0} ditësh"}}},hour:{displayName:"orë",relativeTime:{future:{one:"pas {0} ore",other:"pas {0} orësh"},past:{one:"para {0} ore",other:"para {0} orësh"}}},minute:{displayName:"minutë",relativeTime:{future:{one:"pas {0} minute",other:"pas {0} minutash"},past:{one:"para {0} minute",other:"para {0} minutash"}}},second:{displayName:"sekondë",relative:{0:"tani"},relativeTime:{future:{one:"pas {0} sekonde",other:"pas {0} sekondash"},past:{one:"para {0} sekonde",other:"para {0} sekondash"}}}}}),ReactIntl.__addLocaleData({locale:"sq-AL",parentLocale:"sq"}),ReactIntl.__addLocaleData({locale:"sq-MK",parentLocale:"sq"}),ReactIntl.__addLocaleData({locale:"sq-XK",parentLocale:"sq"}),ReactIntl.__addLocaleData({locale:"sr",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=d.slice(-2),i=e.slice(-1),j=e.slice(-2);return b?"other":f&&1==g&&11!=h||1==i&&11!=j?"one":f&&g>=2&&4>=g&&(12>h||h>14)||i>=2&&4>=i&&(12>j||j>14)?"few":"other"},fields:{year:{displayName:"година",relative:{0:"ове године",1:"следеће године","-1":"прошле године"},relativeTime:{future:{one:"за {0} годину",few:"за {0} године",other:"за {0} година"},past:{one:"пре {0} године",few:"пре {0} године",other:"пре {0} година"}}},month:{displayName:"месец",relative:{0:"овог месеца",1:"следећег месеца","-1":"прошлог месеца"},relativeTime:{future:{one:"за {0} месец",few:"за {0} месеца",other:"за {0} месеци"},past:{one:"пре {0} месеца",few:"пре {0} месеца",other:"пре {0} месеци"}}},day:{displayName:"дан",relative:{0:"данас",1:"сутра",2:"прекосутра","-1":"јуче","-2":"прекјуче"},relativeTime:{future:{one:"за {0} дан",few:"за {0} дана",other:"за {0} дана"},past:{one:"пре {0} дана",few:"пре {0} дана",other:"пре {0} дана"}}},hour:{displayName:"сат",relativeTime:{future:{one:"за {0} сат",few:"за {0} сата",other:"за {0} сати"},past:{one:"пре {0} сата",few:"пре {0} сата",other:"пре {0} сати"}}},minute:{displayName:"минут",relativeTime:{future:{one:"за {0} минут",few:"за {0} минута",other:"за {0} минута"},past:{one:"пре {0} минута",few:"пре {0} минута",other:"пре {0} минута"}}},second:{displayName:"секунд",relative:{0:"сада"},relativeTime:{future:{one:"за {0} секунду",few:"за {0} секунде",other:"за {0} секунди"},past:{one:"пре {0} секунде",few:"пре {0} секунде",other:"пре {0} секунди"}}}}}),ReactIntl.__addLocaleData({locale:"sr-Cyrl",parentLocale:"sr"}),ReactIntl.__addLocaleData({locale:"sr-Cyrl-BA",parentLocale:"sr-Cyrl"}),ReactIntl.__addLocaleData({locale:"sr-Cyrl-ME",parentLocale:"sr-Cyrl"}),ReactIntl.__addLocaleData({locale:"sr-Cyrl-RS",parentLocale:"sr-Cyrl"}),ReactIntl.__addLocaleData({locale:"sr-Cyrl-XK",parentLocale:"sr-Cyrl"}),ReactIntl.__addLocaleData({locale:"sr-Latn",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"godina",relative:{0:"ove godine",1:"sledeće godine","-1":"prošle godine"},relativeTime:{future:{one:"za {0} godinu",few:"za {0} godine",other:"za {0} godina"},past:{one:"pre {0} godine",few:"pre {0} godine",other:"pre {0} godina"}}},month:{displayName:"mesec",relative:{0:"ovog meseca",1:"sledećeg meseca","-1":"prošlog meseca"},relativeTime:{future:{one:"za {0} mesec",few:"za {0} meseca",other:"za {0} meseci"},past:{one:"pre {0} meseca",few:"pre {0} meseca",other:"pre {0} meseci"}}},day:{displayName:"dan",relative:{0:"danas",1:"sutra",2:"prekosutra","-1":"juče","-2":"prekjuče"},relativeTime:{future:{one:"za {0} dan",few:"za {0} dana",other:"za {0} dana"},past:{one:"pre {0} dana",few:"pre {0} dana",other:"pre {0} dana"}}},hour:{displayName:"sat",relativeTime:{future:{one:"za {0} sat",few:"za {0} sata",other:"za {0} sati"},past:{one:"pre {0} sata",few:"pre {0} sata",other:"pre {0} sati"}}},minute:{displayName:"minut",relativeTime:{future:{one:"za {0} minut",few:"za {0} minuta",other:"za {0} minuta"},past:{one:"pre {0} minuta",few:"pre {0} minuta",other:"pre {0} minuta"}}},second:{displayName:"sekund",relative:{0:"sada"},relativeTime:{future:{one:"za {0} sekundu",few:"za {0} sekunde",other:"za {0} sekundi"},past:{one:"pre {0} sekunde",few:"pre {0} sekunde",other:"pre {0} sekundi"}}}}}),ReactIntl.__addLocaleData({locale:"sr-Latn-BA",parentLocale:"sr-Latn"}),ReactIntl.__addLocaleData({locale:"sr-Latn-ME",parentLocale:"sr-Latn"}),ReactIntl.__addLocaleData({locale:"sr-Latn-RS",parentLocale:"sr-Latn"}),ReactIntl.__addLocaleData({locale:"sr-Latn-XK",parentLocale:"sr-Latn"}),ReactIntl.__addLocaleData({locale:"ss",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ss-SZ",parentLocale:"ss"}),ReactIntl.__addLocaleData({locale:"ss-ZA",parentLocale:"ss"}),ReactIntl.__addLocaleData({locale:"ssy",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ssy-ER",parentLocale:"ssy"}),ReactIntl.__addLocaleData({locale:"st",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"sv",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1],e=Number(c[0])==a,f=e&&c[0].slice(-1),g=e&&c[0].slice(-2);return b?1!=f&&2!=f||11==g||12==g?"other":"one":1==a&&d?"one":"other"},fields:{year:{displayName:"År",relative:{0:"i år",1:"nästa år","-1":"i fjol"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"för {0} år sedan",other:"för {0} år sedan"}}},month:{displayName:"Månad",relative:{0:"denna månad",1:"nästa månad","-1":"förra månaden"},relativeTime:{future:{one:"om {0} månad",other:"om {0} månader"},past:{one:"för {0} månad sedan",other:"för {0} månader sedan"}}},day:{displayName:"Dag",relative:{0:"i dag",1:"i morgon",2:"i övermorgon","-1":"i går","-2":"i förrgår"},relativeTime:{future:{one:"om {0} dag",other:"om {0} dagar"},past:{one:"för {0} dag sedan",other:"för {0} dagar sedan"}}},hour:{displayName:"Timme",relativeTime:{future:{one:"om {0} timme",other:"om {0} timmar"},past:{one:"för {0} timme sedan",other:"för {0} timmar sedan"}}},minute:{displayName:"Minut",relativeTime:{future:{one:"om {0} minut",other:"om {0} minuter"},past:{one:"för {0} minut sedan",other:"för {0} minuter sedan"}}},second:{displayName:"Sekund",relative:{0:"nu"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"för {0} sekund sedan",other:"för {0} sekunder sedan"}}}}}),ReactIntl.__addLocaleData({locale:"sv-AX",parentLocale:"sv"}),ReactIntl.__addLocaleData({locale:"sv-FI",parentLocale:"sv",fields:{year:{displayName:"år",relative:{0:"i år",1:"nästa år","-1":"i fjol"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"för {0} år sedan",other:"för {0} år sedan"}}},month:{displayName:"månad",relative:{0:"denna månad",1:"nästa månad","-1":"förra månaden"},relativeTime:{future:{one:"om {0} månad",other:"om {0} månader"},past:{one:"för {0} månad sedan",other:"för {0} månader sedan"}}},day:{displayName:"dag",relative:{0:"i dag",1:"i morgon",2:"i övermorgon","-1":"i går","-2":"i förrgår"},relativeTime:{future:{one:"om {0} dag",other:"om {0} dagar"},past:{one:"för {0} dag sedan",other:"för {0} dagar sedan"}}},hour:{displayName:"Timme",relativeTime:{future:{one:"om {0} timme",other:"om {0} timmar"},past:{one:"för {0} timme sedan",other:"för {0} timmar sedan"}}},minute:{displayName:"minut",relativeTime:{future:{one:"om {0} minut",other:"om {0} minuter"},past:{one:"för {0} minut sedan",other:"för {0} minuter sedan"}}},second:{displayName:"sekund",relative:{0:"nu"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"för {0} sekund sedan",other:"för {0} sekunder sedan"}}}}}),ReactIntl.__addLocaleData({locale:"sv-SE",parentLocale:"sv"}),ReactIntl.__addLocaleData({locale:"sw",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"Mwaka",relative:{0:"mwaka huu",1:"mwaka ujao","-1":"mwaka uliopita"},relativeTime:{future:{one:"baada ya mwaka {0}",other:"baada ya miaka {0}"},past:{one:"mwaka {0} uliopita",other:"miaka {0} iliyopita"}}},month:{displayName:"Mwezi",relative:{0:"mwezi huu",1:"mwezi ujao","-1":"mwezi uliopita"},relativeTime:{future:{one:"baada ya mwezi {0}",other:"baada ya miezi {0}"},past:{one:"mwezi {0} uliopita",other:"miezi {0} iliyopita"}}},day:{displayName:"Siku",relative:{0:"leo",1:"kesho",2:"kesho kutwa","-1":"jana","-2":"juzi"},relativeTime:{future:{one:"baada ya siku {0}",other:"baada ya siku {0}"},past:{one:"siku {0} iliyopita",other:"siku {0} zilizopita"}}},hour:{displayName:"Saa",relativeTime:{future:{one:"baada ya saa {0}",other:"baada ya saa {0}"},past:{one:"saa {0} iliyopita",other:"saa {0} zilizopita"}}},minute:{displayName:"Dakika",relativeTime:{future:{one:"baada ya dakika {0}",other:"baada ya dakika {0}"},past:{one:"dakika {0} iliyopita",other:"dakika {0} zilizopita"}}},second:{displayName:"Sekunde",relative:{0:"sasa"},relativeTime:{future:{one:"baada ya sekunde {0}",other:"baada ya sekunde {0}"},past:{one:"Sekunde {0} iliyopita",other:"Sekunde {0} zilizopita"}}}}}),ReactIntl.__addLocaleData({locale:"sw-KE",parentLocale:"sw"}),ReactIntl.__addLocaleData({locale:"sw-TZ",parentLocale:"sw"}),ReactIntl.__addLocaleData({locale:"sw-UG",parentLocale:"sw"}),
ReactIntl.__addLocaleData({locale:"swc",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Siku",relative:{0:"Leo",1:"Kesho","-1":"Jana"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"swc-CD",parentLocale:"swc"}),ReactIntl.__addLocaleData({locale:"syr",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ta",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"ஆண்டு",relative:{0:"இந்த ஆண்டு",1:"அடுத்த ஆண்டு","-1":"கடந்த ஆண்டு"},relativeTime:{future:{one:"{0} ஆண்டில்",other:"{0} ஆண்டுகளில்"},past:{one:"{0} ஆண்டிற்கு முன்",other:"{0} ஆண்டுகளுக்கு முன்"}}},month:{displayName:"மாதம்",relative:{0:"இந்த மாதம்",1:"அடுத்த மாதம்","-1":"கடந்த மாதம்"},relativeTime:{future:{one:"{0} மாதத்தில்",other:"{0} மாதங்களில்"},past:{one:"{0} மாதத்துக்கு முன்",other:"{0} மாதங்களுக்கு முன்"}}},day:{displayName:"நாள்",relative:{0:"இன்று",1:"நாளை",2:"நாளை மறுநாள்","-1":"நேற்று","-2":"நேற்று முன் தினம்"},relativeTime:{future:{one:"{0} நாளில்",other:"{0} நாட்களில்"},past:{one:"{0} நாளைக்கு முன்",other:"{0} நாட்களுக்கு முன்"}}},hour:{displayName:"மணி",relativeTime:{future:{one:"{0} மணிநேரத்தில்",other:"{0} மணிநேரத்தில்"},past:{one:"{0} மணிநேரம் முன்",other:"{0} மணிநேரம் முன்"}}},minute:{displayName:"நிமிடம்",relativeTime:{future:{one:"{0} நிமிடத்தில்",other:"{0} நிமிடங்களில்"},past:{one:"{0} நிமிடத்திற்கு முன்",other:"{0} நிமிடங்களுக்கு முன்"}}},second:{displayName:"விநாடி",relative:{0:"இப்போது"},relativeTime:{future:{one:"{0} விநாடியில்",other:"{0} விநாடிகளில்"},past:{one:"{0} விநாடிக்கு முன்",other:"{0} விநாடிகளுக்கு முன்"}}}}}),ReactIntl.__addLocaleData({locale:"ta-IN",parentLocale:"ta"}),ReactIntl.__addLocaleData({locale:"ta-LK",parentLocale:"ta"}),ReactIntl.__addLocaleData({locale:"ta-MY",parentLocale:"ta"}),ReactIntl.__addLocaleData({locale:"ta-SG",parentLocale:"ta"}),ReactIntl.__addLocaleData({locale:"te",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"సంవత్సరం",relative:{0:"ఈ సంవత్సరం",1:"తదుపరి సంవత్సరం","-1":"గత సంవత్సరం"},relativeTime:{future:{one:"{0} సంవత్సరంలో",other:"{0} సంవత్సరాల్లో"},past:{one:"{0} సంవత్సరం క్రితం",other:"{0} సంవత్సరాల క్రితం"}}},month:{displayName:"నెల",relative:{0:"ఈ నెల",1:"తదుపరి నెల","-1":"గత నెల"},relativeTime:{future:{one:"{0} నెలలో",other:"{0} నెలల్లో"},past:{one:"{0} నెల క్రితం",other:"{0} నెలల క్రితం"}}},day:{displayName:"దినం",relative:{0:"ఈ రోజు",1:"రేపు",2:"ఎల్లుండి","-1":"నిన్న","-2":"మొన్న"},relativeTime:{future:{one:"{0} రోజులో",other:"{0} రోజుల్లో"},past:{one:"{0} రోజు క్రితం",other:"{0} రోజుల క్రితం"}}},hour:{displayName:"గంట",relativeTime:{future:{one:"{0} గంటలో",other:"{0} గంటల్లో"},past:{one:"{0} గంట క్రితం",other:"{0} గంటల క్రితం"}}},minute:{displayName:"నిమిషము",relativeTime:{future:{one:"{0} నిమిషంలో",other:"{0} నిమిషాల్లో"},past:{one:"{0} నిమిషం క్రితం",other:"{0} నిమిషాల క్రితం"}}},second:{displayName:"క్షణం",relative:{0:"ప్రస్తుతం"},relativeTime:{future:{one:"{0} సెకన్లో",other:"{0} సెకన్లలో"},past:{one:"{0} సెకను క్రితం",other:"{0} సెకన్ల క్రితం"}}}}}),ReactIntl.__addLocaleData({locale:"te-IN",parentLocale:"te"}),ReactIntl.__addLocaleData({locale:"teo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Ekan",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Elap",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Aparan",relative:{0:"Lolo",1:"Moi","-1":"Jaan"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Esaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Idakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Isekonde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"teo-KE",parentLocale:"teo"}),ReactIntl.__addLocaleData({locale:"teo-UG",parentLocale:"teo"}),ReactIntl.__addLocaleData({locale:"th",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ปี",relative:{0:"ปีนี้",1:"ปีหน้า","-1":"ปีที่แล้ว"},relativeTime:{future:{other:"ในอีก {0} ปี"},past:{other:"{0} ปีที่แล้ว"}}},month:{displayName:"เดือน",relative:{0:"เดือนนี้",1:"เดือนหน้า","-1":"เดือนที่แล้ว"},relativeTime:{future:{other:"ในอีก {0} เดือน"},past:{other:"{0} เดือนที่ผ่านมา"}}},day:{displayName:"วัน",relative:{0:"วันนี้",1:"พรุ่งนี้",2:"มะรืนนี้","-1":"เมื่อวาน","-2":"เมื่อวานซืน"},relativeTime:{future:{other:"ในอีก {0} วัน"},past:{other:"{0} วันที่ผ่านมา"}}},hour:{displayName:"ชั่วโมง",relativeTime:{future:{other:"ในอีก {0} ชั่วโมง"},past:{other:"{0} ชั่วโมงที่ผ่านมา"}}},minute:{displayName:"นาที",relativeTime:{future:{other:"ในอีก {0} นาที"},past:{other:"{0} นาทีที่ผ่านมา"}}},second:{displayName:"วินาที",relative:{0:"ขณะนี้"},relativeTime:{future:{other:"ในอีก {0} วินาที"},past:{other:"{0} วินาทีที่ผ่านมา"}}}}}),ReactIntl.__addLocaleData({locale:"th-TH",parentLocale:"th"}),ReactIntl.__addLocaleData({locale:"ti",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ti-ER",parentLocale:"ti"}),ReactIntl.__addLocaleData({locale:"ti-ET",parentLocale:"ti"}),ReactIntl.__addLocaleData({locale:"tig",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"tk",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"tl",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=c[1]||"",f=!c[1],g=d.slice(-1),h=e.slice(-1);return b?1==a?"one":"other":f&&(1==d||2==d||3==d)||f&&4!=g&&6!=g&&9!=g||!f&&4!=h&&6!=h&&9!=h?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"tn",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"tn-BW",parentLocale:"tn"}),ReactIntl.__addLocaleData({locale:"tn-ZA",parentLocale:"tn"}),ReactIntl.__addLocaleData({locale:"to",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"taʻu",relative:{0:"taʻú ni",1:"taʻu kahaʻu","-1":"taʻu kuoʻosi"},relativeTime:{future:{other:"ʻi he taʻu ʻe {0}"},past:{other:"taʻu ʻe {0} kuoʻosi"}}},month:{displayName:"māhina",relative:{0:"māhiná ni",1:"māhina kahaʻu","-1":"māhina kuoʻosi"},relativeTime:{future:{other:"ʻi he māhina ʻe {0}"},past:{other:"māhina ʻe {0} kuoʻosi"}}},day:{displayName:"ʻaho",relative:{0:"ʻahó ni",1:"ʻapongipongi",2:"ʻahepongipongi","-1":"ʻaneafi","-2":"ʻaneheafi"},relativeTime:{future:{other:"ʻi he ʻaho ʻe {0}"},past:{other:"ʻaho ʻe {0} kuoʻosi"}}},hour:{displayName:"houa",relativeTime:{future:{other:"ʻi he houa ʻe {0}"},past:{other:"houa ʻe {0} kuoʻosi"}}},minute:{displayName:"miniti",relativeTime:{future:{other:"ʻi he miniti ʻe {0}"},past:{other:"miniti ʻe {0} kuoʻosi"}}},second:{displayName:"sekoni",relative:{0:"taimiʻni"},relativeTime:{future:{other:"ʻi he sekoni ʻe {0}"},past:{other:"sekoni ʻe {0} kuoʻosi"}}}}}),ReactIntl.__addLocaleData({locale:"to-TO",parentLocale:"to"}),ReactIntl.__addLocaleData({locale:"tr",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Yıl",relative:{0:"bu yıl",1:"gelecek yıl","-1":"geçen yıl"},relativeTime:{future:{one:"{0} yıl sonra",other:"{0} yıl sonra"},past:{one:"{0} yıl önce",other:"{0} yıl önce"}}},month:{displayName:"Ay",relative:{0:"bu ay",1:"gelecek ay","-1":"geçen ay"},relativeTime:{future:{one:"{0} ay sonra",other:"{0} ay sonra"},past:{one:"{0} ay önce",other:"{0} ay önce"}}},day:{displayName:"Gün",relative:{0:"bugün",1:"yarın",2:"öbür gün","-1":"dün","-2":"evvelsi gün"},relativeTime:{future:{one:"{0} gün sonra",other:"{0} gün sonra"},past:{one:"{0} gün önce",other:"{0} gün önce"}}},hour:{displayName:"Saat",relativeTime:{future:{one:"{0} saat sonra",other:"{0} saat sonra"},past:{one:"{0} saat önce",other:"{0} saat önce"}}},minute:{displayName:"Dakika",relativeTime:{future:{one:"{0} dakika sonra",other:"{0} dakika sonra"},past:{one:"{0} dakika önce",other:"{0} dakika önce"}}},second:{displayName:"Saniye",relative:{0:"şimdi"},relativeTime:{future:{one:"{0} saniye sonra",other:"{0} saniye sonra"},past:{one:"{0} saniye önce",other:"{0} saniye önce"}}}}}),ReactIntl.__addLocaleData({locale:"tr-CY",parentLocale:"tr"}),ReactIntl.__addLocaleData({locale:"tr-TR",parentLocale:"tr"}),ReactIntl.__addLocaleData({locale:"ts",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ts-ZA",parentLocale:"ts"}),ReactIntl.__addLocaleData({locale:"twq",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Jiiri",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Handu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Zaari",relative:{0:"Hõo",1:"Suba","-1":"Bi"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Guuru",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Miti",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"twq-NE",parentLocale:"twq"}),ReactIntl.__addLocaleData({locale:"tzm",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=Number(c[0])==a;return b?"other":0==a||1==a||d&&a>=11&&99>=a?"one":"other"},fields:{year:{displayName:"Asseggas",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Ayur",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ass",relative:{0:"Assa",1:"Asekka","-1":"Assenaṭ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Tasragt",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Tusdat",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Tusnat",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"tzm-Latn",parentLocale:"tzm"}),ReactIntl.__addLocaleData({locale:"tzm-Latn-MA",parentLocale:"tzm-Latn"}),ReactIntl.__addLocaleData({locale:"ug",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"يىل",relative:{0:"بۇ يىل",1:"كېلەر يىل","-1":"ئۆتكەن يىل"},relativeTime:{future:{one:"{0} يىلدىن كېيىن",other:"{0} يىلدىن كېيىن"},past:{one:"{0} يىل ئىلگىرى",other:"{0} يىل ئىلگىرى"}}},month:{displayName:"ئاي",relative:{0:"بۇ ئاي",1:"كېلەر ئاي","-1":"ئۆتكەن ئاي"},relativeTime:{future:{one:"{0} ئايدىن كېيىن",other:"{0} ئايدىن كېيىن"},past:{one:"{0} ئاي ئىلگىرى",other:"{0} ئاي ئىلگىرى"}}},day:{displayName:"كۈن",relative:{0:"بۈگۈن",1:"ئەتە","-1":"تۈنۈگۈن"},relativeTime:{future:{one:"{0} كۈندىن كېيىن",other:"{0} كۈندىن كېيىن"},past:{one:"{0} كۈن ئىلگىرى",other:"{0} كۈن ئىلگىرى"}}},hour:{displayName:"سائەت",relativeTime:{future:{one:"{0} سائەتتىن كېيىن",other:"{0} سائەتتىن كېيىن"},past:{one:"{0} سائەت ئىلگىرى",other:"{0} سائەت ئىلگىرى"}}},minute:{displayName:"مىنۇت",relativeTime:{future:{one:"{0} مىنۇتتىن كېيىن",other:"{0} مىنۇتتىن كېيىن"},past:{one:"{0} مىنۇت ئىلگىرى",other:"{0} مىنۇت ئىلگىرى"}}},second:{displayName:"سېكۇنت",relative:{0:"now"},relativeTime:{future:{one:"{0} سېكۇنتتىن كېيىن",other:"{0} سېكۇنتتىن كېيىن"},past:{one:"{0} سېكۇنت ئىلگىرى",other:"{0} سېكۇنت ئىلگىرى"}}}}}),ReactIntl.__addLocaleData({locale:"ug-Arab",parentLocale:"ug"}),ReactIntl.__addLocaleData({locale:"ug-Arab-CN",parentLocale:"ug-Arab"}),ReactIntl.__addLocaleData({locale:"uk",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=c[0],e=!c[1],f=Number(c[0])==a,g=f&&c[0].slice(-1),h=f&&c[0].slice(-2),i=d.slice(-1),j=d.slice(-2);return b?3==g&&13!=h?"few":"other":e&&1==i&&11!=j?"one":e&&i>=2&&4>=i&&(12>j||j>14)?"few":e&&0==i||e&&i>=5&&9>=i||e&&j>=11&&14>=j?"many":"other"},fields:{year:{displayName:"Рік",relative:{0:"цього року",1:"наступного року","-1":"торік"},relativeTime:{future:{one:"через {0} рік",few:"через {0} роки",many:"через {0} років",other:"через {0} року"},past:{one:"{0} рік тому",few:"{0} роки тому",many:"{0} років тому",other:"{0} року тому"}}},month:{displayName:"Місяць",relative:{0:"цього місяця",1:"наступного місяця","-1":"минулого місяця"},relativeTime:{future:{one:"через {0} місяць",few:"через {0} місяці",many:"через {0} місяців",other:"через {0} місяця"},past:{one:"{0} місяць тому",few:"{0} місяці тому",many:"{0} місяців тому",other:"{0} місяця тому"}}},day:{displayName:"День",relative:{0:"сьогодні",1:"завтра",2:"післязавтра","-1":"учора","-2":"позавчора"},relativeTime:{future:{one:"через {0} день",few:"через {0} дні",many:"через {0} днів",other:"через {0} дня"},past:{one:"{0} день тому",few:"{0} дні тому",many:"{0} днів тому",other:"{0} дня тому"}}},hour:{displayName:"Година",relativeTime:{future:{one:"через {0} годину",few:"через {0} години",many:"через {0} годин",other:"через {0} години"},past:{one:"{0} годину тому",few:"{0} години тому",many:"{0} годин тому",other:"{0} години тому"}}},minute:{displayName:"Хвилина",relativeTime:{future:{one:"через {0} хвилину",few:"через {0} хвилини",many:"через {0} хвилин",other:"через {0} хвилини"},past:{one:"{0} хвилину тому",few:"{0} хвилини тому",many:"{0} хвилин тому",other:"{0} хвилини тому"}}},second:{displayName:"Секунда",relative:{0:"зараз"},relativeTime:{future:{one:"через {0} секунду",few:"через {0} секунди",many:"через {0} секунд",other:"через {0} секунди"},past:{one:"{0} секунду тому",few:"{0} секунди тому",many:"{0} секунд тому",other:"{0} секунди тому"}}}}}),ReactIntl.__addLocaleData({locale:"uk-UA",parentLocale:"uk"}),ReactIntl.__addLocaleData({locale:"ur",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"سال",relative:{0:"اس سال",1:"اگلے سال","-1":"گزشتہ سال"},relativeTime:{future:{one:"{0} سال میں",other:"{0} سال میں"},past:{one:"{0} سال پہلے",other:"{0} سال پہلے"}}},month:{displayName:"مہینہ",relative:{0:"اس مہینہ",1:"اگلے مہینہ","-1":"پچھلے مہینہ"},relativeTime:{future:{one:"{0} مہینہ میں",other:"{0} مہینے میں"},past:{one:"{0} مہینہ پہلے",other:"{0} مہینے پہلے"}}},day:{displayName:"دن",relative:{0:"آج",1:"آئندہ کل",2:"آنے والا پرسوں","-1":"گزشتہ کل","-2":"گزشتہ پرسوں"},relativeTime:{future:{one:"{0} دن میں",other:"{0} دنوں میں"},past:{one:"{0} دن پہلے",other:"{0} دنوں پہلے"}}},hour:{displayName:"گھنٹہ",relativeTime:{future:{one:"{0} گھنٹہ میں",other:"{0} گھنٹے میں"},past:{one:"{0} گھنٹہ پہلے",other:"{0} گھنٹے پہلے"}}},minute:{displayName:"منٹ",relativeTime:{future:{one:"{0} منٹ میں",other:"{0} منٹ میں"},past:{one:"{0} منٹ پہلے",other:"{0} منٹ پہلے"}}},second:{displayName:"سیکنڈ",relative:{0:"اب"},relativeTime:{future:{one:"{0} سیکنڈ میں",other:"{0} سیکنڈ میں"},past:{one:"{0} سیکنڈ پہلے",other:"{0} سیکنڈ پہلے"}}}}}),ReactIntl.__addLocaleData({locale:"ur-IN",parentLocale:"ur",fields:{year:{displayName:"سال",relative:{0:"اس سال",1:"اگلے سال","-1":"گزشتہ سال"},relativeTime:{future:{one:"{0} سال میں",other:"{0} سالوں میں"},past:{one:"{0} سال پہلے",other:"{0} سالوں پہلے"}}},month:{displayName:"مہینہ",relative:{0:"اس ماہ",1:"اگلے ماہ","-1":"گزشتہ ماہ"},relativeTime:{future:{one:"{0} ماہ میں",other:"{0} ماہ میں"},past:{one:"{0} ماہ قبل",other:"{0} ماہ قبل"}}},day:{displayName:"دن",relative:{0:"آج",1:"کل",2:"آنے والا پرسوں","-1":"کل","-2":"گزشتہ پرسوں"},relativeTime:{future:{one:"{0} دن میں",other:"{0} دنوں میں"},past:{one:"{0} دن پہلے",other:"{0} دنوں پہلے"}}},hour:{displayName:"گھنٹہ",relativeTime:{future:{one:"{0} گھنٹہ میں",other:"{0} گھنٹے میں"},past:{one:"{0} گھنٹہ پہلے",other:"{0} گھنٹے پہلے"}}},minute:{displayName:"منٹ",relativeTime:{future:{one:"{0} منٹ میں",other:"{0} منٹ میں"},past:{one:"{0} منٹ قبل",other:"{0} منٹ قبل"}}},second:{displayName:"سیکنڈ",relative:{0:"اب"},relativeTime:{future:{one:"{0} سیکنڈ میں",other:"{0} سیکنڈ میں"},past:{one:"{0} سیکنڈ قبل",other:"{0} سیکنڈ قبل"}}}}}),ReactIntl.__addLocaleData({locale:"ur-PK",parentLocale:"ur"}),ReactIntl.__addLocaleData({locale:"uz",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Yil",relative:{0:"bu yil",1:"keyingi yil","-1":"oʻtgan yil"},relativeTime:{future:{one:"{0} yildan soʻng",other:"{0} yildan soʻng"},past:{one:"{0} yil avval",other:"{0} yil avval"}}},month:{displayName:"Oy",relative:{0:"bu oy",1:"keyingi oy","-1":"oʻtgan oy"},relativeTime:{future:{one:"{0} oydan soʻng",other:"{0} oydan soʻng"},past:{one:"{0} oy avval",other:"{0} oy avval"}}},day:{displayName:"Kun",relative:{0:"bugun",1:"ertaga","-1":"kecha"},relativeTime:{future:{one:"{0} kundan soʻng",other:"{0} kundan soʻng"},past:{one:"{0} kun oldin",other:"{0} kun oldin"}}},hour:{displayName:"Soat",relativeTime:{future:{one:"{0} soatdan soʻng",other:"{0} soatdan soʻng"},past:{one:"{0} soat oldin",other:"{0} soat oldin"}}},minute:{displayName:"Daqiqa",relativeTime:{future:{one:"{0} daqiqadan soʻng",other:"{0} daqiqadan soʻng"},past:{one:"{0} daqiqa oldin",other:"{0} daqiqa oldin"}}},second:{displayName:"Soniya",relative:{0:"hozir"},relativeTime:{future:{one:"{0} soniyadan soʻng",other:"{0} soniyadan soʻng"},past:{one:"{0} soniya oldin",other:"{0} soniya oldin"}}}}}),ReactIntl.__addLocaleData({locale:"uz-Arab",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"uz-Arab-AF",parentLocale:"uz-Arab"}),ReactIntl.__addLocaleData({locale:"uz-Cyrl",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Йил",relative:{0:"бу йил",1:"кейинги йил","-1":"ўтган йил"},relativeTime:{future:{one:"{0} йилдан сўнг",other:"{0} йилдан сўнг"},past:{one:"{0} йил аввал",other:"{0} йил аввал"}}},month:{displayName:"Ой",relative:{0:"бу ой",1:"кейинги ой","-1":"ўтган ой"},relativeTime:{future:{one:"{0} ойдан сўнг",other:"{0} ойдан сўнг"},past:{one:"{0} ой аввал",other:"{0} ой аввал"}}},day:{displayName:"Кун",relative:{0:"бугун",1:"эртага","-1":"кеча"},relativeTime:{future:{one:"{0} кундан сўнг",other:"{0} кундан сўнг"},past:{one:"{0} кун олдин",other:"{0} кун олдин"}}},hour:{displayName:"Соат",relativeTime:{future:{one:"{0} соатдан сўнг",other:"{0} соатдан сўнг"},past:{one:"{0} соат олдин",other:"{0} соат олдин"}}},minute:{displayName:"Дақиқа",relativeTime:{future:{one:"{0} дақиқадан сўнг",other:"{0} дақиқадан сўнг"},past:{one:"{0} дақиқа олдин",other:"{0} дақиқа олдин"}}},second:{displayName:"Сония",relative:{0:"ҳозир"},relativeTime:{future:{one:"{0} сониядан сўнг",other:"{0} сониядан сўнг"},past:{one:"{0} сония олдин",other:"{0} сония олдин"}}}}}),ReactIntl.__addLocaleData({locale:"uz-Cyrl-UZ",parentLocale:"uz-Cyrl"}),ReactIntl.__addLocaleData({locale:"uz-Latn",parentLocale:"uz"}),ReactIntl.__addLocaleData({locale:"uz-Latn-UZ",parentLocale:"uz-Latn"}),ReactIntl.__addLocaleData({locale:"vai",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ꕢꘋ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ꕪꖃ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ꔎꔒ",relative:{0:"ꗦꗷ",1:"ꔻꕯ","-1":"ꖴꖸ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ꕌꕎ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ꕆꕇ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ꕧꕃꕧꕪ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"vai-Latn",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"saŋ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"kalo",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"tele",relative:{0:"wɛlɛ",1:"sina","-1":"kunu"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"hawa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"mini",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"jaki-jaka",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"vai-Latn-LR",parentLocale:"vai-Latn"}),ReactIntl.__addLocaleData({locale:"vai-Vaii",parentLocale:"vai"}),ReactIntl.__addLocaleData({locale:"vai-Vaii-LR",parentLocale:"vai-Vaii"}),ReactIntl.__addLocaleData({locale:"ve",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"ve-ZA",parentLocale:"ve"}),ReactIntl.__addLocaleData({locale:"vi",pluralRuleFunction:function(a,b){return b&&1==a?"one":"other"},fields:{year:{displayName:"Năm",relative:{0:"năm nay",1:"năm sau","-1":"năm ngoái"},relativeTime:{future:{other:"trong {0} năm nữa"},past:{other:"{0} năm trước"}}},month:{displayName:"Tháng",relative:{0:"tháng này",1:"tháng sau","-1":"tháng trước"},relativeTime:{future:{other:"trong {0} tháng nữa"},past:{other:"{0} tháng trước"}}},day:{displayName:"Ngày",relative:{0:"hôm nay",1:"ngày mai",2:"ngày kia","-1":"hôm qua","-2":"hôm kia"},relativeTime:{future:{other:"trong {0} ngày nữa"},past:{other:"{0} ngày trước"}}},hour:{displayName:"Giờ",relativeTime:{future:{other:"trong {0} giờ nữa"},past:{other:"{0} giờ trước"}}},minute:{displayName:"Phút",relativeTime:{future:{other:"trong {0} phút nữa"},past:{other:"{0} phút trước"}}},second:{displayName:"Giây",relative:{0:"bây giờ"},relativeTime:{future:{other:"trong {0} giây nữa"},past:{other:"{0} giây trước"}}}}}),ReactIntl.__addLocaleData({locale:"vi-VN",parentLocale:"vi"}),ReactIntl.__addLocaleData({locale:"vo",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"yel",relative:{0:"ayelo",1:"oyelo","-1":"äyelo"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"mul",relative:{0:"amulo",1:"omulo","-1":"ämulo"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Tag",relative:{0:"adelo",1:"odelo",2:"udelo","-1":"ädelo","-2":"edelo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"düp",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"minut",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"sekun",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"vo-001",parentLocale:"vo"}),ReactIntl.__addLocaleData({locale:"vun",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Maka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Mfiri",relative:{0:"Inu",1:"Ngama","-1":"Ukou"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Dakyika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"vun-TZ",parentLocale:"vun"}),ReactIntl.__addLocaleData({locale:"wa",pluralRuleFunction:function(a,b){return b?"other":0==a||1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"
}}}}}),ReactIntl.__addLocaleData({locale:"wae",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Jár",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"I {0} jár",other:"I {0} jár"},past:{one:"vor {0} jár",other:"cor {0} jár"}}},month:{displayName:"Mánet",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"I {0} mánet",other:"I {0} mánet"},past:{one:"vor {0} mánet",other:"vor {0} mánet"}}},day:{displayName:"Tag",relative:{0:"Hitte",1:"Móre",2:"Ubermóre","-1":"Gešter","-2":"Vorgešter"},relativeTime:{future:{one:"i {0} tag",other:"i {0} täg"},past:{one:"vor {0} tag",other:"vor {0} täg"}}},hour:{displayName:"Schtund",relativeTime:{future:{one:"i {0} stund",other:"i {0} stunde"},past:{one:"vor {0} stund",other:"vor {0} stunde"}}},minute:{displayName:"Mínütta",relativeTime:{future:{one:"i {0} minüta",other:"i {0} minüte"},past:{one:"vor {0} minüta",other:"vor {0} minüte"}}},second:{displayName:"Sekunda",relative:{0:"now"},relativeTime:{future:{one:"i {0} sekund",other:"i {0} sekunde"},past:{one:"vor {0} sekund",other:"vor {0} sekunde"}}}}}),ReactIntl.__addLocaleData({locale:"wae-CH",parentLocale:"wae"}),ReactIntl.__addLocaleData({locale:"wo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"xh",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"xog",pluralRuleFunction:function(a,b){return b?"other":1==a?"one":"other"},fields:{year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Omwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Olunaku",relative:{0:"Olwaleelo (leelo)",1:"Enkyo","-1":"Edho"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"Essawa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Edakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Obutikitiki",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"xog-UG",parentLocale:"xog"}),ReactIntl.__addLocaleData({locale:"yav",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"yɔɔŋ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"oóli",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"puɔ́sɛ́",relative:{0:"ínaan",1:"nakinyám","-1":"púyoó"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"kisikɛl,",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"minít",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"síkɛn",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"yav-CM",parentLocale:"yav"}),ReactIntl.__addLocaleData({locale:"yi",pluralRuleFunction:function(a,b){var c=String(a).split("."),d=!c[1];return b?"other":1==a&&d?"one":"other"},fields:{year:{displayName:"יאָהר",relative:{0:"הײַ יאָר",1:"איבער א יאָר","-1":"פֿאַראַיאָר"},relativeTime:{future:{one:"איבער {0} יאָר",other:"איבער {0} יאָר"},past:{one:"פֿאַר {0} יאָר",other:"פֿאַר {0} יאָר"}}},month:{displayName:"מאנאַט",relative:{0:"דעם חודש",1:"קומענדיקן חודש","-1":"פֿאַרגאנגענעם חודש"},relativeTime:{future:{one:"איבער {0} חודש",other:"איבער {0} חדשים"},past:{one:"פֿאַר {0} חודש",other:"פֿאַר {0} חדשים"}}},day:{displayName:"טאג",relative:{0:"היינט",1:"מארגן","-1":"נעכטן"},relativeTime:{future:{one:"אין {0} טאָג אַרום",other:"אין {0} טעג אַרום"},past:{other:"-{0} d"}}},hour:{displayName:"שעה",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"מינוט",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"סעקונדע",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"yi-001",parentLocale:"yi"}),ReactIntl.__addLocaleData({locale:"yo",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"Ọdún",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Osù",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ọjọ́",relative:{0:"Òní",1:"Ọ̀la",2:"òtúùnla","-1":"Àná","-2":"íjẹta"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"wákàtí",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ìsẹ́jú",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Ìsẹ́jú Ààyá",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"yo-BJ",parentLocale:"yo",fields:{year:{displayName:"Ɔdún",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"Osù",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"Ɔjɔ́",relative:{0:"Òní",1:"Ɔ̀la",2:"òtúùnla","-1":"Àná","-2":"íjɛta"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"wákàtí",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"Ìsɛ́jú",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"Ìsɛ́jú Ààyá",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"yo-NG",parentLocale:"yo"}),ReactIntl.__addLocaleData({locale:"zgh",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"ⴰⵙⴳⴳⵯⴰⵙ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}},month:{displayName:"ⴰⵢⵢⵓⵔ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},day:{displayName:"ⴰⵙⵙ",relative:{0:"ⴰⵙⵙⴰ",1:"ⴰⵙⴽⴽⴰ","-1":"ⵉⴹⵍⵍⵉ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},hour:{displayName:"ⵜⴰⵙⵔⴰⴳⵜ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},minute:{displayName:"ⵜⵓⵙⴷⵉⴷⵜ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},second:{displayName:"ⵜⴰⵙⵉⵏⵜ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}}}}),ReactIntl.__addLocaleData({locale:"zgh-MA",parentLocale:"zgh"}),ReactIntl.__addLocaleData({locale:"zh",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},day:{displayName:"日",relative:{0:"今天",1:"明天",2:"后天","-1":"昨天","-2":"前天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},hour:{displayName:"小时",relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},minute:{displayName:"分钟",relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},second:{displayName:"秒钟",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒钟后"},past:{other:"{0}秒钟前"}}}}}),ReactIntl.__addLocaleData({locale:"zh-Hans",parentLocale:"zh"}),ReactIntl.__addLocaleData({locale:"zh-Hans-CN",parentLocale:"zh-Hans"}),ReactIntl.__addLocaleData({locale:"zh-Hans-HK",parentLocale:"zh-Hans",fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},day:{displayName:"日",relative:{0:"今天",1:"明天",2:"后天","-1":"昨天","-2":"前天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},hour:{displayName:"小时",relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},minute:{displayName:"分钟",relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},second:{displayName:"秒钟",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒后"},past:{other:"{0}秒前"}}}}}),ReactIntl.__addLocaleData({locale:"zh-Hans-MO",parentLocale:"zh-Hans",fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},day:{displayName:"天",relative:{0:"今天",1:"明天",2:"后天","-1":"昨天","-2":"前天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},hour:{displayName:"小时",relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},minute:{displayName:"分钟",relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},second:{displayName:"秒钟",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒后"},past:{other:"{0}秒前"}}}}}),ReactIntl.__addLocaleData({locale:"zh-Hans-SG",parentLocale:"zh-Hans",fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},day:{displayName:"日",relative:{0:"今天",1:"明天",2:"后天","-1":"昨天","-2":"前天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},hour:{displayName:"小时",relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},minute:{displayName:"分钟",relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},second:{displayName:"秒钟",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒后"},past:{other:"{0}秒前"}}}}}),ReactIntl.__addLocaleData({locale:"zh-Hant",pluralRuleFunction:function(a,b){return"other"},fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0} 年後"},past:{other:"{0} 年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下個月","-1":"上個月"},relativeTime:{future:{other:"{0} 個月後"},past:{other:"{0} 個月前"}}},day:{displayName:"日",relative:{0:"今天",1:"明天",2:"後天","-1":"昨天","-2":"前天"},relativeTime:{future:{other:"{0} 天後"},past:{other:"{0} 天前"}}},hour:{displayName:"小時",relativeTime:{future:{other:"{0} 小時後"},past:{other:"{0} 小時前"}}},minute:{displayName:"分鐘",relativeTime:{future:{other:"{0} 分鐘後"},past:{other:"{0} 分鐘前"}}},second:{displayName:"秒",relative:{0:"現在"},relativeTime:{future:{other:"{0} 秒後"},past:{other:"{0} 秒前"}}}}}),ReactIntl.__addLocaleData({locale:"zh-Hant-HK",parentLocale:"zh-Hant",fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0} 年後"},past:{other:"{0} 年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下個月","-1":"上個月"},relativeTime:{future:{other:"{0} 個月後"},past:{other:"{0} 個月前"}}},day:{displayName:"日",relative:{0:"今日",1:"明日",2:"後日","-1":"昨日","-2":"前日"},relativeTime:{future:{other:"{0} 日後"},past:{other:"{0} 日前"}}},hour:{displayName:"小時",relativeTime:{future:{other:"{0} 小時後"},past:{other:"{0} 小時前"}}},minute:{displayName:"分鐘",relativeTime:{future:{other:"{0} 分鐘後"},past:{other:"{0} 分鐘前"}}},second:{displayName:"秒",relative:{0:"現在"},relativeTime:{future:{other:"{0} 秒後"},past:{other:"{0} 秒前"}}}}}),ReactIntl.__addLocaleData({locale:"zh-Hant-MO",parentLocale:"zh-Hant-HK"}),ReactIntl.__addLocaleData({locale:"zh-Hant-TW",parentLocale:"zh-Hant"}),ReactIntl.__addLocaleData({locale:"zu",pluralRuleFunction:function(a,b){return b?"other":a>=0&&1>=a?"one":"other"},fields:{year:{displayName:"Unyaka",relative:{0:"kulo nyaka",1:"unyaka ozayo","-1":"onyakeni odlule"},relativeTime:{future:{one:"onyakeni ongu-{0}",other:"Eminyakeni engu-{0}"},past:{one:"{0} unyaka odlule",other:"{0} iminyaka edlule"}}},month:{displayName:"Inyanga",relative:{0:"le nyanga",1:"inyanga ezayo","-1":"inyanga edlule"},relativeTime:{future:{one:"Enyangeni engu-{0}",other:"Ezinyangeni ezingu-{0}"},past:{one:"{0} inyanga edlule",other:"{0} izinyanga ezedlule"}}},day:{displayName:"usuku",relative:{0:"namhlanje",1:"kusasa",2:"Usuku olulandela olakusasa","-1":"izolo","-2":"Usuku olwandulela olwayizolo"},relativeTime:{future:{one:"Osukwini olungu-{0}",other:"Ezinsukwini ezingu-{0}"},past:{one:"osukwini olungu-{0} olwedlule",other:"ezinsukwini ezingu-{0} ezedlule."}}},hour:{displayName:"Ihora",relativeTime:{future:{one:"Ehoreni elingu-{0}",other:"Emahoreni angu-{0}"},past:{one:"ehoreni eligu-{0} eledluli",other:"emahoreni angu-{0} edlule"}}},minute:{displayName:"Iminithi",relativeTime:{future:{one:"Kumunithi engu-{0}",other:"Emaminithini angu-{0}"},past:{one:"eminithini elingu-{0} eledlule",other:"amaminithi angu-{0} adlule"}}},second:{displayName:"Isekhondi",relative:{0:"manje"},relativeTime:{future:{one:"Kusekhondi elingu-{0}",other:"Kumasekhondi angu-{0}"},past:{one:"isekhondi elingu-{0} eledlule",other:"amasekhondi angu-{0} adlule"}}}}}),ReactIntl.__addLocaleData({locale:"zu-ZA",parentLocale:"zu"});
//# sourceMappingURL=react-intl-with-locales.min.js.map |
modules/Link.js | dmitrigrabov/react-router | import React from 'react'
import warning from 'warning'
const { bool, object, string, func } = React.PropTypes
function isLeftClickEvent(event) {
return event.button === 0
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
}
function isEmptyObject(object) {
for (const p in object)
if (object.hasOwnProperty(p))
return false
return true
}
/**
* A <Link> is used to create an <a> element that links to a route.
* When that route is active, the link gets an "active" class name
* (or the value of its `activeClassName` prop).
*
* For example, assuming you have the following route:
*
* <Route path="/posts/:postID" component={Post} />
*
* You could use the following component to link to that route:
*
* <Link to={`/posts/${post.id}`} />
*
* Links may pass along location state and/or query string parameters
* in the state/query props, respectively.
*
* <Link ... query={{ show: true }} state={{ the: 'state' }} />
*/
const Link = React.createClass({
contextTypes: {
history: object
},
propTypes: {
activeStyle: object,
activeClassName: string,
onlyActiveOnIndex: bool.isRequired,
to: string.isRequired,
query: object,
state: object,
onClick: func
},
getDefaultProps() {
return {
onlyActiveOnIndex: false,
className: '',
style: {}
}
},
handleClick(event) {
let allowTransition = true, clickResult
if (this.props.onClick)
clickResult = this.props.onClick(event)
if (isModifiedEvent(event) || !isLeftClickEvent(event))
return
if (clickResult === false || event.defaultPrevented === true)
allowTransition = false
event.preventDefault()
if (allowTransition)
this.context.history.pushState(this.props.state, this.props.to, this.props.query)
},
componentWillMount() {
warning(
this.context.history,
'A <Link> should not be rendered outside the context of history ' +
'some features including real hrefs, active styling, and navigation ' +
'will not function correctly'
)
},
render() {
const { history } = this.context
const { activeClassName, activeStyle, onlyActiveOnIndex, to, query, state, onClick, ...props } = this.props
props.onClick = this.handleClick
// Ignore if rendered outside the context
// of history, simplifies unit testing.
if (history) {
props.href = history.createHref(to, query)
if (activeClassName || (activeStyle != null && !isEmptyObject(activeStyle))) {
if (history.isActive(to, query, onlyActiveOnIndex)) {
if (activeClassName)
props.className += props.className === '' ? activeClassName : ` ${activeClassName}`
if (activeStyle)
props.style = { ...props.style, ...activeStyle }
}
}
}
return React.createElement('a', props)
}
})
export default Link
|
ajax/libs/yui/3.4.0pr3/loader-base/loader-base-debug.js | ppoffice/cdnjs | YUI.add('loader-base', function(Y) {
/**
* The YUI loader core
* @module loader
* @submodule loader-base
*/
if (!YUI.Env[Y.version]) {
(function() {
var VERSION = Y.version,
BUILD = '/build/',
ROOT = VERSION + BUILD,
CDN_BASE = Y.Env.base,
GALLERY_VERSION = 'gallery-2011.07.20-20-59',
TNT = '2in3',
TNT_VERSION = '4',
YUI2_VERSION = '2.9.0',
COMBO_BASE = CDN_BASE + 'combo?',
META = { version: VERSION,
root: ROOT,
base: Y.Env.base,
comboBase: COMBO_BASE,
skin: { defaultSkin: 'sam',
base: 'assets/skins/',
path: 'skin.css',
after: ['cssreset',
'cssfonts',
'cssgrids',
'cssbase',
'cssreset-context',
'cssfonts-context']},
groups: {},
patterns: {} },
groups = META.groups,
yui2Update = function(tnt, yui2) {
var root = TNT + '.' +
(tnt || TNT_VERSION) + '/' +
(yui2 || YUI2_VERSION) + BUILD;
groups.yui2.base = CDN_BASE + root;
groups.yui2.root = root;
},
galleryUpdate = function(tag) {
var root = (tag || GALLERY_VERSION) + BUILD;
groups.gallery.base = CDN_BASE + root;
groups.gallery.root = root;
};
groups[VERSION] = {};
groups.gallery = {
ext: false,
combine: true,
comboBase: COMBO_BASE,
update: galleryUpdate,
patterns: { 'gallery-': { },
'lang/gallery-': {},
'gallerycss-': { type: 'css' } }
};
groups.yui2 = {
combine: true,
ext: false,
comboBase: COMBO_BASE,
update: yui2Update,
patterns: {
'yui2-': {
configFn: function(me) {
if (/-skin|reset|fonts|grids|base/.test(me.name)) {
me.type = 'css';
me.path = me.path.replace(/\.js/, '.css');
// this makes skins in builds earlier than
// 2.6.0 work as long as combine is false
me.path = me.path.replace(/\/yui2-skin/,
'/assets/skins/sam/yui2-skin');
}
}
}
}
};
galleryUpdate();
yui2Update();
YUI.Env[VERSION] = META;
}());
}
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It supports rollup files and will
* automatically use these when appropriate in order to minimize the number of
* http connections required to load all of the dependencies. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* @module loader
* @submodule loader-base
*/
var NOT_FOUND = {},
NO_REQUIREMENTS = [],
MAX_URL_LENGTH = (Y.UA.ie) ? 2048 : 8192,
GLOBAL_ENV = YUI.Env,
GLOBAL_LOADED = GLOBAL_ENV._loaded,
CSS = 'css',
JS = 'js',
INTL = 'intl',
VERSION = Y.version,
ROOT_LANG = '',
YObject = Y.Object,
oeach = YObject.each,
YArray = Y.Array,
_queue = GLOBAL_ENV._loaderQueue,
META = GLOBAL_ENV[VERSION],
SKIN_PREFIX = 'skin-',
L = Y.Lang,
ON_PAGE = GLOBAL_ENV.mods,
modulekey,
cache,
_path = function(dir, file, type, nomin) {
var path = dir + '/' + file;
if (!nomin) {
path += '-min';
}
path += '.' + (type || CSS);
return path;
};
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
* @property Env.meta
* @for YUI
*/
Y.Env.meta = META;
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It supports rollup files and will
* automatically use these when appropriate in order to minimize the number of
* http connections required to load all of the dependencies. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* While the loader can be instantiated by the end user, it normally is not.
* @see YUI.use for the normal use case. The use function automatically will
* pull in missing dependencies.
*
* @constructor
* @class Loader
* @param {object} o an optional set of configuration options. Valid options:
* <ul>
* <li>base:
* The base dir</li>
* <li>comboBase:
* The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
* <li>root:
* The root path to prepend to module names for the combo service.
* Ex: 2.5.2/build/</li>
* <li>filter:.
*
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
*
* </li>
* <li>filters: per-component filter specification. If specified
* for a given component, this overrides the filter config. _Note:_ This does not work on combo urls, use the filter property instead.</li>
* <li>combine:
* Use the YUI combo service to reduce the number of http connections
* required to load your dependencies</li>
* <li>ignore:
* A list of modules that should never be dynamically loaded</li>
* <li>force:
* A list of modules that should always be loaded when required, even if
* already present on the page</li>
* <li>insertBefore:
* Node or id for a node that should be used as the insertion point for
* new nodes</li>
* <li>charset:
* charset for dynamic nodes (deprecated, use jsAttributes or cssAttributes)
* </li>
* <li>jsAttributes: object literal containing attributes to add to script
* nodes</li>
* <li>cssAttributes: object literal containing attributes to add to link
* nodes</li>
* <li>timeout:
* The number of milliseconds before a timeout occurs when dynamically
* loading nodes. If not set, there is no timeout</li>
* <li>context:
* execution context for all callbacks</li>
* <li>onSuccess:
* callback for the 'success' event</li>
* <li>onFailure: callback for the 'failure' event</li>
* <li>onCSS: callback for the 'CSSComplete' event. When loading YUI
* components with CSS the CSS is loaded first, then the script. This
* provides a moment you can tie into to improve
* the presentation of the page while the script is loading.</li>
* <li>onTimeout:
* callback for the 'timeout' event</li>
* <li>onProgress:
* callback executed each time a script or css file is loaded</li>
* <li>modules:
* A list of module definitions. See Loader.addModule for the supported
* module metadata</li>
* <li>groups:
* A list of group definitions. Each group can contain specific definitions
* for base, comboBase, combine, and accepts a list of modules. See above
* for the description of these properties.</li>
* <li>2in3: the version of the YUI 2 in 3 wrapper to use. The intrinsic
* support for YUI 2 modules in YUI 3 relies on versions of the YUI 2
* components inside YUI 3 module wrappers. These wrappers
* change over time to accomodate the issues that arise from running YUI 2
* in a YUI 3 sandbox.</li>
* <li>yui2: when using the 2in3 project, you can select the version of
* YUI 2 to use. Valid values * are 2.2.2, 2.3.1, 2.4.1, 2.5.2, 2.6.0,
* 2.7.0, 2.8.0, and 2.8.1 [default] -- plus all versions of YUI 2
* going forward.</li>
* </ul>
*/
Y.Loader = function(o) {
var defaults = META.modules,
self = this;
modulekey = META.md5;
/**
* Internal callback to handle multiple internal insert() calls
* so that css is inserted prior to js
* @property _internalCallback
* @private
*/
// self._internalCallback = null;
/**
* Callback that will be executed when the loader is finished
* with an insert
* @method onSuccess
* @type function
*/
// self.onSuccess = null;
/**
* Callback that will be executed if there is a failure
* @method onFailure
* @type function
*/
// self.onFailure = null;
/**
* Callback for the 'CSSComplete' event. When loading YUI components
* with CSS the CSS is loaded first, then the script. This provides
* a moment you can tie into to improve the presentation of the page
* while the script is loading.
* @method onCSS
* @type function
*/
// self.onCSS = null;
/**
* Callback executed each time a script or css file is loaded
* @method onProgress
* @type function
*/
// self.onProgress = null;
/**
* Callback that will be executed if a timeout occurs
* @method onTimeout
* @type function
*/
// self.onTimeout = null;
/**
* The execution context for all callbacks
* @property context
* @default {YUI} the YUI instance
*/
self.context = Y;
/**
* Data that is passed to all callbacks
* @property data
*/
// self.data = null;
/**
* Node reference or id where new nodes should be inserted before
* @property insertBefore
* @type string|HTMLElement
*/
// self.insertBefore = null;
/**
* The charset attribute for inserted nodes
* @property charset
* @type string
* @deprecated , use cssAttributes or jsAttributes.
*/
// self.charset = null;
/**
* An object literal containing attributes to add to link nodes
* @property cssAttributes
* @type object
*/
// self.cssAttributes = null;
/**
* An object literal containing attributes to add to script nodes
* @property jsAttributes
* @type object
*/
// self.jsAttributes = null;
/**
* The base directory.
* @property base
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base + Y.Env.meta.root;
/**
* Base path for the combo service
* @property comboBase
* @type string
* @default http://yui.yahooapis.com/combo?
*/
self.comboBase = Y.Env.meta.comboBase;
/*
* Base path for language packs.
*/
// self.langBase = Y.Env.meta.langBase;
// self.lang = "";
/**
* If configured, the loader will attempt to use the combo
* service for YUI resources and configured external resources.
* @property combine
* @type boolean
* @default true if a base dir isn't in the config
*/
self.combine = o.base &&
(o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
/**
* The default seperator to use between files in a combo URL
* @property comboSep
* @type {String}
* @default Ampersand
*/
self.comboSep = '&';
/**
* Max url length for combo urls. The default is 2048 for
* internet explorer, and 8192 otherwise. This is the URL
* limit for the Yahoo! hosted combo servers. If consuming
* a different combo service that has a different URL limit
* it is possible to override this default by supplying
* the maxURLLength config option. The config option will
* only take effect if lower than the default.
*
* Browsers:
* IE: 2048
* Other A-Grade Browsers: Higher that what is typically supported
* 'capable' mobile browsers:
*
* Servers:
* Apache: 8192
*
* @property maxURLLength
* @type int
*/
self.maxURLLength = MAX_URL_LENGTH;
/**
* Ignore modules registered on the YUI global
* @property ignoreRegistered
* @default false
*/
// self.ignoreRegistered = false;
/**
* Root path to prepend to module path for the combo
* service
* @property root
* @type string
* @default [YUI VERSION]/build/
*/
self.root = Y.Env.meta.root;
/**
* Timeout value in milliseconds. If set, self value will be used by
* the get utility. the timeout event will fire if
* a timeout occurs.
* @property timeout
* @type int
*/
self.timeout = 0;
/**
* A list of modules that should not be loaded, even if
* they turn up in the dependency tree
* @property ignore
* @type string[]
*/
// self.ignore = null;
/**
* A list of modules that should always be loaded, even
* if they have already been inserted into the page.
* @property force
* @type string[]
*/
// self.force = null;
self.forceMap = {};
/**
* Should we allow rollups
* @property allowRollup
* @type boolean
* @default false
*/
self.allowRollup = false;
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
* <pre>
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
* </pre>
* @property filter
* @type string| {searchExp: string, replaceStr: string}
*/
// self.filter = null;
/**
* per-component filter specification. If specified for a given
* component, this overrides the filter config.
* @property filters
* @type object
*/
self.filters = {};
/**
* The list of requested modules
* @property required
* @type {string: boolean}
*/
self.required = {};
/**
* If a module name is predefined when requested, it is checked againsts
* the patterns provided in this property. If there is a match, the
* module is added with the default configuration.
*
* At the moment only supporting module prefixes, but anticipate
* supporting at least regular expressions.
* @property patterns
* @type Object
*/
// self.patterns = Y.merge(Y.Env.meta.patterns);
self.patterns = {};
/**
* The library metadata
* @property moduleInfo
*/
// self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
self.moduleInfo = {};
self.groups = Y.merge(Y.Env.meta.groups);
/**
* Provides the information used to skin the skinnable components.
* The following skin definition would result in 'skin1' and 'skin2'
* being loaded for calendar (if calendar was requested), and
* 'sam' for all other skinnable components:
*
* <code>
* skin: {
*
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin. ex:
* // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* calendar: ['skin1', 'skin2']
* }
* }
* </code>
* @property skin
*/
self.skin = Y.merge(Y.Env.meta.skin);
/*
* Map of conditional modules
* @since 3.2.0
*/
self.conditions = {};
// map of modules with a hash of modules that meet the requirement
// self.provides = {};
self.config = o;
self._internal = true;
cache = GLOBAL_ENV._renderedMods;
if (cache) {
oeach(cache, function modCache(v, k) {
//self.moduleInfo[k] = Y.merge(v);
self.moduleInfo[k] = v;
});
cache = GLOBAL_ENV._conditions;
oeach(cache, function condCache(v, k) {
//self.conditions[k] = Y.merge(v);
self.conditions[k] = v;
});
} else {
oeach(defaults, self.addModule, self);
}
if (!GLOBAL_ENV._renderedMods) {
//GLOBAL_ENV._renderedMods = Y.merge(self.moduleInfo);
//GLOBAL_ENV._conditions = Y.merge(self.conditions);
GLOBAL_ENV._renderedMods = self.moduleInfo;
GLOBAL_ENV._conditions = self.conditions;
}
self._inspectPage();
self._internal = false;
self._config(o);
self.testresults = null;
if (Y.config.tests) {
self.testresults = Y.config.tests;
}
/**
* List of rollup files found in the library metadata
* @property rollups
*/
// self.rollups = null;
/**
* Whether or not to load optional dependencies for
* the requested modules
* @property loadOptional
* @type boolean
* @default false
*/
// self.loadOptional = false;
/**
* All of the derived dependencies in sorted order, which
* will be populated when either calculate() or insert()
* is called
* @property sorted
* @type string[]
*/
self.sorted = [];
/**
* Set when beginning to compute the dependency tree.
* Composed of what YUI reports to be loaded combined
* with what has been loaded by any instance on the page
* with the version number specified in the metadata.
* @property loaded
* @type {string: boolean}
*/
self.loaded = GLOBAL_LOADED[VERSION];
/*
* A list of modules to attach to the YUI instance when complete.
* If not supplied, the sorted list of dependencies are applied.
* @property attaching
*/
// self.attaching = null;
/**
* Flag to indicate the dependency tree needs to be recomputed
* if insert is called again.
* @property dirty
* @type boolean
* @default true
*/
self.dirty = true;
/**
* List of modules inserted by the utility
* @property inserted
* @type {string: boolean}
*/
self.inserted = {};
/**
* List of skipped modules during insert() because the module
* was not defined
* @property skipped
*/
self.skipped = {};
// Y.on('yui:load', self.loadNext, self);
self.tested = {};
/*
* Cached sorted calculate results
* @property results
* @since 3.2.0
*/
//self.results = {};
};
Y.Loader.prototype = {
FILTER_DEFS: {
RAW: {
'searchExp': '-min\\.js',
'replaceStr': '.js'
},
DEBUG: {
'searchExp': '-min\\.js',
'replaceStr': '-debug.js'
}
},
/*
* Check the pages meta-data and cache the result.
* @method _inspectPage
* @private
*/
_inspectPage: function() {
oeach(ON_PAGE, function(v, k) {
if (v.details) {
var m = this.moduleInfo[k],
req = v.details.requires,
mr = m && m.requires;
if (m) {
if (!m._inspected && req && mr.length != req.length) {
// console.log('deleting ' + m.name);
// m.requres = YObject.keys(Y.merge(YArray.hash(req), YArray.hash(mr)));
delete m.expanded;
// delete m.expanded_map;
}
} else {
m = this.addModule(v.details, k);
}
m._inspected = true;
}
}, this);
},
/*
* returns true if b is not loaded, and is required directly or by means of modules it supersedes.
* @private
* @method _requires
* @param {String} mod1 The first module to compare
* @param {String} mod2 The second module to compare
*/
_requires: function(mod1, mod2) {
var i, rm, after_map, s,
info = this.moduleInfo,
m = info[mod1],
other = info[mod2];
if (!m || !other) {
return false;
}
rm = m.expanded_map;
after_map = m.after_map;
// check if this module should be sorted after the other
// do this first to short circut circular deps
if (after_map && (mod2 in after_map)) {
return true;
}
after_map = other.after_map;
// and vis-versa
if (after_map && (mod1 in after_map)) {
return false;
}
// check if this module requires one the other supersedes
s = info[mod2] && info[mod2].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod1, s[i])) {
return true;
}
}
}
s = info[mod1] && info[mod1].supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod2, s[i])) {
return false;
}
}
}
// check if this module requires the other directly
// if (r && YArray.indexOf(r, mod2) > -1) {
if (rm && (mod2 in rm)) {
return true;
}
// external css files should be sorted below yui css
if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
return true;
}
return false;
},
/**
* Apply a new config to the Loader instance
* @method _config
* @param {Object} o The new configuration
*/
_config: function(o) {
var i, j, val, f, group, groupName, self = this;
// apply config values
if (o) {
for (i in o) {
if (o.hasOwnProperty(i)) {
val = o[i];
if (i == 'require') {
self.require(val);
} else if (i == 'skin') {
Y.mix(self.skin, o[i], true);
} else if (i == 'groups') {
for (j in val) {
if (val.hasOwnProperty(j)) {
// Y.log('group: ' + j);
groupName = j;
group = val[j];
self.addGroup(group, groupName);
}
}
} else if (i == 'modules') {
// add a hash of module definitions
oeach(val, self.addModule, self);
} else if (i == 'gallery') {
this.groups.gallery.update(val);
} else if (i == 'yui2' || i == '2in3') {
this.groups.yui2.update(o['2in3'], o.yui2);
} else if (i == 'maxURLLength') {
self[i] = Math.min(MAX_URL_LENGTH, val);
} else {
self[i] = val;
}
}
}
}
// fix filter
f = self.filter;
if (L.isString(f)) {
f = f.toUpperCase();
self.filterName = f;
self.filter = self.FILTER_DEFS[f];
if (f == 'DEBUG') {
self.require('yui-log', 'dump');
}
}
if (self.lang) {
self.require('intl-base', 'intl');
}
},
/**
* Returns the skin module name for the specified skin name. If a
* module name is supplied, the returned skin module name is
* specific to the module passed in.
* @method formatSkin
* @param {string} skin the name of the skin.
* @param {string} mod optional: the name of a module to skin.
* @return {string} the full skin module name.
*/
formatSkin: function(skin, mod) {
var s = SKIN_PREFIX + skin;
if (mod) {
s = s + '-' + mod;
}
return s;
},
/**
* Adds the skin def to the module info
* @method _addSkin
* @param {string} skin the name of the skin.
* @param {string} mod the name of the module.
* @param {string} parent parent module if this is a skin of a
* submodule or plugin.
* @return {string} the module name for the skin.
* @private
*/
_addSkin: function(skin, mod, parent) {
var mdef, pkg, name, nmod,
info = this.moduleInfo,
sinf = this.skin,
ext = info[mod] && info[mod].ext;
// Add a module definition for the module-specific skin css
if (mod) {
name = this.formatSkin(skin, mod);
if (!info[name]) {
mdef = info[mod];
pkg = mdef.pkg || mod;
nmod = {
name: name,
group: mdef.group,
type: 'css',
after: sinf.after,
path: (parent || pkg) + '/' + sinf.base + skin +
'/' + mod + '.css',
ext: ext
};
if (mdef.base) {
nmod.base = mdef.base;
}
if (mdef.configFn) {
nmod.configFn = mdef.configFn;
}
this.addModule(nmod, name);
Y.log('adding skin ' + name + ', ' + parent + ', ' + pkg + ', ' + info[name].path);
}
}
return name;
},
/**
* Add a new module group
* <dl>
* <dt>name:</dt> <dd>required, the group name</dd>
* <dt>base:</dt> <dd>The base dir for this module group</dd>
* <dt>root:</dt> <dd>The root path to add to each combo
* resource path</dd>
* <dt>combine:</dt> <dd>combo handle</dd>
* <dt>comboBase:</dt> <dd>combo service base path</dd>
* <dt>modules:</dt> <dd>the group of modules</dd>
* </dl>
* @method addGroup
* @param {object} o An object containing the module data.
* @param {string} name the group name.
*/
addGroup: function(o, name) {
var mods = o.modules,
self = this;
name = name || o.name;
o.name = name;
self.groups[name] = o;
if (o.patterns) {
oeach(o.patterns, function(v, k) {
v.group = name;
self.patterns[k] = v;
});
}
if (mods) {
oeach(mods, function(v, k) {
v.group = name;
self.addModule(v, k);
}, self);
}
},
/**
* Add a new module to the component metadata.
* <dl>
* <dt>name:</dt> <dd>required, the component name</dd>
* <dt>type:</dt> <dd>required, the component type (js or css)
* </dd>
* <dt>path:</dt> <dd>required, the path to the script from
* "base"</dd>
* <dt>requires:</dt> <dd>array of modules required by this
* component</dd>
* <dt>optional:</dt> <dd>array of optional modules for this
* component</dd>
* <dt>supersedes:</dt> <dd>array of the modules this component
* replaces</dd>
* <dt>after:</dt> <dd>array of modules the components which, if
* present, should be sorted above this one</dd>
* <dt>after_map:</dt> <dd>faster alternative to 'after' -- supply
* a hash instead of an array</dd>
* <dt>rollup:</dt> <dd>the number of superseded modules required
* for automatic rollup</dd>
* <dt>fullpath:</dt> <dd>If fullpath is specified, this is used
* instead of the configured base + path</dd>
* <dt>skinnable:</dt> <dd>flag to determine if skin assets should
* automatically be pulled in</dd>
* <dt>submodules:</dt> <dd>a hash of submodules</dd>
* <dt>group:</dt> <dd>The group the module belongs to -- this
* is set automatically when it is added as part of a group
* configuration.</dd>
* <dt>lang:</dt>
* <dd>array of BCP 47 language tags of languages for which this
* module has localized resource bundles,
* e.g., ["en-GB","zh-Hans-CN"]</dd>
* <dt>condition:</dt>
* <dd>Specifies that the module should be loaded automatically if
* a condition is met. This is an object with up to three fields:
* [trigger] - the name of a module that can trigger the auto-load
* [test] - a function that returns true when the module is to be
* loaded.
* [when] - specifies the load order of the conditional module
* with regard to the position of the trigger module.
* This should be one of three values: 'before', 'after', or
* 'instead'. The default is 'after'.
* </dd>
* <dt>testresults:</dt><dd>a hash of test results from Y.Features.all()</dd>
* </dl>
* @method addModule
* @param {object} o An object containing the module data.
* @param {string} name the module name (optional), required if not
* in the module data.
* @return {object} the module definition or null if
* the object passed in did not provide all required attributes.
*/
addModule: function(o, name) {
name = name || o.name;
if (this.moduleInfo[name]) {
//This catches temp modules loaded via a pattern
// The module will be added twice, once from the pattern and
// Once from the actual add call, this ensures that properties
// that were added to the module the first time around (group: gallery)
// are also added the second time around too.
o = Y.merge(this.moduleInfo[name], o);
}
o.name = name;
if (!o || !o.name) {
return null;
}
if (!o.type) {
o.type = JS;
}
if (!o.path && !o.fullpath) {
o.path = _path(name, name, o.type);
}
o.supersedes = o.supersedes || o.use;
o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
o.requires = this.filterRequires(o.requires) || [];
// Handle submodule logic
var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
j, langs, packName, supName, flatSup, flatLang, lang, ret,
overrides, skinname, when,
conditions = this.conditions, trigger;
// , existing = this.moduleInfo[name], newr;
this.moduleInfo[name] = o;
if (!o.langPack && o.lang) {
langs = YArray(o.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
}
}
if (subs) {
sup = o.supersedes || [];
l = 0;
for (i in subs) {
if (subs.hasOwnProperty(i)) {
s = subs[i];
s.path = s.path || _path(name, i, o.type);
s.pkg = name;
s.group = o.group;
if (s.supersedes) {
sup = sup.concat(s.supersedes);
}
smod = this.addModule(s, i);
sup.push(i);
if (smod.skinnable) {
o.skinnable = true;
overrides = this.skin.overrides;
if (overrides && overrides[i]) {
for (j = 0; j < overrides[i].length; j++) {
skinname = this._addSkin(overrides[i][j],
i, name);
sup.push(skinname);
}
}
skinname = this._addSkin(this.skin.defaultSkin,
i, name);
sup.push(skinname);
}
// looks like we are expected to work out the metadata
// for the parent module language packs from what is
// specified in the child modules.
if (s.lang && s.lang.length) {
langs = YArray(s.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
supName = this.getLangPackName(lang, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
flatSup = flatSup || YArray.hash(smod.supersedes);
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
o.lang = o.lang || [];
flatLang = flatLang || YArray.hash(o.lang);
if (!(lang in flatLang)) {
o.lang.push(lang);
}
// Y.log('pack ' + packName + ' should supersede ' + supName);
// Add rollup file, need to add to supersedes list too
// default packages
packName = this.getLangPackName(ROOT_LANG, name);
supName = this.getLangPackName(ROOT_LANG, i);
smod = this.moduleInfo[packName];
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
// Y.log('pack ' + packName + ' should supersede ' + supName);
// Add rollup file, need to add to supersedes list too
}
}
l++;
}
}
//o.supersedes = YObject.keys(YArray.hash(sup));
o.supersedes = YArray.dedupe(sup);
if (this.allowRollup) {
o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
}
}
plugins = o.plugins;
if (plugins) {
for (i in plugins) {
if (plugins.hasOwnProperty(i)) {
plug = plugins[i];
plug.pkg = name;
plug.path = plug.path || _path(name, i, o.type);
plug.requires = plug.requires || [];
plug.group = o.group;
this.addModule(plug, i);
if (o.skinnable) {
this._addSkin(this.skin.defaultSkin, i, name);
}
}
}
}
if (o.condition) {
t = o.condition.trigger;
if (YUI.Env.aliases[t]) {
t = YUI.Env.aliases[t];
}
if (!Y.Lang.isArray(t)) {
t = [t];
}
for (i = 0; i < t.length; i++) {
trigger = t[i];
when = o.condition.when;
conditions[trigger] = conditions[trigger] || {};
conditions[trigger][name] = o.condition;
// the 'when' attribute can be 'before', 'after', or 'instead'
// the default is after.
if (when && when != 'after') {
if (when == 'instead') { // replace the trigger
o.supersedes = o.supersedes || [];
o.supersedes.push(trigger);
} else { // before the trigger
// the trigger requires the conditional mod,
// so it should appear before the conditional
// mod if we do not intersede.
}
} else { // after the trigger
o.after = o.after || [];
o.after.push(trigger);
}
}
}
if (o.after) {
o.after_map = YArray.hash(o.after);
}
// this.dirty = true;
if (o.configFn) {
ret = o.configFn(o);
if (ret === false) {
delete this.moduleInfo[name];
o = null;
}
}
return o;
},
/**
* Add a requirement for one or more module
* @method require
* @param {string[] | string*} what the modules to load.
*/
require: function(what) {
var a = (typeof what === 'string') ? YArray(arguments) : what;
this.dirty = true;
this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
this._explodeRollups();
},
/**
* Grab all the items that were asked for, check to see if the Loader
* meta-data contains a "use" array. If it doesm remove the asked item and replace it with
* the content of the "use".
* This will make asking for: "dd"
* Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
* @private
* @method _explodeRollups
*/
_explodeRollups: function() {
var self = this, m,
r = self.required;
if (!self.allowRollup) {
oeach(r, function(v, name) {
m = self.getModule(name);
if (m && m.use) {
//delete r[name];
YArray.each(m.use, function(v) {
m = self.getModule(v);
if (m && m.use) {
//delete r[v];
YArray.each(m.use, function(v) {
r[v] = true;
});
} else {
r[v] = true;
}
});
}
});
self.required = r;
}
},
/**
* Explodes the required array to remove aliases and replace them with real modules
* @method filterRequires
* @param {Array} r The original requires array
* @return {Array} The new array of exploded requirements
*/
filterRequires: function(r) {
if (r) {
if (!Y.Lang.isArray(r)) {
r = [r];
}
r = Y.Array(r);
var c = [], i, mod, o, m;
for (i = 0; i < r.length; i++) {
mod = this.getModule(r[i]);
if (mod && mod.use) {
for (o = 0; o < mod.use.length; o++) {
//Must walk the other modules in case a module is a rollup of rollups (datatype)
m = this.getModule(mod.use[o]);
if (m && m.use) {
c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
} else {
c.push(mod.use[o]);
}
}
} else {
c.push(r[i]);
}
}
r = c;
}
return r;
},
/**
* Returns an object containing properties for all modules required
* in order to load the requested module
* @method getRequires
* @param {object} mod The module definition from moduleInfo.
* @return {array} the expanded requirement list.
*/
getRequires: function(mod) {
if (!mod || mod._parsed) {
// Y.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
var i, m, j, add, packName, lang, testresults = this.testresults,
name = mod.name, cond, go,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
d, k, m1,
r, old_mod,
o, skinmod, skindef, skinpar, skinname,
intl = mod.lang || mod.intl,
info = this.moduleInfo,
ftests = Y.Features && Y.Features.tests.load,
hash;
// console.log(name);
// pattern match leaves module stub that needs to be filled out
if (mod.temp && adddef) {
old_mod = mod;
mod = this.addModule(adddef, name);
mod.group = old_mod.group;
mod.pkg = old_mod.pkg;
delete mod.expanded;
}
// console.log('cache: ' + mod.langCache + ' == ' + this.lang);
// if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
//Y.log('Already expanded ' + name + ', ' + mod.expanded);
return mod.expanded;
}
d = [];
hash = {};
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
d.unshift('intl');
r.unshift('intl');
intl = true;
}
o = mod.optional;
// Y.log("getRequires: " + name + " (dirty:" + this.dirty +
// ", expanded:" + mod.expanded + ")");
mod._parsed = true;
mod.langCache = this.lang;
for (i = 0; i < r.length; i++) {
//Y.log(name + ' requiring ' + r[i], 'info', 'loader');
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
// get the requirements from superseded modules, if any
r = mod.supersedes;
if (r) {
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
// if this module has submodules, the requirements list is
// expanded to include the submodules. This is so we can
// prevent dups when a submodule is already loaded and the
// parent is requested.
if (mod.submodules) {
d.push(r[i]);
}
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
if (o && this.loadOptional) {
for (i = 0; i < o.length; i++) {
if (!hash[o[i]]) {
d.push(o[i]);
hash[o[i]] = true;
m = info[o[i]];
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
cond = this.conditions[name];
if (cond) {
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
if (!hash[condmod] && ftests[id].trigger == name) {
if (result && ftests[id]) {
hash[condmod] = true;
d.push(condmod);
}
}
});
} else {
oeach(cond, function(def, condmod) {
if (!hash[condmod]) {
go = def && ((def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[condmod] = true;
d.push(condmod);
m = this.getModule(condmod);
// Y.log('conditional', m);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}, this);
}
}
// Create skin modules
if (mod.skinnable) {
skindef = this.skin.overrides;
oeach(YUI.Env.aliases, function(o, n) {
if (Y.Array.indexOf(o, name) > -1) {
skinpar = n;
}
});
if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
skinname = name;
if (skindef[skinpar]) {
skinname = skinpar;
}
for (i = 0; i < skindef[skinname].length; i++) {
skinmod = this._addSkin(skindef[skinname][i], name);
d.push(skinmod);
}
} else {
skinmod = this._addSkin(this.skin.defaultSkin, name);
d.push(skinmod);
}
}
mod._parsed = false;
if (intl) {
if (mod.lang && !mod.langPack && Y.Intl) {
lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
//Y.log('Best lang: ' + lang + ', this.lang: ' + this.lang + ', mod.lang: ' + mod.lang);
packName = this.getLangPackName(lang, name);
if (packName) {
d.unshift(packName);
}
}
d.unshift(INTL);
}
mod.expanded_map = YArray.hash(d);
mod.expanded = YObject.keys(mod.expanded_map);
return mod.expanded;
},
/**
* Returns a hash of module names the supplied module satisfies.
* @method getProvides
* @param {string} name The name of the module.
* @return {object} what this module provides.
*/
getProvides: function(name) {
var m = this.getModule(name), o, s;
// supmap = this.provides;
if (!m) {
return NOT_FOUND;
}
if (m && !m.provides) {
o = {};
s = m.supersedes;
if (s) {
YArray.each(s, function(v) {
Y.mix(o, this.getProvides(v));
}, this);
}
o[name] = true;
m.provides = o;
}
return m.provides;
},
/**
* Calculates the dependency tree, the result is stored in the sorted
* property.
* @method calculate
* @param {object} o optional options object.
* @param {string} type optional argument to prune modules.
*/
calculate: function(o, type) {
if (o || type || this.dirty) {
if (o) {
this._config(o);
}
if (!this._init) {
this._setup();
}
this._explode();
if (this.allowRollup) {
this._rollup();
} else {
this._explodeRollups();
}
this._reduce();
this._sort();
}
},
/**
* Creates a "psuedo" package for languages provided in the lang array
* @method _addLangPack
* @param {String} lang The language to create
* @param {Object} m The module definition to create the language pack around
* @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
* @return {Object} The module definition
*/
_addLangPack: function(lang, m, packName) {
var name = m.name,
packPath,
existing = this.moduleInfo[packName];
if (!existing) {
packPath = _path((m.pkg || name), packName, JS, true);
this.addModule({ path: packPath,
intl: true,
langPack: true,
ext: m.ext,
group: m.group,
supersedes: [] }, packName);
if (lang) {
Y.Env.lang = Y.Env.lang || {};
Y.Env.lang[lang] = Y.Env.lang[lang] || {};
Y.Env.lang[lang][name] = true;
}
}
return this.moduleInfo[packName];
},
/**
* Investigates the current YUI configuration on the page. By default,
* modules already detected will not be loaded again unless a force
* option is encountered. Called by calculate()
* @method _setup
* @private
*/
_setup: function() {
var info = this.moduleInfo, name, i, j, m, l,
packName;
for (name in info) {
if (info.hasOwnProperty(name)) {
m = info[name];
if (m) {
// remove dups
//m.requires = YObject.keys(YArray.hash(m.requires));
m.requires = YArray.dedupe(m.requires);
// Create lang pack modules
if (m.lang && m.lang.length) {
// Setup root package if the module has lang defined,
// it needs to provide a root language pack
packName = this.getLangPackName(ROOT_LANG, name);
this._addLangPack(null, m, packName);
}
}
}
}
//l = Y.merge(this.inserted);
l = {};
// available modules
if (!this.ignoreRegistered) {
Y.mix(l, GLOBAL_ENV.mods);
}
// add the ignore list to the list of loaded packages
if (this.ignore) {
Y.mix(l, YArray.hash(this.ignore));
}
// expand the list to include superseded modules
for (j in l) {
if (l.hasOwnProperty(j)) {
Y.mix(l, this.getProvides(j));
}
}
// remove modules on the force list from the loaded list
if (this.force) {
for (i = 0; i < this.force.length; i++) {
if (this.force[i] in l) {
delete l[this.force[i]];
}
}
}
Y.mix(this.loaded, l);
this._init = true;
},
/**
* Builds a module name for a language pack
* @method getLangPackName
* @param {string} lang the language code.
* @param {string} mname the module to build it for.
* @return {string} the language pack module name.
*/
getLangPackName: function(lang, mname) {
return ('lang/' + mname + ((lang) ? '_' + lang : ''));
},
/**
* Inspects the required modules list looking for additional
* dependencies. Expands the required list to include all
* required modules. Called by calculate()
* @method _explode
* @private
*/
_explode: function() {
var r = this.required, m, reqs, done = {},
self = this;
// the setup phase is over, all modules have been created
self.dirty = false;
self._explodeRollups();
r = self.required;
oeach(r, function(v, name) {
if (!done[name]) {
done[name] = true;
m = self.getModule(name);
if (m) {
var expound = m.expound;
if (expound) {
r[expound] = self.getModule(expound);
reqs = self.getRequires(r[expound]);
Y.mix(r, YArray.hash(reqs));
}
reqs = self.getRequires(m);
Y.mix(r, YArray.hash(reqs));
}
}
});
// Y.log('After explode: ' + YObject.keys(r));
},
/**
* Get's the loader meta data for the requested module
* @method getModule
* @param {String} mname The module name to get
* @return {Object} The module metadata
*/
getModule: function(mname) {
//TODO: Remove name check - it's a quick hack to fix pattern WIP
if (!mname) {
return null;
}
var p, found, pname,
m = this.moduleInfo[mname],
patterns = this.patterns;
// check the patterns library to see if we should automatically add
// the module with defaults
if (!m) {
// Y.log('testing patterns ' + YObject.keys(patterns));
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
// Y.log('testing pattern ' + i);
p = patterns[pname];
// use the metadata supplied for the pattern
// as the module definition.
if (mname.indexOf(pname) > -1) {
found = p;
break;
}
}
}
if (found) {
if (p.action) {
// Y.log('executing pattern action: ' + pname);
p.action.call(this, mname, pname);
} else {
Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
pname, 'info', 'loader');
// ext true or false?
m = this.addModule(Y.merge(found), mname);
m.temp = true;
}
}
}
return m;
},
// impl in rollup submodule
_rollup: function() { },
/**
* Remove superceded modules and loaded modules. Called by
* calculate() after we have the mega list of all dependencies
* @method _reduce
* @return {object} the reduced dependency hash.
* @private
*/
_reduce: function(r) {
r = r || this.required;
var i, j, s, m, type = this.loadType,
ignore = this.ignore ? YArray.hash(this.ignore) : false;
for (i in r) {
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
// remove if already loaded
if (((this.loaded[i] || ON_PAGE[i]) &&
!this.forceMap[i] && !this.ignoreRegistered) ||
(type && m && m.type != type)) {
delete r[i];
}
if (ignore && ignore[i]) {
delete r[i];
}
// remove anything this module supersedes
s = m && m.supersedes;
if (s) {
for (j = 0; j < s.length; j++) {
if (s[j] in r) {
delete r[s[j]];
}
}
}
}
}
return r;
},
/**
* Handles the queue when a module has been loaded for all cases
* @method _finish
* @private
* @param {String} msg The message from Loader
* @param {Boolean} success A boolean denoting success or failure
*/
_finish: function(msg, success) {
Y.log('loader finishing: ' + msg + ', ' + Y.id + ', ' +
this.data, 'info', 'loader');
_queue.running = false;
var onEnd = this.onEnd;
if (onEnd) {
onEnd.call(this.context, {
msg: msg,
data: this.data,
success: success
});
}
this._continue();
},
/**
* The default Loader onSuccess handler, calls this.onSuccess with a payload
* @method _onSuccess
* @private
*/
_onSuccess: function() {
var self = this, skipped = Y.merge(self.skipped), fn,
failed = [], rreg = self.requireRegistration,
success, msg;
oeach(skipped, function(k) {
delete self.inserted[k];
});
self.skipped = {};
oeach(self.inserted, function(v, k) {
var mod = self.getModule(k);
if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
failed.push(k);
} else {
Y.mix(self.loaded, self.getProvides(k));
}
});
fn = self.onSuccess;
msg = (failed.length) ? 'notregistered' : 'success';
success = !(failed.length);
if (fn) {
fn.call(self.context, {
msg: msg,
data: self.data,
success: success,
failed: failed,
skipped: skipped
});
}
self._finish(msg, success);
},
/**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
*/
_onFailure: function(o) {
Y.log('load error: ' + o.msg + ', ' + Y.id, 'error', 'loader');
var f = this.onFailure, msg = 'failure: ' + o.msg;
if (f) {
f.call(this.context, {
msg: msg,
data: this.data,
success: false
});
}
this._finish(msg, false);
},
/**
* The default Loader onTimeout handler, calls this.onTimeout with a payload
* @method _onTimeout
* @private
*/
_onTimeout: function() {
Y.log('loader timeout: ' + Y.id, 'error', 'loader');
var f = this.onTimeout;
if (f) {
f.call(this.context, {
msg: 'timeout',
data: this.data,
success: false
});
}
this._finish('timeout', false);
},
/**
* Sorts the dependency tree. The last step of calculate()
* @method _sort
* @private
*/
_sort: function() {
// create an indexed list
var s = YObject.keys(this.required),
// loaded = this.loaded,
done = {},
p = 0, l, a, b, j, k, moved, doneKey;
// keep going until we make a pass without moving anything
for (;;) {
l = s.length;
moved = false;
// start the loop after items that are already sorted
for (j = p; j < l; j++) {
// check the next module on the list to see if its
// dependencies have been met
a = s[j];
// check everything below current item and move if we
// find a requirement for the current item
for (k = j + 1; k < l; k++) {
doneKey = a + s[k];
if (!done[doneKey] && this._requires(a, s[k])) {
// extract the dependency so we can move it up
b = s.splice(k, 1);
// insert the dependency above the item that
// requires it
s.splice(j, 0, b[0]);
// only swap two dependencies once to short circut
// circular dependencies
done[doneKey] = true;
// keep working
moved = true;
break;
}
}
// jump out of loop if we moved something
if (moved) {
break;
// this item is sorted, move our pointer and keep going
} else {
p++;
}
}
// when we make it here and moved is false, we are
// finished sorting
if (!moved) {
break;
}
}
this.sorted = s;
},
/**
* (Unimplemented)
* @method partial
* @unimplemented
*/
partial: function(partial, o, type) {
this.sorted = partial;
this.insert(o, type, true);
},
/**
* Handles the actual insertion of script/link tags
* @method _insert
* @param {Object} source The YUI instance the request came from
* @param {Object} o The metadata to include
* @param {String} type JS or CSS
* @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
*/
_insert: function(source, o, type, skipcalc) {
// Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
// restore the state at the time of the request
if (source) {
this._config(source);
}
// build the dependency list
// don't include type so we can process CSS and script in
// one pass when the type is not specified.
if (!skipcalc) {
this.calculate(o);
}
this.loadType = type;
if (!type) {
var self = this;
// Y.log("trying to load css first");
this._internalCallback = function() {
var f = self.onCSS, n, p, sib;
// IE hack for style overrides that are not being applied
if (this.insertBefore && Y.UA.ie) {
n = Y.config.doc.getElementById(this.insertBefore);
p = n.parentNode;
sib = n.nextSibling;
p.removeChild(n);
if (sib) {
p.insertBefore(n, sib);
} else {
p.appendChild(n);
}
}
if (f) {
f.call(self.context, Y);
}
self._internalCallback = null;
self._insert(null, null, JS);
};
this._insert(null, null, CSS);
return;
}
// set a flag to indicate the load has started
this._loading = true;
// flag to indicate we are done with the combo service
// and any additional files will need to be loaded
// individually
this._combineComplete = {};
// start the load
this.loadNext();
},
/**
* Once a loader operation is completely finished, process any additional queued items.
* @method _continue
* @private
*/
_continue: function() {
if (!(_queue.running) && _queue.size() > 0) {
_queue.running = true;
_queue.next()();
}
},
/**
* inserts the requested modules and their dependencies.
* <code>type</code> can be "js" or "css". Both script and
* css are inserted if type is not provided.
* @method insert
* @param {object} o optional options object.
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
// Y.log('public insert() ' + (type || '') + ', ' +
// Y.Object.keys(this.required), "info", "loader");
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
_queue.add(function() {
self._insert(copy, o, type, skipsort);
});
this._continue();
},
/**
* Executed every time a module is loaded, and if we are in a load
* cycle, we attempt to load the next script. Public so that it
* is possible to call this if using a method other than
* Y.register to determine when scripts are fully loaded
* @method loadNext
* @param {string} mname optional the name of the module that has
* been loaded (which is usually why it is time to load the next
* one).
*/
loadNext: function(mname) {
// It is possible that this function is executed due to something
// else on the page loading a YUI module. Only react when we
// are actively loading something
if (!this._loading) {
return;
}
var s, len, i, m, url, fn, msg, attr, group, groupName, j, frag,
comboSource, comboSources, mods, combining, urls, comboBase,
self = this,
type = self.loadType,
handleSuccess = function(o) {
self.loadNext(o.data);
},
handleCombo = function(o) {
self._combineComplete[type] = true;
var i, len = combining.length;
for (i = 0; i < len; i++) {
self.inserted[combining[i]] = true;
}
handleSuccess(o);
};
if (self.combine && (!self._combineComplete[type])) {
combining = [];
self._combining = combining;
s = self.sorted;
len = s.length;
// the default combo base
comboBase = self.comboBase;
url = comboBase;
urls = [];
comboSources = {};
for (i = 0; i < len; i++) {
comboSource = comboBase;
m = self.getModule(s[i]);
groupName = m && m.group;
if (groupName) {
group = self.groups[groupName];
if (!group.combine) {
m.combine = false;
continue;
}
m.combine = true;
if (group.comboBase) {
comboSource = group.comboBase;
}
if ("root" in group && L.isValue(group.root)) {
m.root = group.root;
}
}
comboSources[comboSource] = comboSources[comboSource] || [];
comboSources[comboSource].push(m);
}
for (j in comboSources) {
if (comboSources.hasOwnProperty(j)) {
url = j;
mods = comboSources[j];
len = mods.length;
for (i = 0; i < len; i++) {
// m = self.getModule(s[i]);
m = mods[i];
// Do not try to combine non-yui JS unless combo def
// is found
if (m && (m.type === type) && (m.combine || !m.ext)) {
frag = ((L.isValue(m.root)) ? m.root : self.root) + m.path;
if ((url !== j) && (i < (len - 1)) &&
((frag.length + url.length) > self.maxURLLength)) {
urls.push(self._filter(url));
url = j;
}
url += frag;
if (i < (len - 1)) {
url += self.comboSep;
}
combining.push(m.name);
}
}
if (combining.length && (url != j)) {
urls.push(self._filter(url));
}
}
}
if (combining.length) {
Y.log('Attempting to use combo: ' + combining, 'info', 'loader');
// if (m.type === CSS) {
if (type === CSS) {
fn = Y.Get.css;
attr = self.cssAttributes;
} else {
fn = Y.Get.script;
attr = self.jsAttributes;
}
fn(urls, {
data: self._loading,
onSuccess: handleCombo,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
insertBefore: self.insertBefore,
charset: self.charset,
attributes: attr,
timeout: self.timeout,
autopurge: false,
context: self
});
return;
} else {
self._combineComplete[type] = true;
}
}
if (mname) {
// if the module that was just loaded isn't what we were expecting,
// continue to wait
if (mname !== self._loading) {
return;
}
// Y.log("loadNext executing, just loaded " + mname + ", " +
// Y.id, "info", "loader");
// The global handler that is called when each module is loaded
// will pass that module name to this function. Storing this
// data to avoid loading the same module multiple times
// centralize this in the callback
self.inserted[mname] = true;
// self.loaded[mname] = true;
// provided = self.getProvides(mname);
// Y.mix(self.loaded, provided);
// Y.mix(self.inserted, provided);
if (self.onProgress) {
self.onProgress.call(self.context, {
name: mname,
data: self.data
});
}
}
s = self.sorted;
len = s.length;
for (i = 0; i < len; i = i + 1) {
// this.inserted keeps track of what the loader has loaded.
// move on if this item is done.
if (s[i] in self.inserted) {
continue;
}
// Because rollups will cause multiple load notifications
// from Y, loadNext may be called multiple times for
// the same module when loading a rollup. We can safely
// skip the subsequent requests
if (s[i] === self._loading) {
Y.log('still loading ' + s[i] + ', waiting', 'info', 'loader');
return;
}
// log("inserting " + s[i]);
m = self.getModule(s[i]);
if (!m) {
if (!self.skipped[s[i]]) {
msg = 'Undefined module ' + s[i] + ' skipped';
Y.log(msg, 'warn', 'loader');
// self.inserted[s[i]] = true;
self.skipped[s[i]] = true;
}
continue;
}
group = (m.group && self.groups[m.group]) || NOT_FOUND;
// The load type is stored to offer the possibility to load
// the css separately from the script.
if (!type || type === m.type) {
self._loading = s[i];
Y.log('attempting to load ' + s[i] + ', ' + self.base, 'info', 'loader');
if (m.type === CSS) {
fn = Y.Get.css;
attr = self.cssAttributes;
} else {
fn = Y.Get.script;
attr = self.jsAttributes;
}
url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
self._url(m.path, s[i], group.base || m.base);
fn(url, {
data: s[i],
onSuccess: handleSuccess,
insertBefore: self.insertBefore,
charset: self.charset,
attributes: attr,
onFailure: self._onFailure,
onTimeout: self._onTimeout,
timeout: self.timeout,
autopurge: false,
context: self
});
return;
}
}
// we are finished
self._loading = null;
fn = self._internalCallback;
// internal callback for loading css first
if (fn) {
// Y.log('loader internal');
self._internalCallback = null;
fn.call(self);
} else {
// Y.log('loader complete');
self._onSuccess();
}
},
/**
* Apply filter defined for this instance to a url/path
* method _filter
* @param {string} u the string to filter.
* @param {string} name the name of the module, if we are processing
* a single module as opposed to a combined url.
* @return {string} the filtered string.
* @private
*/
_filter: function(u, name) {
var f = this.filter,
hasFilter = name && (name in this.filters),
modFilter = hasFilter && this.filters[name];
if (u) {
if (hasFilter) {
f = (L.isString(modFilter)) ?
this.FILTER_DEFS[modFilter.toUpperCase()] || null :
modFilter;
}
if (f) {
u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
}
}
return u;
},
/**
* Generates the full url for a module
* method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @pamra {String} [base=self.base] The base url to use
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
* @param {Array} [s=loader.sorted] An override for the loader.sorted array
* @return {Object} Object hash (js and css) of two arrays of file lists
* @example This method can be used as an off-line dep calculator
*
* var Y = YUI();
* var loader = new Y.Loader({
* filter: 'debug',
* base: '../../',
* root: 'build/',
* combine: true,
* require: ['node', 'dd', 'console']
* });
* var out = loader.resolve(true);
*
*/
resolve: function(calc, s) {
var self = this, i, m, url, out = { js: [], css: [] };
if (calc) {
self.calculate();
}
s = s || self.sorted;
for (i = 0; i < s.length; i++) {
m = self.getModule(s[i]);
if (m) {
if (self.combine) {
url = self._filter((self.root + m.path), m.name, self.root);
} else {
url = self._filter(m.fullpath, m.name, '') || self._url(m.path, m.name);
}
out[m.type].push(url);
}
}
if (self.combine) {
out.js = [self.comboBase + out.js.join(self.comboSep)];
out.css = [self.comboBase + out.css.join(self.comboSep)];
}
return out;
}
};
}, '@VERSION@' ,{requires:['get']});
|
src/components/About/AboutPage.js | deepak-kapoor/react-elections-dashboard | import React from 'react';
class AboutPage extends React.Component {
render() {
return (
<div>
<h1>About</h1>
<p>This application is created using React.js.</p>
<p>It is a learning exercise and there is no guarantee of data accuracy.</p>
<p>Credits:</p>
<ol>
<li>React.js</li>
<li>Bootswatch</li>
<li>AEC for data</li>
</ol>
</div>
);
}
}
export default AboutPage; |
themes/genius/Genius 2.3.1 Bootstrap 4/React_Starter/src/components/Footer/Footer.js | davidchristie/kaenga-housing-calculator | import React, { Component } from 'react';
class Footer extends Component {
render() {
return (
<footer className="app-footer">
<a href="https://genesisui.com">Genius</a> © 2017 creativeLabs.
<span className="float-right">Powered by <a href="https://genesisui.com">GenesisUI</a></span>
</footer>
)
}
}
export default Footer;
|
spec/javascripts/jsx/grading/AssignmentPostingPolicyTray/AssignmentPostingPolicyTraySpec.js | djbender/canvas-lms | /*
* Copyright (C) 2019 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import ReactDOM from 'react-dom'
import {waitForElement, wait} from '@testing-library/react'
import AssignmentPostingPolicyTray from 'jsx/grading/AssignmentPostingPolicyTray'
import * as Api from 'jsx/grading/AssignmentPostingPolicyTray/Api'
import * as FlashAlert from 'jsx/shared/FlashAlert'
QUnit.module('AssignmentPostingPolicyTray', suiteHooks => {
let $container
let context
let tray
suiteHooks.beforeEach(() => {
$container = document.body.appendChild(document.createElement('div'))
context = {
assignment: {
id: '2301',
name: 'Math 1.1',
postManually: false
},
onAssignmentPostPolicyUpdated: sinon.spy(),
onExited: sinon.spy()
}
const bindRef = ref => {
tray = ref
}
ReactDOM.render(<AssignmentPostingPolicyTray ref={bindRef} />, $container)
})
suiteHooks.afterEach(async () => {
if (getTrayElement()) {
getCloseButton().click()
await waitForTrayClosed()
}
ReactDOM.unmountComponentAtNode($container)
$container.remove()
})
function getTrayElement() {
return document.querySelector('[role="dialog"][aria-label="Grade posting policy tray"]')
}
function getCancelButton() {
const $tray = getTrayElement()
return [...$tray.querySelectorAll('button')].find($button => $button.textContent === 'Cancel')
}
function getCloseButton() {
const $tray = getTrayElement()
return [...$tray.querySelectorAll('button')].find($button => $button.textContent === 'Close')
}
function getSaveButton() {
const $tray = getTrayElement()
return [...$tray.querySelectorAll('button')].find($button => $button.textContent === 'Save')
}
function getLabel(text) {
const $tray = getTrayElement()
return [...$tray.querySelectorAll('label')].find($label => $label.textContent.includes(text))
}
function getInputByLabel(label) {
const $label = getLabel(label)
if ($label === undefined) return undefined
return document.getElementById($label.htmlFor)
}
function show() {
tray.show(context)
return waitForElement(getTrayElement)
}
function waitForTrayClosed() {
return wait(() => {
if (context.onExited.callCount > 0) {
return
}
throw new Error('Tray is still open')
})
}
QUnit.module('#show()', () => {
test('opens the tray', async () => {
await show()
ok(getTrayElement())
})
test('includes the name of the assignment', async () => {
await show()
const heading = getTrayElement().querySelector('h2')
equal(heading.textContent, 'Grade Posting Policy: Math 1.1')
})
test('disables the "Automatically" input for an anonymous assignment', async () => {
context.assignment.anonymousGrading = true
await show()
strictEqual(getInputByLabel('Automatically').disabled, true)
})
QUnit.module('when the assignment is moderated', hooks => {
hooks.beforeEach(() => {
context.assignment.moderatedGrading = true
})
test('disables the "Automatically" input when grades are not published', async () => {
context.assignment.gradesPublished = false
await show()
strictEqual(getInputByLabel('Automatically').disabled, true)
})
test('enables the "Automatically" input when grades are published', async () => {
context.assignment.gradesPublished = true
await show()
strictEqual(getInputByLabel('Automatically').disabled, false)
})
test('always disables the "Automatically" input when the assignment is anonymous', async () => {
context.assignment.anonymousGrading = true
context.assignment.gradesPublished = true
await show()
strictEqual(getInputByLabel('Automatically').disabled, true)
})
})
test('enables the "Automatically" input if the assignment is not anonymous or moderated', async () => {
await show()
strictEqual(getInputByLabel('Automatically').disabled, false)
})
test('the "Automatically" input is initally selected if an auto-posted assignment is passed', async () => {
await show()
strictEqual(getInputByLabel('Automatically').checked, true)
})
test('the "Manually" input is initially selected if a manual-posted assignment is passed', async () => {
context.assignment.postManually = true
await show()
strictEqual(getInputByLabel('Manually').checked, true)
})
test('enables the "Save" button if the postManually value has changed and no request is in progress', async () => {
await show()
getInputByLabel('Manually').click()
strictEqual(getSaveButton().disabled, false)
})
test('disables the "Save" button if the postManually value has not changed', async () => {
await show()
getInputByLabel('Manually').click()
getInputByLabel('Automatically').click()
strictEqual(getSaveButton().disabled, true)
})
test('disables the "Save" button if a request is already in progress', async () => {
let resolveRequest
const setAssignmentPostPolicyStub = sinon.stub(Api, 'setAssignmentPostPolicy').returns(
new Promise(resolve => {
resolveRequest = () => {
resolve({assignmnentId: '2301', postManually: true})
}
})
)
await show()
getInputByLabel('Manually').click()
getSaveButton().click()
strictEqual(getSaveButton().disabled, true)
resolveRequest()
setAssignmentPostPolicyStub.restore()
})
})
QUnit.module('"Close" Button', hooks => {
hooks.beforeEach(show)
test('closes the tray', async () => {
getCloseButton().click()
await waitForTrayClosed()
notOk(getTrayElement())
})
})
QUnit.module('"Cancel" button', hooks => {
hooks.beforeEach(show)
test('closes the tray', async () => {
getCancelButton().click()
await waitForTrayClosed()
notOk(getTrayElement())
})
test('is enabled when no request is in progress', () => {
strictEqual(getCancelButton().disabled, false)
})
test('is disabled when a request is in progress', () => {
let resolveRequest
const setAssignmentPostPolicyStub = sinon.stub(Api, 'setAssignmentPostPolicy').returns(
new Promise(resolve => {
resolveRequest = () => {
resolve({assignmnentId: '2301', postManually: true})
}
})
)
getInputByLabel('Manually').click()
getSaveButton().click()
strictEqual(getCancelButton().disabled, true)
resolveRequest()
setAssignmentPostPolicyStub.restore()
})
})
QUnit.module('"Save" button', hooks => {
let setAssignmentPostPolicyStub
let showFlashAlertStub
hooks.beforeEach(() => {
return show().then(() => {
getInputByLabel('Manually').click()
showFlashAlertStub = sinon.stub(FlashAlert, 'showFlashAlert')
setAssignmentPostPolicyStub = sinon
.stub(Api, 'setAssignmentPostPolicy')
.resolves({assignmentId: '2301', postManually: true})
})
})
hooks.afterEach(() => {
FlashAlert.destroyContainer()
setAssignmentPostPolicyStub.restore()
showFlashAlertStub.restore()
})
test('calls setAssignmentPostPolicy', () => {
getSaveButton().click()
strictEqual(setAssignmentPostPolicyStub.callCount, 1)
})
test('passes the assignment ID to setAssignmentPostPolicy', () => {
getSaveButton().click()
strictEqual(setAssignmentPostPolicyStub.firstCall.args[0].assignmentId, '2301')
})
test('passes the selected postManually value to setAssignmentPostPolicy', () => {
getSaveButton().click()
strictEqual(setAssignmentPostPolicyStub.firstCall.args[0].postManually, true)
})
QUnit.module('on success', () => {
const waitForSuccess = async () => {
await wait(() => getTrayElement() == null)
}
test('renders a success alert', async () => {
getSaveButton().click()
await waitForSuccess()
strictEqual(showFlashAlertStub.callCount, 1)
})
test('the rendered alert includes a message referencing the assignment', async () => {
getSaveButton().click()
await waitForSuccess()
const message = 'Success! The post policy for Math 1.1 has been updated.'
strictEqual(showFlashAlertStub.firstCall.args[0].message, message)
})
test('calls the provided onAssignmentPostPolicyUpdated function', async () => {
getSaveButton().click()
await waitForSuccess()
strictEqual(context.onAssignmentPostPolicyUpdated.callCount, 1)
})
test('passes the assignmentId to onAssignmentPostPolicyUpdated', async () => {
getSaveButton().click()
await waitForSuccess()
strictEqual(context.onAssignmentPostPolicyUpdated.firstCall.args[0].assignmentId, '2301')
})
test('passes the postManually value to onAssignmentPostPolicyUpdated', async () => {
getSaveButton().click()
await waitForSuccess()
strictEqual(context.onAssignmentPostPolicyUpdated.firstCall.args[0].postManually, true)
})
})
QUnit.module('on failure', failureHooks => {
const waitForFailure = async () => {
await wait(() => FlashAlert.showFlashAlert.callCount > 0)
}
failureHooks.beforeEach(() => {
setAssignmentPostPolicyStub.rejects({error: 'oh no'})
})
test('renders an error alert', async () => {
getSaveButton().click()
await waitForFailure()
strictEqual(showFlashAlertStub.callCount, 1)
})
test('the rendered error alert contains a message', async () => {
getSaveButton().click()
await waitForFailure()
const message = 'An error occurred while saving the assignment post policy'
strictEqual(showFlashAlertStub.firstCall.args[0].message, message)
})
test('the tray remains open', async () => {
getSaveButton().click()
await waitForFailure()
ok(getTrayElement())
})
})
})
})
|
src/app.js | xiwc/kitematic | require.main.paths.splice(0, 0, process.env.NODE_PATH);
import remote from 'remote';
var Menu = remote.require('menu');
import React from 'react';
import SetupStore from './stores/SetupStore';
import ipc from 'ipc';
import machine from './utils/DockerMachineUtil';
import metrics from './utils/MetricsUtil';
import template from './menutemplate';
import webUtil from './utils/WebUtil';
import hubUtil from './utils/HubUtil';
var urlUtil = require('./utils/URLUtil');
var app = remote.require('app');
import request from 'request';
import docker from './utils/DockerUtil';
import hub from './utils/HubUtil';
import Router from 'react-router';
import routes from './routes';
import routerContainer from './router';
import repositoryActions from './actions/RepositoryActions';
hubUtil.init();
if (hubUtil.loggedin()) {
repositoryActions.repos();
}
repositoryActions.recommended();
webUtil.addWindowSizeSaving();
webUtil.addLiveReload();
webUtil.addBugReporting();
webUtil.disableGlobalBackspace();
Menu.setApplicationMenu(Menu.buildFromTemplate(template()));
metrics.track('Started App');
metrics.track('app heartbeat');
setInterval(function () {
metrics.track('app heartbeat');
}, 14400000);
var router = Router.create({
routes: routes
});
router.run(Handler => React.render(<Handler/>, document.body));
routerContainer.set(router);
SetupStore.setup().then(() => {
Menu.setApplicationMenu(Menu.buildFromTemplate(template()));
docker.init();
if (!hub.prompted() && !hub.loggedin()) {
router.transitionTo('login');
} else {
router.transitionTo('search');
}
}).catch(err => {
metrics.track('Setup Failed', {
step: 'catch',
message: err.message
});
throw err;
});
ipc.on('application:quitting', () => {
if (localStorage.getItem('settings.closeVMOnQuit') === 'true') {
machine.stop();
}
});
// Event fires when the app receives a docker:// URL such as
// docker://repository/run/redis
ipc.on('application:open-url', opts => {
request.get('https://kitematic.com/flags.json', (err, response, body) => {
if (err || response.statusCode !== 200) {
return;
}
var flags = JSON.parse(body);
if (!flags) {
return;
}
urlUtil.openUrl(opts.url, flags, app.getVersion());
});
});
module.exports = {
router: router
};
|
PC_client_dist/js/main.d6a9dbb643442c12a8e0.js | yodfz/nblog | webpackJsonp([0],{
/***/ "./PC_client/components/Article/Article.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Article/Article.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Article/Article.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Article/Article.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/components/Article/List.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _dec, _class, _class2, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _Article = __webpack_require__("./PC_client/components/Article/Article.less");
var _Article2 = _interopRequireDefault(_Article);
var _ListItem = __webpack_require__("./PC_client/components/Article/ListItem.js");
var _ListItem2 = _interopRequireDefault(_ListItem);
var _UI = __webpack_require__("./PC_client/components/UI/index.js");
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _Article3 = __webpack_require__("./PC_client/store/actions/Article.js");
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var List = (_dec = (0, _reactRedux.connect)(function (state) {
return { state: state.Article };
}, function (dispatch) {
return (0, _redux.bindActionCreators)({ selectArticle: _Article3.selectArticle, getArticle: _Article3.getArticle }, dispatch);
}), _dec(_class = (_temp = _class2 = function (_Component) {
(0, _inherits3.default)(List, _Component);
function List(props) {
(0, _classCallCheck3.default)(this, List);
return (0, _possibleConstructorReturn3.default)(this, (List.__proto__ || (0, _getPrototypeOf2.default)(List)).call(this, props));
}
(0, _createClass3.default)(List, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'handleLoadMore',
value: function handleLoadMore() {
this.props.getArticle(this.props.state.pageIndex + 1, this.props.searchkey ? this.props.searchkey : '');
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var loadingEl = function () {
if (_this2.props.state.status == _actionsType.STATE.FETCHING) {
return _react2.default.createElement(
'div',
{ className: 'loadMore' },
_react2.default.createElement(_UI.Icon, { name: 'loading1' }),
'\xA0\xA0\u6B63\u5728\u83B7\u53D6\u6587\u7AE0'
);
}
}();
var loadingButton = void 0;
if (this.props.state.status != _actionsType.STATE.FETCHING) {
loadingButton = _react2.default.createElement(
'button',
{
className: 'loadMoreButton',
onClick: this.handleLoadMore.bind(this) },
'\u52A0\u8F7D\u66F4\u591A\u6587\u7AE0'
);
}
return _react2.default.createElement(
'div',
{ className: _Article2.default.List, id: this.props.id },
this.props.state.data.map(function (item) {
return _react2.default.createElement(_ListItem2.default, { data: item, className: _this2.props.state.selectIdx == item.idx ? 'selected' : '',
select: _this2.props.selectArticle, key: item.idx });
}),
loadingEl,
loadingButton
);
}
}]);
return List;
}(_react.Component), _class2.defaultProps = {}, _class2.propTypes = {}, _temp)) || _class);
exports.default = List;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(List, 'List', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/Article/List.js');
}();
;
/***/ }),
/***/ "./PC_client/components/Article/ListItem.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _Article = __webpack_require__("./PC_client/components/Article/Article.less");
var _Article2 = _interopRequireDefault(_Article);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ListItem = (_temp = _class = function (_Component) {
(0, _inherits3.default)(ListItem, _Component);
function ListItem(props) {
(0, _classCallCheck3.default)(this, ListItem);
var _this = (0, _possibleConstructorReturn3.default)(this, (ListItem.__proto__ || (0, _getPrototypeOf2.default)(ListItem)).call(this, props));
_this.select = props.select;
return _this;
}
(0, _createClass3.default)(ListItem, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
this.model = this.props.data;
var formatDate = function formatDate(str) {
var $date = new Date(str);
return $date.getFullYear() + '-' + ($date.getMonth() + 1) + '-' + $date.getDate();
};
return _react2.default.createElement(
'div',
{ onClick: this.select.bind(this, this.model.idx),
className: _Article2.default.ListItem + ' ' + (this.props.className || '') },
_react2.default.createElement(
'h3',
null,
this.model.title
),
_react2.default.createElement(
'p',
{ className: 'description' },
this.model.description
),
_react2.default.createElement(
'span',
{ className: 'description' },
this.model.tag && this.model.tag.split(' ').map(function (p) {
return '#' + p + ' ';
})
),
_react2.default.createElement(
'span',
{ className: 'description par' },
formatDate(this.model.createdAt)
)
);
}
}]);
return ListItem;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = ListItem;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(ListItem, 'ListItem', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/Article/ListItem.js');
}();
;
/***/ }),
/***/ "./PC_client/components/Article/setting.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _Article = __webpack_require__("./PC_client/components/Article/Article.less");
var _Article2 = _interopRequireDefault(_Article);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var setting = (_temp = _class = function (_Component) {
(0, _inherits3.default)(setting, _Component);
function setting() {
(0, _classCallCheck3.default)(this, setting);
return (0, _possibleConstructorReturn3.default)(this, (setting.__proto__ || (0, _getPrototypeOf2.default)(setting)).call(this));
}
(0, _createClass3.default)(setting, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement('div', { className: _Article2.default.setting, onClick: this.props.onClick });
}
}]);
return setting;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = setting;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(setting, 'setting', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/Article/setting.js');
}();
;
/***/ }),
/***/ "./PC_client/components/Markdown/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _services = __webpack_require__("./PC_client/services/index.js");
var _services2 = _interopRequireDefault(_services);
var _index = __webpack_require__("./PC_client/components/Markdown/index.less");
var _index2 = _interopRequireDefault(_index);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Markdown = (_temp = _class = function (_Component) {
(0, _inherits3.default)(Markdown, _Component);
function Markdown(props) {
(0, _classCallCheck3.default)(this, Markdown);
var _this = (0, _possibleConstructorReturn3.default)(this, (Markdown.__proto__ || (0, _getPrototypeOf2.default)(Markdown)).call(this));
_this.editor = null;
return _this;
}
(0, _createClass3.default)(Markdown, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
var that = this;
this.editor = new Editor({
element: this.refs.MarkdownEditor // document.getElementById('editor')
});
this.editor.render();
this.props.bindCodemirror(this.editor.codemirror);
this.refs.editor.addEventListener("drop", function (e) {
console.log('drop');
});
this.refs.editor.addEventListener("dragover", function (e) {
console.log('dragover');
});
this.refs.editor.addEventListener("paste", function (e) {
var cbd = e.clipboardData;
//var ua = window.navigator.userAgent;
// for(var i = 0; i < cbd.items.length; i++) {
var item = cbd.items[0];
if (item.kind == "file") {
var blob = item.getAsFile();
if (blob.size === 0) {
return;
}
// blob 就是从剪切板获得的文件 可以进行上传或其他操作
var postFormData = new FormData();
postFormData.append('file', blob);
_services2.default.upload(postFormData, { method: 'POST' }).then(function (data) {
that.editor.codemirror.replaceSelection('', 'Alt');
});
}
// }
}, false);
// this.editor.codemirror.on('paste', function (editor, event) {
// console.log('codemirror paste');
// var data = editor.getValue();
// });
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
// console.log(this.props.content);
// this.editor.render();
// console.log();
this.editor.codemirror.setValue(this.props.content);
this.props.bindCodemirror(this.editor.codemirror);
this.content = this.props.content;
var previewactive = document.querySelector('.editor-preview-active');
if (previewactive) {
previewactive.classList.remove('editor-preview-active');
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'handleMouseClick',
value: function handleMouseClick(event) {
// console.log(window.getSelection().toString());
}
}, {
key: 'handleUpdatState',
value: function handleUpdatState() {}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
{ ref: 'editor', className: _index2.default.index },
_react2.default.createElement('textarea', { name: '', id: '', ref: 'MarkdownEditor', cols: '30', rows: '10',
defaultValue: this.props.content })
);
}
}]);
return Markdown;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = Markdown;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(Markdown, 'Markdown', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/Markdown/index.js');
}();
;
/***/ }),
/***/ "./PC_client/components/Markdown/index.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Markdown/index.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Markdown/index.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Markdown/index.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/components/Menu/MenuItem.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _reactRouterDom = __webpack_require__("./node_modules/react-router-dom/es/index.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = function _default(item) {
return _react2.default.createElement(
_reactRouterDom.Link,
{ to: item.url },
_react2.default.createElement(
'li',
{ onClick: item.select, className: item.className },
_react2.default.createElement('i', { className: "iconfont icon-" + item.icon }),
item.text
)
);
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/Menu/MenuItem.js');
}();
;
/***/ }),
/***/ "./PC_client/components/Time/showTime.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _utils = __webpack_require__("./PC_client/core/utils.js");
var _utils2 = _interopRequireDefault(_utils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = function _default(props) {
var $dateTime = props.date;
return _react2.default.createElement(
'div',
{ className: 'showTime' },
_react2.default.createElement(
'span',
{ className: 'date' },
$dateTime.getDate() < 10 ? '0' : '',
$dateTime.getDate()
),
_react2.default.createElement(
'span',
{ className: 'monthAndYear' },
_utils2.default.returnMonthStringFormNumber($dateTime.getMonth() + 1),
'\u6708 \xA0',
$dateTime.getFullYear()
),
_react2.default.createElement(
'span',
{ className: 'weekAndTime' },
'\u661F\u671F',
_utils2.default.returnWeekStringFormNumber($dateTime.getDay()),
'\xA0',
$dateTime.getHours() < 10 ? '0' : '',
$dateTime.getHours(),
':',
$dateTime.getMinutes() < 10 ? '0' : '',
$dateTime.getMinutes()
)
);
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/Time/showTime.js');
}();
;
/***/ }),
/***/ "./PC_client/components/UI/Icon/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _index = __webpack_require__("./PC_client/components/UI/Icon/index.less");
var _index2 = _interopRequireDefault(_index);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var animationList = ['loading1'];
var _default = function _default(props) {
var animationClass = animationList.indexOf(props.name) > -1 ? 'icon-animation' : '';
return _react2.default.createElement('i', { className: "iconfont icon-" + props.name + ' ' + (props.className || '') + ' ' + animationClass });
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(animationList, 'animationList', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/UI/Icon/index.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/UI/Icon/index.js');
}();
;
/***/ }),
/***/ "./PC_client/components/UI/Icon/index.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Icon/index.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Icon/index.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Icon/index.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/components/UI/Input/index.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Input/index.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Input/index.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Input/index.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/components/UI/Input/input.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _extends2 = __webpack_require__("./node_modules/babel-runtime/helpers/extends.js");
var _extends3 = _interopRequireDefault(_extends2);
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _index = __webpack_require__("./PC_client/components/UI/Input/index.less");
var _index2 = _interopRequireDefault(_index);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Input = function (_Component) {
(0, _inherits3.default)(Input, _Component);
function Input() {
(0, _classCallCheck3.default)(this, Input);
return (0, _possibleConstructorReturn3.default)(this, (Input.__proto__ || (0, _getPrototypeOf2.default)(Input)).call(this));
}
(0, _createClass3.default)(Input, [{
key: 'componentDidUpdate',
value: function componentDidUpdate() {
if (this.props.autoFocus) {
this.refs.input.focus();
}
}
}, {
key: 'render',
value: function render() {
var props = this.props;
var className = _index2.default.inputDefault + ' ' + (props.className || '');
return _react2.default.createElement('input', (0, _extends3.default)({ type: 'text', ref: 'input' }, props, { className: className }));
}
}]);
return Input;
}(_react.Component);
exports.default = Input;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(Input, 'Input', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/components/UI/Input/input.js');
}();
;
/***/ }),
/***/ "./PC_client/components/UI/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Input = exports.Icon = undefined;
var _input = __webpack_require__("./PC_client/components/UI/Input/input.js");
var _input2 = _interopRequireDefault(_input);
var _index = __webpack_require__("./PC_client/components/UI/Icon/index.js");
var _index2 = _interopRequireDefault(_index);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Icon = _index2.default;
exports.Input = _input2.default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
}();
;
/***/ }),
/***/ "./PC_client/core/handle.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _default = {
handleOnChange: function handleOnChange(event) {
var id = event.target.id;
var idArrays = id.split('.');
var obj = this.state;
var NowObj = obj;
for (var i = 0; i < idArrays.length; i++) {
if (i < idArrays.length - 1) {
// NowObj[idArrays[i]] = {};
if (!NowObj[idArrays[i]]) {
NowObj[idArrays[i]] = {};
}
NowObj = NowObj[idArrays[i]];
} else {
NowObj[idArrays[i]] = event.target.value;
}
}
console.log(obj);
this.setState(obj);
// this.eventUpdateContent();
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/core/handle.js');
}();
;
/***/ }),
/***/ "./PC_client/core/utils.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var _default = {
returnMonthStringFormNumber: function returnMonthStringFormNumber(number) {
var str = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
return str[number];
},
returnWeekStringFormNumber: function returnWeekStringFormNumber(number) {
var str = ['天', '一', '二', '三', '四', '五', '六'];
return str[number];
},
formatString: function formatString(STATUS) {
if (STATUS == _actionsType.STATE.FETCHING) return '正在与服务器聊天,请稍后...';
if (STATUS == _actionsType.STATE.SUCCESS) return '执行成功';
if (STATUS == _actionsType.STATE.ERROR) return '服务器聊崩了,看看出什么问题了。';
return STATUS;
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/core/utils.js');
}();
;
/***/ }),
/***/ "./PC_client/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__("./node_modules/react-dom/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _reactRouterDom = __webpack_require__("./node_modules/react-router-dom/es/index.js");
var _reduxSaga = __webpack_require__("./node_modules/redux-saga/es/index.js");
var _reduxSaga2 = _interopRequireDefault(_reduxSaga);
var _store = __webpack_require__("./PC_client/store/index.js");
var _store2 = _interopRequireDefault(_store);
var _sagas = __webpack_require__("./PC_client/store/sagas/index.js");
var _sagas2 = _interopRequireDefault(_sagas);
var _index = __webpack_require__("./PC_client/index.less");
var _index2 = _interopRequireDefault(_index);
var _Main = __webpack_require__("./PC_client/views/manage/Main.js");
var _Main2 = _interopRequireDefault(_Main);
var _NoMatch = __webpack_require__("./PC_client/views/manage/NoMatch.js");
var _NoMatch2 = _interopRequireDefault(_NoMatch);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var sagaMiddleware = (0, _reduxSaga2.default)();
// import Routes from './routers';
var store = (0, _redux.createStore)(_store2.default, (0, _redux.applyMiddleware)(sagaMiddleware));
// sagaMiddleware.run(watchSagas.watchGetArticleList);
var run = function run() {
try {
sagaMiddleware.run(_sagas.sagas);
} catch (err) {
run();
}
};
run();
(0, _reactDom.render)(_react2.default.createElement(
_reactRedux.Provider,
{ store: store },
_react2.default.createElement(
_reactRouterDom.BrowserRouter,
null,
_react2.default.createElement(
_reactRouterDom.Switch,
null,
_react2.default.createElement(_reactRouterDom.Route, { path: '/manage', component: _Main2.default }),
_react2.default.createElement(_reactRouterDom.Route, { component: _NoMatch2.default })
)
)
), document.querySelector('#app'));
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(sagaMiddleware, 'sagaMiddleware', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/index.js');
__REACT_HOT_LOADER__.register(store, 'store', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/index.js');
__REACT_HOT_LOADER__.register(run, 'run', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/index.js');
}();
;
/***/ }),
/***/ "./PC_client/index.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/index.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/index.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/index.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/services/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _url = __webpack_require__("./PC_client/services/url.js");
var _url2 = _interopRequireDefault(_url);
var _axios = __webpack_require__("./node_modules/axios/index.js");
var _axios2 = _interopRequireDefault(_axios);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var fn = {};
_url2.default.map(function (p) {
fn[p.key] = function (data) {
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
// let params = {
// pageIndex: $pageIndex || 1
// };
return (0, _axios2.default)((0, _assign2.default)({}, {
method: opt.method || p.method || 'GET',
url: p.url,
// params: data,
// data: data,
headers: opt.headers || {}
}, opt, (opt.method || p.method) == 'POST' ? { data: data } : { params: data }));
};
});
var _default = fn;
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(fn, 'fn', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/services/index.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/services/index.js');
}();
;
/***/ }),
/***/ "./PC_client/services/url.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _default = [{ key: 'article_list', url: window.config.apiPre + 'article' }, { key: 'article_save', url: window.config.apiPre + 'article/save', method: 'POST' }, { key: 'article_delete', url: window.config.apiPre + 'article/delete', method: 'POST' }, { key: 'photo_list', url: window.config.apiPre + 'photo' }, { key: 'photo_save', url: window.config.apiPre + 'photo/save', method: 'POST' }, { key: 'photo_delete', url: window.config.apiPre + 'photo/delete', method: 'POST' }, { key: 'system_updatePassword', url: window.config.apiPre + 'system/updatepassword', method: 'POST' }, { key: 'upload', url: window.config.apiPre + 'upload' }];
// import $config from '../config';
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/services/url.js');
}();
;
/***/ }),
/***/ "./PC_client/store/actions/Article.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.saveArticle = exports.getArticle = exports.selectArticle = exports.deleteArticle = exports.addArticle = undefined;
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
/**
* 列表选中文章
* @param $id 被选中文章的id
* @returns {{type, payLoad: {id: *}}}
*/
var selectArticle = function selectArticle($id) {
return { type: _actionsType.SELECT_ARTICLE, payLoad: { id: $id } };
};
/**
* 获取远程数据链接
* @param $pageIndex
* @returns {{type, payLoad: {pageIndex: *}}}
*/
var getArticle = function getArticle($pageIndex, $key) {
return { type: _actionsType.GET_ARTICLE_LIST, payLoad: { pageIndex: $pageIndex, key: $key } };
};
/**
* 新建文章
* @returns {{type, payLoad: {}}}
*/
var addArticle = function addArticle() {
return { type: _actionsType.ADD_ARTICLE, payLoad: {} };
};
/**
* 保存文章
*/
var saveArticle = function saveArticle($data) {
console.log($data);
return { type: _actionsType.SAVE_ARTICLE, payLoad: { data: $data } };
};
/**
* 删除文章
* @param $idx
* @returns {{type, payLoad: *}}
*/
var deleteArticle = function deleteArticle($idx) {
return { type: _actionsType.REMOVE_ARTICLE, payLoad: $idx };
};
exports.addArticle = addArticle;
exports.deleteArticle = deleteArticle;
exports.selectArticle = selectArticle;
exports.getArticle = getArticle;
exports.saveArticle = saveArticle;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(selectArticle, 'selectArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Article.js');
__REACT_HOT_LOADER__.register(getArticle, 'getArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Article.js');
__REACT_HOT_LOADER__.register(addArticle, 'addArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Article.js');
__REACT_HOT_LOADER__.register(saveArticle, 'saveArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Article.js');
__REACT_HOT_LOADER__.register(deleteArticle, 'deleteArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Article.js');
}();
;
/***/ }),
/***/ "./PC_client/store/actions/Menu.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.selectMenu = selectMenu;
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var _actionsType2 = _interopRequireDefault(_actionsType);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function selectMenu(index) {
return { type: _actionsType.SELECT_MENU, payLoad: { index: index } };
} /**
* 用于将修改指令进行封装,否则需要自己进行指令的封装
* old: dispatch({type:SELECT_MENU,payLoad:{index}})
* now: dispatch(selectMenu(index));
*/
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(selectMenu, 'selectMenu', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Menu.js');
}();
;
/***/ }),
/***/ "./PC_client/store/actions/Photo.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.savePhotoDetail = exports.updatePhotoDetail = exports.getPhotoList = exports.deletePhotoDetail = exports.createPhotoDetail = undefined;
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
/**
* 创建相片
* 用于重置相片对应变量
*/
var createPhotoDetail = function createPhotoDetail() {
return { type: _actionsType.CREATE_PHOTO_DETAIL };
};
/**
* 获取相册列表
*/
var getPhotoList = function getPhotoList($pageIndex, $key) {
return {
type: _actionsType.GET_PHOTO_LIST, payLoad: {
pageIndex: $pageIndex,
key: $key
}
};
};
/**
* 更新详情框中的Img数据
* @param $obj
* @returns {{type, payLoad: *}}
*/
var updatePhotoDetail = function updatePhotoDetail($obj) {
return {
type: _actionsType.UPDATE_PHOTO_DETAIL, payLoad: $obj
};
};
/**
* 保存数据
* @param $obj
*/
var savePhotoDetail = function savePhotoDetail($obj) {
return {
type: _actionsType.SAVE_PHOTO_DETAIL,
payLoad: $obj
};
};
/**
* 删除数据
* @param $idx
* @returns {{type, payLoad: *}}
*/
var deletePhotoDetail = function deletePhotoDetail($idx) {
return {
type: _actionsType.DELETE_PHOTO_DETAIL,
payLoad: $idx
};
};
exports.createPhotoDetail = createPhotoDetail;
exports.deletePhotoDetail = deletePhotoDetail;
exports.getPhotoList = getPhotoList;
exports.updatePhotoDetail = updatePhotoDetail;
exports.savePhotoDetail = savePhotoDetail;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(createPhotoDetail, 'createPhotoDetail', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Photo.js');
__REACT_HOT_LOADER__.register(getPhotoList, 'getPhotoList', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Photo.js');
__REACT_HOT_LOADER__.register(updatePhotoDetail, 'updatePhotoDetail', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Photo.js');
__REACT_HOT_LOADER__.register(savePhotoDetail, 'savePhotoDetail', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Photo.js');
__REACT_HOT_LOADER__.register(deletePhotoDetail, 'deletePhotoDetail', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/Photo.js');
}();
;
/***/ }),
/***/ "./PC_client/store/actions/System.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.updatePassword = updatePassword;
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
function updatePassword($obj) {
return { type: _actionsType.UPDATE_SYSTEM_PASSWORD, payLoad: $obj };
}
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(updatePassword, 'updatePassword', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actions/System.js');
}();
;
/***/ }),
/***/ "./PC_client/store/actionsType.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* actionsType 表示系统中所有的修改数据指令名称
* @type {string}
*/
var SELECT_MENU = 'SELECT_MENU';
var GET_ARTICLE_LIST = 'GET_ARTICLE_LIST';
var APPEND_ARTICLE_LIST = 'APPEND_ARTICLE_LIST';
var GET_ARTICLE_DETAIL = 'GET_ARTICLE_DETAIL';
var ADD_ARTICLE = 'ADD_ARTICLE';
var SAVE_ARTICLE = 'SAVE_ARTICLE';
var UPDATE_ARTICLE = 'UPDATE_ARTICLE';
var UPDATE_ARTICLE_DETAIL = 'UPDATE_ARTICLE_DETAIL';
var UPDATE_ARTICLE_PAGEINDEX = 'UPDATE_ARTICLE_PAGEINDEX';
var REMOVE_ARTICLE = 'REMOVE_ARTICLE';
var REMOVE_ARTICLE_INLIST = 'REMOVE_ARTICLE_INLIST';
var CLEAR_ARTICLE = 'CLEAR_ARTICLE';
var SELECT_ARTICLE = 'SELECT_ARTICLE';
var UPDATE_ARTICLE_STATE = 'UPDATE_ARTICLE_STATE';
var UPDATE_ARTICLE_SAVEING = 'UPDATE_ARTICLE_SAVEING';
var APPEND_PHOTO_LIST = 'APPEND_PHOTO_LIST';
var APPEND_PHOTO_DETAIL_FOR_LIST = 'APPEND_PHOTO_DETAIL_FOR_LIST';
var CLEAR_PHOTO_DETAIL = 'CLEAR_PHOTO_DETAIL';
var CLEAR_PHOTO_LIST = 'CLEAR_PHOTO_LIST';
var DELETE_PHOTO_DETAIL = 'DELETE_PHOTO_DETAIL';
var UPDATE_PHOTO_DETAIL = 'UPDATE_PHOTO_DETAIL';
var UPDATE_PHOTO_LIST_STATUS = 'UPDATE_PHOTO_LIST_STATUS';
var UPDATE_PHOTO_DETAIL_STATUS = 'UPDATE_PHOTO_DETAIL_STATUS';
var UPDATE_PHOTO_PAGEINDEX = 'UPDATE_PHOTO_PAGEINDEX';
var CREATE_PHOTO_DETAIL = 'CREATE_PHOTO_DETAIL';
var SAVE_PHOTO_DETAIL = 'SAVE_PHOTO_DETAIL';
var GET_PHOTO_LIST = 'GET_PHOTO_LIST';
var REMOVE_PHOTO_INLIST = 'REMOVE_PHOTO_INLIST';
var SELECT_SYSTEM_MENU = 'SELECT_SYSTEM_MENU';
var UPDATE_SYSTEM_PASSWORD = 'UPDATE_SYSTEM_PASSWORD';
var UPDATE_SYSTEM_PASSWORD_STATUS = 'UPDATE_SYSTEM_PASSWORD_STATUS';
var STATE = {
FETCHING: 'FETCHING',
SUCCESS: 'SUCCESS',
ERROR: 'ERROR'
};
exports.SELECT_MENU = SELECT_MENU;
exports.GET_ARTICLE_LIST = GET_ARTICLE_LIST;
exports.GET_ARTICLE_DETAIL = GET_ARTICLE_DETAIL;
exports.ADD_ARTICLE = ADD_ARTICLE;
exports.CLEAR_ARTICLE = CLEAR_ARTICLE;
exports.UPDATE_ARTICLE = UPDATE_ARTICLE;
exports.UPDATE_ARTICLE_STATE = UPDATE_ARTICLE_STATE;
exports.UPDATE_ARTICLE_SAVEING = UPDATE_ARTICLE_SAVEING;
exports.UPDATE_ARTICLE_DETAIL = UPDATE_ARTICLE_DETAIL;
exports.UPDATE_ARTICLE_PAGEINDEX = UPDATE_ARTICLE_PAGEINDEX;
exports.REMOVE_ARTICLE = REMOVE_ARTICLE;
exports.REMOVE_ARTICLE_INLIST = REMOVE_ARTICLE_INLIST;
exports.SELECT_ARTICLE = SELECT_ARTICLE;
exports.SAVE_ARTICLE = SAVE_ARTICLE;
exports.APPEND_ARTICLE_LIST = APPEND_ARTICLE_LIST;
exports.APPEND_PHOTO_LIST = APPEND_PHOTO_LIST;
exports.APPEND_PHOTO_DETAIL_FOR_LIST = APPEND_PHOTO_DETAIL_FOR_LIST;
exports.CLEAR_PHOTO_DETAIL = CLEAR_PHOTO_DETAIL;
exports.CLEAR_PHOTO_LIST = CLEAR_PHOTO_LIST;
exports.DELETE_PHOTO_DETAIL = DELETE_PHOTO_DETAIL;
exports.UPDATE_PHOTO_DETAIL = UPDATE_PHOTO_DETAIL;
exports.UPDATE_PHOTO_LIST_STATUS = UPDATE_PHOTO_LIST_STATUS;
exports.UPDATE_PHOTO_DETAIL_STATUS = UPDATE_PHOTO_DETAIL_STATUS;
exports.UPDATE_PHOTO_PAGEINDEX = UPDATE_PHOTO_PAGEINDEX;
exports.CREATE_PHOTO_DETAIL = CREATE_PHOTO_DETAIL;
exports.GET_PHOTO_LIST = GET_PHOTO_LIST;
exports.SAVE_PHOTO_DETAIL = SAVE_PHOTO_DETAIL;
exports.REMOVE_PHOTO_INLIST = REMOVE_PHOTO_INLIST;
exports.SELECT_SYSTEM_MENU = SELECT_SYSTEM_MENU;
exports.UPDATE_SYSTEM_PASSWORD = UPDATE_SYSTEM_PASSWORD;
exports.UPDATE_SYSTEM_PASSWORD_STATUS = UPDATE_SYSTEM_PASSWORD_STATUS;
exports.STATE = STATE;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(SELECT_MENU, 'SELECT_MENU', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(GET_ARTICLE_LIST, 'GET_ARTICLE_LIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(APPEND_ARTICLE_LIST, 'APPEND_ARTICLE_LIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(GET_ARTICLE_DETAIL, 'GET_ARTICLE_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(ADD_ARTICLE, 'ADD_ARTICLE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(SAVE_ARTICLE, 'SAVE_ARTICLE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_ARTICLE, 'UPDATE_ARTICLE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_ARTICLE_DETAIL, 'UPDATE_ARTICLE_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_ARTICLE_PAGEINDEX, 'UPDATE_ARTICLE_PAGEINDEX', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(REMOVE_ARTICLE, 'REMOVE_ARTICLE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(REMOVE_ARTICLE_INLIST, 'REMOVE_ARTICLE_INLIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(CLEAR_ARTICLE, 'CLEAR_ARTICLE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(SELECT_ARTICLE, 'SELECT_ARTICLE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_ARTICLE_STATE, 'UPDATE_ARTICLE_STATE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_ARTICLE_SAVEING, 'UPDATE_ARTICLE_SAVEING', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(APPEND_PHOTO_LIST, 'APPEND_PHOTO_LIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(APPEND_PHOTO_DETAIL_FOR_LIST, 'APPEND_PHOTO_DETAIL_FOR_LIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(CLEAR_PHOTO_DETAIL, 'CLEAR_PHOTO_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(CLEAR_PHOTO_LIST, 'CLEAR_PHOTO_LIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(DELETE_PHOTO_DETAIL, 'DELETE_PHOTO_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_PHOTO_DETAIL, 'UPDATE_PHOTO_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_PHOTO_LIST_STATUS, 'UPDATE_PHOTO_LIST_STATUS', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_PHOTO_DETAIL_STATUS, 'UPDATE_PHOTO_DETAIL_STATUS', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_PHOTO_PAGEINDEX, 'UPDATE_PHOTO_PAGEINDEX', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(CREATE_PHOTO_DETAIL, 'CREATE_PHOTO_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(SAVE_PHOTO_DETAIL, 'SAVE_PHOTO_DETAIL', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(GET_PHOTO_LIST, 'GET_PHOTO_LIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(REMOVE_PHOTO_INLIST, 'REMOVE_PHOTO_INLIST', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(SELECT_SYSTEM_MENU, 'SELECT_SYSTEM_MENU', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_SYSTEM_PASSWORD, 'UPDATE_SYSTEM_PASSWORD', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(UPDATE_SYSTEM_PASSWORD_STATUS, 'UPDATE_SYSTEM_PASSWORD_STATUS', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
__REACT_HOT_LOADER__.register(STATE, 'STATE', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/actionsType.js');
}();
;
/***/ }),
/***/ "./PC_client/store/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _Menu = __webpack_require__("./PC_client/store/reducer/Menu.js");
var _Menu2 = _interopRequireDefault(_Menu);
var _Article = __webpack_require__("./PC_client/store/reducer/Article.js");
var _Article2 = _interopRequireDefault(_Article);
var _Photo = __webpack_require__("./PC_client/store/reducer/Photo.js");
var _Photo2 = _interopRequireDefault(_Photo);
var _System = __webpack_require__("./PC_client/store/reducer/System.js");
var _System2 = _interopRequireDefault(_System);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// import actions_Menu from './actions/Menu';
var _default = (0, _redux.combineReducers)({
Article: _Article2.default,
Menu: _Menu2.default,
Photo: _Photo2.default,
System: _System2.default
});
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/index.js');
}();
;
/***/ }),
/***/ "./PC_client/store/reducer/Article.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _toConsumableArray2 = __webpack_require__("./node_modules/babel-runtime/helpers/toConsumableArray.js");
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultState = {
// 当前状态
status: '',
// 文章详情状态
saveing: '',
// 选中的文章 0 为创建的
select: {},
// 选中文章的idx
selectIdx: -1,
// 是否可以加载更多文章
isMore: true,
// 正在加载更多
loadMore: false,
// 当前加载页码
pageIndex: 0,
// 文章列表数据
data: [],
detail: {}
};
var _default = function _default() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action = arguments[1];
console.log(action);
switch (action.type) {
case _actionsType.CLEAR_ARTICLE:
{
return (0, _assign2.default)({}, state, { data: [] });
}
break;
case _actionsType.SELECT_ARTICLE:
{
if (action.payLoad.id == -1) {
return (0, _assign2.default)({}, state, { select: {} });
}
var selectArticle = state.data.find(function (p) {
return p.idx == action.payLoad.id;
});
return (0, _assign2.default)({}, state, { select: selectArticle, selectIdx: selectArticle.idx, saveing: '' });
}
break;
case _actionsType.UPDATE_ARTICLE_STATE:
{
return (0, _assign2.default)({}, state, { status: action.payLoad.state });
}
break;
case _actionsType.UPDATE_ARTICLE_SAVEING:
{
return (0, _assign2.default)({}, state, { saveing: action.payLoad });
}
break;
case _actionsType.UPDATE_ARTICLE_PAGEINDEX:
{
return (0, _assign2.default)({}, state, { pageIndex: action.payLoad });
}
break;
case _actionsType.APPEND_ARTICLE_LIST:
{
return (0, _assign2.default)({}, state, { data: [].concat((0, _toConsumableArray3.default)(state.data), (0, _toConsumableArray3.default)(action.payLoad.data)) });
}
break;
case _actionsType.ADD_ARTICLE:
{
var $index = state.data.findIndex(function (p) {
return p.idx == 0;
});
if ($index == -1) {
return (0, _assign2.default)({}, state, {
data: [{
idx: 0,
tag: '',
createdAt: new Date(),
content: '',
title: ''
}].concat((0, _toConsumableArray3.default)(state.data))
});
} else {
return state;
}
}
break;
case _actionsType.REMOVE_ARTICLE_INLIST:
{
var _$index = state.data.findIndex(function (p) {
return p.idx == action.payLoad;
});
state.data.splice(_$index, 1);
return (0, _assign2.default)({}, state, { data: [].concat((0, _toConsumableArray3.default)(state.data)) });
}
break;
// case REMOVE_ARTICLE: {
// return Object.assign({}, state, {data: [], pageIndex: 0});
// }
// break;
case _actionsType.UPDATE_ARTICLE_DETAIL:
{
var $item = state.data.findIndex(function (p) {
return p.idx == (action.payLoad.isCreate ? 0 : action.payLoad.data.idx);
});
if ($item >= 0) {
state.data[$item] = (0, _assign2.default)({}, state.data[$item], action.payLoad.data);
}
return (0, _assign2.default)({}, state, { data: [].concat((0, _toConsumableArray3.default)(state.data)) });
}
break;
default:
return state;
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(defaultState, 'defaultState', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/Article.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/Article.js');
}();
;
/***/ }),
/***/ "./PC_client/store/reducer/Menu.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultState = {
index: 0
};
var _default = function _default() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action = arguments[1];
switch (action.type) {
case _actionsType.SELECT_MENU:
{
return (0, _assign2.default)({}, state, { index: action.payLoad.index });
}
break;
default:
return state;
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(defaultState, 'defaultState', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/Menu.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/Menu.js');
}();
;
/***/ }),
/***/ "./PC_client/store/reducer/Photo.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _toConsumableArray2 = __webpack_require__("./node_modules/babel-runtime/helpers/toConsumableArray.js");
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultState = {
photo: {},
data: [],
status: '',
detailStatus: '',
pageIndex: 0,
total: 0
};
var _default = function _default() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action = arguments[1];
// console.log('photo', action);
// let map = {};
// map[APPEND_PHOTO_LIST] = ()=> {
// return Object.assign({}, state, {
// data: [...state.data, ...action.payLoad.data],
// total: action.payLoad.total
// });
// };
//
// map[APPEND_PHOTO_DETAIL_FOR_LIST] = ()=> {
// //判断是更新还是新增
// let $index = state.data.findIndex(p=>p.idx == action.payLoad.data.idx);
// if ($index > 0) {
// state.data[$index] = Object.assign({}, action.payLoad.data);
// return Object.assign({}, state, {data: [...state.data]})
//
// } else {
// return Object.assign({}, state, {data: [action.payLoad.data, ...state.data]})
// }
// };
//
// map[CREATE_PHOTO_DETAIL] = ()=>{
// return Object.assign({}, state, {photo: {}});
// };
switch (action.type) {
case _actionsType.APPEND_PHOTO_LIST:
{
return (0, _assign2.default)({}, state, {
data: [].concat((0, _toConsumableArray3.default)(state.data), (0, _toConsumableArray3.default)(action.payLoad.data)),
total: action.payLoad.total
});
}
break;
case _actionsType.APPEND_PHOTO_DETAIL_FOR_LIST:
{
//判断是更新还是新增
var $index = state.data.findIndex(function (p) {
return p.idx == action.payLoad.data.idx;
});
if ($index > 0) {
state.data[$index] = (0, _assign2.default)({}, action.payLoad.data);
return (0, _assign2.default)({}, state, { data: [].concat((0, _toConsumableArray3.default)(state.data)) });
} else {
return (0, _assign2.default)({}, state, { data: [action.payLoad.data].concat((0, _toConsumableArray3.default)(state.data)) });
}
}
break;
case _actionsType.CREATE_PHOTO_DETAIL:
{
return (0, _assign2.default)({}, state, { photo: {} });
}
break;
case _actionsType.UPDATE_PHOTO_DETAIL:
{
return (0, _assign2.default)({}, state, { photo: (0, _assign2.default)({}, state.photo, action.payLoad) });
}
break;
case _actionsType.CLEAR_PHOTO_DETAIL:
{
return (0, _assign2.default)({}, state, { photo: {} });
}
break;
case _actionsType.CLEAR_PHOTO_LIST:
{
return (0, _assign2.default)({}, state, { data: [] });
}
break;
case _actionsType.UPDATE_PHOTO_LIST_STATUS:
{
return (0, _assign2.default)({}, state, { status: action.payLoad });
}
break;
case _actionsType.UPDATE_PHOTO_DETAIL_STATUS:
{
return (0, _assign2.default)({}, state, { detailStatus: action.payLoad });
}
break;
case _actionsType.UPDATE_PHOTO_PAGEINDEX:
{
return (0, _assign2.default)({}, state, { pageIndex: action.payLoad });
}
break;
case _actionsType.REMOVE_PHOTO_INLIST:
{
var _$index = state.data.findIndex(function (p) {
return p.idx == action.payLoad;
});
state.data.splice(_$index, 1);
return (0, _assign2.default)({}, state, { data: [].concat((0, _toConsumableArray3.default)(state.data)) });
}
break;
default:
{
return (0, _assign2.default)({}, state);
}
break;
}
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(defaultState, 'defaultState', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/Photo.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/Photo.js');
}();
;
/***/ }),
/***/ "./PC_client/store/reducer/System.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultState = {
index: 0,
updatePasswordStatus: '',
updatePassword: {
oldPassword: {},
newPassword1: {},
newPassword2: {}
}
};
var _default = function _default() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
var action = arguments[1];
var map = {};
map[_actionsType.UPDATE_SYSTEM_PASSWORD] = function () {
return state;
};
map[_actionsType.UPDATE_SYSTEM_PASSWORD_STATUS] = function () {
return (0, _assign2.default)({}, state, { updatePasswordStatus: action.payLoad });
};
var $action = map[action.type];
if ($action) {
return $action();
}
return state;
};
exports.default = _default;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(defaultState, 'defaultState', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/System.js');
__REACT_HOT_LOADER__.register(_default, 'default', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/reducer/System.js');
}();
;
/***/ }),
/***/ "./PC_client/store/sagas/article.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _regenerator = __webpack_require__("./node_modules/babel-runtime/regenerator/index.js");
var _regenerator2 = _interopRequireDefault(_regenerator);
exports.watchGetArticleList = watchGetArticleList;
exports.watchSaveArticle = watchSaveArticle;
exports.wathcDeleteArticle = wathcDeleteArticle;
var _reduxSaga = __webpack_require__("./node_modules/redux-saga/es/index.js");
var _effects = __webpack_require__("./node_modules/redux-saga/es/effects.js");
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var actions = _interopRequireWildcard(_actionsType);
var _services = __webpack_require__("./PC_client/services/index.js");
var _services2 = _interopRequireDefault(_services);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _marked = [watchGetArticleList, watchSaveArticle, wathcDeleteArticle].map(_regenerator2.default.mark);
/**
* 监听请求数据事件
*/
function watchGetArticleList() {
return _regenerator2.default.wrap(function watchGetArticleList$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0, _reduxSaga.takeEvery)(actions.GET_ARTICLE_LIST, _regenerator2.default.mark(function _callee(action) {
var data;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_STATE, payLoad: { state: actions.STATE.FETCHING } });
case 3:
console.log(action);
_context.next = 6;
return (0, _effects.call)(_services2.default.article_list, {
pageIndex: action.payLoad.pageIndex,
key: action.payLoad.key ? action.payLoad.key : null
});
case 6:
data = _context.sent;
data = data.data;
if (!(!action.payLoad.pageIndex || action.payLoad.pageIndex <= 1)) {
_context.next = 11;
break;
}
_context.next = 11;
return (0, _effects.put)({ type: actions.CLEAR_ARTICLE });
case 11:
if (!(data.errorNo == 0)) {
_context.next = 20;
break;
}
_context.next = 14;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_STATE, payLoad: { state: actions.STATE.SUCCESS } });
case 14:
_context.next = 16;
return (0, _effects.put)({ type: actions.APPEND_ARTICLE_LIST, payLoad: { data: data.data } });
case 16:
_context.next = 18;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_PAGEINDEX, payLoad: action.payLoad.pageIndex || 1 });
case 18:
_context.next = 22;
break;
case 20:
_context.next = 22;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_STATE, payLoad: { state: actions.STATE.ERROR } });
case 22:
_context.next = 28;
break;
case 24:
_context.prev = 24;
_context.t0 = _context['catch'](0);
_context.next = 28;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_STATE, payLoad: { state: actions.STATE.ERROR } });
case 28:
case 'end':
return _context.stop();
}
}
}, _callee, this, [[0, 24]]);
}));
case 2:
case 'end':
return _context2.stop();
}
}
}, _marked[0], this);
}
function watchSaveArticle() {
return _regenerator2.default.wrap(function watchSaveArticle$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0, _reduxSaga.takeEvery)(actions.SAVE_ARTICLE, _regenerator2.default.mark(function _callee2(action) {
var data;
return _regenerator2.default.wrap(function _callee2$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.prev = 0;
_context3.next = 3;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_SAVEING, payLoad: actions.STATE.FETCHING });
case 3:
_context3.next = 5;
return (0, _effects.call)(_services2.default.article_save, action.payLoad.data);
case 5:
data = _context3.sent;
data = data.data;
if (!(data.errorNo == 0)) {
_context3.next = 16;
break;
}
_context3.next = 10;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_SAVEING, payLoad: actions.STATE.SUCCESS });
case 10:
_context3.next = 12;
return (0, _effects.put)({
type: actions.UPDATE_ARTICLE_DETAIL,
payLoad: { data: data.data, isCreate: action.payLoad.data.idx != data.data.idx }
});
case 12:
_context3.next = 14;
return (0, _effects.put)({ type: actions.SELECT_ARTICLE, payLoad: { id: data.data.idx } });
case 14:
_context3.next = 18;
break;
case 16:
_context3.next = 18;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_SAVEING, payLoad: data.errorMessage });
case 18:
_context3.next = 24;
break;
case 20:
_context3.prev = 20;
_context3.t0 = _context3['catch'](0);
_context3.next = 24;
return (0, _effects.put)({ type: actions.UPDATE_ARTICLE_SAVEING, payLoad: actions.STATE.ERROR });
case 24:
case 'end':
return _context3.stop();
}
}
}, _callee2, this, [[0, 20]]);
}));
case 2:
case 'end':
return _context4.stop();
}
}
}, _marked[1], this);
}
function wathcDeleteArticle() {
return _regenerator2.default.wrap(function wathcDeleteArticle$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return (0, _reduxSaga.takeEvery)(actions.REMOVE_ARTICLE, _regenerator2.default.mark(function _callee3(action) {
var data;
return _regenerator2.default.wrap(function _callee3$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.prev = 0;
_context5.next = 3;
return (0, _effects.call)(_services2.default.article_delete, { idx: action.payLoad });
case 3:
data = _context5.sent;
if (!(data.data.errorNo == 0)) {
_context5.next = 7;
break;
}
_context5.next = 7;
return (0, _effects.put)({ type: actions.REMOVE_ARTICLE_INLIST, payLoad: action.payLoad });
case 7:
_context5.next = 11;
break;
case 9:
_context5.prev = 9;
_context5.t0 = _context5['catch'](0);
case 11:
case 'end':
return _context5.stop();
}
}
}, _callee3, this, [[0, 9]]);
}));
case 2:
case 'end':
return _context6.stop();
}
}
}, _marked[2], this);
}
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(watchGetArticleList, 'watchGetArticleList', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/article.js');
__REACT_HOT_LOADER__.register(watchSaveArticle, 'watchSaveArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/article.js');
__REACT_HOT_LOADER__.register(wathcDeleteArticle, 'wathcDeleteArticle', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/article.js');
}();
;
/***/ }),
/***/ "./PC_client/store/sagas/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _regenerator = __webpack_require__("./node_modules/babel-runtime/regenerator/index.js");
var _regenerator2 = _interopRequireDefault(_regenerator);
var _keys = __webpack_require__("./node_modules/babel-runtime/core-js/object/keys.js");
var _keys2 = _interopRequireDefault(_keys);
exports.sagas = sagas;
var _article = __webpack_require__("./PC_client/store/sagas/article.js");
var article = _interopRequireWildcard(_article);
var _photo = __webpack_require__("./PC_client/store/sagas/photo.js");
var photo = _interopRequireWildcard(_photo);
var _system = __webpack_require__("./PC_client/store/sagas/system.js");
var system = _interopRequireWildcard(_system);
var _effects = __webpack_require__("./node_modules/redux-saga/es/effects.js");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _marked = [sagas].map(_regenerator2.default.mark);
// {watchGetArticleList, watchSaveArticle,wathcDeleteArticle}
// export default [watchGetArticleList, watchSaveArticle,wathcDeleteArticle];
var importSaga = [article, photo, system];
var sagasList = [];
importSaga.map(function (saga) {
saga && (0, _keys2.default)(saga).map(function (p) {
sagasList.push((0, _effects.fork)(saga[p]));
});
});
function sagas() {
return _regenerator2.default.wrap(function sagas$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return sagasList;
case 2:
case 'end':
return _context.stop();
}
}
}, _marked[0], this);
};
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(importSaga, 'importSaga', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/index.js');
__REACT_HOT_LOADER__.register(sagasList, 'sagasList', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/index.js');
__REACT_HOT_LOADER__.register(sagas, 'sagas', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/index.js');
}();
;
/***/ }),
/***/ "./PC_client/store/sagas/photo.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _regenerator = __webpack_require__("./node_modules/babel-runtime/regenerator/index.js");
var _regenerator2 = _interopRequireDefault(_regenerator);
exports.watchSavePhoto = watchSavePhoto;
exports.watchPhotoList = watchPhotoList;
exports.watchDeletePhoto = watchDeletePhoto;
var _reduxSaga = __webpack_require__("./node_modules/redux-saga/es/index.js");
var _effects = __webpack_require__("./node_modules/redux-saga/es/effects.js");
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var actions = _interopRequireWildcard(_actionsType);
var _services = __webpack_require__("./PC_client/services/index.js");
var _services2 = _interopRequireDefault(_services);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _marked = [watchSavePhoto, watchPhotoList, watchDeletePhoto].map(_regenerator2.default.mark);
/*
* 监听保存请求
*/
function watchSavePhoto() {
return _regenerator2.default.wrap(function watchSavePhoto$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0, _reduxSaga.takeEvery)(actions.SAVE_PHOTO_DETAIL, _regenerator2.default.mark(function _callee(action) {
var data;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_DETAIL_STATUS, payLoad: actions.STATE.FETCHING });
case 3:
_context.next = 5;
return (0, _effects.call)(_services2.default.photo_save, action.payLoad);
case 5:
data = _context.sent;
data = data.data;
if (!(data.errorNo == 0)) {
_context.next = 19;
break;
}
_context.next = 10;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_DETAIL_STATUS, payLoad: actions.STATE.SUCCESS });
case 10:
if (!(action.payLoad.idx > 0)) {
_context.next = 15;
break;
}
_context.next = 13;
return (0, _effects.put)({ type: actions.APPEND_PHOTO_DETAIL_FOR_LIST, payLoad: { data: action.payLoad } });
case 13:
_context.next = 17;
break;
case 15:
_context.next = 17;
return (0, _effects.put)({ type: actions.APPEND_PHOTO_DETAIL_FOR_LIST, payLoad: { data: data.data } });
case 17:
_context.next = 21;
break;
case 19:
_context.next = 21;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_DETAIL_STATUS, payLoad: data.errorMessage });
case 21:
_context.next = 27;
break;
case 23:
_context.prev = 23;
_context.t0 = _context['catch'](0);
_context.next = 27;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_DETAIL_STATUS, payLoad: actions.STATE.ERROR });
case 27:
case 'end':
return _context.stop();
}
}
}, _callee, this, [[0, 23]]);
}));
case 2:
case 'end':
return _context2.stop();
}
}
}, _marked[0], this);
}
function watchPhotoList() {
return _regenerator2.default.wrap(function watchPhotoList$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0, _reduxSaga.takeEvery)(actions.GET_PHOTO_LIST, _regenerator2.default.mark(function _callee2(action) {
var data;
return _regenerator2.default.wrap(function _callee2$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.prev = 0;
_context3.next = 3;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_LIST_STATUS, payLoad: actions.STATE.FETCHING });
case 3:
_context3.next = 5;
return (0, _effects.call)(_services2.default.photo_list, action.payLoad);
case 5:
data = _context3.sent;
data = data.data;
if (!(!action.payLoad.pageIndex || action.payLoad.pageIndex <= 1)) {
_context3.next = 10;
break;
}
_context3.next = 10;
return (0, _effects.put)({ type: actions.CLEAR_PHOTO_LIST });
case 10:
if (!(data.errorNo == 0)) {
_context3.next = 19;
break;
}
_context3.next = 13;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_PAGEINDEX, payLoad: action.payLoad.pageIndex || 1 });
case 13:
_context3.next = 15;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_LIST_STATUS, payLoad: actions.STATE.SUCCESS });
case 15:
_context3.next = 17;
return (0, _effects.put)({ type: actions.APPEND_PHOTO_LIST, payLoad: { data: data.data, total: data.total } });
case 17:
_context3.next = 21;
break;
case 19:
_context3.next = 21;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_LIST_STATUS, payLoad: actions.STATE.ERROR });
case 21:
_context3.next = 27;
break;
case 23:
_context3.prev = 23;
_context3.t0 = _context3['catch'](0);
_context3.next = 27;
return (0, _effects.put)({ type: actions.UPDATE_PHOTO_LIST_STATUS, payLoad: actions.STATE.ERROR });
case 27:
case 'end':
return _context3.stop();
}
}
}, _callee2, this, [[0, 23]]);
}));
case 2:
case 'end':
return _context4.stop();
}
}
}, _marked[1], this);
}
function watchDeletePhoto() {
return _regenerator2.default.wrap(function watchDeletePhoto$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return (0, _reduxSaga.takeEvery)(actions.DELETE_PHOTO_DETAIL, _regenerator2.default.mark(function _callee3(action) {
var data;
return _regenerator2.default.wrap(function _callee3$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.prev = 0;
_context5.next = 3;
return (0, _effects.call)(_services2.default.photo_delete, { idx: action.payLoad });
case 3:
data = _context5.sent;
data = data.data;
if (!(data.errorNo == 0)) {
_context5.next = 8;
break;
}
_context5.next = 8;
return (0, _effects.put)({ type: actions.REMOVE_PHOTO_INLIST, payLoad: action.payLoad });
case 8:
_context5.next = 12;
break;
case 10:
_context5.prev = 10;
_context5.t0 = _context5['catch'](0);
case 12:
case 'end':
return _context5.stop();
}
}
}, _callee3, this, [[0, 10]]);
}));
case 2:
case 'end':
return _context6.stop();
}
}
}, _marked[2], this);
}
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(watchSavePhoto, 'watchSavePhoto', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/photo.js');
__REACT_HOT_LOADER__.register(watchPhotoList, 'watchPhotoList', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/photo.js');
__REACT_HOT_LOADER__.register(watchDeletePhoto, 'watchDeletePhoto', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/photo.js');
}();
;
/***/ }),
/***/ "./PC_client/store/sagas/system.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _regenerator = __webpack_require__("./node_modules/babel-runtime/regenerator/index.js");
var _regenerator2 = _interopRequireDefault(_regenerator);
exports.watchUpdatePassword = watchUpdatePassword;
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var _effects = __webpack_require__("./node_modules/redux-saga/es/effects.js");
var _reduxSaga = __webpack_require__("./node_modules/redux-saga/es/index.js");
var _services = __webpack_require__("./PC_client/services/index.js");
var _services2 = _interopRequireDefault(_services);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _marked = [watchUpdatePassword].map(_regenerator2.default.mark);
function watchUpdatePassword() {
return _regenerator2.default.wrap(function watchUpdatePassword$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0, _reduxSaga.takeEvery)(_actionsType.UPDATE_SYSTEM_PASSWORD, _regenerator2.default.mark(function _callee(action) {
var data;
return _regenerator2.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return (0, _effects.put)({ type: _actionsType.UPDATE_SYSTEM_PASSWORD_STATUS, payLoad: _actionsType.STATE.FETCHING });
case 3:
_context.next = 5;
return (0, _effects.call)(_services2.default.system_updatePassword, action.payLoad);
case 5:
data = _context.sent;
data = data.data;
if (!(data.errorNo == 0)) {
_context.next = 12;
break;
}
_context.next = 10;
return (0, _effects.put)({ type: _actionsType.UPDATE_SYSTEM_PASSWORD_STATUS, payLoad: _actionsType.STATE.SUCCESS });
case 10:
_context.next = 14;
break;
case 12:
_context.next = 14;
return (0, _effects.put)({ type: _actionsType.UPDATE_SYSTEM_PASSWORD_STATUS, payLoad: _actionsType.STATE.ERROR });
case 14:
_context.next = 20;
break;
case 16:
_context.prev = 16;
_context.t0 = _context['catch'](0);
_context.next = 20;
return (0, _effects.put)({ type: _actionsType.UPDATE_SYSTEM_PASSWORD_STATUS, payLoad: _actionsType.STATE.ERROR });
case 20:
case 'end':
return _context.stop();
}
}
}, _callee, this, [[0, 16]]);
}));
case 2:
case 'end':
return _context2.stop();
}
}
}, _marked[0], this);
}
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(watchUpdatePassword, 'watchUpdatePassword', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/store/sagas/system.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/Article/Detail.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _defineProperty2 = __webpack_require__("./node_modules/babel-runtime/helpers/defineProperty.js");
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _Detail = __webpack_require__("./PC_client/views/manage/Article/Detail.less");
var _Detail2 = _interopRequireDefault(_Detail);
var _Markdown = __webpack_require__("./PC_client/components/Markdown/index.js");
var _Markdown2 = _interopRequireDefault(_Markdown);
var _setting = __webpack_require__("./PC_client/components/Article/setting.js");
var _setting2 = _interopRequireDefault(_setting);
var _UI = __webpack_require__("./PC_client/components/UI/index.js");
var _showTime = __webpack_require__("./PC_client/components/Time/showTime.js");
var _showTime2 = _interopRequireDefault(_showTime);
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var _utils = __webpack_require__("./PC_client/core/utils.js");
var _utils2 = _interopRequireDefault(_utils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Detail = (_temp = _class = function (_Component) {
(0, _inherits3.default)(Detail, _Component);
function Detail(props) {
(0, _classCallCheck3.default)(this, Detail);
var _this = (0, _possibleConstructorReturn3.default)(this, (Detail.__proto__ || (0, _getPrototypeOf2.default)(Detail)).call(this));
_this.state = {
// // 标题
// title: '',
// // 描述
// description: '',
// // 正文内容
// content: '',
// // 标签
// tag: '',
// // 类别
// category: '',
showSetting: false
};
return _this;
}
(0, _createClass3.default)(Detail, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
// if(this.props.data.idx!=this.state.idx){
return true;
// }
// return false;
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
// this.setState({
// showSetting: false
// });
// fixbug:由于点开侧边栏不再切换数据造成的问题
// this.state = {};
if (nextProps.data.idx != this.props.data.idx) {
this.setState(nextProps.data);
console.log('componentWillReceiveProps');
}
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {
// nowIdx = this.props.data.idx;
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
// this.setState(this.props.data);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
// @this.eventUpdateContent
}, {
key: 'handleChange',
value: function handleChange(event) {
var id = event.target.id;
this.eventUpdateContent();
// console.log(event.target.value);
this.setState((0, _defineProperty3.default)({}, id, event.target.value));
}
}, {
key: 'handleSetting',
value: function handleSetting() {
this.eventUpdateContent();
this.setState({ showSetting: !this.state.showSetting });
}
}, {
key: 'handleSave',
value: function handleSave() {
this.eventUpdateContent();
this.props.save((0, _assign2.default)({}, this.state, { idx: this.props.data.idx, content: this.codemirror.getValue() }));
}
}, {
key: 'handleDelete',
value: function handleDelete() {
var that = this;
window.messageBox.showMsg({
title: '',
content: '是否删除这篇文章?一旦删除,无法找回。',
ok: function ok(e) {
// alert('ok');
that.props.delete(that.props.data.idx);
},
cancel: function cancel(e) {
// alert('cancel')
},
type: 0,
buttonText: '确定删除'
});
}
}, {
key: 'eventUpdateContent',
value: function eventUpdateContent() {
this.setState({ content: this.codemirror.getValue() });
// return function () {
//
// }
}
}, {
key: 'eventBindCodemirror',
value: function eventBindCodemirror($codemirror) {
this.codemirror = $codemirror;
}
//
// formatString (STATUS) {
// if (STATUS == STATE.FETCHING) return '保存中,请稍后...';
// if (STATUS == STATE.SUCCESS) return '保存成功';
// return STATUS;
// }
}, {
key: 'render',
value: function render() {
var model = (0, _assign2.default)({}, this.props.data, this.state);
var showSettingView = void 0;
if (this.state.showSetting) {
var $dateTime = new Date(this.props.data.createdAt);
showSettingView = _react2.default.createElement(
'div',
{ className: _Detail2.default.setting, onClick: this.handleSetting.bind(this) },
_react2.default.createElement(
'div',
{ className: 'show', onClick: function onClick(e) {
e.stopPropagation();
} },
_react2.default.createElement(_showTime2.default, { date: $dateTime }),
_react2.default.createElement(
'ul',
null,
_react2.default.createElement(
'li',
null,
'\u63CF\u8FF0'
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('textarea', {
id: 'description', value: model.description || '', onChange: this.handleChange.bind(this),
cols: '30', rows: '5' })
),
_react2.default.createElement(
'li',
null,
'\u5206\u7C7B'
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'text',
id: 'category', value: model.category || '',
onChange: this.handleChange.bind(this)
})
),
_react2.default.createElement(
'li',
null,
'\u6807\u7B7E'
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'text',
id: 'tag', value: model.tag || '',
onChange: this.handleChange.bind(this)
})
),
_react2.default.createElement(
'li',
null,
'\u5B57\u7B26\u6570: ',
model.content.length
),
_react2.default.createElement(
'li',
null,
'\u9605\u8BFB\u91CF: ',
model.viewCount || 0
),
_react2.default.createElement(
'li',
{ className: 'hText' },
'\u590D\u5236\u6587\u7AE0\u94FE\u63A5'
),
_react2.default.createElement(
'li',
{ className: 'hText' },
'\u5BFC\u51FA\u4E3APDF'
),
_react2.default.createElement(
'li',
{ className: 'hText' },
'\u5BFC\u51FA\u4E3AMarkdown'
)
)
)
);
}
// console.log(this.state);
return _react2.default.createElement(
'div',
{ className: _Detail2.default.Detail },
_react2.default.createElement(
'div',
{ className: 'title' },
_react2.default.createElement(
'span',
{ className: 'pal tag' },
'H1'
),
_react2.default.createElement('input', { type: 'text', id: 'title', value: model.title, onChange: this.handleChange.bind(this) }),
_react2.default.createElement(
'button',
{ onClick: this.handleSetting.bind(this),
className: 'peizhi' },
_react2.default.createElement(_UI.Icon, { name: 'peizhi' })
)
),
_react2.default.createElement(
'div',
{ className: 'content' },
_react2.default.createElement(_Markdown2.default, { content: model.content, bindCodemirror: this.eventBindCodemirror.bind(this) }),
_react2.default.createElement(
'div',
{ className: 'showController' },
_react2.default.createElement(
'span',
{ className: 'message' },
_utils2.default.formatString(this.props.saveing)
),
_react2.default.createElement(
'span',
{ className: 'btnGroup' },
_react2.default.createElement(
'button',
{ className: 'btn submit', onClick: this.handleSave.bind(this) },
'\u786E\u8BA4'
),
_react2.default.createElement(
'button',
{ className: 'btn delete', onClick: this.handleDelete.bind(this) },
'\u5220\u9664'
)
)
)
),
showSettingView
);
}
}]);
return Detail;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = Detail;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(Detail, 'Detail', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/Article/Detail.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/Article/Detail.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Detail.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Detail.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Detail.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/Article/Main.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _dec, _class, _class2, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _MiddleArticleList = __webpack_require__("./PC_client/views/manage/Article/MiddleArticleList.js");
var _MiddleArticleList2 = _interopRequireDefault(_MiddleArticleList);
var _RightDetail = __webpack_require__("./PC_client/views/manage/RightDetail.js");
var _RightDetail2 = _interopRequireDefault(_RightDetail);
var _NoMatchImg = __webpack_require__("./PC_client/views/manage/NoMatchImg.js");
var _NoMatchImg2 = _interopRequireDefault(_NoMatchImg);
var _Detail = __webpack_require__("./PC_client/views/manage/Article/Detail.js");
var _Detail2 = _interopRequireDefault(_Detail);
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _Article = __webpack_require__("./PC_client/store/actions/Article.js");
var _Main = __webpack_require__("./PC_client/views/manage/Article/Main.less");
var _Main2 = _interopRequireDefault(_Main);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ArticleMain = (_dec = (0, _reactRedux.connect)(function (state) {
return { state: state.Article };
}, function (dispatch) {
return (0, _redux.bindActionCreators)({ selectArticle: _Article.selectArticle, saveArticle: _Article.saveArticle, deleteArticle: _Article.deleteArticle }, dispatch);
}), _dec(_class = (_temp = _class2 = function (_Component) {
(0, _inherits3.default)(ArticleMain, _Component);
function ArticleMain(props) {
(0, _classCallCheck3.default)(this, ArticleMain);
return (0, _possibleConstructorReturn3.default)(this, (ArticleMain.__proto__ || (0, _getPrototypeOf2.default)(ArticleMain)).call(this, props));
}
(0, _createClass3.default)(ArticleMain, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var children = function () {
if (_this2.props.state.selectIdx != -1) {
return _react2.default.createElement(_Detail2.default, { data: _this2.props.state.select, save: _this2.props.saveArticle,
'delete': _this2.props.deleteArticle,
saveing: _this2.props.state.saveing
});
} else {
return _react2.default.createElement(_NoMatchImg2.default, null);
}
}();
return _react2.default.createElement(
'div',
{ className: _Main2.default.Main },
_react2.default.createElement(_MiddleArticleList2.default, null),
_react2.default.createElement(
_RightDetail2.default,
null,
children
)
);
}
}]);
return ArticleMain;
}(_react.Component), _class2.defaultProps = {}, _class2.propTypes = {}, _temp)) || _class);
exports.default = ArticleMain;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(ArticleMain, 'ArticleMain', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/Article/Main.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/Article/Main.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Main.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Main.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Main.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/Article/MiddleArticleList.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _defineProperty2 = __webpack_require__("./node_modules/babel-runtime/helpers/defineProperty.js");
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _dec, _class, _class2, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _UI = __webpack_require__("./PC_client/components/UI/index.js");
var _List = __webpack_require__("./PC_client/components/Article/List.js");
var _List2 = _interopRequireDefault(_List);
var _MiddleArticleList = __webpack_require__("./PC_client/views/manage/Article/MiddleArticleList.less");
var _MiddleArticleList2 = _interopRequireDefault(_MiddleArticleList);
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var _Article = __webpack_require__("./PC_client/store/actions/Article.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var MiddleArticleList = (_dec = (0, _reactRedux.connect)(function (state) {
return { state: state.Article };
}, function (dispatch) {
return (0, _redux.bindActionCreators)({ getArticle: _Article.getArticle, selectArticle: _Article.selectArticle, addArticle: _Article.addArticle }, dispatch);
}), _dec(_class = (_temp = _class2 = function (_Component) {
(0, _inherits3.default)(MiddleArticleList, _Component);
function MiddleArticleList(props) {
(0, _classCallCheck3.default)(this, MiddleArticleList);
var _this = (0, _possibleConstructorReturn3.default)(this, (MiddleArticleList.__proto__ || (0, _getPrototypeOf2.default)(MiddleArticleList)).call(this, props));
_this.state = {
isFocus: false
};
if (_this.props.state.data.length == 0) {
_this.props.getArticle();
}
return _this;
}
(0, _createClass3.default)(MiddleArticleList, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
// replace hight text
var key = this.searchKey;
var items = document.querySelectorAll('#articleList h3');
if (items && key) {
Array.prototype.map.call(items, function (p) {
p.innerHTML = p.innerHTML.replace(key, '<span class="heightText">' + key + '</span>');
});
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'handleSearchTextOnFocus',
value: function handleSearchTextOnFocus() {
this.setState({
isFocus: true
});
}
}, {
key: 'handleSearchTextOnBlur',
value: function handleSearchTextOnBlur() {
if (this.state.searchTextInput) {} else {
this.setState({
isFocus: false
});
}
}
}, {
key: 'handleKeyDown',
value: function handleKeyDown(event) {
if (event.keyCode == 13) {
this.searchKey = event.target.value;
this.props.getArticle(1, event.target.value);
}
}
}, {
key: 'handleAddArticle',
value: function handleAddArticle() {
this.props.addArticle();
this.props.selectArticle(0);
}
}, {
key: 'handleChange',
value: function handleChange(event) {
var id = event.target.id;
this.setState((0, _defineProperty3.default)({}, id, event.target.value));
}
}, {
key: 'render',
value: function render() {
// if (this.props.state.data.length == 0) {
// this.props.getArticle();
// }
// let loading = (() => {
// if (this.state.status) {
// return <div className='loading'>
// <Icon name="loading1"/>
// 正在获取文章中...
// </div>;
// }
// return null;
// })();
return _react2.default.createElement(
'div',
{ className: "fl vh100 " + _MiddleArticleList2.default.MiddleArticleList },
_react2.default.createElement(
'div',
{ className: _MiddleArticleList2.default.top },
_react2.default.createElement(
'div',
{ className: 'inputBorder' },
_react2.default.createElement(
'div',
{ className: "ShowSearchText fs12 " + (this.state.isFocus ? 'focused' : '') },
_react2.default.createElement(_UI.Input, { id: 'searchTextInput', className: 'searchTextInput',
onChange: this.handleChange.bind(this),
onFocus: this.handleSearchTextOnFocus.bind(this),
onBlur: this.handleSearchTextOnBlur.bind(this),
onKeyDown: this.handleKeyDown.bind(this),
placeholder: '\u641C\u7D22\u6587\u7AE0' }),
_react2.default.createElement(_UI.Icon, { name: 'search', className: 'fs40' })
),
_react2.default.createElement(
'button',
{ className: 'btnRight', onClick: this.handleAddArticle.bind(this) },
_react2.default.createElement(_UI.Icon, { name: 'fankui1', className: 'fs24' })
)
)
),
_react2.default.createElement(_List2.default, { id: 'articleList',
searchkey: this.searchKey
})
);
}
}]);
return MiddleArticleList;
}(_react.Component), _class2.defaultProps = {}, _class2.propTypes = {}, _temp)) || _class);
exports.default = MiddleArticleList;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(MiddleArticleList, 'MiddleArticleList', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/Article/MiddleArticleList.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/Article/MiddleArticleList.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/MiddleArticleList.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/MiddleArticleList.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/MiddleArticleList.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/LeftMenu.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _extends2 = __webpack_require__("./node_modules/babel-runtime/helpers/extends.js");
var _extends3 = _interopRequireDefault(_extends2);
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _dec, _class, _class2, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _LeftMenu = __webpack_require__("./PC_client/views/manage/LeftMenu.less");
var _LeftMenu2 = _interopRequireDefault(_LeftMenu);
var _Menu = __webpack_require__("./PC_client/store/actions/Menu.js");
var _MenuItem = __webpack_require__("./PC_client/components/Menu/MenuItem.js");
var _MenuItem2 = _interopRequireDefault(_MenuItem);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// import $config from '../../config';
var LeftMenu = (_dec = (0, _reactRedux.connect)(function (state) {
return { state: state.Menu };
}, function (dispatch) {
return (0, _redux.bindActionCreators)({ selectMenu: _Menu.selectMenu }, dispatch);
}), _dec(_class = (_temp = _class2 = function (_Component) {
(0, _inherits3.default)(LeftMenu, _Component);
function LeftMenu(props) {
(0, _classCallCheck3.default)(this, LeftMenu);
return (0, _possibleConstructorReturn3.default)(this, (LeftMenu.__proto__ || (0, _getPrototypeOf2.default)(LeftMenu)).call(this));
}
(0, _createClass3.default)(LeftMenu, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
// shouldComponentUpdate () {
// return true;
// }
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var checkUrl = function checkUrl(path) {
return path == window.location.pathname;
};
var children = this.props.items.map(function (item) {
return _react2.default.createElement(_MenuItem2.default, (0, _extends3.default)({
select: _this2.props.selectMenu,
index: _this2.props.state.index,
key: item.idx,
className: checkUrl(item.url) ? 'selected' : ''
}, item));
});
return _react2.default.createElement(
'div',
{ className: "fl vh100 " + _LeftMenu2.default.leftMenu },
_react2.default.createElement(
'div',
{ className: _LeftMenu2.default.logo },
'NBlog 1.0.0'
),
_react2.default.createElement(
'ul',
{ className: _LeftMenu2.default.ul },
children
)
);
}
}]);
return LeftMenu;
}(_react.Component), _class2.defaultProps = {
items: window.config.leftMenu
}, _class2.propTypes = {}, _temp)) || _class);
exports.default = LeftMenu;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(LeftMenu, 'LeftMenu', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/LeftMenu.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/LeftMenu.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/LeftMenu.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/LeftMenu.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/LeftMenu.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/Main.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _reactRouterDom = __webpack_require__("./node_modules/react-router-dom/es/index.js");
var _LeftMenu = __webpack_require__("./PC_client/views/manage/LeftMenu.js");
var _LeftMenu2 = _interopRequireDefault(_LeftMenu);
var _Main = __webpack_require__("./PC_client/views/manage/Article/Main.js");
var _Main2 = _interopRequireDefault(_Main);
var _Photo = __webpack_require__("./PC_client/views/manage/Photo/index.js");
var _Photo2 = _interopRequireDefault(_Photo);
var _System = __webpack_require__("./PC_client/views/manage/System/index.js");
var _System2 = _interopRequireDefault(_System);
var _NoMatchImg = __webpack_require__("./PC_client/views/manage/NoMatchImg.js");
var _NoMatchImg2 = _interopRequireDefault(_NoMatchImg);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Main = function (_Component) {
(0, _inherits3.default)(Main, _Component);
function Main(_ref) {
var match = _ref.match;
(0, _classCallCheck3.default)(this, Main);
var _this = (0, _possibleConstructorReturn3.default)(this, (Main.__proto__ || (0, _getPrototypeOf2.default)(Main)).call(this));
_this.match = match;
return _this;
}
(0, _createClass3.default)(Main, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
_reactRouterDom.BrowserRouter,
null,
_react2.default.createElement(
'div',
{ className: 'vh100 main' },
_react2.default.createElement(_LeftMenu2.default, null),
_react2.default.createElement(
_reactRouterDom.Switch,
null,
_react2.default.createElement(_reactRouterDom.Route, { exact: true, path: this.match.url + '/article', component: _Main2.default }),
_react2.default.createElement(_reactRouterDom.Route, { exact: true, path: this.match.url + '/photo', component: _Photo2.default }),
_react2.default.createElement(_reactRouterDom.Route, { exact: true, path: this.match.url + '/system', component: _System2.default }),
_react2.default.createElement(_reactRouterDom.Route, { component: _NoMatchImg2.default })
)
)
);
}
}]);
return Main;
}(_react.Component);
exports.default = Main;
;
;
var _temp = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(Main, 'Main', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/Main.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/NoMatch.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var NoMatch = (_temp = _class = function (_Component) {
(0, _inherits3.default)(NoMatch, _Component);
function NoMatch() {
(0, _classCallCheck3.default)(this, NoMatch);
return (0, _possibleConstructorReturn3.default)(this, (NoMatch.__proto__ || (0, _getPrototypeOf2.default)(NoMatch)).call(this));
}
(0, _createClass3.default)(NoMatch, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
'404 not found!'
);
}
}]);
return NoMatch;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = NoMatch;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(NoMatch, 'NoMatch', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/NoMatch.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/NoMatchImg.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _NoMatchImg = __webpack_require__("./PC_client/views/manage/NoMatchImg.less");
var _NoMatchImg2 = _interopRequireDefault(_NoMatchImg);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var NoMatchImg = (_temp = _class = function (_Component) {
(0, _inherits3.default)(NoMatchImg, _Component);
function NoMatchImg() {
(0, _classCallCheck3.default)(this, NoMatchImg);
return (0, _possibleConstructorReturn3.default)(this, (NoMatchImg.__proto__ || (0, _getPrototypeOf2.default)(NoMatchImg)).call(this));
}
(0, _createClass3.default)(NoMatchImg, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
{ className: _NoMatchImg2.default.NoMatchImg },
_react2.default.createElement('img', { src: '/static/images/noselectArticle.png', alt: '' })
);
}
}]);
return NoMatchImg;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = NoMatchImg;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(NoMatchImg, 'NoMatchImg', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/NoMatchImg.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/NoMatchImg.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/NoMatchImg.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/NoMatchImg.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/NoMatchImg.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/Photo/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _defineProperty2 = __webpack_require__("./node_modules/babel-runtime/helpers/defineProperty.js");
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _dec, _class, _class2, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _index = __webpack_require__("./PC_client/views/manage/Photo/index.less");
var _index2 = _interopRequireDefault(_index);
var _services = __webpack_require__("./PC_client/services/index.js");
var _services2 = _interopRequireDefault(_services);
var _Detail = __webpack_require__("./PC_client/views/manage/Article/Detail.less");
var _Detail2 = _interopRequireDefault(_Detail);
var _utils = __webpack_require__("./PC_client/core/utils.js");
var _utils2 = _interopRequireDefault(_utils);
var _handle = __webpack_require__("./PC_client/core/handle.js");
var _handle2 = _interopRequireDefault(_handle);
var _actionsType = __webpack_require__("./PC_client/store/actionsType.js");
var _UI = __webpack_require__("./PC_client/components/UI/index.js");
var _showTime = __webpack_require__("./PC_client/components/Time/showTime.js");
var _showTime2 = _interopRequireDefault(_showTime);
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _Photo = __webpack_require__("./PC_client/store/actions/Photo.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PhotoIndex = (_dec = (0, _reactRedux.connect)(function (state) {
return { state: state.Photo };
}, function (dispatch) {
return (0, _redux.bindActionCreators)({
getPhotoList: _Photo.getPhotoList,
deletePhotoDetail: _Photo.deletePhotoDetail,
updatePhotoDetail: _Photo.updatePhotoDetail, savePhotoDetail: _Photo.savePhotoDetail, createPhotoDetail: _Photo.createPhotoDetail
}, dispatch);
}), _dec(_class = (_temp = _class2 = function (_Component) {
(0, _inherits3.default)(PhotoIndex, _Component);
function PhotoIndex(props) {
(0, _classCallCheck3.default)(this, PhotoIndex);
var _this = (0, _possibleConstructorReturn3.default)(this, (PhotoIndex.__proto__ || (0, _getPrototypeOf2.default)(PhotoIndex)).call(this, props));
_this.state = (0, _assign2.default)({}, {
showSetting: false,
isUpload: false
}, { photo: props.state.photo });
if (props.state.data.length == 0) {
_this.props.getPhotoList();
}
return _this;
}
(0, _createClass3.default)(PhotoIndex, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
// console.log(nextProps.data.idx, this.state.idx);
console.log(!nextProps.state.photo.idx);
if (nextProps.state.status == _actionsType.STATE.SUCCESS) {
this.setState({ photo: {} });
}
if (!nextProps.state.photo.idx || nextProps.state.photo && nextProps.state.photo.idx != this.state.photo.idx) {
this.setState({ photo: nextProps.state.photo });
// console.log('componentWillReceiveProps');
}
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'handleSetting',
value: function handleSetting() {
this.setState({ showSetting: !this.state.showSetting });
}
}, {
key: 'handleSave',
value: function handleSave() {
this.props.savePhotoDetail(this.state.photo);
}
}, {
key: 'handleDelete',
value: function handleDelete() {}
}, {
key: 'handleSelect',
value: function handleSelect($obj) {
var that = this;
return function () {
that.props.updatePhotoDetail($obj);
that.setState({ showSetting: true });
};
}
}, {
key: 'handleLoadMore',
value: function handleLoadMore() {
this.props.getPhotoList(this.props.state.pageIndex + 1);
}
}, {
key: 'handleUpload',
value: function handleUpload() {
var that = this;
var numberInvert = null;
this.refs.fileUploadControl.onchange = function () {
if (that.state.isUpload) return;
var file = that.refs.fileUploadControl.files[0];
if (window.FileReader) {
if (file.size >= 1024 * 1024 * 20) {
window.alert('你选择的图片过大,当前图片大小:' + (file.size / (1024 * 1024)).toFixed(0) + 'MB,请选择小于20MB图片!');
return;
}
if (file.type.startsWith('image/')) {
that.state.isUpload = true;
var postFormData = new FormData();
var nowNumber = 0;
var resultNumber = 0;
var uploadProgressSpan = document.querySelector('#uploadProgress');
var fr = new FileReader();
fr.onloadend = function (e) {
that.refs.fileUploadImage.src = e.target.result;
// console.log(that.refs.fileUploadImage);
};
fr.readAsDataURL(file);
postFormData.append('file', file);
numberInvert && clearInterval(numberInvert);
numberInvert = setInterval(function () {
if (nowNumber < resultNumber) {
if (resultNumber - nowNumber < 1) {
nowNumber += 0.01;
} else if (resultNumber - nowNumber > 10) {
nowNumber += 1;
} else {
nowNumber += 0.1;
}
} else {
return;
}
if (nowNumber > resultNumber) nowNumber = resultNumber;
if (nowNumber >= 100 || resultNumber == 100) {
nowNumber = 100;
}
uploadProgressSpan.innerText = nowNumber.toFixed(2) + '%';
that.refs.progresswidth.style.width = 100 - nowNumber.toFixed(2) + '%';
if (nowNumber >= 100) {
clearInterval(numberInvert);
}
}, 30);
_services2.default.upload(postFormData, {
method: 'POST',
onUploadProgress: function onUploadProgress(progressEvent) {
resultNumber = (progressEvent.loaded / progressEvent.total).toFixed(4) * 100;
// loaded: 306203, total: 306203
}
}).then(function (data) {
that.refs.fileUploadControl.value = '';
// window.config.uploadImage
// {"errorNo":0,"errorMessage":"","data":"/upload/20170614/1497423078000.jpg"}
console.log(data);
// window.config.uploadImage +
var imageUrl = data.data.data;
// that.props.updatePhotoDetail({url: imageUrl});
console.log(that.state.photo);
if (that.state.photo.idx > 0) {
that.setState({
photo: (0, _assign2.default)({}, that.state.photo, {
url: imageUrl,
size: file.size
})
});
} else {
that.setState({
photo: (0, _assign2.default)({}, that.state.photo, {
url: imageUrl,
size: file.size
})
});
}
that.state.isUpload = false;
// that.editor.codemirror.replaceSelection('', 'Alt')
});
// let fr = new FileReader();
// fr.onloadend = function (e) {
// // console.log(e.target.result);
//
// };
// fr.readAsArrayBuffer(file);
// onUploadProgress: function (progressEvent) {
// Do whatever you want with the native progress event
// },
} else {
window.alert('上传图片类型不正确!');
}
}
};
this.refs.fileUploadControl.click();
}
}, {
key: 'handleOnChange',
value: function handleOnChange($event) {
var id = $event.target.id;
this.setState({ photo: (0, _assign2.default)({}, this.state.photo, (0, _defineProperty3.default)({}, id, $event.target.value)) });
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var model = this.state.photo;
var showSettingView = void 0;
var loadingButton = void 0;
if (this.state.showSetting) {
var $dateTime = model.createdAt ? new Date(model.createdAt) : new Date();
showSettingView = _react2.default.createElement(
'div',
{ className: _Detail2.default.setting, onClick: this.handleSetting.bind(this) },
_react2.default.createElement(
'div',
{ className: 'show', onClick: function onClick(e) {
e.stopPropagation();
} },
_react2.default.createElement(_showTime2.default, { date: $dateTime }),
_react2.default.createElement(
'ul',
null,
_react2.default.createElement(
'li',
null,
'\u56FE\u7247\u4E0A\u4F20'
),
_react2.default.createElement(
'li',
{ style: { 'position': 'relative' } },
_react2.default.createElement(
'div',
{ className: 'uploadImage' },
'+'
),
_react2.default.createElement('div', { className: 'width',
style: { 'width': model.url ? '0' : '' },
ref: 'progresswidth',
onClick: this.handleUpload.bind(this) }),
_react2.default.createElement('img', { ref: 'fileUploadImage', onClick: this.handleUpload.bind(this),
src: model.url || "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
id: 'fileUploadImage' }),
_react2.default.createElement('input', { type: 'file', id: 'fileUploadControl',
ref: 'fileUploadControl' })
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement(
'div',
{ className: 'progress' },
_react2.default.createElement('span', { id: 'uploadProgress' })
)
),
_react2.default.createElement(
'li',
null,
'\u6807\u9898'
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'text',
id: 'title',
value: model.title,
onChange: this.handleOnChange.bind(this)
})
),
_react2.default.createElement(
'li',
null,
'\u63CF\u8FF0\u4FE1\u606F'
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'text',
id: 'description', value: model.description,
onChange: this.handleOnChange.bind(this)
})
),
_react2.default.createElement(
'li',
null,
this.props.state.detailStatus
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement(
'button',
{ className: 'btn submit w100',
onClick: this.handleSave.bind(this)
},
model.idx > 0 ? '修改图片' : '添加图片'
)
)
)
)
);
}
if (this.props.state.status != _actionsType.STATE.FETCHING) {
loadingButton = _react2.default.createElement(
'button',
{
className: 'loadMoreButton',
onClick: this.handleLoadMore.bind(this) },
'\u66F4\u591A'
);
}
return _react2.default.createElement(
'div',
{ className: _index2.default.index },
_react2.default.createElement(
'div',
{ className: 'nav' },
_react2.default.createElement(
'span',
null,
'\u5171\u8BA1',
this.props.state.total,
'\u5F20\u76F8\u7247'
),
_react2.default.createElement(
'button',
{ className: 'btn submit', onClick: function onClick(e) {
_this2.props.createPhotoDetail();
_this2.setState({ showSetting: !_this2.state.showSetting });
} },
'+ \u4E0A\u4F20\u76F8\u7247'
),
_react2.default.createElement(
'button',
{ className: 'btn', onClick: function onClick(e) {
_this2.props.getPhotoList(1);
} },
'\u5237\u65B0'
)
),
_react2.default.createElement(
'div',
{ className: 'clear' },
this.props.state.data.map(function (item) {
return _react2.default.createElement(
'div',
{ className: 'photo', key: item.idx },
_react2.default.createElement('div', { className: 'thumbnail', style: { 'backgroundImage': 'url(' + item.url + ')' } }),
_react2.default.createElement(
'p',
{ className: 'title' },
item.title
),
_react2.default.createElement(
'p',
{ className: 'info' },
item.description
),
_react2.default.createElement(
'p',
null,
_react2.default.createElement(
'a',
{ className: 'hoverText', onClick: _this2.handleSelect.call(_this2, item) },
'\u7F16\u8F91'
),
'\xA0|\xA0',
_react2.default.createElement(
'a',
{ className: 'hoverText delete',
onClick: function onClick(e) {
_this2.props.deletePhotoDetail(item.idx);
} },
'\u5220\u9664'
)
)
);
})
),
loadingButton,
function () {
if (_this2.props.state.status == _actionsType.STATE.FETCHING) {
return _react2.default.createElement(
'div',
{ className: 'loadMore' },
_react2.default.createElement(_UI.Icon, { name: 'loading1' }),
'\xA0\xA0\u6B63\u5728\u83B7\u53D6\u6570\u636E\u4E2D...'
);
}
}(),
showSettingView
);
}
}]);
return PhotoIndex;
}(_react.Component), _class2.defaultProps = {}, _class2.propTypes = {}, _temp)) || _class);
exports.default = PhotoIndex;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(PhotoIndex, 'PhotoIndex', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/Photo/index.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/Photo/index.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Photo/index.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Photo/index.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Photo/index.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/RightDetail.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _class, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _RightDetail = __webpack_require__("./PC_client/views/manage/RightDetail.less");
var _RightDetail2 = _interopRequireDefault(_RightDetail);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var RightDetail = (_temp = _class = function (_Component) {
(0, _inherits3.default)(RightDetail, _Component);
function RightDetail(props) {
(0, _classCallCheck3.default)(this, RightDetail);
return (0, _possibleConstructorReturn3.default)(this, (RightDetail.__proto__ || (0, _getPrototypeOf2.default)(RightDetail)).call(this, props));
}
(0, _createClass3.default)(RightDetail, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
{ className: "fl vh100 " + _RightDetail2.default.RightDetail },
this.props.children
);
}
}]);
return RightDetail;
}(_react.Component), _class.defaultProps = {}, _class.propTypes = {}, _temp);
exports.default = RightDetail;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(RightDetail, 'RightDetail', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/RightDetail.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/RightDetail.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/RightDetail.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/RightDetail.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/RightDetail.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./PC_client/views/manage/System/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _getPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/get-prototype-of.js");
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
var _classCallCheck2 = __webpack_require__("./node_modules/babel-runtime/helpers/classCallCheck.js");
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__("./node_modules/babel-runtime/helpers/createClass.js");
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js");
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__("./node_modules/babel-runtime/helpers/inherits.js");
var _inherits3 = _interopRequireDefault(_inherits2);
var _dec, _class, _class2, _temp;
var _react = __webpack_require__("./node_modules/react/react.js");
var _react2 = _interopRequireDefault(_react);
var _index = __webpack_require__("./PC_client/views/manage/System/index.less");
var _index2 = _interopRequireDefault(_index);
var _reactRedux = __webpack_require__("./node_modules/react-redux/es/index.js");
var _redux = __webpack_require__("./node_modules/redux/es/index.js");
var _System = __webpack_require__("./PC_client/store/actions/System.js");
var _handle = __webpack_require__("./PC_client/core/handle.js");
var _handle2 = _interopRequireDefault(_handle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SystemIndex = (_dec = (0, _reactRedux.connect)(function (state) {
return { state: state.System };
}, function (dispatch) {
return (0, _redux.bindActionCreators)({
updatePassword: _System.updatePassword
}, dispatch);
}), _dec(_class = (_temp = _class2 = function (_Component) {
(0, _inherits3.default)(SystemIndex, _Component);
function SystemIndex(props) {
(0, _classCallCheck3.default)(this, SystemIndex);
var _this = (0, _possibleConstructorReturn3.default)(this, (SystemIndex.__proto__ || (0, _getPrototypeOf2.default)(SystemIndex)).call(this, props));
_this.state = { updatePassword: {} };
return _this;
}
(0, _createClass3.default)(SystemIndex, [{
key: 'componentWillMount',
value: function componentWillMount() {}
}, {
key: 'componentDidMount',
value: function componentDidMount() {}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate() {
return true;
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate() {}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var model = this.state.updatePassword;
return _react2.default.createElement(
'div',
{ className: _index2.default.index },
_react2.default.createElement(
'div',
{ className: 'nav' },
_react2.default.createElement(
'div',
{ className: 'menu' },
'\u4FEE\u6539\u5BC6\u7801'
),
_react2.default.createElement(
'div',
{ className: 'menu' },
'\u6570\u636E\u5E93\u5907\u4EFD'
)
),
_react2.default.createElement(
'div',
{ id: 'updatePassword' },
_react2.default.createElement(
'ul',
null,
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'password', required: true, className: 'input', id: 'updatePassword.oldPassword',
value: model.oldPassword,
onChange: _handle2.default.handleOnChange.bind(this) }),
_react2.default.createElement(
'span',
{ className: 'label' },
'\u539F\u59CB\u5BC6\u7801'
)
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'password', required: true, className: 'input', id: 'updatePassword.newPassword1',
value: model.newPassword1,
onChange: _handle2.default.handleOnChange.bind(this)
}),
_react2.default.createElement(
'span',
{ className: 'label' },
'\u65B0\u5BC6\u7801'
)
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement('input', { type: 'password', required: true, className: 'input', id: 'updatePassword.newPassword2',
value: model.newPassword2,
onChange: _handle2.default.handleOnChange.bind(this)
}),
_react2.default.createElement(
'span',
{ className: 'label' },
'\u91CD\u590D\u65B0\u5BC6\u7801'
)
),
_react2.default.createElement(
'li',
null,
_react2.default.createElement(
'button',
{ className: 'btn submit', onClick: function onClick(e) {
_this2.props.updatePassword(_this2.state.updatePassword);
} },
'\u786E\u5B9A\u4FEE\u6539\u5BC6\u7801'
)
),
_react2.default.createElement(
'li',
null,
this.props.state.updatePasswordStatus
)
)
)
);
}
}]);
return SystemIndex;
}(_react.Component), _class2.defaultProps = {}, _class2.propTypes = {}, _temp)) || _class);
exports.default = SystemIndex;
;
var _temp2 = function () {
if (typeof __REACT_HOT_LOADER__ === 'undefined') {
return;
}
__REACT_HOT_LOADER__.register(SystemIndex, 'SystemIndex', '/Users/zhaoyifeng/Documents/project/nblog/PC_client/views/manage/System/index.js');
}();
;
/***/ }),
/***/ "./PC_client/views/manage/System/index.less":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/System/index.less");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("./node_modules/style-loader/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/System/index.less", function() {
var newContent = __webpack_require__("./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/System/index.less");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "./node_modules/axios/index.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./node_modules/axios/lib/axios.js");
/***/ }),
/***/ "./node_modules/axios/lib/adapters/xhr.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
var settle = __webpack_require__("./node_modules/axios/lib/core/settle.js");
var buildURL = __webpack_require__("./node_modules/axios/lib/helpers/buildURL.js");
var parseHeaders = __webpack_require__("./node_modules/axios/lib/helpers/parseHeaders.js");
var isURLSameOrigin = __webpack_require__("./node_modules/axios/lib/helpers/isURLSameOrigin.js");
var createError = __webpack_require__("./node_modules/axios/lib/core/createError.js");
var btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__("./node_modules/axios/lib/helpers/btoa.js");
module.exports = function xhrAdapter(config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
var requestData = config.data;
var requestHeaders = config.headers;
if (utils.isFormData(requestData)) {
delete requestHeaders['Content-Type']; // Let the browser set it
}
var request = new XMLHttpRequest();
var loadEvent = 'onreadystatechange';
var xDomain = false;
// For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers.
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
if (process.env.NODE_ENV !== 'test' &&
typeof window !== 'undefined' &&
window.XDomainRequest && !('withCredentials' in request) &&
!isURLSameOrigin(config.url)) {
request = new window.XDomainRequest();
loadEvent = 'onload';
xDomain = true;
request.onprogress = function handleProgress() {};
request.ontimeout = function handleTimeout() {};
}
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = config.auth.password || '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
// Listen for ready state
request[loadEvent] = function handleLoad() {
if (!request || (request.readyState !== 4 && !xDomain)) {
return;
}
// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
return;
}
// Prepare the response
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
var response = {
data: responseData,
// IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
status: request.status === 1223 ? 204 : request.status,
statusText: request.status === 1223 ? 'No Content' : request.statusText,
headers: responseHeaders,
config: config,
request: request
};
settle(resolve, reject, response);
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(createError('Network Error', config));
// Clean up request
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED'));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
var cookies = __webpack_require__("./node_modules/axios/lib/helpers/cookies.js");
// Add xsrf header
var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
cookies.read(config.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
// Otherwise add header to the request
request.setRequestHeader(key, val);
}
});
}
// Add withCredentials to request if needed
if (config.withCredentials) {
request.withCredentials = true;
}
// Add responseType to request if needed
if (config.responseType) {
try {
request.responseType = config.responseType;
} catch (e) {
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
if (config.responseType !== 'json') {
throw e;
}
}
}
// Handle progress if needed
if (typeof config.onDownloadProgress === 'function') {
request.addEventListener('progress', config.onDownloadProgress);
}
// Not all browsers support upload events
if (typeof config.onUploadProgress === 'function' && request.upload) {
request.upload.addEventListener('progress', config.onUploadProgress);
}
if (config.cancelToken) {
// Handle cancellation
config.cancelToken.promise.then(function onCanceled(cancel) {
if (!request) {
return;
}
request.abort();
reject(cancel);
// Clean up request
request = null;
});
}
if (requestData === undefined) {
requestData = null;
}
// Send the request
request.send(requestData);
});
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/axios/lib/axios.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
var bind = __webpack_require__("./node_modules/axios/lib/helpers/bind.js");
var Axios = __webpack_require__("./node_modules/axios/lib/core/Axios.js");
var defaults = __webpack_require__("./node_modules/axios/lib/defaults.js");
/**
* Create an instance of Axios
*
* @param {Object} defaultConfig The default config for the instance
* @return {Axios} A new instance of Axios
*/
function createInstance(defaultConfig) {
var context = new Axios(defaultConfig);
var instance = bind(Axios.prototype.request, context);
// Copy axios.prototype to instance
utils.extend(instance, Axios.prototype, context);
// Copy context to instance
utils.extend(instance, context);
return instance;
}
// Create the default instance to be exported
var axios = createInstance(defaults);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Factory for creating new instances
axios.create = function create(instanceConfig) {
return createInstance(utils.merge(defaults, instanceConfig));
};
// Expose Cancel & CancelToken
axios.Cancel = __webpack_require__("./node_modules/axios/lib/cancel/Cancel.js");
axios.CancelToken = __webpack_require__("./node_modules/axios/lib/cancel/CancelToken.js");
axios.isCancel = __webpack_require__("./node_modules/axios/lib/cancel/isCancel.js");
// Expose all/spread
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = __webpack_require__("./node_modules/axios/lib/helpers/spread.js");
module.exports = axios;
// Allow use of default import syntax in TypeScript
module.exports.default = axios;
/***/ }),
/***/ "./node_modules/axios/lib/cancel/Cancel.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* A `Cancel` is an object that is thrown when an operation is canceled.
*
* @class
* @param {string=} message The message.
*/
function Cancel(message) {
this.message = message;
}
Cancel.prototype.toString = function toString() {
return 'Cancel' + (this.message ? ': ' + this.message : '');
};
Cancel.prototype.__CANCEL__ = true;
module.exports = Cancel;
/***/ }),
/***/ "./node_modules/axios/lib/cancel/CancelToken.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var Cancel = __webpack_require__("./node_modules/axios/lib/cancel/Cancel.js");
/**
* A `CancelToken` is an object that can be used to request cancellation of an operation.
*
* @class
* @param {Function} executor The executor function.
*/
function CancelToken(executor) {
if (typeof executor !== 'function') {
throw new TypeError('executor must be a function.');
}
var resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
var token = this;
executor(function cancel(message) {
if (token.reason) {
// Cancellation has already been requested
return;
}
token.reason = new Cancel(message);
resolvePromise(token.reason);
});
}
/**
* Throws a `Cancel` if cancellation has been requested.
*/
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
if (this.reason) {
throw this.reason;
}
};
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
CancelToken.source = function source() {
var cancel;
var token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token: token,
cancel: cancel
};
};
module.exports = CancelToken;
/***/ }),
/***/ "./node_modules/axios/lib/cancel/isCancel.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function isCancel(value) {
return !!(value && value.__CANCEL__);
};
/***/ }),
/***/ "./node_modules/axios/lib/core/Axios.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var defaults = __webpack_require__("./node_modules/axios/lib/defaults.js");
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
var InterceptorManager = __webpack_require__("./node_modules/axios/lib/core/InterceptorManager.js");
var dispatchRequest = __webpack_require__("./node_modules/axios/lib/core/dispatchRequest.js");
var isAbsoluteURL = __webpack_require__("./node_modules/axios/lib/helpers/isAbsoluteURL.js");
var combineURLs = __webpack_require__("./node_modules/axios/lib/helpers/combineURLs.js");
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*/
function Axios(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = utils.merge({
url: arguments[0]
}, arguments[1]);
}
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
// Support baseURL config
if (config.baseURL && !isAbsoluteURL(config.url)) {
config.url = combineURLs(config.baseURL, config.url);
}
// Hook up interceptors middleware
var chain = [dispatchRequest, undefined];
var promise = Promise.resolve(config);
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
chain.unshift(interceptor.fulfilled, interceptor.rejected);
});
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
chain.push(interceptor.fulfilled, interceptor.rejected);
});
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
};
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, data, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url,
data: data
}));
};
});
module.exports = Axios;
/***/ }),
/***/ "./node_modules/axios/lib/core/InterceptorManager.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
function InterceptorManager() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
this.handlers.push({
fulfilled: fulfilled,
rejected: rejected
});
return this.handlers.length - 1;
};
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*/
InterceptorManager.prototype.eject = function eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
};
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*/
InterceptorManager.prototype.forEach = function forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
};
module.exports = InterceptorManager;
/***/ }),
/***/ "./node_modules/axios/lib/core/createError.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var enhanceError = __webpack_require__("./node_modules/axios/lib/core/enhanceError.js");
/**
* Create an Error with the specified message, config, error code, and response.
*
* @param {string} message The error message.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
@ @param {Object} [response] The response.
* @returns {Error} The created error.
*/
module.exports = function createError(message, config, code, response) {
var error = new Error(message);
return enhanceError(error, config, code, response);
};
/***/ }),
/***/ "./node_modules/axios/lib/core/dispatchRequest.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
var transformData = __webpack_require__("./node_modules/axios/lib/core/transformData.js");
var isCancel = __webpack_require__("./node_modules/axios/lib/cancel/isCancel.js");
var defaults = __webpack_require__("./node_modules/axios/lib/defaults.js");
/**
* Throws a `Cancel` if cancellation has been requested.
*/
function throwIfCancellationRequested(config) {
if (config.cancelToken) {
config.cancelToken.throwIfRequested();
}
}
/**
* Dispatch a request to the server using the configured adapter.
*
* @param {object} config The config that is to be used for the request
* @returns {Promise} The Promise to be fulfilled
*/
module.exports = function dispatchRequest(config) {
throwIfCancellationRequested(config);
// Ensure headers exist
config.headers = config.headers || {};
// Transform request data
config.data = transformData(
config.data,
config.headers,
config.transformRequest
);
// Flatten headers
config.headers = utils.merge(
config.headers.common || {},
config.headers[config.method] || {},
config.headers || {}
);
utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
function cleanHeaderConfig(method) {
delete config.headers[method];
}
);
var adapter = config.adapter || defaults.adapter;
return adapter(config).then(function onAdapterResolution(response) {
throwIfCancellationRequested(config);
// Transform response data
response.data = transformData(
response.data,
response.headers,
config.transformResponse
);
return response;
}, function onAdapterRejection(reason) {
if (!isCancel(reason)) {
throwIfCancellationRequested(config);
// Transform response data
if (reason && reason.response) {
reason.response.data = transformData(
reason.response.data,
reason.response.headers,
config.transformResponse
);
}
}
return Promise.reject(reason);
});
};
/***/ }),
/***/ "./node_modules/axios/lib/core/enhanceError.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Update an Error with the specified config, error code, and response.
*
* @param {Error} error The error to update.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
@ @param {Object} [response] The response.
* @returns {Error} The error.
*/
module.exports = function enhanceError(error, config, code, response) {
error.config = config;
if (code) {
error.code = code;
}
error.response = response;
return error;
};
/***/ }),
/***/ "./node_modules/axios/lib/core/settle.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var createError = __webpack_require__("./node_modules/axios/lib/core/createError.js");
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*/
module.exports = function settle(resolve, reject, response) {
var validateStatus = response.config.validateStatus;
// Note: status is not exposed by XDomainRequest
if (!response.status || !validateStatus || validateStatus(response.status)) {
resolve(response);
} else {
reject(createError(
'Request failed with status code ' + response.status,
response.config,
null,
response
));
}
};
/***/ }),
/***/ "./node_modules/axios/lib/core/transformData.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
/*eslint no-param-reassign:0*/
utils.forEach(fns, function transform(fn) {
data = fn(data, headers);
});
return data;
};
/***/ }),
/***/ "./node_modules/axios/lib/defaults.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
var normalizeHeaderName = __webpack_require__("./node_modules/axios/lib/helpers/normalizeHeaderName.js");
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
};
function setContentTypeIfUnset(headers, value) {
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
headers['Content-Type'] = value;
}
}
function getDefaultAdapter() {
var adapter;
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = __webpack_require__("./node_modules/axios/lib/adapters/xhr.js");
} else if (typeof process !== 'undefined') {
// For node use HTTP adapter
adapter = __webpack_require__("./node_modules/axios/lib/adapters/xhr.js");
}
return adapter;
}
var defaults = {
adapter: getDefaultAdapter(),
transformRequest: [function transformRequest(data, headers) {
normalizeHeaderName(headers, 'Content-Type');
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
utils.isBlob(data)
) {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.buffer;
}
if (utils.isURLSearchParams(data)) {
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
return data.toString();
}
if (utils.isObject(data)) {
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
return JSON.stringify(data);
}
return data;
}],
transformResponse: [function transformResponse(data) {
/*eslint no-param-reassign:0*/
if (typeof data === 'string') {
try {
data = JSON.parse(data);
} catch (e) { /* Ignore */ }
}
return data;
}],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: function validateStatus(status) {
return status >= 200 && status < 300;
}
};
defaults.headers = {
common: {
'Accept': 'application/json, text/plain, */*'
}
};
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
defaults.headers[method] = {};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});
module.exports = defaults;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/axios/lib/helpers/bind.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function bind(fn, thisArg) {
return function wrap() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/btoa.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
function E() {
this.message = 'String contains an invalid character';
}
E.prototype = new Error;
E.prototype.code = 5;
E.prototype.name = 'InvalidCharacterError';
function btoa(input) {
var str = String(input);
var output = '';
for (
// initialize result and counter
var block, charCode, idx = 0, map = chars;
// if the next str index does not exist:
// change the mapping table to "="
// check if d has no fractional digits
str.charAt(idx | 0) || (map = '=', idx % 1);
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
) {
charCode = str.charCodeAt(idx += 3 / 4);
if (charCode > 0xFF) {
throw new E();
}
block = block << 8 | charCode;
}
return output;
}
module.exports = btoa;
/***/ }),
/***/ "./node_modules/axios/lib/helpers/buildURL.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
function encode(val) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']');
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
module.exports = function buildURL(url, params, paramsSerializer) {
/*eslint no-param-reassign:0*/
if (!params) {
return url;
}
var serializedParams;
if (paramsSerializer) {
serializedParams = paramsSerializer(params);
} else if (utils.isURLSearchParams(params)) {
serializedParams = params.toString();
} else {
var parts = [];
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return;
}
if (utils.isArray(val)) {
key = key + '[]';
}
if (!utils.isArray(val)) {
val = [val];
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString();
} else if (utils.isObject(v)) {
v = JSON.stringify(v);
}
parts.push(encode(key) + '=' + encode(v));
});
});
serializedParams = parts.join('&');
}
if (serializedParams) {
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/combineURLs.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
module.exports = function combineURLs(baseURL, relativeURL) {
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
: baseURL;
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/cookies.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
if (utils.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
if (utils.isString(path)) {
cookie.push('path=' + path);
}
if (utils.isString(domain)) {
cookie.push('domain=' + domain);
}
if (secure === true) {
cookie.push('secure');
}
document.cookie = cookie.join('; ');
},
read: function read(name) {
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})()
);
/***/ }),
/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname :
'/' + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
};
})()
);
/***/ }),
/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
module.exports = function normalizeHeaderName(headers, normalizedName) {
utils.forEach(headers, function processHeader(value, name) {
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
headers[normalizedName] = value;
delete headers[name];
}
});
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__("./node_modules/axios/lib/utils.js");
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {};
var key;
var val;
var i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function parser(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
});
return parsed;
};
/***/ }),
/***/ "./node_modules/axios/lib/helpers/spread.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
* @returns {Function}
*/
module.exports = function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
};
/***/ }),
/***/ "./node_modules/axios/lib/utils.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Buffer) {
var bind = __webpack_require__("./node_modules/axios/lib/helpers/bind.js");
/*global toString:true*/
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is a Node Buffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Node Buffer, otherwise false
*/
function isBuffer(val) {
return ((typeof Buffer !== 'undefined') && (Buffer.isBuffer) && (Buffer.isBuffer(val)));
}
/**
* Determine if a value is an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
function isArrayBuffer(val) {
return toString.call(val) === '[object ArrayBuffer]';
}
/**
* Determine if a value is a FormData
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(val) {
return (typeof FormData !== 'undefined') && (val instanceof FormData);
}
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
var result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
}
return result;
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
function isUndefined(val) {
return typeof val === 'undefined';
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
function isObject(val) {
return val !== null && typeof val === 'object';
}
/**
* Determine if a value is a Date
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
function isDate(val) {
return toString.call(val) === '[object Date]';
}
/**
* Determine if a value is a File
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
function isFile(val) {
return toString.call(val) === '[object File]';
}
/**
* Determine if a value is a Blob
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
function isBlob(val) {
return toString.call(val) === '[object Blob]';
}
/**
* Determine if a value is a Function
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
function isFunction(val) {
return toString.call(val) === '[object Function]';
}
/**
* Determine if a value is a Stream
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Stream, otherwise false
*/
function isStream(val) {
return isObject(val) && isFunction(val.pipe);
}
/**
* Determine if a value is a URLSearchParams object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
function isURLSearchParams(val) {
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
}
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* navigator.product -> 'ReactNative'
*/
function isStandardBrowserEnv() {
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
return false;
}
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object' && !isArray(obj)) {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn.call(null, obj[key], key, obj);
}
}
}
}
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
function merge(/* obj1, obj2, obj3, ... */) {
var result = {};
function assignValue(val, key) {
if (typeof result[key] === 'object' && typeof val === 'object') {
result[key] = merge(result[key], val);
} else {
result[key] = val;
}
}
for (var i = 0, l = arguments.length; i < l; i++) {
forEach(arguments[i], assignValue);
}
return result;
}
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
* @return {Object} The resulting value of object a
*/
function extend(a, b, thisArg) {
forEach(b, function assignValue(val, key) {
if (thisArg && typeof val === 'function') {
a[key] = bind(val, thisArg);
} else {
a[key] = val;
}
});
return a;
}
module.exports = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
isBuffer: isBuffer,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isUndefined: isUndefined,
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isFunction: isFunction,
isStream: isStream,
isURLSearchParams: isURLSearchParams,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
extend: extend,
trim: trim
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/buffer/index.js").Buffer))
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/array/from.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/array/from.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/object/assign.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/assign.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/object/create.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/create.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/object/define-property.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/define-property.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/object/get-prototype-of.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/get-prototype-of.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/object/keys.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/keys.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/object/set-prototype-of.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/object/set-prototype-of.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/symbol.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/symbol/index.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/core-js/symbol/iterator.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__("./node_modules/core-js/library/fn/symbol/iterator.js"), __esModule: true };
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/classCallCheck.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/createClass.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _defineProperty = __webpack_require__("./node_modules/babel-runtime/core-js/object/define-property.js");
var _defineProperty2 = _interopRequireDefault(_defineProperty);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = 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;
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/defineProperty.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _defineProperty = __webpack_require__("./node_modules/babel-runtime/core-js/object/define-property.js");
var _defineProperty2 = _interopRequireDefault(_defineProperty);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (obj, key, value) {
if (key in obj) {
(0, _defineProperty2.default)(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/extends.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _assign = __webpack_require__("./node_modules/babel-runtime/core-js/object/assign.js");
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _assign2.default || 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;
};
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/inherits.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _setPrototypeOf = __webpack_require__("./node_modules/babel-runtime/core-js/object/set-prototype-of.js");
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
var _create = __webpack_require__("./node_modules/babel-runtime/core-js/object/create.js");
var _create2 = _interopRequireDefault(_create);
var _typeof2 = __webpack_require__("./node_modules/babel-runtime/helpers/typeof.js");
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
}
subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
};
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/possibleConstructorReturn.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof2 = __webpack_require__("./node_modules/babel-runtime/helpers/typeof.js");
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
};
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/toConsumableArray.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _from = __webpack_require__("./node_modules/babel-runtime/core-js/array/from.js");
var _from2 = _interopRequireDefault(_from);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return (0, _from2.default)(arr);
}
};
/***/ }),
/***/ "./node_modules/babel-runtime/helpers/typeof.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _iterator = __webpack_require__("./node_modules/babel-runtime/core-js/symbol/iterator.js");
var _iterator2 = _interopRequireDefault(_iterator);
var _symbol = __webpack_require__("./node_modules/babel-runtime/core-js/symbol.js");
var _symbol2 = _interopRequireDefault(_symbol);
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof(obj);
} : function (obj) {
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
};
/***/ }),
/***/ "./node_modules/babel-runtime/regenerator/index.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./node_modules/regenerator-runtime/runtime-module.js");
/***/ }),
/***/ "./node_modules/base64-js/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function placeHoldersCount (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
}
function byteLength (b64) {
// base64 is 4/3 + up to two characters of the original data
return b64.length * 3 / 4 - placeHoldersCount(b64)
}
function toByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
var len = b64.length
placeHolders = placeHoldersCount(b64)
arr = new Arr(len * 3 / 4 - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? len - 4 : len
var L = 0
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
arr[L++] = (tmp >> 16) & 0xFF
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
if (placeHolders === 2) {
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[L++] = tmp & 0xFF
} else if (placeHolders === 1) {
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var output = ''
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
output += lookup[tmp >> 2]
output += lookup[(tmp << 4) & 0x3F]
output += '=='
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
output += lookup[tmp >> 10]
output += lookup[(tmp >> 4) & 0x3F]
output += lookup[(tmp << 2) & 0x3F]
output += '='
}
parts.push(output)
return parts.join('')
}
/***/ }),
/***/ "./node_modules/buffer/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
var base64 = __webpack_require__("./node_modules/base64-js/index.js")
var ieee754 = __webpack_require__("./node_modules/ieee754/index.js")
var isArray = __webpack_require__("./node_modules/buffer/node_modules/isarray/index.js")
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
/*
* Export kMaxLength after typed array support is determined.
*/
exports.kMaxLength = kMaxLength()
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
function createBuffer (that, length) {
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length)
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
that = new Buffer(length)
}
that.length = length
}
return that
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(this, arg)
}
return from(this, arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
arr.__proto__ = Buffer.prototype
return arr
}
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(that, value, encodingOrOffset)
}
return fromObject(that, value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true
})
}
}
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(that, size).fill(fill, encoding)
: createBuffer(that, size).fill(fill)
}
return createBuffer(that, size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
}
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0
}
}
return that
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(null, size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, length)
var actual = that.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}
return that
}
function fromArrayLike (that, array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('\'length\' is out of bounds')
}
if (byteOffset === undefined && length === undefined) {
array = new Uint8Array(array)
} else if (length === undefined) {
array = new Uint8Array(array, byteOffset)
} else {
array = new Uint8Array(array, byteOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array)
}
return that
}
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(that, 0)
}
return fromArrayLike(that, obj)
}
if (obj.type === 'Buffer' && isArray(obj.data)) {
return fromArrayLike(that, obj.data)
}
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function checked (length) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
string = '' + string
}
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
case undefined:
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (isNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end)
newBuf.__proto__ = Buffer.prototype
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start]
}
}
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, start + len),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if (code < 256) {
val = code
}
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: utf8ToBytes(new Buffer(val, encoding).toString())
var len = bytes.length
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/buffer/node_modules/isarray/index.js":
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/***/ "./node_modules/core-js/library/fn/array/from.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.string.iterator.js");
__webpack_require__("./node_modules/core-js/library/modules/es6.array.from.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Array.from;
/***/ }),
/***/ "./node_modules/core-js/library/fn/object/assign.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.object.assign.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object.assign;
/***/ }),
/***/ "./node_modules/core-js/library/fn/object/create.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.object.create.js");
var $Object = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object;
module.exports = function create(P, D){
return $Object.create(P, D);
};
/***/ }),
/***/ "./node_modules/core-js/library/fn/object/define-property.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.object.define-property.js");
var $Object = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object;
module.exports = function defineProperty(it, key, desc){
return $Object.defineProperty(it, key, desc);
};
/***/ }),
/***/ "./node_modules/core-js/library/fn/object/get-prototype-of.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.object.get-prototype-of.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object.getPrototypeOf;
/***/ }),
/***/ "./node_modules/core-js/library/fn/object/keys.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.object.keys.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object.keys;
/***/ }),
/***/ "./node_modules/core-js/library/fn/object/set-prototype-of.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.object.set-prototype-of.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Object.setPrototypeOf;
/***/ }),
/***/ "./node_modules/core-js/library/fn/symbol/index.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.symbol.js");
__webpack_require__("./node_modules/core-js/library/modules/es6.object.to-string.js");
__webpack_require__("./node_modules/core-js/library/modules/es7.symbol.async-iterator.js");
__webpack_require__("./node_modules/core-js/library/modules/es7.symbol.observable.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").Symbol;
/***/ }),
/***/ "./node_modules/core-js/library/fn/symbol/iterator.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.string.iterator.js");
__webpack_require__("./node_modules/core-js/library/modules/web.dom.iterable.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_wks-ext.js").f('iterator');
/***/ }),
/***/ "./node_modules/core-js/library/modules/_a-function.js":
/***/ (function(module, exports) {
module.exports = function(it){
if(typeof it != 'function')throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_add-to-unscopables.js":
/***/ (function(module, exports) {
module.exports = function(){ /* empty */ };
/***/ }),
/***/ "./node_modules/core-js/library/modules/_an-object.js":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js");
module.exports = function(it){
if(!isObject(it))throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_array-includes.js":
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js")
, toLength = __webpack_require__("./node_modules/core-js/library/modules/_to-length.js")
, toIndex = __webpack_require__("./node_modules/core-js/library/modules/_to-index.js");
module.exports = function(IS_INCLUDES){
return function($this, el, fromIndex){
var O = toIObject($this)
, length = toLength(O.length)
, index = toIndex(fromIndex, length)
, value;
// Array#includes uses SameValueZero equality algorithm
if(IS_INCLUDES && el != el)while(length > index){
value = O[index++];
if(value != value)return true;
// Array#toIndex ignores holes, Array#includes - not
} else for(;length > index; index++)if(IS_INCLUDES || index in O){
if(O[index] === el)return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_classof.js":
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__("./node_modules/core-js/library/modules/_cof.js")
, TAG = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('toStringTag')
// ES3 wrong here
, ARG = cof(function(){ return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function(it, key){
try {
return it[key];
} catch(e){ /* empty */ }
};
module.exports = function(it){
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_cof.js":
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function(it){
return toString.call(it).slice(8, -1);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_core.js":
/***/ (function(module, exports) {
var core = module.exports = {version: '2.4.0'};
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
/***/ }),
/***/ "./node_modules/core-js/library/modules/_create-property.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $defineProperty = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js")
, createDesc = __webpack_require__("./node_modules/core-js/library/modules/_property-desc.js");
module.exports = function(object, index, value){
if(index in object)$defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_ctx.js":
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__("./node_modules/core-js/library/modules/_a-function.js");
module.exports = function(fn, that, length){
aFunction(fn);
if(that === undefined)return fn;
switch(length){
case 1: return function(a){
return fn.call(that, a);
};
case 2: return function(a, b){
return fn.call(that, a, b);
};
case 3: return function(a, b, c){
return fn.call(that, a, b, c);
};
}
return function(/* ...args */){
return fn.apply(that, arguments);
};
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_defined.js":
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function(it){
if(it == undefined)throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_descriptors.js":
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__("./node_modules/core-js/library/modules/_fails.js")(function(){
return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ }),
/***/ "./node_modules/core-js/library/modules/_dom-create.js":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js")
, document = __webpack_require__("./node_modules/core-js/library/modules/_global.js").document
// in old IE typeof document.createElement is 'object'
, is = isObject(document) && isObject(document.createElement);
module.exports = function(it){
return is ? document.createElement(it) : {};
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_enum-bug-keys.js":
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/***/ "./node_modules/core-js/library/modules/_enum-keys.js":
/***/ (function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js")
, gOPS = __webpack_require__("./node_modules/core-js/library/modules/_object-gops.js")
, pIE = __webpack_require__("./node_modules/core-js/library/modules/_object-pie.js");
module.exports = function(it){
var result = getKeys(it)
, getSymbols = gOPS.f;
if(getSymbols){
var symbols = getSymbols(it)
, isEnum = pIE.f
, i = 0
, key;
while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
} return result;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_export.js":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js")
, core = __webpack_require__("./node_modules/core-js/library/modules/_core.js")
, ctx = __webpack_require__("./node_modules/core-js/library/modules/_ctx.js")
, hide = __webpack_require__("./node_modules/core-js/library/modules/_hide.js")
, PROTOTYPE = 'prototype';
var $export = function(type, name, source){
var IS_FORCED = type & $export.F
, IS_GLOBAL = type & $export.G
, IS_STATIC = type & $export.S
, IS_PROTO = type & $export.P
, IS_BIND = type & $export.B
, IS_WRAP = type & $export.W
, exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
, expProto = exports[PROTOTYPE]
, target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
, key, own, out;
if(IS_GLOBAL)source = name;
for(key in source){
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if(own && key in exports)continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function(C){
var F = function(a, b, c){
if(this instanceof C){
switch(arguments.length){
case 0: return new C;
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if(IS_PROTO){
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/***/ "./node_modules/core-js/library/modules/_fails.js":
/***/ (function(module, exports) {
module.exports = function(exec){
try {
return !!exec();
} catch(e){
return true;
}
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_global.js":
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
/***/ }),
/***/ "./node_modules/core-js/library/modules/_has.js":
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function(it, key){
return hasOwnProperty.call(it, key);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_hide.js":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js")
, createDesc = __webpack_require__("./node_modules/core-js/library/modules/_property-desc.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") ? function(object, key, value){
return dP.f(object, key, createDesc(1, value));
} : function(object, key, value){
object[key] = value;
return object;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_html.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_global.js").document && document.documentElement;
/***/ }),
/***/ "./node_modules/core-js/library/modules/_ie8-dom-define.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") && !__webpack_require__("./node_modules/core-js/library/modules/_fails.js")(function(){
return Object.defineProperty(__webpack_require__("./node_modules/core-js/library/modules/_dom-create.js")('div'), 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iobject.js":
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__("./node_modules/core-js/library/modules/_cof.js");
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_is-array-iter.js":
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__("./node_modules/core-js/library/modules/_iterators.js")
, ITERATOR = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('iterator')
, ArrayProto = Array.prototype;
module.exports = function(it){
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_is-array.js":
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__("./node_modules/core-js/library/modules/_cof.js");
module.exports = Array.isArray || function isArray(arg){
return cof(arg) == 'Array';
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_is-object.js":
/***/ (function(module, exports) {
module.exports = function(it){
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iter-call.js":
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js");
module.exports = function(iterator, fn, value, entries){
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch(e){
var ret = iterator['return'];
if(ret !== undefined)anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iter-create.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var create = __webpack_require__("./node_modules/core-js/library/modules/_object-create.js")
, descriptor = __webpack_require__("./node_modules/core-js/library/modules/_property-desc.js")
, setToStringTag = __webpack_require__("./node_modules/core-js/library/modules/_set-to-string-tag.js")
, IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__("./node_modules/core-js/library/modules/_hide.js")(IteratorPrototype, __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('iterator'), function(){ return this; });
module.exports = function(Constructor, NAME, next){
Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iter-define.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__("./node_modules/core-js/library/modules/_library.js")
, $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js")
, redefine = __webpack_require__("./node_modules/core-js/library/modules/_redefine.js")
, hide = __webpack_require__("./node_modules/core-js/library/modules/_hide.js")
, has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, Iterators = __webpack_require__("./node_modules/core-js/library/modules/_iterators.js")
, $iterCreate = __webpack_require__("./node_modules/core-js/library/modules/_iter-create.js")
, setToStringTag = __webpack_require__("./node_modules/core-js/library/modules/_set-to-string-tag.js")
, getPrototypeOf = __webpack_require__("./node_modules/core-js/library/modules/_object-gpo.js")
, ITERATOR = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('iterator')
, BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
, FF_ITERATOR = '@@iterator'
, KEYS = 'keys'
, VALUES = 'values';
var returnThis = function(){ return this; };
module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
$iterCreate(Constructor, NAME, next);
var getMethod = function(kind){
if(!BUGGY && kind in proto)return proto[kind];
switch(kind){
case KEYS: return function keys(){ return new Constructor(this, kind); };
case VALUES: return function values(){ return new Constructor(this, kind); };
} return function entries(){ return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator'
, DEF_VALUES = DEFAULT == VALUES
, VALUES_BUG = false
, proto = Base.prototype
, $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
, $default = $native || getMethod(DEFAULT)
, $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
, $anyNative = NAME == 'Array' ? proto.entries || $native : $native
, methods, key, IteratorPrototype;
// Fix native
if($anyNative){
IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
if(IteratorPrototype !== Object.prototype){
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if(DEF_VALUES && $native && $native.name !== VALUES){
VALUES_BUG = true;
$default = function values(){ return $native.call(this); };
}
// Define iterator
if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if(DEFAULT){
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if(FORCED)for(key in methods){
if(!(key in proto))redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iter-detect.js":
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('iterator')
, SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function(){ SAFE_CLOSING = true; };
Array.from(riter, function(){ throw 2; });
} catch(e){ /* empty */ }
module.exports = function(exec, skipClosing){
if(!skipClosing && !SAFE_CLOSING)return false;
var safe = false;
try {
var arr = [7]
, iter = arr[ITERATOR]();
iter.next = function(){ return {done: safe = true}; };
arr[ITERATOR] = function(){ return iter; };
exec(arr);
} catch(e){ /* empty */ }
return safe;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iter-step.js":
/***/ (function(module, exports) {
module.exports = function(done, value){
return {value: value, done: !!done};
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_iterators.js":
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_keyof.js":
/***/ (function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js")
, toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js");
module.exports = function(object, el){
var O = toIObject(object)
, keys = getKeys(O)
, length = keys.length
, index = 0
, key;
while(length > index)if(O[key = keys[index++]] === el)return key;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_library.js":
/***/ (function(module, exports) {
module.exports = true;
/***/ }),
/***/ "./node_modules/core-js/library/modules/_meta.js":
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__("./node_modules/core-js/library/modules/_uid.js")('meta')
, isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js")
, has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, setDesc = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js").f
, id = 0;
var isExtensible = Object.isExtensible || function(){
return true;
};
var FREEZE = !__webpack_require__("./node_modules/core-js/library/modules/_fails.js")(function(){
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function(it){
setDesc(it, META, {value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
}});
};
var fastKey = function(it, create){
// return primitive with prefix
if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if(!has(it, META)){
// can't set metadata to uncaught frozen object
if(!isExtensible(it))return 'F';
// not necessary to add metadata
if(!create)return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function(it, create){
if(!has(it, META)){
// can't set metadata to uncaught frozen object
if(!isExtensible(it))return true;
// not necessary to add metadata
if(!create)return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function(it){
if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-assign.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js")
, gOPS = __webpack_require__("./node_modules/core-js/library/modules/_object-gops.js")
, pIE = __webpack_require__("./node_modules/core-js/library/modules/_object-pie.js")
, toObject = __webpack_require__("./node_modules/core-js/library/modules/_to-object.js")
, IObject = __webpack_require__("./node_modules/core-js/library/modules/_iobject.js")
, $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__("./node_modules/core-js/library/modules/_fails.js")(function(){
var A = {}
, B = {}
, S = Symbol()
, K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function(k){ B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source){ // eslint-disable-line no-unused-vars
var T = toObject(target)
, aLen = arguments.length
, index = 1
, getSymbols = gOPS.f
, isEnum = pIE.f;
while(aLen > index){
var S = IObject(arguments[index++])
, keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
, length = keys.length
, j = 0
, key;
while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
} return T;
} : $assign;
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-create.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js")
, dPs = __webpack_require__("./node_modules/core-js/library/modules/_object-dps.js")
, enumBugKeys = __webpack_require__("./node_modules/core-js/library/modules/_enum-bug-keys.js")
, IE_PROTO = __webpack_require__("./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO')
, Empty = function(){ /* empty */ }
, PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function(){
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__("./node_modules/core-js/library/modules/_dom-create.js")('iframe')
, i = enumBugKeys.length
, lt = '<'
, gt = '>'
, iframeDocument;
iframe.style.display = 'none';
__webpack_require__("./node_modules/core-js/library/modules/_html.js").appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties){
var result;
if(O !== null){
Empty[PROTOTYPE] = anObject(O);
result = new Empty;
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-dp.js":
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js")
, IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/library/modules/_ie8-dom-define.js")
, toPrimitive = __webpack_require__("./node_modules/core-js/library/modules/_to-primitive.js")
, dP = Object.defineProperty;
exports.f = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes){
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if(IE8_DOM_DEFINE)try {
return dP(O, P, Attributes);
} catch(e){ /* empty */ }
if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
if('value' in Attributes)O[P] = Attributes.value;
return O;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-dps.js":
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js")
, anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js")
, getKeys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties){
anObject(O);
var keys = getKeys(Properties)
, length = keys.length
, i = 0
, P;
while(length > i)dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-gopd.js":
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__("./node_modules/core-js/library/modules/_object-pie.js")
, createDesc = __webpack_require__("./node_modules/core-js/library/modules/_property-desc.js")
, toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js")
, toPrimitive = __webpack_require__("./node_modules/core-js/library/modules/_to-primitive.js")
, has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/library/modules/_ie8-dom-define.js")
, gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P){
O = toIObject(O);
P = toPrimitive(P, true);
if(IE8_DOM_DEFINE)try {
return gOPD(O, P);
} catch(e){ /* empty */ }
if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-gopn-ext.js":
/***/ (function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js")
, gOPN = __webpack_require__("./node_modules/core-js/library/modules/_object-gopn.js").f
, toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function(it){
try {
return gOPN(it);
} catch(e){
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it){
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-gopn.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys-internal.js")
, hiddenKeys = __webpack_require__("./node_modules/core-js/library/modules/_enum-bug-keys.js").concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
return $keys(O, hiddenKeys);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-gops.js":
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-gpo.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, toObject = __webpack_require__("./node_modules/core-js/library/modules/_to-object.js")
, IE_PROTO = __webpack_require__("./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO')
, ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function(O){
O = toObject(O);
if(has(O, IE_PROTO))return O[IE_PROTO];
if(typeof O.constructor == 'function' && O instanceof O.constructor){
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-keys-internal.js":
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js")
, arrayIndexOf = __webpack_require__("./node_modules/core-js/library/modules/_array-includes.js")(false)
, IE_PROTO = __webpack_require__("./node_modules/core-js/library/modules/_shared-key.js")('IE_PROTO');
module.exports = function(object, names){
var O = toIObject(object)
, i = 0
, result = []
, key;
for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while(names.length > i)if(has(O, key = names[i++])){
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-keys.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys-internal.js")
, enumBugKeys = __webpack_require__("./node_modules/core-js/library/modules/_enum-bug-keys.js");
module.exports = Object.keys || function keys(O){
return $keys(O, enumBugKeys);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-pie.js":
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/***/ "./node_modules/core-js/library/modules/_object-sap.js":
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js")
, core = __webpack_require__("./node_modules/core-js/library/modules/_core.js")
, fails = __webpack_require__("./node_modules/core-js/library/modules/_fails.js");
module.exports = function(KEY, exec){
var fn = (core.Object || {})[KEY] || Object[KEY]
, exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_property-desc.js":
/***/ (function(module, exports) {
module.exports = function(bitmap, value){
return {
enumerable : !(bitmap & 1),
configurable: !(bitmap & 2),
writable : !(bitmap & 4),
value : value
};
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_redefine.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_hide.js");
/***/ }),
/***/ "./node_modules/core-js/library/modules/_set-proto.js":
/***/ (function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js")
, anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js");
var check = function(O, proto){
anObject(O);
if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function(test, buggy, set){
try {
set = __webpack_require__("./node_modules/core-js/library/modules/_ctx.js")(Function.call, __webpack_require__("./node_modules/core-js/library/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch(e){ buggy = true; }
return function setPrototypeOf(O, proto){
check(O, proto);
if(buggy)O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_set-to-string-tag.js":
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js").f
, has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, TAG = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('toStringTag');
module.exports = function(it, tag, stat){
if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_shared-key.js":
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__("./node_modules/core-js/library/modules/_shared.js")('keys')
, uid = __webpack_require__("./node_modules/core-js/library/modules/_uid.js");
module.exports = function(key){
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_shared.js":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js")
, SHARED = '__core-js_shared__'
, store = global[SHARED] || (global[SHARED] = {});
module.exports = function(key){
return store[key] || (store[key] = {});
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_string-at.js":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("./node_modules/core-js/library/modules/_to-integer.js")
, defined = __webpack_require__("./node_modules/core-js/library/modules/_defined.js");
// true -> String#at
// false -> String#codePointAt
module.exports = function(TO_STRING){
return function(that, pos){
var s = String(defined(that))
, i = toInteger(pos)
, l = s.length
, a, b;
if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_to-index.js":
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__("./node_modules/core-js/library/modules/_to-integer.js")
, max = Math.max
, min = Math.min;
module.exports = function(index, length){
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_to-integer.js":
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil
, floor = Math.floor;
module.exports = function(it){
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_to-iobject.js":
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__("./node_modules/core-js/library/modules/_iobject.js")
, defined = __webpack_require__("./node_modules/core-js/library/modules/_defined.js");
module.exports = function(it){
return IObject(defined(it));
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_to-length.js":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__("./node_modules/core-js/library/modules/_to-integer.js")
, min = Math.min;
module.exports = function(it){
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_to-object.js":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__("./node_modules/core-js/library/modules/_defined.js");
module.exports = function(it){
return Object(defined(it));
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_to-primitive.js":
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__("./node_modules/core-js/library/modules/_is-object.js");
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function(it, S){
if(!isObject(it))return it;
var fn, val;
if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_uid.js":
/***/ (function(module, exports) {
var id = 0
, px = Math.random();
module.exports = function(key){
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_wks-define.js":
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js")
, core = __webpack_require__("./node_modules/core-js/library/modules/_core.js")
, LIBRARY = __webpack_require__("./node_modules/core-js/library/modules/_library.js")
, wksExt = __webpack_require__("./node_modules/core-js/library/modules/_wks-ext.js")
, defineProperty = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js").f;
module.exports = function(name){
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/_wks-ext.js":
/***/ (function(module, exports, __webpack_require__) {
exports.f = __webpack_require__("./node_modules/core-js/library/modules/_wks.js");
/***/ }),
/***/ "./node_modules/core-js/library/modules/_wks.js":
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__("./node_modules/core-js/library/modules/_shared.js")('wks')
, uid = __webpack_require__("./node_modules/core-js/library/modules/_uid.js")
, Symbol = __webpack_require__("./node_modules/core-js/library/modules/_global.js").Symbol
, USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function(name){
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/***/ "./node_modules/core-js/library/modules/core.get-iterator-method.js":
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__("./node_modules/core-js/library/modules/_classof.js")
, ITERATOR = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('iterator')
, Iterators = __webpack_require__("./node_modules/core-js/library/modules/_iterators.js");
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_core.js").getIteratorMethod = function(it){
if(it != undefined)return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.array.from.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ctx = __webpack_require__("./node_modules/core-js/library/modules/_ctx.js")
, $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js")
, toObject = __webpack_require__("./node_modules/core-js/library/modules/_to-object.js")
, call = __webpack_require__("./node_modules/core-js/library/modules/_iter-call.js")
, isArrayIter = __webpack_require__("./node_modules/core-js/library/modules/_is-array-iter.js")
, toLength = __webpack_require__("./node_modules/core-js/library/modules/_to-length.js")
, createProperty = __webpack_require__("./node_modules/core-js/library/modules/_create-property.js")
, getIterFn = __webpack_require__("./node_modules/core-js/library/modules/core.get-iterator-method.js");
$export($export.S + $export.F * !__webpack_require__("./node_modules/core-js/library/modules/_iter-detect.js")(function(iter){ Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
var O = toObject(arrayLike)
, C = typeof this == 'function' ? this : Array
, aLen = arguments.length
, mapfn = aLen > 1 ? arguments[1] : undefined
, mapping = mapfn !== undefined
, index = 0
, iterFn = getIterFn(O)
, length, result, step, iterator;
if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for(result = new C(length); length > index; index++){
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.array.iterator.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var addToUnscopables = __webpack_require__("./node_modules/core-js/library/modules/_add-to-unscopables.js")
, step = __webpack_require__("./node_modules/core-js/library/modules/_iter-step.js")
, Iterators = __webpack_require__("./node_modules/core-js/library/modules/_iterators.js")
, toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js");
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__("./node_modules/core-js/library/modules/_iter-define.js")(Array, 'Array', function(iterated, kind){
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function(){
var O = this._t
, kind = this._k
, index = this._i++;
if(!O || index >= O.length){
this._t = undefined;
return step(1);
}
if(kind == 'keys' )return step(0, index);
if(kind == 'values')return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.assign.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js");
$export($export.S + $export.F, 'Object', {assign: __webpack_require__("./node_modules/core-js/library/modules/_object-assign.js")});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.create.js":
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js")
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', {create: __webpack_require__("./node_modules/core-js/library/modules/_object-create.js")});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.define-property.js":
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js");
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__("./node_modules/core-js/library/modules/_descriptors.js"), 'Object', {defineProperty: __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js").f});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.get-prototype-of.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__("./node_modules/core-js/library/modules/_to-object.js")
, $getPrototypeOf = __webpack_require__("./node_modules/core-js/library/modules/_object-gpo.js");
__webpack_require__("./node_modules/core-js/library/modules/_object-sap.js")('getPrototypeOf', function(){
return function getPrototypeOf(it){
return $getPrototypeOf(toObject(it));
};
});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.keys.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__("./node_modules/core-js/library/modules/_to-object.js")
, $keys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js");
__webpack_require__("./node_modules/core-js/library/modules/_object-sap.js")('keys', function(){
return function keys(it){
return $keys(toObject(it));
};
});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.set-prototype-of.js":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js");
$export($export.S, 'Object', {setPrototypeOf: __webpack_require__("./node_modules/core-js/library/modules/_set-proto.js").set});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.object.to-string.js":
/***/ (function(module, exports) {
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.string.iterator.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $at = __webpack_require__("./node_modules/core-js/library/modules/_string-at.js")(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__("./node_modules/core-js/library/modules/_iter-define.js")(String, 'String', function(iterated){
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function(){
var O = this._t
, index = this._i
, point;
if(index >= O.length)return {value: undefined, done: true};
point = $at(O, index);
this._i += point.length;
return {value: point, done: false};
});
/***/ }),
/***/ "./node_modules/core-js/library/modules/es6.symbol.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// ECMAScript 6 symbols shim
var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js")
, has = __webpack_require__("./node_modules/core-js/library/modules/_has.js")
, DESCRIPTORS = __webpack_require__("./node_modules/core-js/library/modules/_descriptors.js")
, $export = __webpack_require__("./node_modules/core-js/library/modules/_export.js")
, redefine = __webpack_require__("./node_modules/core-js/library/modules/_redefine.js")
, META = __webpack_require__("./node_modules/core-js/library/modules/_meta.js").KEY
, $fails = __webpack_require__("./node_modules/core-js/library/modules/_fails.js")
, shared = __webpack_require__("./node_modules/core-js/library/modules/_shared.js")
, setToStringTag = __webpack_require__("./node_modules/core-js/library/modules/_set-to-string-tag.js")
, uid = __webpack_require__("./node_modules/core-js/library/modules/_uid.js")
, wks = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")
, wksExt = __webpack_require__("./node_modules/core-js/library/modules/_wks-ext.js")
, wksDefine = __webpack_require__("./node_modules/core-js/library/modules/_wks-define.js")
, keyOf = __webpack_require__("./node_modules/core-js/library/modules/_keyof.js")
, enumKeys = __webpack_require__("./node_modules/core-js/library/modules/_enum-keys.js")
, isArray = __webpack_require__("./node_modules/core-js/library/modules/_is-array.js")
, anObject = __webpack_require__("./node_modules/core-js/library/modules/_an-object.js")
, toIObject = __webpack_require__("./node_modules/core-js/library/modules/_to-iobject.js")
, toPrimitive = __webpack_require__("./node_modules/core-js/library/modules/_to-primitive.js")
, createDesc = __webpack_require__("./node_modules/core-js/library/modules/_property-desc.js")
, _create = __webpack_require__("./node_modules/core-js/library/modules/_object-create.js")
, gOPNExt = __webpack_require__("./node_modules/core-js/library/modules/_object-gopn-ext.js")
, $GOPD = __webpack_require__("./node_modules/core-js/library/modules/_object-gopd.js")
, $DP = __webpack_require__("./node_modules/core-js/library/modules/_object-dp.js")
, $keys = __webpack_require__("./node_modules/core-js/library/modules/_object-keys.js")
, gOPD = $GOPD.f
, dP = $DP.f
, gOPN = gOPNExt.f
, $Symbol = global.Symbol
, $JSON = global.JSON
, _stringify = $JSON && $JSON.stringify
, PROTOTYPE = 'prototype'
, HIDDEN = wks('_hidden')
, TO_PRIMITIVE = wks('toPrimitive')
, isEnum = {}.propertyIsEnumerable
, SymbolRegistry = shared('symbol-registry')
, AllSymbols = shared('symbols')
, OPSymbols = shared('op-symbols')
, ObjectProto = Object[PROTOTYPE]
, USE_NATIVE = typeof $Symbol == 'function'
, QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function(){
return _create(dP({}, 'a', {
get: function(){ return dP(this, 'a', {value: 7}).a; }
})).a != 7;
}) ? function(it, key, D){
var protoDesc = gOPD(ObjectProto, key);
if(protoDesc)delete ObjectProto[key];
dP(it, key, D);
if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function(tag){
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
return typeof it == 'symbol';
} : function(it){
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D){
if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if(has(AllSymbols, key)){
if(!D.enumerable){
if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
D = _create(D, {enumerable: createDesc(0, false)});
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P){
anObject(it);
var keys = enumKeys(P = toIObject(P))
, i = 0
, l = keys.length
, key;
while(l > i)$defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P){
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key){
var E = isEnum.call(this, key = toPrimitive(key, true));
if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
it = toIObject(it);
key = toPrimitive(key, true);
if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
var D = gOPD(it, key);
if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it){
var names = gOPN(toIObject(it))
, result = []
, i = 0
, key;
while(names.length > i){
if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
var IS_OP = it === ObjectProto
, names = gOPN(IS_OP ? OPSymbols : toIObject(it))
, result = []
, i = 0
, key;
while(names.length > i){
if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if(!USE_NATIVE){
$Symbol = function Symbol(){
if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function(value){
if(this === ObjectProto)$set.call(OPSymbols, value);
if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString(){
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__("./node_modules/core-js/library/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__("./node_modules/core-js/library/modules/_object-pie.js").f = $propertyIsEnumerable;
__webpack_require__("./node_modules/core-js/library/modules/_object-gops.js").f = $getOwnPropertySymbols;
if(DESCRIPTORS && !__webpack_require__("./node_modules/core-js/library/modules/_library.js")){
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function(name){
return wrap(wks(name));
}
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
for(var symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function(key){
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(key){
if(isSymbol(key))return keyOf(SymbolRegistry, key);
throw TypeError(key + ' is not a symbol!');
},
useSetter: function(){ setter = true; },
useSimple: function(){ setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it){
if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
var args = [it]
, i = 1
, replacer, $replacer;
while(arguments.length > i)args.push(arguments[i++]);
replacer = args[1];
if(typeof replacer == 'function')$replacer = replacer;
if($replacer || !isArray(replacer))replacer = function(key, value){
if($replacer)value = $replacer.call(this, key, value);
if(!isSymbol(value))return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__("./node_modules/core-js/library/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ }),
/***/ "./node_modules/core-js/library/modules/es7.symbol.async-iterator.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/_wks-define.js")('asyncIterator');
/***/ }),
/***/ "./node_modules/core-js/library/modules/es7.symbol.observable.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/_wks-define.js")('observable');
/***/ }),
/***/ "./node_modules/core-js/library/modules/web.dom.iterable.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/core-js/library/modules/es6.array.iterator.js");
var global = __webpack_require__("./node_modules/core-js/library/modules/_global.js")
, hide = __webpack_require__("./node_modules/core-js/library/modules/_hide.js")
, Iterators = __webpack_require__("./node_modules/core-js/library/modules/_iterators.js")
, TO_STRING_TAG = __webpack_require__("./node_modules/core-js/library/modules/_wks.js")('toStringTag');
for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
var NAME = collections[i]
, Collection = global[NAME]
, proto = Collection && Collection.prototype;
if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = Iterators.Array;
}
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Article/Article.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".zm0gbCE_l8VLLMxTIFBdr {\n position: relative;\n box-sizing: border-box;\n height: calc(100% - 66px);\n overflow-y: auto;\n}\n.zm0gbCE_l8VLLMxTIFBdr .loadMoreButton {\n border: 0px;\n width: 100%;\n background-color: #fbfbfb;\n height: 35px;\n line-height: 35px;\n outline: none;\n}\n.zm0gbCE_l8VLLMxTIFBdr .loadMoreButton:hover {\n background-color: #efefef;\n cursor: pointer;\n}\n.zm0gbCE_l8VLLMxTIFBdr .loadMore {\n position: relative;\n text-align: center;\n height: 40px;\n line-height: 40px;\n font-size: 12px;\n color: #545454;\n}\n.zm0gbCE_l8VLLMxTIFBdr .loadMore .icon-animation {\n position: absolute;\n left: 70px;\n}\n._2n2KuCermdaqIZVwsR85Z2 {\n padding-left: 50px;\n padding-right: 10px;\n border-bottom: 1px solid #dedede;\n font-size: 12px;\n padding-bottom: 20px;\n transition-duration: .5s;\n border-left: 5px solid transparent;\n}\n._2n2KuCermdaqIZVwsR85Z2 .par {\n right: 10px;\n}\n._2n2KuCermdaqIZVwsR85Z2.selected {\n border-left-color: #db4d52;\n background-color: #fff;\n}\n._2n2KuCermdaqIZVwsR85Z2 h3 {\n padding-top: 20px;\n min-height: 35px;\n}\n._2n2KuCermdaqIZVwsR85Z2 .description {\n line-height: 23px;\n color: #b7bdc4;\n}\n", ""]);
// exports
exports.locals = {
"List": "zm0gbCE_l8VLLMxTIFBdr",
"ListItem": "_2n2KuCermdaqIZVwsR85Z2"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/Markdown/index.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".BTxMaxRSt1_UVgsaY7kUL {\n outline: none;\n font-size: 14px;\n line-height: 30px;\n padding: 0px;\n color: #545454;\n}\n.BTxMaxRSt1_UVgsaY7kUL .editor {\n outline: none;\n}\n.BTxMaxRSt1_UVgsaY7kUL .CodeMirror-scroll {\n padding: 10px 20px;\n padding-right: 45px;\n}\n", ""]);
// exports
exports.locals = {
"index": "BTxMaxRSt1_UVgsaY7kUL"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Icon/index.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".icon-animation {\n display: block;\n width: 30px;\n transform-origin: 50% 47.6%;\n animation: loading 1s linear infinite;\n}\n@keyframes loading {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n", ""]);
// exports
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/components/UI/Input/index.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".VcQM-ZBmmZe45b-byvQQN {\n border: 1px solid #cacaca;\n border-radius: 5px;\n height: 22px;\n width: 100%;\n}\n", ""]);
// exports
exports.locals = {
"inputDefault": "VcQM-ZBmmZe45b-byvQQN"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/index.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".input {\n border: 1px solid #dedede;\n border-radius: 5px;\n padding: 5px;\n width: 100%;\n outline: none;\n resize: none;\n box-sizing: border-box;\n}\nbody,\ndiv,\nul,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np {\n margin: 0;\n padding: 0;\n}\nul,\nli {\n list-style: none;\n}\nbody {\n overflow: hidden;\n background-color: #fbfbfb;\n}\n.clear:after {\n content: \".\";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n}\n.vh100 {\n height: 100vh;\n}\n.par {\n position: absolute;\n right: 0;\n}\n.pal {\n position: absolute;\n left: 0;\n}\n.fl {\n float: left;\n}\n.tag {\n font-size: 12px;\n color: #b4b4b4;\n}\ninput {\n outline: none;\n}\n.main {\n display: flex;\n}\n.btn {\n border: 1px solid #ccc;\n border-radius: 5px;\n background-color: #fff;\n height: 35px;\n min-width: 80px;\n color: #545454;\n transition-duration: .5s;\n outline: none;\n}\n.btn.submit {\n opacity: .8;\n background-color: #db4d52;\n color: #fff;\n border-color: #db4d52;\n}\n.btn.submit:hover {\n opacity: 1;\n}\n.heightText {\n background-color: yellow;\n}\n.fs12 {\n font-size: 12px;\n}\n.fs13 {\n font-size: 13px;\n}\n.fs14 {\n font-size: 14px;\n}\n.fs15 {\n font-size: 15px;\n}\n.fs16 {\n font-size: 16px;\n}\n.fs17 {\n font-size: 17px;\n}\n.fs18 {\n font-size: 18px;\n}\n.fs19 {\n font-size: 19px;\n}\n.fs20 {\n font-size: 20px;\n}\n.fs21 {\n font-size: 21px;\n}\n.fs22 {\n font-size: 22px;\n}\n.fs23 {\n font-size: 23px;\n}\n.fs24 {\n font-size: 24px;\n}\n.fs25 {\n font-size: 25px;\n}\n.fs26 {\n font-size: 26px;\n}\n.fs27 {\n font-size: 27px;\n}\n.fs28 {\n font-size: 28px;\n}\n.fs29 {\n font-size: 29px;\n}\n.fs30 {\n font-size: 30px;\n}\n.fs40 {\n font-size: 40px;\n}\n", ""]);
// exports
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Detail.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._2tUsKOpq5vINChXzw-Ga0B .title {\n position: relative;\n height: 65px;\n line-height: 64px;\n border-bottom: 1px solid #dedede;\n}\n._2tUsKOpq5vINChXzw-Ga0B .title .peizhi {\n position: absolute;\n top: 18px;\n right: 10px;\n font-size: 20px;\n color: #666;\n cursor: pointer;\n border: 0;\n background-color: transparent;\n outline: none;\n}\n._2tUsKOpq5vINChXzw-Ga0B .title .peizhi:hover {\n color: #db4d52;\n}\n._2tUsKOpq5vINChXzw-Ga0B .title .pal {\n left: 10px;\n}\n._2tUsKOpq5vINChXzw-Ga0B .title input {\n height: 64px;\n width: 100%;\n line-height: 64px;\n font-size: 20px;\n padding-left: 35px;\n padding-right: 10px;\n box-sizing: border-box;\n border: 0;\n background: transparent;\n color: #333;\n}\n._2tUsKOpq5vINChXzw-Ga0B .showController {\n box-sizing: border-box;\n bottom: 0px;\n padding: 10px;\n}\n._2tUsKOpq5vINChXzw-Ga0B .btnGroup {\n float: right;\n}\n._2tUsKOpq5vINChXzw-Ga0B .btnGroup .btn {\n margin-left: 10px;\n transition-duration: .5s;\n outline: none;\n}\n._2tUsKOpq5vINChXzw-Ga0B .message {\n font-size: 12px;\n color: #98b123;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n transform: translateZ(0);\n animation: 0.3s fade-in;\n -webkit-animation: 0.3s fade-in;\n z-index: 100;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .showTime {\n position: relative;\n padding: 0 0 8px 0;\n margin: 0 0 10px 0;\n border-bottom: 1px solid #dedede;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .showTime .date {\n font-size: 34px;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .showTime .monthAndYear {\n position: absolute;\n top: 6px;\n left: 50px;\n font-weight: bold;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .showTime .weekAndTime {\n position: absolute;\n left: 50px;\n top: 22px;\n color: #ccd0d5;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .show {\n position: absolute;\n width: 350px;\n top: 0;\n bottom: 0;\n right: 0;\n border-left: 1px solid #dedede;\n background-color: #fbfbfb;\n transform: translateZ(0);\n animation: 0.3s slide-in;\n -webkit-animation: 0.3s slide-in;\n padding: 10px 30px;\n color: #545454;\n font-size: 12px;\n box-sizing: border-box;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .show ul {\n list-style: none;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .show ul li {\n min-height: 35px;\n line-height: 35px;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .show ul textarea,\n._2cxBJcLUtAdQIqh1yyQ9Dg .show ul input {\n border: 1px solid #dedede;\n border-radius: 5px;\n padding: 5px;\n width: 100%;\n outline: none;\n resize: none;\n box-sizing: border-box;\n}\n._2cxBJcLUtAdQIqh1yyQ9Dg .show ul .hText {\n font-weight: bold;\n}\n@keyframes slide-in {\n from {\n right: -350px;\n }\n to {\n right: 0;\n }\n}\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n", ""]);
// exports
exports.locals = {
"Detail": "_2tUsKOpq5vINChXzw-Ga0B",
"setting": "_2cxBJcLUtAdQIqh1yyQ9Dg"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/Main.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._20HsCKJ71NLzhxA4OEOb3x {\n display: flex;\n flex: 1;\n}\n", ""]);
// exports
exports.locals = {
"Main": "_20HsCKJ71NLzhxA4OEOb3x"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Article/MiddleArticleList.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._2Ql9EGLeMBeX3bg9Swwji7 {\n width: 280px;\n background-color: #fbfbfb;\n border-right: 1px solid #dedede;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .td {\n transition-duration: .5s;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .loading {\n position: relative;\n text-align: center;\n height: 40px;\n line-height: 40px;\n font-size: 12px;\n color: #545454;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .loading .icon-animation {\n position: absolute;\n left: 70px;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .ShowSearchText {\n position: relative;\n transition-duration: .5s;\n transform: translateZ(0px);\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .ShowSearchText .iconfont {\n position: relative;\n top: -35px;\n left: 40px;\n transition-duration: .5s;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .ShowSearchText.focused .iconfont {\n left: -5px;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .ShowSearchText.focused .searchTextInput {\n padding-left: 26px;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .ShowSearchText span {\n transition-duration: .5s;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:focus {\n border-color: #db4d52;\n padding-left: 26px;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:focus::-webkit-input-placeholder {\n opacity: 0;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:focus::-moz-placeholder {\n opacity: 0;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:focus:-ms-input-placeholder {\n opacity: 0;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:focus ~ .ShowSearchText {\n padding-left: 0;\n left: -5px;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:focus ~ .ShowSearchText span {\n opacity: 0;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput {\n box-sizing: border-box;\n padding-left: 76px;\n height: 26px;\n transition-duration: .5s;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput::-webkit-input-placeholder {\n transition-duration: .5s;\n color: #bdbdbd;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput::-moz-placeholder {\n transition-duration: .5s;\n color: #bdbdbd;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .searchTextInput:-ms-input-placeholder {\n transition-duration: .5s;\n color: #bdbdbd;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .btnRight {\n position: absolute;\n right: 0;\n border: 0;\n background-color: transparent;\n top: -2px;\n color: #bdbdbd;\n transition-duration: .5s;\n outline: none;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .btnRight:hover {\n color: #db4d52;\n}\n._2Ql9EGLeMBeX3bg9Swwji7 .inputBorder {\n position: relative;\n padding-right: 50px;\n color: #bdbdbd;\n margin: 15px;\n}\n._33ex2kArW6v2p62vQWX8_c {\n height: 50px;\n border-bottom: 1px solid #dedede;\n}\n", ""]);
// exports
exports.locals = {
"MiddleArticleList": "_2Ql9EGLeMBeX3bg9Swwji7",
"top": "_33ex2kArW6v2p62vQWX8_c"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/LeftMenu.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._3LKcnbu71ftfMVs7dUqDF3 {\n width: 165px;\n background-color: #2e3235;\n color: #cfcfcf;\n}\n._25KdsaCGL0fioKVD87TZE_ {\n height: 66px;\n line-height: 66px;\n text-indent: 25px;\n}\n._1aXbd02DggAGIi2j2HM1T9 .iconfont {\n margin-right: 15px;\n}\n._1aXbd02DggAGIi2j2HM1T9 li {\n padding-left: 25px;\n height: 30px;\n line-height: 30px;\n box-sizing: border-box;\n font-size: 14px;\n cursor: pointer;\n transition-duration: .2s;\n}\n._1aXbd02DggAGIi2j2HM1T9 li.selected {\n color: #fff;\n background-color: #db4d52;\n}\n._1aXbd02DggAGIi2j2HM1T9 a {\n text-decoration: none;\n color: #cfcfcf;\n}\n", ""]);
// exports
exports.locals = {
"leftMenu": "_3LKcnbu71ftfMVs7dUqDF3",
"logo": "_25KdsaCGL0fioKVD87TZE_",
"ul": "_1aXbd02DggAGIi2j2HM1T9"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/NoMatchImg.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._3T8n5Y60GhCOzOwGtcn9G5 {\n flex: 1;\n text-align: center;\n line-height: 100%;\n background-color: #fbfbfb;\n}\n._3T8n5Y60GhCOzOwGtcn9G5 img {\n max-width: 100%;\n max-height: 100vh;\n}\n", ""]);
// exports
exports.locals = {
"NoMatchImg": "_3T8n5Y60GhCOzOwGtcn9G5"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/Photo/index.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".P9MIoZMZjZN8b_vqnUQXi {\n position: relative;\n flex: 1;\n box-sizing: border-box;\n padding: 60px 20px 20px 20px;\n}\n.P9MIoZMZjZN8b_vqnUQXi .loadMore {\n position: relative;\n text-align: center;\n height: 40px;\n line-height: 40px;\n font-size: 12px;\n color: #545454;\n}\n.P9MIoZMZjZN8b_vqnUQXi .loadMore .icon-animation {\n position: absolute;\n left: 30%;\n}\n.P9MIoZMZjZN8b_vqnUQXi .uploadImage {\n position: relative;\n border-radius: 5px;\n height: 150px;\n text-align: center;\n line-height: 150px;\n font-size: 40px;\n color: #ccc;\n cursor: pointer;\n z-index: 1;\n}\n.P9MIoZMZjZN8b_vqnUQXi .loadMoreButton {\n float: left;\n width: 100%;\n margin-top: 10px;\n border: 0px;\n background-color: transparent;\n outline: none;\n height: 35px;\n line-height: 35px;\n}\n.P9MIoZMZjZN8b_vqnUQXi .loadMoreButton:hover {\n background-color: #f5f5f5;\n}\n.P9MIoZMZjZN8b_vqnUQXi #fileUploadImage {\n position: absolute;\n top: 1px;\n border-width: 0px;\n border-style: none;\n border-radius: 5px;\n height: 150px;\n width: 100%;\n z-index: 2;\n}\n.P9MIoZMZjZN8b_vqnUQXi .width {\n position: absolute;\n top: 0;\n cursor: pointer;\n right: 0;\n width: 100%;\n transition-duration: .3s;\n height: 152px;\n background-color: rgba(255, 255, 255, 0.5);\n z-index: 11;\n}\n.P9MIoZMZjZN8b_vqnUQXi .progress {\n position: relative;\n width: 100%;\n text-align: right;\n}\n.P9MIoZMZjZN8b_vqnUQXi .progress .uploadProgress {\n position: relative;\n margin-top: 10px;\n font-size: 10px;\n}\n.P9MIoZMZjZN8b_vqnUQXi #fileUploadControl {\n display: none;\n}\n.P9MIoZMZjZN8b_vqnUQXi .w100 {\n width: 100%;\n}\n.P9MIoZMZjZN8b_vqnUQXi .nav {\n position: absolute;\n top: 0;\n width: 100%;\n left: 0;\n height: 50px;\n line-height: 50px;\n font-size: 12px;\n color: #333;\n text-indent: 25px;\n border-bottom: 1px solid #efefef;\n}\n.P9MIoZMZjZN8b_vqnUQXi .nav .btn {\n float: right;\n margin-right: 10px;\n margin-top: 5px;\n}\n.P9MIoZMZjZN8b_vqnUQXi .hoverText {\n -webkit-transition-duration: .5s;\n -moz-transition-duration: .5s;\n -ms-transition-duration: .5s;\n -o-transition-duration: .5s;\n transition-duration: .5s;\n cursor: pointer;\n}\n.P9MIoZMZjZN8b_vqnUQXi .hoverText:hover {\n text-decoration: underline;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo {\n float: left;\n margin-right: 10px;\n margin-bottom: 10px;\n width: 220px;\n background-color: #fff;\n font-size: 12px;\n padding: 5px;\n border-radius: 5px;\n border: 1px solid #efefef;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo .thumbnail {\n height: 150px;\n margin-bottom: 10px;\n background-size: cover;\n background-repeat: no-repeat;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo p {\n line-height: 20px;\n text-align: center;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo .title {\n font-size: 14px;\n font-weight: bold;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo .info {\n color: #666;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo a {\n color: #04a1d6;\n}\n.P9MIoZMZjZN8b_vqnUQXi .photo a.delete {\n color: #db4d52;\n}\n", ""]);
// exports
exports.locals = {
"index": "P9MIoZMZjZN8b_vqnUQXi"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/RightDetail.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._3a-fFuEI8Qblrgi3VFZB0d {\n flex: 1;\n background-color: #fbfbfb;\n}\n", ""]);
// exports
exports.locals = {
"RightDetail": "_3a-fFuEI8Qblrgi3VFZB0d"
};
/***/ }),
/***/ "./node_modules/css-loader/index.js!./node_modules/less-loader/dist/index.js!./PC_client/views/manage/System/index.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, "._1ZVRTMWyOBb9dsqLR_NSO1 {\n flex: 1;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 .nav {\n width: 100%;\n height: 50px;\n line-height: 50px;\n box-sizing: border-box;\n border-bottom: 1px solid #efefef;\n font-size: 12px;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 .nav .menu {\n width: 120px;\n text-align: center;\n cursor: pointer;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 .nav .menu:hover {\n background-color: #454545;\n color: #fff;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 .nav .menu.select {\n background-color: #454545;\n color: #fff;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 #updatePassword {\n padding: 10px;\n padding-left: 30px;\n width: 300px;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 #updatePassword li {\n position: relative;\n font-size: 12px;\n color: #333;\n padding-top: 20px;\n height: 35px;\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 #updatePassword li .label {\n color: #ccc;\n position: absolute;\n top: 25px;\n left: 10px;\n -webkit-transition-duration: .5s;\n -moz-transition-duration: .5s;\n -ms-transition-duration: .5s;\n -o-transition-duration: .5s;\n transition-duration: .5s;\n transform: translateZ(0px);\n}\n._1ZVRTMWyOBb9dsqLR_NSO1 #updatePassword li .input:valid ~ .label,\n._1ZVRTMWyOBb9dsqLR_NSO1 #updatePassword li .input:focus ~ .label {\n top: 13px;\n background-color: #fbfbfb;\n color: #db4d52;\n}\n", ""]);
// exports
exports.locals = {
"index": "_1ZVRTMWyOBb9dsqLR_NSO1"
};
/***/ }),
/***/ "./node_modules/css-loader/lib/css-base.js":
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/***/ "./node_modules/events/events.js":
/***/ (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
} else {
// At least give some kind of context to the user
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
err.context = er;
throw err;
}
}
}
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:
args = Array.prototype.slice.call(arguments, 1);
handler.apply(this, args);
}
} else if (isObject(handler)) {
args = Array.prototype.slice.call(arguments, 1);
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) {
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 if (listeners) {
// 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.prototype.listenerCount = function(type) {
if (this._events) {
var evlistener = this._events[type];
if (isFunction(evlistener))
return 1;
else if (evlistener)
return evlistener.length;
}
return 0;
};
EventEmitter.listenerCount = function(emitter, type) {
return emitter.listenerCount(type);
};
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;
}
/***/ }),
/***/ "./node_modules/global/window.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var win;
if (typeof window !== "undefined") {
win = window;
} else if (typeof global !== "undefined") {
win = global;
} else if (typeof self !== "undefined"){
win = self;
} else {
win = {};
}
module.exports = win;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/history/DOMUtils.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {
return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
};
var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {
return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
};
var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {
return callback(window.confirm(message));
}; // eslint-disable-line no-alert
/**
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
*
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
*/
var supportsHistory = exports.supportsHistory = function supportsHistory() {
var ua = window.navigator.userAgent;
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
return window.history && 'pushState' in window.history;
};
/**
* Returns true if browser fires popstate on hash change.
* IE10 and IE11 do not.
*/
var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {
return window.navigator.userAgent.indexOf('Trident') === -1;
};
/**
* Returns false if using go(n) with hash history causes a full page reload.
*/
var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
return window.navigator.userAgent.indexOf('Firefox') === -1;
};
/**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
};
/***/ }),
/***/ "./node_modules/history/createBrowserHistory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _warning = __webpack_require__("./node_modules/warning/browser.js");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__("./node_modules/invariant/browser.js");
var _invariant2 = _interopRequireDefault(_invariant);
var _LocationUtils = __webpack_require__("./node_modules/history/LocationUtils.js");
var _PathUtils = __webpack_require__("./node_modules/history/PathUtils.js");
var _createTransitionManager = __webpack_require__("./node_modules/history/createTransitionManager.js");
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
var _DOMUtils = __webpack_require__("./node_modules/history/DOMUtils.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PopStateEvent = 'popstate';
var HashChangeEvent = 'hashchange';
var getHistoryState = function getHistoryState() {
try {
return window.history.state || {};
} catch (e) {
// IE 11 sometimes throws when accessing window.history.state
// See https://github.com/ReactTraining/history/pull/289
return {};
}
};
/**
* Creates a history object that uses the HTML5 history API including
* pushState, replaceState, and the popstate event.
*/
var createBrowserHistory = function createBrowserHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
(0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM');
var globalHistory = window.history;
var canUseHistory = (0, _DOMUtils.supportsHistory)();
var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)();
var _props$forceRefresh = props.forceRefresh,
forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,
_props$getUserConfirm = props.getUserConfirmation,
getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,
_props$keyLength = props.keyLength,
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';
var getDOMLocation = function getDOMLocation(historyState) {
var _ref = historyState || {},
key = _ref.key,
state = _ref.state;
var _window$location = window.location,
pathname = _window$location.pathname,
search = _window$location.search,
hash = _window$location.hash;
var path = pathname + search + hash;
if (basename) path = (0, _PathUtils.stripPrefix)(path, basename);
return _extends({}, (0, _PathUtils.parsePath)(path), {
state: state,
key: key
});
};
var createKey = function createKey() {
return Math.random().toString(36).substr(2, keyLength);
};
var transitionManager = (0, _createTransitionManager2.default)();
var setState = function setState(nextState) {
_extends(history, nextState);
history.length = globalHistory.length;
transitionManager.notifyListeners(history.location, history.action);
};
var handlePopState = function handlePopState(event) {
// Ignore extraneous popstate events in WebKit.
if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;
handlePop(getDOMLocation(event.state));
};
var handleHashChange = function handleHashChange() {
handlePop(getDOMLocation(getHistoryState()));
};
var forceNextPop = false;
var handlePop = function handlePop(location) {
if (forceNextPop) {
forceNextPop = false;
setState();
} else {
var action = 'POP';
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({ action: action, location: location });
} else {
revertPop(location);
}
});
}
};
var revertPop = function revertPop(fromLocation) {
var toLocation = history.location;
// TODO: We could probably make this more reliable by
// keeping a list of keys we've seen in sessionStorage.
// Instead, we just default to 0 for keys we don't know.
var toIndex = allKeys.indexOf(toLocation.key);
if (toIndex === -1) toIndex = 0;
var fromIndex = allKeys.indexOf(fromLocation.key);
if (fromIndex === -1) fromIndex = 0;
var delta = toIndex - fromIndex;
if (delta) {
forceNextPop = true;
go(delta);
}
};
var initialLocation = getDOMLocation(getHistoryState());
var allKeys = [initialLocation.key];
// Public interface
var createHref = function createHref(location) {
return basename + (0, _PathUtils.createPath)(location);
};
var push = function push(path, state) {
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var href = createHref(location);
var key = location.key,
state = location.state;
if (canUseHistory) {
globalHistory.pushState({ key: key, state: state }, null, href);
if (forceRefresh) {
window.location.href = href;
} else {
var prevIndex = allKeys.indexOf(history.location.key);
var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
nextKeys.push(location.key);
allKeys = nextKeys;
setState({ action: action, location: location });
}
} else {
(0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
window.location.href = href;
}
});
};
var replace = function replace(path, state) {
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var href = createHref(location);
var key = location.key,
state = location.state;
if (canUseHistory) {
globalHistory.replaceState({ key: key, state: state }, null, href);
if (forceRefresh) {
window.location.replace(href);
} else {
var prevIndex = allKeys.indexOf(history.location.key);
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
setState({ action: action, location: location });
}
} else {
(0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
window.location.replace(href);
}
});
};
var go = function go(n) {
globalHistory.go(n);
};
var goBack = function goBack() {
return go(-1);
};
var goForward = function goForward() {
return go(1);
};
var listenerCount = 0;
var checkDOMListeners = function checkDOMListeners(delta) {
listenerCount += delta;
if (listenerCount === 1) {
(0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);
if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
} else if (listenerCount === 0) {
(0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);
if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
}
};
var isBlocked = false;
var block = function block() {
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var unblock = transitionManager.setPrompt(prompt);
if (!isBlocked) {
checkDOMListeners(1);
isBlocked = true;
}
return function () {
if (isBlocked) {
isBlocked = false;
checkDOMListeners(-1);
}
return unblock();
};
};
var listen = function listen(listener) {
var unlisten = transitionManager.appendListener(listener);
checkDOMListeners(1);
return function () {
checkDOMListeners(-1);
unlisten();
};
};
var history = {
length: globalHistory.length,
action: 'POP',
location: initialLocation,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
block: block,
listen: listen
};
return history;
};
exports.default = createBrowserHistory;
/***/ }),
/***/ "./node_modules/history/createHashHistory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = 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 _warning = __webpack_require__("./node_modules/warning/browser.js");
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__("./node_modules/invariant/browser.js");
var _invariant2 = _interopRequireDefault(_invariant);
var _LocationUtils = __webpack_require__("./node_modules/history/LocationUtils.js");
var _PathUtils = __webpack_require__("./node_modules/history/PathUtils.js");
var _createTransitionManager = __webpack_require__("./node_modules/history/createTransitionManager.js");
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
var _DOMUtils = __webpack_require__("./node_modules/history/DOMUtils.js");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HashChangeEvent = 'hashchange';
var HashPathCoders = {
hashbang: {
encodePath: function encodePath(path) {
return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path);
},
decodePath: function decodePath(path) {
return path.charAt(0) === '!' ? path.substr(1) : path;
}
},
noslash: {
encodePath: _PathUtils.stripLeadingSlash,
decodePath: _PathUtils.addLeadingSlash
},
slash: {
encodePath: _PathUtils.addLeadingSlash,
decodePath: _PathUtils.addLeadingSlash
}
};
var getHashPath = function getHashPath() {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
var href = window.location.href;
var hashIndex = href.indexOf('#');
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
};
var pushHashPath = function pushHashPath(path) {
return window.location.hash = path;
};
var replaceHashPath = function replaceHashPath(path) {
var hashIndex = window.location.href.indexOf('#');
window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
};
var createHashHistory = function createHashHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
(0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM');
var globalHistory = window.history;
var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();
var _props$getUserConfirm = props.getUserConfirmation,
getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,
_props$hashType = props.hashType,
hashType = _props$hashType === undefined ? 'slash' : _props$hashType;
var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';
var _HashPathCoders$hashT = HashPathCoders[hashType],
encodePath = _HashPathCoders$hashT.encodePath,
decodePath = _HashPathCoders$hashT.decodePath;
var getDOMLocation = function getDOMLocation() {
var path = decodePath(getHashPath());
if (basename) path = (0, _PathUtils.stripPrefix)(path, basename);
return (0, _PathUtils.parsePath)(path);
};
var transitionManager = (0, _createTransitionManager2.default)();
var setState = function setState(nextState) {
_extends(history, nextState);
history.length = globalHistory.length;
transitionManager.notifyListeners(history.location, history.action);
};
var forceNextPop = false;
var ignorePath = null;
var handleHashChange = function handleHashChange() {
var path = getHashPath();
var encodedPath = encodePath(path);
if (path !== encodedPath) {
// Ensure we always have a properly-encoded hash.
replaceHashPath(encodedPath);
} else {
var location = getDOMLocation();
var prevLocation = history.location;
if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.
if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.
ignorePath = null;
handlePop(location);
}
};
var handlePop = function handlePop(location) {
if (forceNextPop) {
forceNextPop = false;
setState();
} else {
var action = 'POP';
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({ action: action, location: location });
} else {
revertPop(location);
}
});
}
};
var revertPop = function revertPop(fromLocation) {
var toLocation = history.location;
// TODO: We could probably make this more reliable by
// keeping a list of paths we've seen in sessionStorage.
// Instead, we just default to 0 for paths we don't know.
var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation));
if (toIndex === -1) toIndex = 0;
var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation));
if (fromIndex === -1) fromIndex = 0;
var delta = toIndex - fromIndex;
if (delta) {
forceNextPop = true;
go(delta);
}
};
// Ensure the hash is encoded properly before doing anything else.
var path = getHashPath();
var encodedPath = encodePath(path);
if (path !== encodedPath) replaceHashPath(encodedPath);
var initialLocation = getDOMLocation();
var allPaths = [(0, _PathUtils.createPath)(initialLocation)];
// Public interface
var createHref = function createHref(location) {
return '#' + encodePath(basename + (0, _PathUtils.createPath)(location));
};
var push = function push(path, state) {
(0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored');
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var path = (0, _PathUtils.createPath)(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
if (hashChanged) {
// We cannot tell if a hashchange was caused by a PUSH, so we'd
// rather setState here and ignore the hashchange. The caveat here
// is that other hash histories in the page will consider it a POP.
ignorePath = path;
pushHashPath(encodedPath);
var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location));
var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
nextPaths.push(path);
allPaths = nextPaths;
setState({ action: action, location: location });
} else {
(0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
setState();
}
});
};
var replace = function replace(path, state) {
(0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored');
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var path = (0, _PathUtils.createPath)(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
if (hashChanged) {
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
// rather setState here and ignore the hashchange. The caveat here
// is that other hash histories in the page will consider it a POP.
ignorePath = path;
replaceHashPath(encodedPath);
}
var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location));
if (prevIndex !== -1) allPaths[prevIndex] = path;
setState({ action: action, location: location });
});
};
var go = function go(n) {
(0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
globalHistory.go(n);
};
var goBack = function goBack() {
return go(-1);
};
var goForward = function goForward() {
return go(1);
};
var listenerCount = 0;
var checkDOMListeners = function checkDOMListeners(delta) {
listenerCount += delta;
if (listenerCount === 1) {
(0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
} else if (listenerCount === 0) {
(0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
}
};
var isBlocked = false;
var block = function block() {
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var unblock = transitionManager.setPrompt(prompt);
if (!isBlocked) {
checkDOMListeners(1);
isBlocked = true;
}
return function () {
if (isBlocked) {
isBlocked = false;
checkDOMListeners(-1);
}
return unblock();
};
};
var listen = function listen(listener) {
var unlisten = transitionManager.appendListener(listener);
checkDOMListeners(1);
return function () {
checkDOMListeners(-1);
unlisten();
};
};
var history = {
length: globalHistory.length,
action: 'POP',
location: initialLocation,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
block: block,
listen: listen
};
return history;
};
exports.default = createHashHistory;
/***/ }),
/***/ "./node_modules/ieee754/index.js":
/***/ (function(module, exports) {
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = nBytes * 8 - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = nBytes * 8 - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = (value * c - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/***/ "./node_modules/lodash/_DataView.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js"),
root = __webpack_require__("./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/***/ "./node_modules/lodash/_Hash.js":
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__("./node_modules/lodash/_hashClear.js"),
hashDelete = __webpack_require__("./node_modules/lodash/_hashDelete.js"),
hashGet = __webpack_require__("./node_modules/lodash/_hashGet.js"),
hashHas = __webpack_require__("./node_modules/lodash/_hashHas.js"),
hashSet = __webpack_require__("./node_modules/lodash/_hashSet.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_ListCache.js":
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__("./node_modules/lodash/_listCacheClear.js"),
listCacheDelete = __webpack_require__("./node_modules/lodash/_listCacheDelete.js"),
listCacheGet = __webpack_require__("./node_modules/lodash/_listCacheGet.js"),
listCacheHas = __webpack_require__("./node_modules/lodash/_listCacheHas.js"),
listCacheSet = __webpack_require__("./node_modules/lodash/_listCacheSet.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_Map.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js"),
root = __webpack_require__("./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/***/ "./node_modules/lodash/_MapCache.js":
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__("./node_modules/lodash/_mapCacheClear.js"),
mapCacheDelete = __webpack_require__("./node_modules/lodash/_mapCacheDelete.js"),
mapCacheGet = __webpack_require__("./node_modules/lodash/_mapCacheGet.js"),
mapCacheHas = __webpack_require__("./node_modules/lodash/_mapCacheHas.js"),
mapCacheSet = __webpack_require__("./node_modules/lodash/_mapCacheSet.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_Promise.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js"),
root = __webpack_require__("./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/***/ "./node_modules/lodash/_Set.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js"),
root = __webpack_require__("./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/***/ "./node_modules/lodash/_SetCache.js":
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__("./node_modules/lodash/_MapCache.js"),
setCacheAdd = __webpack_require__("./node_modules/lodash/_setCacheAdd.js"),
setCacheHas = __webpack_require__("./node_modules/lodash/_setCacheHas.js");
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/***/ "./node_modules/lodash/_Stack.js":
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__("./node_modules/lodash/_ListCache.js"),
stackClear = __webpack_require__("./node_modules/lodash/_stackClear.js"),
stackDelete = __webpack_require__("./node_modules/lodash/_stackDelete.js"),
stackGet = __webpack_require__("./node_modules/lodash/_stackGet.js"),
stackHas = __webpack_require__("./node_modules/lodash/_stackHas.js"),
stackSet = __webpack_require__("./node_modules/lodash/_stackSet.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_Symbol.js":
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__("./node_modules/lodash/_root.js");
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/***/ "./node_modules/lodash/_Uint8Array.js":
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__("./node_modules/lodash/_root.js");
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/***/ "./node_modules/lodash/_WeakMap.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js"),
root = __webpack_require__("./node_modules/lodash/_root.js");
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/***/ "./node_modules/lodash/_apply.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_arrayFilter.js":
/***/ (function(module, exports) {
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = arrayFilter;
/***/ }),
/***/ "./node_modules/lodash/_arrayIncludes.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__("./node_modules/lodash/_baseIndexOf.js");
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;
/***/ }),
/***/ "./node_modules/lodash/_arrayIncludesWith.js":
/***/ (function(module, exports) {
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
module.exports = arrayIncludesWith;
/***/ }),
/***/ "./node_modules/lodash/_arrayLikeKeys.js":
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__("./node_modules/lodash/_baseTimes.js"),
isArguments = __webpack_require__("./node_modules/lodash/isArguments.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
isBuffer = __webpack_require__("./node_modules/lodash/isBuffer.js"),
isIndex = __webpack_require__("./node_modules/lodash/_isIndex.js"),
isTypedArray = __webpack_require__("./node_modules/lodash/isTypedArray.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_arrayMap.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_arrayPush.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_arraySome.js":
/***/ (function(module, exports) {
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
module.exports = arraySome;
/***/ }),
/***/ "./node_modules/lodash/_assignValue.js":
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__("./node_modules/lodash/_baseAssignValue.js"),
eq = __webpack_require__("./node_modules/lodash/eq.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_assocIndexOf.js":
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__("./node_modules/lodash/eq.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseAssignValue.js":
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__("./node_modules/lodash/_defineProperty.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseDifference.js":
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__("./node_modules/lodash/_SetCache.js"),
arrayIncludes = __webpack_require__("./node_modules/lodash/_arrayIncludes.js"),
arrayIncludesWith = __webpack_require__("./node_modules/lodash/_arrayIncludesWith.js"),
arrayMap = __webpack_require__("./node_modules/lodash/_arrayMap.js"),
baseUnary = __webpack_require__("./node_modules/lodash/_baseUnary.js"),
cacheHas = __webpack_require__("./node_modules/lodash/_cacheHas.js");
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
module.exports = baseDifference;
/***/ }),
/***/ "./node_modules/lodash/_baseFindIndex.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_baseFlatten.js":
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__("./node_modules/lodash/_arrayPush.js"),
isFlattenable = __webpack_require__("./node_modules/lodash/_isFlattenable.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseGet.js":
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__("./node_modules/lodash/_castPath.js"),
toKey = __webpack_require__("./node_modules/lodash/_toKey.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseGetAllKeys.js":
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__("./node_modules/lodash/_arrayPush.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseGetTag.js":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("./node_modules/lodash/_Symbol.js"),
getRawTag = __webpack_require__("./node_modules/lodash/_getRawTag.js"),
objectToString = __webpack_require__("./node_modules/lodash/_objectToString.js");
/** `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;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/***/ "./node_modules/lodash/_baseHasIn.js":
/***/ (function(module, exports) {
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
module.exports = baseHasIn;
/***/ }),
/***/ "./node_modules/lodash/_baseIndexOf.js":
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__("./node_modules/lodash/_baseFindIndex.js"),
baseIsNaN = __webpack_require__("./node_modules/lodash/_baseIsNaN.js"),
strictIndexOf = __webpack_require__("./node_modules/lodash/_strictIndexOf.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseIsArguments.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"),
isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js");
/** `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;
/***/ }),
/***/ "./node_modules/lodash/_baseIsEqual.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__("./node_modules/lodash/_baseIsEqualDeep.js"),
isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js");
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
module.exports = baseIsEqual;
/***/ }),
/***/ "./node_modules/lodash/_baseIsEqualDeep.js":
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__("./node_modules/lodash/_Stack.js"),
equalArrays = __webpack_require__("./node_modules/lodash/_equalArrays.js"),
equalByTag = __webpack_require__("./node_modules/lodash/_equalByTag.js"),
equalObjects = __webpack_require__("./node_modules/lodash/_equalObjects.js"),
getTag = __webpack_require__("./node_modules/lodash/_getTag.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
isBuffer = __webpack_require__("./node_modules/lodash/isBuffer.js"),
isTypedArray = __webpack_require__("./node_modules/lodash/isTypedArray.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
module.exports = baseIsEqualDeep;
/***/ }),
/***/ "./node_modules/lodash/_baseIsMatch.js":
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__("./node_modules/lodash/_Stack.js"),
baseIsEqual = __webpack_require__("./node_modules/lodash/_baseIsEqual.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
/***/ }),
/***/ "./node_modules/lodash/_baseIsNaN.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_baseIsNative.js":
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__("./node_modules/lodash/isFunction.js"),
isMasked = __webpack_require__("./node_modules/lodash/_isMasked.js"),
isObject = __webpack_require__("./node_modules/lodash/isObject.js"),
toSource = __webpack_require__("./node_modules/lodash/_toSource.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseIsTypedArray.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"),
isLength = __webpack_require__("./node_modules/lodash/isLength.js"),
isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js");
/** `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;
/***/ }),
/***/ "./node_modules/lodash/_baseIteratee.js":
/***/ (function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__("./node_modules/lodash/_baseMatches.js"),
baseMatchesProperty = __webpack_require__("./node_modules/lodash/_baseMatchesProperty.js"),
identity = __webpack_require__("./node_modules/lodash/identity.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
property = __webpack_require__("./node_modules/lodash/property.js");
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
module.exports = baseIteratee;
/***/ }),
/***/ "./node_modules/lodash/_baseKeys.js":
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__("./node_modules/lodash/_isPrototype.js"),
nativeKeys = __webpack_require__("./node_modules/lodash/_nativeKeys.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_baseMatches.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__("./node_modules/lodash/_baseIsMatch.js"),
getMatchData = __webpack_require__("./node_modules/lodash/_getMatchData.js"),
matchesStrictComparable = __webpack_require__("./node_modules/lodash/_matchesStrictComparable.js");
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
module.exports = baseMatches;
/***/ }),
/***/ "./node_modules/lodash/_baseMatchesProperty.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__("./node_modules/lodash/_baseIsEqual.js"),
get = __webpack_require__("./node_modules/lodash/get.js"),
hasIn = __webpack_require__("./node_modules/lodash/hasIn.js"),
isKey = __webpack_require__("./node_modules/lodash/_isKey.js"),
isStrictComparable = __webpack_require__("./node_modules/lodash/_isStrictComparable.js"),
matchesStrictComparable = __webpack_require__("./node_modules/lodash/_matchesStrictComparable.js"),
toKey = __webpack_require__("./node_modules/lodash/_toKey.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
module.exports = baseMatchesProperty;
/***/ }),
/***/ "./node_modules/lodash/_baseProperty.js":
/***/ (function(module, exports) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ }),
/***/ "./node_modules/lodash/_basePropertyDeep.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__("./node_modules/lodash/_baseGet.js");
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
/***/ }),
/***/ "./node_modules/lodash/_baseRest.js":
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__("./node_modules/lodash/identity.js"),
overRest = __webpack_require__("./node_modules/lodash/_overRest.js"),
setToString = __webpack_require__("./node_modules/lodash/_setToString.js");
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @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.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
/***/ }),
/***/ "./node_modules/lodash/_baseSetToString.js":
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__("./node_modules/lodash/constant.js"),
defineProperty = __webpack_require__("./node_modules/lodash/_defineProperty.js"),
identity = __webpack_require__("./node_modules/lodash/identity.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_baseTimes.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_baseToString.js":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("./node_modules/lodash/_Symbol.js"),
arrayMap = __webpack_require__("./node_modules/lodash/_arrayMap.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
isSymbol = __webpack_require__("./node_modules/lodash/isSymbol.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_baseUnary.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_cacheHas.js":
/***/ (function(module, exports) {
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ }),
/***/ "./node_modules/lodash/_castPath.js":
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
isKey = __webpack_require__("./node_modules/lodash/_isKey.js"),
stringToPath = __webpack_require__("./node_modules/lodash/_stringToPath.js"),
toString = __webpack_require__("./node_modules/lodash/toString.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_copyObject.js":
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__("./node_modules/lodash/_assignValue.js"),
baseAssignValue = __webpack_require__("./node_modules/lodash/_baseAssignValue.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_coreJsData.js":
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__("./node_modules/lodash/_root.js");
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/***/ "./node_modules/lodash/_createAssigner.js":
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__("./node_modules/lodash/_baseRest.js"),
isIterateeCall = __webpack_require__("./node_modules/lodash/_isIterateeCall.js");
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
module.exports = createAssigner;
/***/ }),
/***/ "./node_modules/lodash/_createFind.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__("./node_modules/lodash/_baseIteratee.js"),
isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"),
keys = __webpack_require__("./node_modules/lodash/keys.js");
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
module.exports = createFind;
/***/ }),
/***/ "./node_modules/lodash/_defineProperty.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js");
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/***/ "./node_modules/lodash/_equalArrays.js":
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__("./node_modules/lodash/_SetCache.js"),
arraySome = __webpack_require__("./node_modules/lodash/_arraySome.js"),
cacheHas = __webpack_require__("./node_modules/lodash/_cacheHas.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
module.exports = equalArrays;
/***/ }),
/***/ "./node_modules/lodash/_equalByTag.js":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("./node_modules/lodash/_Symbol.js"),
Uint8Array = __webpack_require__("./node_modules/lodash/_Uint8Array.js"),
eq = __webpack_require__("./node_modules/lodash/eq.js"),
equalArrays = __webpack_require__("./node_modules/lodash/_equalArrays.js"),
mapToArray = __webpack_require__("./node_modules/lodash/_mapToArray.js"),
setToArray = __webpack_require__("./node_modules/lodash/_setToArray.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
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]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
/***/ }),
/***/ "./node_modules/lodash/_equalObjects.js":
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__("./node_modules/lodash/_getAllKeys.js");
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
module.exports = equalObjects;
/***/ }),
/***/ "./node_modules/lodash/_freeGlobal.js":
/***/ (function(module, exports, __webpack_require__) {
/* 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, __webpack_require__("./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/lodash/_getAllKeys.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__("./node_modules/lodash/_baseGetAllKeys.js"),
getSymbols = __webpack_require__("./node_modules/lodash/_getSymbols.js"),
keys = __webpack_require__("./node_modules/lodash/keys.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_getMapData.js":
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__("./node_modules/lodash/_isKeyable.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_getMatchData.js":
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__("./node_modules/lodash/_isStrictComparable.js"),
keys = __webpack_require__("./node_modules/lodash/keys.js");
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
module.exports = getMatchData;
/***/ }),
/***/ "./node_modules/lodash/_getNative.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__("./node_modules/lodash/_baseIsNative.js"),
getValue = __webpack_require__("./node_modules/lodash/_getValue.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_getRawTag.js":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("./node_modules/lodash/_Symbol.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_getSymbols.js":
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__("./node_modules/lodash/_arrayFilter.js"),
stubArray = __webpack_require__("./node_modules/lodash/stubArray.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* 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 ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
module.exports = getSymbols;
/***/ }),
/***/ "./node_modules/lodash/_getTag.js":
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__("./node_modules/lodash/_DataView.js"),
Map = __webpack_require__("./node_modules/lodash/_Map.js"),
Promise = __webpack_require__("./node_modules/lodash/_Promise.js"),
Set = __webpack_require__("./node_modules/lodash/_Set.js"),
WeakMap = __webpack_require__("./node_modules/lodash/_WeakMap.js"),
baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"),
toSource = __webpack_require__("./node_modules/lodash/_toSource.js");
/** `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;
/***/ }),
/***/ "./node_modules/lodash/_getValue.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_hasPath.js":
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__("./node_modules/lodash/_castPath.js"),
isArguments = __webpack_require__("./node_modules/lodash/isArguments.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
isIndex = __webpack_require__("./node_modules/lodash/_isIndex.js"),
isLength = __webpack_require__("./node_modules/lodash/isLength.js"),
toKey = __webpack_require__("./node_modules/lodash/_toKey.js");
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
module.exports = hasPath;
/***/ }),
/***/ "./node_modules/lodash/_hashClear.js":
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__("./node_modules/lodash/_nativeCreate.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_hashDelete.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_hashGet.js":
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__("./node_modules/lodash/_nativeCreate.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_hashHas.js":
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__("./node_modules/lodash/_nativeCreate.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_hashSet.js":
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__("./node_modules/lodash/_nativeCreate.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_isFlattenable.js":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("./node_modules/lodash/_Symbol.js"),
isArguments = __webpack_require__("./node_modules/lodash/isArguments.js"),
isArray = __webpack_require__("./node_modules/lodash/isArray.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_isIndex.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_isIterateeCall.js":
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__("./node_modules/lodash/eq.js"),
isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"),
isIndex = __webpack_require__("./node_modules/lodash/_isIndex.js"),
isObject = __webpack_require__("./node_modules/lodash/isObject.js");
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ }),
/***/ "./node_modules/lodash/_isKey.js":
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__("./node_modules/lodash/isArray.js"),
isSymbol = __webpack_require__("./node_modules/lodash/isSymbol.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_isKeyable.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_isMasked.js":
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__("./node_modules/lodash/_coreJsData.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_isPrototype.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_isStrictComparable.js":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("./node_modules/lodash/isObject.js");
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
/***/ }),
/***/ "./node_modules/lodash/_listCacheClear.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_listCacheDelete.js":
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_listCacheGet.js":
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_listCacheHas.js":
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_listCacheSet.js":
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheClear.js":
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__("./node_modules/lodash/_Hash.js"),
ListCache = __webpack_require__("./node_modules/lodash/_ListCache.js"),
Map = __webpack_require__("./node_modules/lodash/_Map.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheDelete.js":
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__("./node_modules/lodash/_getMapData.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheGet.js":
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__("./node_modules/lodash/_getMapData.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheHas.js":
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__("./node_modules/lodash/_getMapData.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_mapCacheSet.js":
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__("./node_modules/lodash/_getMapData.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_mapToArray.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_matchesStrictComparable.js":
/***/ (function(module, exports) {
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
module.exports = matchesStrictComparable;
/***/ }),
/***/ "./node_modules/lodash/_memoizeCapped.js":
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__("./node_modules/lodash/memoize.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_nativeCreate.js":
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__("./node_modules/lodash/_getNative.js");
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/***/ "./node_modules/lodash/_nativeKeys.js":
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__("./node_modules/lodash/_overArg.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/***/ "./node_modules/lodash/_nodeUtil.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__("./node_modules/lodash/_freeGlobal.js");
/** 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__("./node_modules/webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/lodash/_objectToString.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_overArg.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_overRest.js":
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__("./node_modules/lodash/_apply.js");
/* 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;
/***/ }),
/***/ "./node_modules/lodash/_root.js":
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__("./node_modules/lodash/_freeGlobal.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_setCacheAdd.js":
/***/ (function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
/***/ }),
/***/ "./node_modules/lodash/_setCacheHas.js":
/***/ (function(module, exports) {
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
/***/ }),
/***/ "./node_modules/lodash/_setToArray.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_setToString.js":
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__("./node_modules/lodash/_baseSetToString.js"),
shortOut = __webpack_require__("./node_modules/lodash/_shortOut.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_shortOut.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_stackClear.js":
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__("./node_modules/lodash/_ListCache.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/_stackDelete.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_stackGet.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_stackHas.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_stackSet.js":
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__("./node_modules/lodash/_ListCache.js"),
Map = __webpack_require__("./node_modules/lodash/_Map.js"),
MapCache = __webpack_require__("./node_modules/lodash/_MapCache.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_strictIndexOf.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/_stringToPath.js":
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__("./node_modules/lodash/_memoizeCapped.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_toKey.js":
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__("./node_modules/lodash/isSymbol.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/_toSource.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/assign.js":
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__("./node_modules/lodash/_assignValue.js"),
copyObject = __webpack_require__("./node_modules/lodash/_copyObject.js"),
createAssigner = __webpack_require__("./node_modules/lodash/_createAssigner.js"),
isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"),
isPrototype = __webpack_require__("./node_modules/lodash/_isPrototype.js"),
keys = __webpack_require__("./node_modules/lodash/keys.js");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns own enumerable string keyed properties of source objects to the
* destination object. Source objects are applied from left to right.
* Subsequent sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @static
* @memberOf _
* @since 0.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assignIn
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3 }
*/
var assign = createAssigner(function(object, source) {
if (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
module.exports = assign;
/***/ }),
/***/ "./node_modules/lodash/constant.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/difference.js":
/***/ (function(module, exports, __webpack_require__) {
var baseDifference = __webpack_require__("./node_modules/lodash/_baseDifference.js"),
baseFlatten = __webpack_require__("./node_modules/lodash/_baseFlatten.js"),
baseRest = __webpack_require__("./node_modules/lodash/_baseRest.js"),
isArrayLikeObject = __webpack_require__("./node_modules/lodash/isArrayLikeObject.js");
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
module.exports = difference;
/***/ }),
/***/ "./node_modules/lodash/eq.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/find.js":
/***/ (function(module, exports, __webpack_require__) {
var createFind = __webpack_require__("./node_modules/lodash/_createFind.js"),
findIndex = __webpack_require__("./node_modules/lodash/findIndex.js");
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
module.exports = find;
/***/ }),
/***/ "./node_modules/lodash/findIndex.js":
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__("./node_modules/lodash/_baseFindIndex.js"),
baseIteratee = __webpack_require__("./node_modules/lodash/_baseIteratee.js"),
toInteger = __webpack_require__("./node_modules/lodash/toInteger.js");
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
/***/ }),
/***/ "./node_modules/lodash/get.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__("./node_modules/lodash/_baseGet.js");
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ }),
/***/ "./node_modules/lodash/hasIn.js":
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__("./node_modules/lodash/_baseHasIn.js"),
hasPath = __webpack_require__("./node_modules/lodash/_hasPath.js");
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;
/***/ }),
/***/ "./node_modules/lodash/identity.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/isArguments.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__("./node_modules/lodash/_baseIsArguments.js"),
isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/isArray.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/isArrayLike.js":
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__("./node_modules/lodash/isFunction.js"),
isLength = __webpack_require__("./node_modules/lodash/isLength.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/isArrayLikeObject.js":
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"),
isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js");
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;
/***/ }),
/***/ "./node_modules/lodash/isBuffer.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__("./node_modules/lodash/_root.js"),
stubFalse = __webpack_require__("./node_modules/lodash/stubFalse.js");
/** 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__("./node_modules/webpack/buildin/module.js")(module)))
/***/ }),
/***/ "./node_modules/lodash/isFunction.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"),
isObject = __webpack_require__("./node_modules/lodash/isObject.js");
/** `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;
/***/ }),
/***/ "./node_modules/lodash/isLength.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/isObject.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/isObjectLike.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/isSymbol.js":
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"),
isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js");
/** `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;
/***/ }),
/***/ "./node_modules/lodash/isTypedArray.js":
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__("./node_modules/lodash/_baseIsTypedArray.js"),
baseUnary = __webpack_require__("./node_modules/lodash/_baseUnary.js"),
nodeUtil = __webpack_require__("./node_modules/lodash/_nodeUtil.js");
/* 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;
/***/ }),
/***/ "./node_modules/lodash/keys.js":
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__("./node_modules/lodash/_arrayLikeKeys.js"),
baseKeys = __webpack_require__("./node_modules/lodash/_baseKeys.js"),
isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/memoize.js":
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__("./node_modules/lodash/_MapCache.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/property.js":
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__("./node_modules/lodash/_baseProperty.js"),
basePropertyDeep = __webpack_require__("./node_modules/lodash/_basePropertyDeep.js"),
isKey = __webpack_require__("./node_modules/lodash/_isKey.js"),
toKey = __webpack_require__("./node_modules/lodash/_toKey.js");
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
/***/ }),
/***/ "./node_modules/lodash/stubArray.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/stubFalse.js":
/***/ (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;
/***/ }),
/***/ "./node_modules/lodash/toFinite.js":
/***/ (function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__("./node_modules/lodash/toNumber.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/toInteger.js":
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__("./node_modules/lodash/toFinite.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/lodash/toNumber.js":
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__("./node_modules/lodash/isObject.js"),
isSymbol = __webpack_require__("./node_modules/lodash/isSymbol.js");
/** 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;
/***/ }),
/***/ "./node_modules/lodash/toString.js":
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__("./node_modules/lodash/_baseToString.js");
/**
* 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;
/***/ }),
/***/ "./node_modules/react-hot-loader/lib/patch.dev.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var React = __webpack_require__("./node_modules/react/react.js");
var createProxy = __webpack_require__("./node_modules/react-proxy/modules/index.js").default;
var global = __webpack_require__("./node_modules/global/window.js");
var ComponentMap = function () {
function ComponentMap(useWeakMap) {
_classCallCheck(this, ComponentMap);
if (useWeakMap) {
this.wm = new WeakMap();
} else {
this.slots = {};
}
}
_createClass(ComponentMap, [{
key: 'getSlot',
value: function getSlot(type) {
var key = type.displayName || type.name || 'Unknown';
if (!this.slots[key]) {
this.slots[key] = [];
}
return this.slots[key];
}
}, {
key: 'get',
value: function get(type) {
if (this.wm) {
return this.wm.get(type);
}
var slot = this.getSlot(type);
for (var i = 0; i < slot.length; i++) {
if (slot[i].key === type) {
return slot[i].value;
}
}
return undefined;
}
}, {
key: 'set',
value: function set(type, value) {
if (this.wm) {
this.wm.set(type, value);
} else {
var slot = this.getSlot(type);
for (var i = 0; i < slot.length; i++) {
if (slot[i].key === type) {
slot[i].value = value;
return;
}
}
slot.push({ key: type, value: value });
}
}
}, {
key: 'has',
value: function has(type) {
if (this.wm) {
return this.wm.has(type);
}
var slot = this.getSlot(type);
for (var i = 0; i < slot.length; i++) {
if (slot[i].key === type) {
return true;
}
}
return false;
}
}]);
return ComponentMap;
}();
var proxiesByID = void 0;
var didWarnAboutID = void 0;
var hasCreatedElementsByType = void 0;
var idsByType = void 0;
var hooks = {
register: function register(type, uniqueLocalName, fileName) {
if (typeof type !== 'function') {
return;
}
if (!uniqueLocalName || !fileName) {
return;
}
if (typeof uniqueLocalName !== 'string' || typeof fileName !== 'string') {
return;
}
var id = fileName + '#' + uniqueLocalName; // eslint-disable-line prefer-template
if (!idsByType.has(type) && hasCreatedElementsByType.has(type)) {
if (!didWarnAboutID[id]) {
didWarnAboutID[id] = true;
var baseName = fileName.replace(/^.*[\\\/]/, '');
console.error('React Hot Loader: ' + uniqueLocalName + ' in ' + fileName + ' will not hot reload ' + ('correctly because ' + baseName + ' uses <' + uniqueLocalName + ' /> during ') + ('module definition. For hot reloading to work, move ' + uniqueLocalName + ' ') + ('into a separate file and import it from ' + baseName + '.'));
}
return;
}
// Remember the ID.
idsByType.set(type, id);
// We use React Proxy to generate classes that behave almost
// the same way as the original classes but are updatable with
// new versions without destroying original instances.
if (!proxiesByID[id]) {
proxiesByID[id] = createProxy(type);
} else {
proxiesByID[id].update(type);
}
},
reset: function reset(useWeakMap) {
proxiesByID = {};
didWarnAboutID = {};
hasCreatedElementsByType = new ComponentMap(useWeakMap);
idsByType = new ComponentMap(useWeakMap);
}
};
hooks.reset(typeof WeakMap === 'function');
function resolveType(type) {
// We only care about composite components
if (typeof type !== 'function') {
return type;
}
hasCreatedElementsByType.set(type, true);
// When available, give proxy class to React instead of the real class.
var id = idsByType.get(type);
if (!id) {
return type;
}
var proxy = proxiesByID[id];
if (!proxy) {
return type;
}
return proxy.get();
}
var createElement = React.createElement;
function patchedCreateElement(type) {
// Trick React into rendering a proxy so that
// its state is preserved when the class changes.
// This will update the proxy if it's for a known type.
var resolvedType = resolveType(type);
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return createElement.apply(undefined, [resolvedType].concat(args));
}
patchedCreateElement.isPatchedByReactHotLoader = true;
function patchedCreateFactory(type) {
// Patch React.createFactory to use patched createElement
// because the original implementation uses the internal,
// unpatched ReactElement.createElement
var factory = patchedCreateElement.bind(null, type);
factory.type = type;
return factory;
}
patchedCreateFactory.isPatchedByReactHotLoader = true;
if (typeof global.__REACT_HOT_LOADER__ === 'undefined') {
React.createElement = patchedCreateElement;
React.createFactory = patchedCreateFactory;
global.__REACT_HOT_LOADER__ = hooks;
}
/***/ }),
/***/ "./node_modules/react-hot-loader/lib/patch.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* eslint-disable global-require */
if (!module.hot || process.env.NODE_ENV === 'production') {
module.exports = __webpack_require__("./node_modules/react-hot-loader/lib/patch.prod.js");
} else {
module.exports = __webpack_require__("./node_modules/react-hot-loader/lib/patch.dev.js");
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/react-hot-loader/lib/patch.prod.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* noop */
/***/ }),
/***/ "./node_modules/react-hot-loader/patch.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__("./node_modules/react-hot-loader/lib/patch.js");
/***/ }),
/***/ "./node_modules/react-proxy/modules/bindAutoBindMethods.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = bindAutoBindMethods;
/**
* Copyright 2013-2015, 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 React source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* Original:
* https://github.com/facebook/react/blob/6508b1ad273a6f371e8d90ae676e5390199461b4/src/isomorphic/classic/class/ReactClass.js#L650-L713
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName,
_bind = boundMethod.bind;
boundMethod.bind = function (newThis) {
var args = Array.prototype.slice.call(arguments, 1);
if (newThis !== component && newThis !== null) {
console.warn('bind(): React component methods may only be bound to the ' + 'component instance. See ' + componentName);
} else if (!args.length) {
console.warn('bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See ' + componentName);
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
return boundMethod;
}
function bindAutoBindMethodsFromMap(component) {
for (var autoBindKey in component.__reactAutoBindMap) {
if (!component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
return;
}
// Tweak: skip methods that are already bound.
// This is to preserve method reference in case it is used
// as a subscription handler that needs to be detached later.
if (component.hasOwnProperty(autoBindKey) && component[autoBindKey].__reactBoundContext === component) {
continue;
}
var method = component.__reactAutoBindMap[autoBindKey];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
function bindAutoBindMethods(component) {
if (component.__reactAutoBindPairs) {
bindAutoBindMethodsFromArray(component);
} else if (component.__reactAutoBindMap) {
bindAutoBindMethodsFromMap(component);
}
}
function bindAutoBindMethodsFromArray(component) {
var pairs = component.__reactAutoBindPairs;
if (!pairs) {
return;
}
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
if (component.hasOwnProperty(autoBindKey) && component[autoBindKey].__reactBoundContext === component) {
continue;
}
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
/***/ }),
/***/ "./node_modules/react-proxy/modules/createClassProxy.js":
/***/ (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 _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
exports.default = createClassProxy;
var _find = __webpack_require__("./node_modules/lodash/find.js");
var _find2 = _interopRequireDefault(_find);
var _createPrototypeProxy = __webpack_require__("./node_modules/react-proxy/modules/createPrototypeProxy.js");
var _createPrototypeProxy2 = _interopRequireDefault(_createPrototypeProxy);
var _bindAutoBindMethods = __webpack_require__("./node_modules/react-proxy/modules/bindAutoBindMethods.js");
var _bindAutoBindMethods2 = _interopRequireDefault(_bindAutoBindMethods);
var _deleteUnknownAutoBindMethods = __webpack_require__("./node_modules/react-proxy/modules/deleteUnknownAutoBindMethods.js");
var _deleteUnknownAutoBindMethods2 = _interopRequireDefault(_deleteUnknownAutoBindMethods);
var _supportsProtoAssignment = __webpack_require__("./node_modules/react-proxy/modules/supportsProtoAssignment.js");
var _supportsProtoAssignment2 = _interopRequireDefault(_supportsProtoAssignment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var RESERVED_STATICS = ['length', 'displayName', 'name', 'arguments', 'caller', 'prototype', 'toString'];
function isEqualDescriptor(a, b) {
if (!a && !b) {
return true;
}
if (!a || !b) {
return false;
}
for (var key in a) {
if (a[key] !== b[key]) {
return false;
}
}
return true;
}
function getDisplayName(Component) {
var displayName = Component.displayName || Component.name;
return displayName && displayName !== 'ReactComponent' ? displayName : 'Unknown';
}
// This was originally a WeakMap but we had issues with React Native:
// https://github.com/gaearon/react-proxy/issues/50#issuecomment-192928066
var allProxies = [];
function findProxy(Component) {
var pair = (0, _find2.default)(allProxies, function (_ref) {
var _ref2 = _slicedToArray(_ref, 1);
var key = _ref2[0];
return key === Component;
});
return pair ? pair[1] : null;
}
function addProxy(Component, proxy) {
allProxies.push([Component, proxy]);
}
function proxyClass(InitialComponent) {
// Prevent double wrapping.
// Given a proxy class, return the existing proxy managing it.
var existingProxy = findProxy(InitialComponent);
if (existingProxy) {
return existingProxy;
}
var CurrentComponent = undefined;
var ProxyComponent = undefined;
var savedDescriptors = {};
function instantiate(factory, context, params) {
var component = factory();
try {
return component.apply(context, params);
} catch (err) {
(function () {
// Native ES6 class instantiation
var instance = new (Function.prototype.bind.apply(component, [null].concat(_toConsumableArray(params))))();
Object.keys(instance).forEach(function (key) {
if (RESERVED_STATICS.indexOf(key) > -1) {
return;
}
context[key] = instance[key];
});
})();
}
}
var displayName = getDisplayName(InitialComponent);
try {
// Create a proxy constructor with matching name
ProxyComponent = new Function('factory', 'instantiate', 'return function ' + displayName + '() {\n return instantiate(factory, this, arguments);\n }')(function () {
return CurrentComponent;
}, instantiate);
} catch (err) {
// Some environments may forbid dynamic evaluation
ProxyComponent = function ProxyComponent() {
return instantiate(function () {
return CurrentComponent;
}, this, arguments);
};
}
try {
Object.defineProperty(ProxyComponent, 'name', {
value: displayName
});
} catch (err) {}
// Proxy toString() to the current constructor
ProxyComponent.toString = function toString() {
return CurrentComponent.toString();
};
var prototypeProxy = undefined;
if (InitialComponent.prototype && InitialComponent.prototype.isReactComponent) {
// Point proxy constructor to the proxy prototype
prototypeProxy = (0, _createPrototypeProxy2.default)();
ProxyComponent.prototype = prototypeProxy.get();
}
function update(NextComponent) {
if (typeof NextComponent !== 'function') {
throw new Error('Expected a constructor.');
}
if (NextComponent === CurrentComponent) {
return;
}
// Prevent proxy cycles
var existingProxy = findProxy(NextComponent);
if (existingProxy) {
return update(existingProxy.__getCurrent());
}
// Save the next constructor so we call it
var PreviousComponent = CurrentComponent;
CurrentComponent = NextComponent;
// Try to infer displayName
displayName = getDisplayName(NextComponent);
ProxyComponent.displayName = displayName;
try {
Object.defineProperty(ProxyComponent, 'name', {
value: displayName
});
} catch (err) {}
// Set up the same prototype for inherited statics
ProxyComponent.__proto__ = NextComponent.__proto__;
// Copy over static methods and properties added at runtime
if (PreviousComponent) {
Object.getOwnPropertyNames(PreviousComponent).forEach(function (key) {
if (RESERVED_STATICS.indexOf(key) > -1) {
return;
}
var prevDescriptor = Object.getOwnPropertyDescriptor(PreviousComponent, key);
var savedDescriptor = savedDescriptors[key];
if (!isEqualDescriptor(prevDescriptor, savedDescriptor)) {
Object.defineProperty(NextComponent, key, prevDescriptor);
}
});
}
// Copy newly defined static methods and properties
Object.getOwnPropertyNames(NextComponent).forEach(function (key) {
if (RESERVED_STATICS.indexOf(key) > -1) {
return;
}
var prevDescriptor = PreviousComponent && Object.getOwnPropertyDescriptor(PreviousComponent, key);
var savedDescriptor = savedDescriptors[key];
// Skip redefined descriptors
if (prevDescriptor && savedDescriptor && !isEqualDescriptor(savedDescriptor, prevDescriptor)) {
Object.defineProperty(NextComponent, key, prevDescriptor);
Object.defineProperty(ProxyComponent, key, prevDescriptor);
return;
}
if (prevDescriptor && !savedDescriptor) {
Object.defineProperty(ProxyComponent, key, prevDescriptor);
return;
}
var nextDescriptor = _extends({}, Object.getOwnPropertyDescriptor(NextComponent, key), {
configurable: true
});
savedDescriptors[key] = nextDescriptor;
Object.defineProperty(ProxyComponent, key, nextDescriptor);
});
// Remove static methods and properties that are no longer defined
Object.getOwnPropertyNames(ProxyComponent).forEach(function (key) {
if (RESERVED_STATICS.indexOf(key) > -1) {
return;
}
// Skip statics that exist on the next class
if (NextComponent.hasOwnProperty(key)) {
return;
}
// Skip non-configurable statics
var proxyDescriptor = Object.getOwnPropertyDescriptor(ProxyComponent, key);
if (proxyDescriptor && !proxyDescriptor.configurable) {
return;
}
var prevDescriptor = PreviousComponent && Object.getOwnPropertyDescriptor(PreviousComponent, key);
var savedDescriptor = savedDescriptors[key];
// Skip redefined descriptors
if (prevDescriptor && savedDescriptor && !isEqualDescriptor(savedDescriptor, prevDescriptor)) {
return;
}
delete ProxyComponent[key];
});
if (prototypeProxy) {
// Update the prototype proxy with new methods
var mountedInstances = prototypeProxy.update(NextComponent.prototype);
// Set up the constructor property so accessing the statics work
ProxyComponent.prototype.constructor = NextComponent;
// We might have added new methods that need to be auto-bound
mountedInstances.forEach(_bindAutoBindMethods2.default);
mountedInstances.forEach(_deleteUnknownAutoBindMethods2.default);
}
};
function get() {
return ProxyComponent;
}
function getCurrent() {
return CurrentComponent;
}
update(InitialComponent);
var proxy = { get: get, update: update };
addProxy(ProxyComponent, proxy);
Object.defineProperty(proxy, '__getCurrent', {
configurable: false,
writable: false,
enumerable: false,
value: getCurrent
});
return proxy;
}
function createFallback(Component) {
var CurrentComponent = Component;
return {
get: function get() {
return CurrentComponent;
},
update: function update(NextComponent) {
CurrentComponent = NextComponent;
}
};
}
function createClassProxy(Component) {
return Component.__proto__ && (0, _supportsProtoAssignment2.default)() ? proxyClass(Component) : createFallback(Component);
}
/***/ }),
/***/ "./node_modules/react-proxy/modules/createPrototypeProxy.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createPrototypeProxy;
var _assign = __webpack_require__("./node_modules/lodash/assign.js");
var _assign2 = _interopRequireDefault(_assign);
var _difference = __webpack_require__("./node_modules/lodash/difference.js");
var _difference2 = _interopRequireDefault(_difference);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createPrototypeProxy() {
var proxy = {};
var current = null;
var mountedInstances = [];
/**
* Creates a proxied toString() method pointing to the current version's toString().
*/
function proxyToString(name) {
// Wrap to always call the current version
return function toString() {
if (typeof current[name] === 'function') {
return current[name].toString();
} else {
return '<method was deleted>';
}
};
}
/**
* Creates a proxied method that calls the current version, whenever available.
*/
function proxyMethod(name) {
// Wrap to always call the current version
var proxiedMethod = function proxiedMethod() {
if (typeof current[name] === 'function') {
return current[name].apply(this, arguments);
}
};
// Copy properties of the original function, if any
(0, _assign2.default)(proxiedMethod, current[name]);
proxiedMethod.toString = proxyToString(name);
try {
Object.defineProperty(proxiedMethod, 'name', {
value: name
});
} catch (err) {}
return proxiedMethod;
}
/**
* Augments the original componentDidMount with instance tracking.
*/
function proxiedComponentDidMount() {
mountedInstances.push(this);
if (typeof current.componentDidMount === 'function') {
return current.componentDidMount.apply(this, arguments);
}
}
proxiedComponentDidMount.toString = proxyToString('componentDidMount');
/**
* Augments the original componentWillUnmount with instance tracking.
*/
function proxiedComponentWillUnmount() {
var index = mountedInstances.indexOf(this);
// Unless we're in a weird environment without componentDidMount
if (index !== -1) {
mountedInstances.splice(index, 1);
}
if (typeof current.componentWillUnmount === 'function') {
return current.componentWillUnmount.apply(this, arguments);
}
}
proxiedComponentWillUnmount.toString = proxyToString('componentWillUnmount');
/**
* Defines a property on the proxy.
*/
function defineProxyProperty(name, descriptor) {
Object.defineProperty(proxy, name, descriptor);
}
/**
* Defines a property, attempting to keep the original descriptor configuration.
*/
function defineProxyPropertyWithValue(name, value) {
var _ref = Object.getOwnPropertyDescriptor(current, name) || {};
var _ref$enumerable = _ref.enumerable;
var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;
var _ref$writable = _ref.writable;
var writable = _ref$writable === undefined ? true : _ref$writable;
defineProxyProperty(name, {
configurable: true,
enumerable: enumerable,
writable: writable,
value: value
});
}
/**
* Creates an auto-bind map mimicking the original map, but directed at proxy.
*/
function createAutoBindMap() {
if (!current.__reactAutoBindMap) {
return;
}
var __reactAutoBindMap = {};
for (var name in current.__reactAutoBindMap) {
if (typeof proxy[name] === 'function' && current.__reactAutoBindMap.hasOwnProperty(name)) {
__reactAutoBindMap[name] = proxy[name];
}
}
return __reactAutoBindMap;
}
/**
* Creates an auto-bind map mimicking the original map, but directed at proxy.
*/
function createAutoBindPairs() {
var __reactAutoBindPairs = [];
for (var i = 0; i < current.__reactAutoBindPairs.length; i += 2) {
var name = current.__reactAutoBindPairs[i];
var method = proxy[name];
if (typeof method === 'function') {
__reactAutoBindPairs.push(name, method);
}
}
return __reactAutoBindPairs;
}
/**
* Applies the updated prototype.
*/
function update(next) {
// Save current source of truth
current = next;
// Find changed property names
var currentNames = Object.getOwnPropertyNames(current);
var previousName = Object.getOwnPropertyNames(proxy);
var removedNames = (0, _difference2.default)(previousName, currentNames);
// Remove properties and methods that are no longer there
removedNames.forEach(function (name) {
delete proxy[name];
});
// Copy every descriptor
currentNames.forEach(function (name) {
var descriptor = Object.getOwnPropertyDescriptor(current, name);
if (typeof descriptor.value === 'function') {
// Functions require additional wrapping so they can be bound later
defineProxyPropertyWithValue(name, proxyMethod(name));
} else {
// Other values can be copied directly
defineProxyProperty(name, descriptor);
}
});
// Track mounting and unmounting
defineProxyPropertyWithValue('componentDidMount', proxiedComponentDidMount);
defineProxyPropertyWithValue('componentWillUnmount', proxiedComponentWillUnmount);
if (current.hasOwnProperty('__reactAutoBindMap')) {
defineProxyPropertyWithValue('__reactAutoBindMap', createAutoBindMap());
}
if (current.hasOwnProperty('__reactAutoBindPairs')) {
defineProxyPropertyWithValue('__reactAutoBindPairs', createAutoBindPairs());
}
// Set up the prototype chain
proxy.__proto__ = next;
return mountedInstances;
}
/**
* Returns the up-to-date proxy prototype.
*/
function get() {
return proxy;
}
return {
update: update,
get: get
};
};
/***/ }),
/***/ "./node_modules/react-proxy/modules/deleteUnknownAutoBindMethods.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = deleteUnknownAutoBindMethods;
function shouldDeleteClassicInstanceMethod(component, name) {
if (component.__reactAutoBindMap && component.__reactAutoBindMap.hasOwnProperty(name)) {
// It's a known autobound function, keep it
return false;
}
if (component.__reactAutoBindPairs && component.__reactAutoBindPairs.indexOf(name) >= 0) {
// It's a known autobound function, keep it
return false;
}
if (component[name].__reactBoundArguments !== null) {
// It's a function bound to specific args, keep it
return false;
}
// It's a cached bound method for a function
// that was deleted by user, so we delete it from component.
return true;
}
function shouldDeleteModernInstanceMethod(component, name) {
var prototype = component.constructor.prototype;
var prototypeDescriptor = Object.getOwnPropertyDescriptor(prototype, name);
if (!prototypeDescriptor || !prototypeDescriptor.get) {
// This is definitely not an autobinding getter
return false;
}
if (prototypeDescriptor.get().length !== component[name].length) {
// The length doesn't match, bail out
return false;
}
// This seems like a method bound using an autobinding getter on the prototype
// Hopefully we won't run into too many false positives.
return true;
}
function shouldDeleteInstanceMethod(component, name) {
var descriptor = Object.getOwnPropertyDescriptor(component, name);
if (typeof descriptor.value !== 'function') {
// Not a function, or something fancy: bail out
return;
}
if (component.__reactAutoBindMap || component.__reactAutoBindPairs) {
// Classic
return shouldDeleteClassicInstanceMethod(component, name);
} else {
// Modern
return shouldDeleteModernInstanceMethod(component, name);
}
}
/**
* Deletes autobound methods from the instance.
*
* For classic React classes, we only delete the methods that no longer exist in map.
* This means the user actually deleted them in code.
*
* For modern classes, we delete methods that exist on prototype with the same length,
* and which have getters on prototype, but are normal values on the instance.
* This is usually an indication that an autobinding decorator is being used,
* and the getter will re-generate the memoized handler on next access.
*/
function deleteUnknownAutoBindMethods(component) {
var names = Object.getOwnPropertyNames(component);
names.forEach(function (name) {
if (shouldDeleteInstanceMethod(component, name)) {
delete component[name];
}
});
}
/***/ }),
/***/ "./node_modules/react-proxy/modules/index.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _supportsProtoAssignment = __webpack_require__("./node_modules/react-proxy/modules/supportsProtoAssignment.js");
var _supportsProtoAssignment2 = _interopRequireDefault(_supportsProtoAssignment);
var _createClassProxy = __webpack_require__("./node_modules/react-proxy/modules/createClassProxy.js");
var _createClassProxy2 = _interopRequireDefault(_createClassProxy);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (!(0, _supportsProtoAssignment2.default)()) {
console.warn('This JavaScript environment does not support __proto__. ' + 'This means that react-proxy is unable to proxy React components. ' + 'Features that rely on react-proxy, such as react-transform-hmr, ' + 'will not function as expected.');
}
exports.default = _createClassProxy2.default;
/***/ }),
/***/ "./node_modules/react-proxy/modules/supportsProtoAssignment.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = supportsProtoAssignment;
var x = {};
var y = { supports: true };
try {
x.__proto__ = y;
} catch (err) {}
function supportsProtoAssignment() {
return x.supports || false;
};
/***/ }),
/***/ "./node_modules/react-router-dom/es/BrowserRouter.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__("./node_modules/react/react.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__("./node_modules/prop-types/index.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__ = __webpack_require__("./node_modules/history/createBrowserHistory.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
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; }
/**
* The public API for a <Router> that uses HTML5 history.
*/
var BrowserRouter = function (_React$Component) {
_inherits(BrowserRouter, _React$Component);
function BrowserRouter() {
var _temp, _this, _ret;
_classCallCheck(this, BrowserRouter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
BrowserRouter.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["Router"], { history: this.history, children: this.props.children });
};
return BrowserRouter;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
BrowserRouter.propTypes = {
basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
forceRefresh: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number,
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node
};
/* harmony default export */ __webpack_exports__["a"] = (BrowserRouter);
/***/ }),
/***/ "./node_modules/react-router-dom/es/HashRouter.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__("./node_modules/react/react.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__("./node_modules/prop-types/index.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__ = __webpack_require__("./node_modules/history/createHashHistory.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
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; }
/**
* The public API for a <Router> that uses window.location.hash.
*/
var HashRouter = function (_React$Component) {
_inherits(HashRouter, _React$Component);
function HashRouter() {
var _temp, _this, _ret;
_classCallCheck(this, HashRouter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
HashRouter.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["Router"], { history: this.history, children: this.props.children });
};
return HashRouter;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
HashRouter.propTypes = {
basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
hashType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hashbang', 'noslash', 'slash']),
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node
};
/* harmony default export */ __webpack_exports__["a"] = (HashRouter);
/***/ }),
/***/ "./node_modules/react-router-dom/es/Link.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__("./node_modules/react/react.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__("./node_modules/prop-types/index.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
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; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
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 isModifiedEvent = function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
};
/**
* The public API for rendering a history-aware <a>.
*/
var Link = function (_React$Component) {
_inherits(Link, _React$Component);
function Link() {
var _temp, _this, _ret;
_classCallCheck(this, Link);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
if (_this.props.onClick) _this.props.onClick(event);
if (!event.defaultPrevented && // onClick prevented default
event.button === 0 && // ignore right clicks
!_this.props.target && // let browser handle "target=_blank" etc.
!isModifiedEvent(event) // ignore clicks with modifier keys
) {
event.preventDefault();
var history = _this.context.router.history;
var _this$props = _this.props,
replace = _this$props.replace,
to = _this$props.to;
if (replace) {
history.replace(to);
} else {
history.push(to);
}
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Link.prototype.render = function render() {
var _props = this.props,
replace = _props.replace,
to = _props.to,
props = _objectWithoutProperties(_props, ['replace', 'to']); // eslint-disable-line no-unused-vars
var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href }));
};
return Link;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Link.propTypes = {
onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired
};
Link.defaultProps = {
replace: false
};
Link.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
}).isRequired
}).isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (Link);
/***/ }),
/***/ "./node_modules/react-router-dom/es/MemoryRouter.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["MemoryRouter"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/NavLink.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__("./node_modules/react/react.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__("./node_modules/prop-types/index.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__("./node_modules/react-router-dom/es/Link.js");
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; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
/**
* A <Link> wrapper that knows if it's "active" or not.
*/
var NavLink = function NavLink(_ref) {
var to = _ref.to,
exact = _ref.exact,
strict = _ref.strict,
location = _ref.location,
activeClassName = _ref.activeClassName,
className = _ref.className,
activeStyle = _ref.activeStyle,
style = _ref.style,
getIsActive = _ref.isActive,
rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive']);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["Route"], {
path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to,
exact: exact,
strict: strict,
location: location,
children: function children(_ref2) {
var location = _ref2.location,
match = _ref2.match;
var isActive = !!(getIsActive ? getIsActive(match, location) : match);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */], _extends({
to: to,
className: isActive ? [activeClassName, className].filter(function (i) {
return i;
}).join(' ') : className,
style: isActive ? _extends({}, style, activeStyle) : style
}, rest));
}
});
};
NavLink.propTypes = {
to: __WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */].propTypes.to,
exact: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
strict: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
activeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
activeStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
isActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
};
NavLink.defaultProps = {
activeClassName: 'active'
};
/* harmony default export */ __webpack_exports__["a"] = (NavLink);
/***/ }),
/***/ "./node_modules/react-router-dom/es/Prompt.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["Prompt"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/Redirect.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["Redirect"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/Route.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["Route"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/Router.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["Router"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/StaticRouter.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["StaticRouter"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/Switch.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["Switch"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/index.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__("./node_modules/react-router-dom/es/BrowserRouter.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserRouter", function() { return __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__("./node_modules/react-router-dom/es/HashRouter.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "HashRouter", function() { return __WEBPACK_IMPORTED_MODULE_1__HashRouter__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__("./node_modules/react-router-dom/es/Link.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return __WEBPACK_IMPORTED_MODULE_2__Link__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__("./node_modules/react-router-dom/es/MemoryRouter.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__("./node_modules/react-router-dom/es/NavLink.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return __WEBPACK_IMPORTED_MODULE_4__NavLink__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__("./node_modules/react-router-dom/es/Prompt.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_5__Prompt__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__("./node_modules/react-router-dom/es/Redirect.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_6__Redirect__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__("./node_modules/react-router-dom/es/Route.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_7__Route__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Router__ = __webpack_require__("./node_modules/react-router-dom/es/Router.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_8__Router__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__("./node_modules/react-router-dom/es/StaticRouter.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_9__StaticRouter__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__("./node_modules/react-router-dom/es/Switch.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_10__Switch__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__("./node_modules/react-router-dom/es/matchPath.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_11__matchPath__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__("./node_modules/react-router-dom/es/withRouter.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_12__withRouter__["a"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/matchPath.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["matchPath"]; });
/***/ }),
/***/ "./node_modules/react-router-dom/es/withRouter.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__("./node_modules/react-router/es/index.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_react_router__["withRouter"]; });
/***/ }),
/***/ "./node_modules/redux-saga/es/effects.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_io__ = __webpack_require__("./node_modules/redux-saga/es/internal/io.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takem", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["b"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "put", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["c"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["d"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["e"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "call", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["f"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["g"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "cps", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["h"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fork", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["i"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "spawn", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["j"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "join", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["k"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "cancel", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["l"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["m"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "actionChannel", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["n"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "cancelled", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["o"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flush", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["p"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "getContext", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["q"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "setContext", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["r"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeEvery", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["s"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeLatest", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["t"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_io__["u"]; });
/***/ }),
/***/ "./node_modules/redux-saga/es/index.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_middleware__ = __webpack_require__("./node_modules/redux-saga/es/internal/middleware.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_runSaga__ = __webpack_require__("./node_modules/redux-saga/es/internal/runSaga.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "runSaga", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_runSaga__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_channel__ = __webpack_require__("./node_modules/redux-saga/es/internal/channel.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "END", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_channel__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "eventChannel", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_channel__["b"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "channel", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_channel__["c"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_buffers__ = __webpack_require__("./node_modules/redux-saga/es/internal/buffers.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "buffers", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_buffers__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__ = __webpack_require__("./node_modules/redux-saga/es/internal/sagaHelpers.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeEvery", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__["d"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeLatest", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__["e"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_sagaHelpers__["f"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_utils__["j"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CANCEL", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_utils__["q"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__effects__ = __webpack_require__("./node_modules/redux-saga/es/effects.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils__ = __webpack_require__("./node_modules/redux-saga/es/utils.js");
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "effects", function() { return __WEBPACK_IMPORTED_MODULE_6__effects__; });
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "utils", function() { return __WEBPACK_IMPORTED_MODULE_7__utils__; });
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__internal_middleware__["a" /* default */]);
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/buffers.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export BUFFER_OVERFLOW */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return buffers; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
var BUFFER_OVERFLOW = 'Channel\'s Buffer overflow!';
var ON_OVERFLOW_THROW = 1;
var ON_OVERFLOW_DROP = 2;
var ON_OVERFLOW_SLIDE = 3;
var ON_OVERFLOW_EXPAND = 4;
var zeroBuffer = { isEmpty: __WEBPACK_IMPORTED_MODULE_0__utils__["k" /* kTrue */], put: __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */], take: __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */] };
function ringBuffer() {
var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
var overflowAction = arguments[1];
var arr = new Array(limit);
var length = 0;
var pushIndex = 0;
var popIndex = 0;
var push = function push(it) {
arr[pushIndex] = it;
pushIndex = (pushIndex + 1) % limit;
length++;
};
var take = function take() {
if (length != 0) {
var it = arr[popIndex];
arr[popIndex] = null;
length--;
popIndex = (popIndex + 1) % limit;
return it;
}
};
var flush = function flush() {
var items = [];
while (length) {
items.push(take());
}
return items;
};
return {
isEmpty: function isEmpty() {
return length == 0;
},
put: function put(it) {
if (length < limit) {
push(it);
} else {
var doubledLimit = void 0;
switch (overflowAction) {
case ON_OVERFLOW_THROW:
throw new Error(BUFFER_OVERFLOW);
case ON_OVERFLOW_SLIDE:
arr[pushIndex] = it;
pushIndex = (pushIndex + 1) % limit;
popIndex = pushIndex;
break;
case ON_OVERFLOW_EXPAND:
doubledLimit = 2 * limit;
arr = flush();
length = arr.length;
pushIndex = arr.length;
popIndex = 0;
arr.length = doubledLimit;
limit = doubledLimit;
push(it);
break;
default:
// DROP
}
}
},
take: take, flush: flush
};
}
var buffers = {
none: function none() {
return zeroBuffer;
},
fixed: function fixed(limit) {
return ringBuffer(limit, ON_OVERFLOW_THROW);
},
dropping: function dropping(limit) {
return ringBuffer(limit, ON_OVERFLOW_DROP);
},
sliding: function sliding(limit) {
return ringBuffer(limit, ON_OVERFLOW_SLIDE);
},
expanding: function expanding(initialSize) {
return ringBuffer(initialSize, ON_OVERFLOW_EXPAND);
}
};
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/channel.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return END; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isEnd; });
/* harmony export (immutable) */ __webpack_exports__["f"] = emitter;
/* unused harmony export INVALID_BUFFER */
/* unused harmony export UNDEFINED_INPUT_ERROR */
/* harmony export (immutable) */ __webpack_exports__["c"] = channel;
/* harmony export (immutable) */ __webpack_exports__["b"] = eventChannel;
/* harmony export (immutable) */ __webpack_exports__["d"] = stdChannel;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__buffers__ = __webpack_require__("./node_modules/redux-saga/es/internal/buffers.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler__ = __webpack_require__("./node_modules/redux-saga/es/internal/scheduler.js");
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 CHANNEL_END_TYPE = '@@redux-saga/CHANNEL_END';
var END = { type: CHANNEL_END_TYPE };
var isEnd = function isEnd(a) {
return a && a.type === CHANNEL_END_TYPE;
};
function emitter() {
var subscribers = [];
function subscribe(sub) {
subscribers.push(sub);
return function () {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["m" /* remove */])(subscribers, sub);
};
}
function emit(item) {
var arr = subscribers.slice();
for (var i = 0, len = arr.length; i < len; i++) {
arr[i](item);
}
}
return {
subscribe: subscribe,
emit: emit
};
}
var INVALID_BUFFER = 'invalid buffer passed to channel factory function';
var UNDEFINED_INPUT_ERROR = 'Saga was provided with an undefined action';
if (process.env.NODE_ENV !== 'production') {
UNDEFINED_INPUT_ERROR += '\nHints:\n - check that your Action Creator returns a non-undefined value\n - if the Saga was started using runSaga, check that your subscribe source provides the action to its listeners\n ';
}
function channel() {
var buffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_1__buffers__["a" /* buffers */].fixed();
var closed = false;
var takers = [];
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].buffer, INVALID_BUFFER);
function checkForbiddenStates() {
if (closed && takers.length) {
throw __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["n" /* internalErr */])('Cannot have a closed channel with pending takers');
}
if (takers.length && !buffer.isEmpty()) {
throw __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["n" /* internalErr */])('Cannot have pending takers with non empty buffer');
}
}
function put(input) {
checkForbiddenStates();
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(input, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, UNDEFINED_INPUT_ERROR);
if (closed) {
return;
}
if (!takers.length) {
return buffer.put(input);
}
for (var i = 0; i < takers.length; i++) {
var cb = takers[i];
if (!cb[__WEBPACK_IMPORTED_MODULE_0__utils__["o" /* MATCH */]] || cb[__WEBPACK_IMPORTED_MODULE_0__utils__["o" /* MATCH */]](input)) {
takers.splice(i, 1);
return cb(input);
}
}
}
function take(cb) {
checkForbiddenStates();
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(cb, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, 'channel.take\'s callback must be a function');
if (closed && buffer.isEmpty()) {
cb(END);
} else if (!buffer.isEmpty()) {
cb(buffer.take());
} else {
takers.push(cb);
cb.cancel = function () {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["m" /* remove */])(takers, cb);
};
}
}
function flush(cb) {
checkForbiddenStates(); // TODO: check if some new state should be forbidden now
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(cb, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, 'channel.flush\' callback must be a function');
if (closed && buffer.isEmpty()) {
cb(END);
return;
}
cb(buffer.flush());
}
function close() {
checkForbiddenStates();
if (!closed) {
closed = true;
if (takers.length) {
var arr = takers;
takers = [];
for (var i = 0, len = arr.length; i < len; i++) {
arr[i](END);
}
}
}
}
return { take: take, put: put, flush: flush, close: close,
get __takers__() {
return takers;
},
get __closed__() {
return closed;
}
};
}
function eventChannel(subscribe) {
var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_1__buffers__["a" /* buffers */].none();
var matcher = arguments[2];
/**
should be if(typeof matcher !== undefined) instead?
see PR #273 for a background discussion
**/
if (arguments.length > 2) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(matcher, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, 'Invalid match function passed to eventChannel');
}
var chan = channel(buffer);
var close = function close() {
if (!chan.__closed__) {
if (unsubscribe) {
unsubscribe();
}
chan.close();
}
};
var unsubscribe = subscribe(function (input) {
if (isEnd(input)) {
close();
return;
}
if (matcher && !matcher(input)) {
return;
}
chan.put(input);
});
if (chan.__closed__) {
unsubscribe();
}
if (!__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(unsubscribe)) {
throw new Error('in eventChannel: subscribe should return a function to unsubscribe');
}
return {
take: chan.take,
flush: chan.flush,
close: close
};
}
function stdChannel(subscribe) {
var chan = eventChannel(function (cb) {
return subscribe(function (input) {
if (input[__WEBPACK_IMPORTED_MODULE_0__utils__["p" /* SAGA_ACTION */]]) {
cb(input);
return;
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__scheduler__["a" /* asap */])(function () {
return cb(input);
});
});
});
return _extends({}, chan, {
take: function take(cb, matcher) {
if (arguments.length > 1) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(matcher, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, 'channel.take\'s matcher argument must be a function');
cb[__WEBPACK_IMPORTED_MODULE_0__utils__["o" /* MATCH */]] = matcher;
}
chan.take(cb);
}
});
}
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/io.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = take;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return takem; });
/* harmony export (immutable) */ __webpack_exports__["c"] = put;
/* harmony export (immutable) */ __webpack_exports__["d"] = all;
/* harmony export (immutable) */ __webpack_exports__["e"] = race;
/* harmony export (immutable) */ __webpack_exports__["f"] = call;
/* harmony export (immutable) */ __webpack_exports__["g"] = apply;
/* harmony export (immutable) */ __webpack_exports__["h"] = cps;
/* harmony export (immutable) */ __webpack_exports__["i"] = fork;
/* harmony export (immutable) */ __webpack_exports__["j"] = spawn;
/* harmony export (immutable) */ __webpack_exports__["k"] = join;
/* harmony export (immutable) */ __webpack_exports__["l"] = cancel;
/* harmony export (immutable) */ __webpack_exports__["m"] = select;
/* harmony export (immutable) */ __webpack_exports__["n"] = actionChannel;
/* harmony export (immutable) */ __webpack_exports__["o"] = cancelled;
/* harmony export (immutable) */ __webpack_exports__["p"] = flush;
/* harmony export (immutable) */ __webpack_exports__["q"] = getContext;
/* harmony export (immutable) */ __webpack_exports__["r"] = setContext;
/* harmony export (immutable) */ __webpack_exports__["s"] = takeEvery;
/* harmony export (immutable) */ __webpack_exports__["t"] = takeLatest;
/* harmony export (immutable) */ __webpack_exports__["u"] = throttle;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return asEffect; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__sagaHelpers__ = __webpack_require__("./node_modules/redux-saga/es/internal/sagaHelpers.js");
var IO = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* sym */])('IO');
var TAKE = 'TAKE';
var PUT = 'PUT';
var ALL = 'ALL';
var RACE = 'RACE';
var CALL = 'CALL';
var CPS = 'CPS';
var FORK = 'FORK';
var JOIN = 'JOIN';
var CANCEL = 'CANCEL';
var SELECT = 'SELECT';
var ACTION_CHANNEL = 'ACTION_CHANNEL';
var CANCELLED = 'CANCELLED';
var FLUSH = 'FLUSH';
var GET_CONTEXT = 'GET_CONTEXT';
var SET_CONTEXT = 'SET_CONTEXT';
var TEST_HINT = '\n(HINT: if you are getting this errors in tests, consider using createMockTask from redux-saga/utils)';
var effect = function effect(type, payload) {
var _ref;
return _ref = {}, _ref[IO] = true, _ref[type] = payload, _ref;
};
function take() {
var patternOrChannel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '*';
if (arguments.length) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(arguments[0], __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'take(patternOrChannel): patternOrChannel is undefined');
}
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].pattern(patternOrChannel)) {
return effect(TAKE, { pattern: patternOrChannel });
}
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].channel(patternOrChannel)) {
return effect(TAKE, { channel: patternOrChannel });
}
throw new Error('take(patternOrChannel): argument ' + String(patternOrChannel) + ' is not valid channel or a valid pattern');
}
take.maybe = function () {
var eff = take.apply(undefined, arguments);
eff[TAKE].maybe = true;
return eff;
};
var takem = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["d" /* deprecate */])(take.maybe, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["e" /* updateIncentive */])('takem', 'take.maybe'));
function put(channel, action) {
if (arguments.length > 1) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(channel, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'put(channel, action): argument channel is undefined');
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(channel, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].channel, 'put(channel, action): argument ' + channel + ' is not a valid channel');
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(action, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'put(channel, action): argument action is undefined');
} else {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(channel, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'put(action): argument action is undefined');
action = channel;
channel = null;
}
return effect(PUT, { channel: channel, action: action });
}
put.resolve = function () {
var eff = put.apply(undefined, arguments);
eff[PUT].resolve = true;
return eff;
};
put.sync = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["d" /* deprecate */])(put.resolve, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["e" /* updateIncentive */])('put.sync', 'put.resolve'));
function all(effects) {
return effect(ALL, effects);
}
function race(effects) {
return effect(RACE, effects);
}
function getFnCallDesc(meth, fn, args) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(fn, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, meth + ': argument fn is undefined');
var context = null;
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].array(fn)) {
var _fn = fn;
context = _fn[0];
fn = _fn[1];
} else if (fn.fn) {
var _fn2 = fn;
context = _fn2.context;
fn = _fn2.fn;
}
if (context && __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].string(fn) && __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(context[fn])) {
fn = context[fn];
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(fn, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, meth + ': argument ' + fn + ' is not a function');
return { context: context, fn: fn, args: args };
}
function call(fn) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return effect(CALL, getFnCallDesc('call', fn, args));
}
function apply(context, fn) {
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
return effect(CALL, getFnCallDesc('apply', { context: context, fn: fn }, args));
}
function cps(fn) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return effect(CPS, getFnCallDesc('cps', fn, args));
}
function fork(fn) {
for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = arguments[_key3];
}
return effect(FORK, getFnCallDesc('fork', fn, args));
}
function spawn(fn) {
for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
args[_key4 - 1] = arguments[_key4];
}
var eff = fork.apply(undefined, [fn].concat(args));
eff[FORK].detached = true;
return eff;
}
function join() {
for (var _len5 = arguments.length, tasks = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
tasks[_key5] = arguments[_key5];
}
if (tasks.length > 1) {
return all(tasks.map(function (t) {
return join(t);
}));
}
var task = tasks[0];
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(task, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'join(task): argument task is undefined');
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(task, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].task, 'join(task): argument ' + task + ' is not a valid Task object ' + TEST_HINT);
return effect(JOIN, task);
}
function cancel() {
for (var _len6 = arguments.length, tasks = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
tasks[_key6] = arguments[_key6];
}
if (tasks.length > 1) {
return all(tasks.map(function (t) {
return cancel(t);
}));
}
var task = tasks[0];
if (tasks.length === 1) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(task, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'cancel(task): argument task is undefined');
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(task, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].task, 'cancel(task): argument ' + task + ' is not a valid Task object ' + TEST_HINT);
}
return effect(CANCEL, task || __WEBPACK_IMPORTED_MODULE_0__utils__["f" /* SELF_CANCELLATION */]);
}
function select(selector) {
for (var _len7 = arguments.length, args = Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
args[_key7 - 1] = arguments[_key7];
}
if (arguments.length === 0) {
selector = __WEBPACK_IMPORTED_MODULE_0__utils__["g" /* ident */];
} else {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(selector, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'select(selector,[...]): argument selector is undefined');
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(selector, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, 'select(selector,[...]): argument ' + selector + ' is not a function');
}
return effect(SELECT, { selector: selector, args: args });
}
/**
channel(pattern, [buffer]) => creates an event channel for store actions
**/
function actionChannel(pattern, buffer) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(pattern, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'actionChannel(pattern,...): argument pattern is undefined');
if (arguments.length > 1) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(buffer, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].buffer, 'actionChannel(pattern, buffer): argument ' + buffer + ' is not a valid buffer');
}
return effect(ACTION_CHANNEL, { pattern: pattern, buffer: buffer });
}
function cancelled() {
return effect(CANCELLED, {});
}
function flush(channel) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(channel, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].channel, 'flush(channel): argument ' + channel + ' is not valid channel');
return effect(FLUSH, channel);
}
function getContext(prop) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(prop, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].string, 'getContext(prop): argument ' + prop + ' is not a string');
return effect(GET_CONTEXT, prop);
}
function setContext(props) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(props, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].object, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* createSetContextWarning */])(null, props));
return effect(SET_CONTEXT, props);
}
function takeEvery(patternOrChannel, worker) {
for (var _len8 = arguments.length, args = Array(_len8 > 2 ? _len8 - 2 : 0), _key8 = 2; _key8 < _len8; _key8++) {
args[_key8 - 2] = arguments[_key8];
}
return fork.apply(undefined, [__WEBPACK_IMPORTED_MODULE_1__sagaHelpers__["a" /* takeEveryHelper */], patternOrChannel, worker].concat(args));
}
function takeLatest(patternOrChannel, worker) {
for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) {
args[_key9 - 2] = arguments[_key9];
}
return fork.apply(undefined, [__WEBPACK_IMPORTED_MODULE_1__sagaHelpers__["b" /* takeLatestHelper */], patternOrChannel, worker].concat(args));
}
function throttle(ms, pattern, worker) {
for (var _len10 = arguments.length, args = Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) {
args[_key10 - 3] = arguments[_key10];
}
return fork.apply(undefined, [__WEBPACK_IMPORTED_MODULE_1__sagaHelpers__["c" /* throttleHelper */], ms, pattern, worker].concat(args));
}
var createAsEffectType = function createAsEffectType(type) {
return function (effect) {
return effect && effect[IO] && effect[type];
};
};
var asEffect = {
take: createAsEffectType(TAKE),
put: createAsEffectType(PUT),
all: createAsEffectType(ALL),
race: createAsEffectType(RACE),
call: createAsEffectType(CALL),
cps: createAsEffectType(CPS),
fork: createAsEffectType(FORK),
join: createAsEffectType(JOIN),
cancel: createAsEffectType(CANCEL),
select: createAsEffectType(SELECT),
actionChannel: createAsEffectType(ACTION_CHANNEL),
cancelled: createAsEffectType(CANCELLED),
flush: createAsEffectType(FLUSH),
getContext: createAsEffectType(GET_CONTEXT),
setContext: createAsEffectType(SET_CONTEXT)
};
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/middleware.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = sagaMiddlewareFactory;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__channel__ = __webpack_require__("./node_modules/redux-saga/es/internal/channel.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__runSaga__ = __webpack_require__("./node_modules/redux-saga/es/internal/runSaga.js");
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function sagaMiddlewareFactory() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref$context = _ref.context,
context = _ref$context === undefined ? {} : _ref$context,
options = _objectWithoutProperties(_ref, ['context']);
var sagaMonitor = options.sagaMonitor,
logger = options.logger,
onError = options.onError;
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(options)) {
if (process.env.NODE_ENV === 'production') {
throw new Error('Saga middleware no longer accept Generator functions. Use sagaMiddleware.run instead');
} else {
throw new Error('You passed a function to the Saga middleware. You are likely trying to start a Saga by directly passing it to the middleware. This is no longer possible starting from 0.10.0. To run a Saga, you must do it dynamically AFTER mounting the middleware into the store.\n Example:\n import createSagaMiddleware from \'redux-saga\'\n ... other imports\n\n const sagaMiddleware = createSagaMiddleware()\n const store = createStore(reducer, applyMiddleware(sagaMiddleware))\n sagaMiddleware.run(saga, ...args)\n ');
}
}
if (logger && !__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(logger)) {
throw new Error('`options.logger` passed to the Saga middleware is not a function!');
}
if (process.env.NODE_ENV === 'development' && options.onerror) {
throw new Error('`options.onerror` was removed. Use `options.onError` instead.');
}
if (onError && !__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(onError)) {
throw new Error('`options.onError` passed to the Saga middleware is not a function!');
}
if (options.emitter && !__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(options.emitter)) {
throw new Error('`options.emitter` passed to the Saga middleware is not a function!');
}
function sagaMiddleware(_ref2) {
var getState = _ref2.getState,
dispatch = _ref2.dispatch;
var sagaEmitter = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__channel__["f" /* emitter */])();
sagaEmitter.emit = (options.emitter || __WEBPACK_IMPORTED_MODULE_0__utils__["g" /* ident */])(sagaEmitter.emit);
sagaMiddleware.run = __WEBPACK_IMPORTED_MODULE_2__runSaga__["a" /* runSaga */].bind(null, {
subscribe: sagaEmitter.subscribe,
dispatch: dispatch,
getState: getState,
sagaMonitor: sagaMonitor,
logger: logger,
onError: onError
});
return function (next) {
return function (action) {
if (sagaMonitor && sagaMonitor.actionDispatched) {
sagaMonitor.actionDispatched(action);
}
var result = next(action); // hit reducers
sagaEmitter.emit(action);
return result;
};
};
}
sagaMiddleware.run = function () {
throw new Error('Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware');
};
sagaMiddleware.setContext = function (props) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(props, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].object, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* createSetContextWarning */])('sagaMiddleware', props));
__WEBPACK_IMPORTED_MODULE_0__utils__["z" /* object */].assign(context, props);
};
return sagaMiddleware;
}
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/proc.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export NOT_ITERATOR_ERROR */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CHANNEL_END; });
/* unused harmony export TASK_CANCEL */
/* harmony export (immutable) */ __webpack_exports__["b"] = proc;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler__ = __webpack_require__("./node_modules/redux-saga/es/internal/scheduler.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__io__ = __webpack_require__("./node_modules/redux-saga/es/internal/io.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__channel__ = __webpack_require__("./node_modules/redux-saga/es/internal/channel.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__buffers__ = __webpack_require__("./node_modules/redux-saga/es/internal/buffers.js");
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; };
function _defineEnumerableProperties(obj, descs) { for (var key in descs) { var desc = descs[key]; desc.configurable = desc.enumerable = true; if ("value" in desc) desc.writable = true; Object.defineProperty(obj, key, desc); } return obj; }
var NOT_ITERATOR_ERROR = 'proc first argument (Saga function result) must be an iterator';
var CHANNEL_END = {
toString: function toString() {
return '@@redux-saga/CHANNEL_END';
}
};
var TASK_CANCEL = {
toString: function toString() {
return '@@redux-saga/TASK_CANCEL';
}
};
var matchers = {
wildcard: function wildcard() {
return __WEBPACK_IMPORTED_MODULE_0__utils__["k" /* kTrue */];
},
default: function _default(pattern) {
return function (input) {
return input.type === ((typeof pattern === 'undefined' ? 'undefined' : _typeof(pattern)) === 'symbol' ? pattern : String(pattern));
};
},
array: function array(patterns) {
return function (input) {
return patterns.some(function (p) {
return matcher(p)(input);
});
};
},
predicate: function predicate(_predicate) {
return function (input) {
return _predicate(input);
};
}
};
function matcher(pattern) {
return (pattern === '*' ? matchers.wildcard : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].array(pattern) ? matchers.array : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].stringableFunc(pattern) ? matchers.default : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(pattern) ? matchers.predicate : matchers.default)(pattern);
}
/**
Used to track a parent task and its forks
In the new fork model, forked tasks are attached by default to their parent
We model this using the concept of Parent task && main Task
main task is the main flow of the current Generator, the parent tasks is the
aggregation of the main tasks + all its forked tasks.
Thus the whole model represents an execution tree with multiple branches (vs the
linear execution tree in sequential (non parallel) programming)
A parent tasks has the following semantics
- It completes if all its forks either complete or all cancelled
- If it's cancelled, all forks are cancelled as well
- It aborts if any uncaught error bubbles up from forks
- If it completes, the return value is the one returned by the main task
**/
function forkQueue(name, mainTask, cb) {
var tasks = [],
result = void 0,
completed = false;
addTask(mainTask);
function abort(err) {
cancelAll();
cb(err, true);
}
function addTask(task) {
tasks.push(task);
task.cont = function (res, isErr) {
if (completed) {
return;
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["m" /* remove */])(tasks, task);
task.cont = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
if (isErr) {
abort(res);
} else {
if (task === mainTask) {
result = res;
}
if (!tasks.length) {
completed = true;
cb(result);
}
}
};
// task.cont.cancel = task.cancel
}
function cancelAll() {
if (completed) {
return;
}
completed = true;
tasks.forEach(function (t) {
t.cont = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
t.cancel();
});
tasks = [];
}
return {
addTask: addTask,
cancelAll: cancelAll,
abort: abort,
getTasks: function getTasks() {
return tasks;
},
taskNames: function taskNames() {
return tasks.map(function (t) {
return t.name;
});
}
};
}
function createTaskIterator(_ref) {
var context = _ref.context,
fn = _ref.fn,
args = _ref.args;
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator(fn)) {
return fn;
}
// catch synchronous failures; see #152 and #441
var result = void 0,
error = void 0;
try {
result = fn.apply(context, args);
} catch (err) {
error = err;
}
// i.e. a generator function returns an iterator
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator(result)) {
return result;
}
// do not bubble up synchronous failures for detached forks
// instead create a failed task. See #152 and #441
return error ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["i" /* makeIterator */])(function () {
throw error;
}) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["i" /* makeIterator */])(function () {
var pc = void 0;
var eff = { done: false, value: result };
var ret = function ret(value) {
return { done: true, value: value };
};
return function (arg) {
if (!pc) {
pc = true;
return eff;
} else {
return ret(arg);
}
};
}());
}
var wrapHelper = function wrapHelper(helper) {
return { fn: helper };
};
function proc(iterator) {
var subscribe = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
return __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
};
var dispatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
var getState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
var parentContext = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
var parentEffectId = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
var name = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'anonymous';
var cont = arguments[8];
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(iterator, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator, NOT_ITERATOR_ERROR);
var effectsString = '[...effects]';
var runParallelEffect = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["d" /* deprecate */])(runAllEffect, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["e" /* updateIncentive */])(effectsString, 'all(' + effectsString + ')'));
var sagaMonitor = options.sagaMonitor,
logger = options.logger,
onError = options.onError;
var log = logger || __WEBPACK_IMPORTED_MODULE_0__utils__["w" /* log */];
var stdChannel = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__channel__["d" /* stdChannel */])(subscribe);
var taskContext = Object.create(parentContext);
/**
Tracks the current effect cancellation
Each time the generator progresses. calling runEffect will set a new value
on it. It allows propagating cancellation to child effects
**/
next.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
/**
Creates a new task descriptor for this generator, We'll also create a main task
to track the main flow (besides other forked tasks)
**/
var task = newTask(parentEffectId, name, iterator, cont);
var mainTask = { name: name, cancel: cancelMain, isRunning: true };
var taskQueue = forkQueue(name, mainTask, end);
/**
cancellation of the main task. We'll simply resume the Generator with a Cancel
**/
function cancelMain() {
if (mainTask.isRunning && !mainTask.isCancelled) {
mainTask.isCancelled = true;
next(TASK_CANCEL);
}
}
/**
This may be called by a parent generator to trigger/propagate cancellation
cancel all pending tasks (including the main task), then end the current task.
Cancellation propagates down to the whole execution tree holded by this Parent task
It's also propagated to all joiners of this task and their execution tree/joiners
Cancellation is noop for terminated/Cancelled tasks tasks
**/
function cancel() {
/**
We need to check both Running and Cancelled status
Tasks can be Cancelled but still Running
**/
if (iterator._isRunning && !iterator._isCancelled) {
iterator._isCancelled = true;
taskQueue.cancelAll();
/**
Ending with a Never result will propagate the Cancellation to all joiners
**/
end(TASK_CANCEL);
}
}
/**
attaches cancellation logic to this task's continuation
this will permit cancellation to propagate down the call chain
**/
cont && (cont.cancel = cancel);
// tracks the running status
iterator._isRunning = true;
// kicks up the generator
next();
// then return the task descriptor to the caller
return task;
/**
This is the generator driver
It's a recursive async/continuation function which calls itself
until the generator terminates or throws
**/
function next(arg, isErr) {
// Preventive measure. If we end up here, then there is really something wrong
if (!mainTask.isRunning) {
throw new Error('Trying to resume an already finished generator');
}
try {
var result = void 0;
if (isErr) {
result = iterator.throw(arg);
} else if (arg === TASK_CANCEL) {
/**
getting TASK_CANCEL automatically cancels the main task
We can get this value here
- By cancelling the parent task manually
- By joining a Cancelled task
**/
mainTask.isCancelled = true;
/**
Cancels the current effect; this will propagate the cancellation down to any called tasks
**/
next.cancel();
/**
If this Generator has a `return` method then invokes it
This will jump to the finally block
**/
result = __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(iterator.return) ? iterator.return(TASK_CANCEL) : { done: true, value: TASK_CANCEL };
} else if (arg === CHANNEL_END) {
// We get CHANNEL_END by taking from a channel that ended using `take` (and not `takem` used to trap End of channels)
result = __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func(iterator.return) ? iterator.return() : { done: true };
} else {
result = iterator.next(arg);
}
if (!result.done) {
runEffect(result.value, parentEffectId, '', next);
} else {
/**
This Generator has ended, terminate the main task and notify the fork queue
**/
mainTask.isMainRunning = false;
mainTask.cont && mainTask.cont(result.value);
}
} catch (error) {
if (mainTask.isCancelled) {
log('error', 'uncaught at ' + name, error.message);
}
mainTask.isMainRunning = false;
mainTask.cont(error, true);
}
}
function end(result, isErr) {
iterator._isRunning = false;
stdChannel.close();
if (!isErr) {
if (process.env.NODE_ENV === 'development' && result === TASK_CANCEL) {
log('info', name + ' has been cancelled', '');
}
iterator._result = result;
iterator._deferredEnd && iterator._deferredEnd.resolve(result);
} else {
if (result instanceof Error) {
result.sagaStack = 'at ' + name + ' \n ' + (result.sagaStack || result.stack);
}
if (!task.cont) {
log('error', 'uncaught', result.sagaStack || result.stack);
if (result instanceof Error && onError) {
onError(result);
}
}
iterator._error = result;
iterator._isAborted = true;
iterator._deferredEnd && iterator._deferredEnd.reject(result);
}
task.cont && task.cont(result, isErr);
task.joiners.forEach(function (j) {
return j.cb(result, isErr);
});
task.joiners = null;
}
function runEffect(effect, parentEffectId) {
var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var cb = arguments[3];
var effectId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["x" /* uid */])();
sagaMonitor && sagaMonitor.effectTriggered({ effectId: effectId, parentEffectId: parentEffectId, label: label, effect: effect });
/**
completion callback and cancel callback are mutually exclusive
We can't cancel an already completed effect
And We can't complete an already cancelled effectId
**/
var effectSettled = void 0;
// Completion callback passed to the appropriate effect runner
function currCb(res, isErr) {
if (effectSettled) {
return;
}
effectSettled = true;
cb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */]; // defensive measure
if (sagaMonitor) {
isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);
}
cb(res, isErr);
}
// tracks down the current cancel
currCb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
// setup cancellation logic on the parent cb
cb.cancel = function () {
// prevents cancelling an already completed effect
if (effectSettled) {
return;
}
effectSettled = true;
/**
propagates cancel downward
catch uncaught cancellations errors; since we can no longer call the completion
callback, log errors raised during cancellations into the console
**/
try {
currCb.cancel();
} catch (err) {
log('error', 'uncaught at ' + name, err.message);
}
currCb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */]; // defensive measure
sagaMonitor && sagaMonitor.effectCancelled(effectId);
};
/**
each effect runner must attach its own logic of cancellation to the provided callback
it allows this generator to propagate cancellation downward.
ATTENTION! effect runners must setup the cancel logic by setting cb.cancel = [cancelMethod]
And the setup must occur before calling the callback
This is a sort of inversion of control: called async functions are responsible
for completing the flow by calling the provided continuation; while caller functions
are responsible for aborting the current flow by calling the attached cancel function
Library users can attach their own cancellation logic to promises by defining a
promise[CANCEL] method in their returned promises
ATTENTION! calling cancel must have no effect on an already completed or cancelled effect
**/
var data = void 0;
return (
// Non declarative effect
__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].promise(effect) ? resolvePromise(effect, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].helper(effect) ? runForkEffect(wrapHelper(effect), effectId, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator(effect) ? resolveIterator(effect, effectId, name, currCb)
// declarative effects
: __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].array(effect) ? runParallelEffect(effect, effectId, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].take(effect)) ? runTakeEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].put(effect)) ? runPutEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].all(effect)) ? runAllEffect(data, effectId, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].race(effect)) ? runRaceEffect(data, effectId, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].call(effect)) ? runCallEffect(data, effectId, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].cps(effect)) ? runCPSEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].fork(effect)) ? runForkEffect(data, effectId, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].join(effect)) ? runJoinEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].cancel(effect)) ? runCancelEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].select(effect)) ? runSelectEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].actionChannel(effect)) ? runChannelEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].flush(effect)) ? runFlushEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].cancelled(effect)) ? runCancelledEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].getContext(effect)) ? runGetContextEffect(data, currCb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].notUndef(data = __WEBPACK_IMPORTED_MODULE_2__io__["v" /* asEffect */].setContext(effect)) ? runSetContextEffect(data, currCb) : /* anything else returned as is */currCb(effect)
);
}
function resolvePromise(promise, cb) {
var cancelPromise = promise[__WEBPACK_IMPORTED_MODULE_0__utils__["q" /* CANCEL */]];
if (typeof cancelPromise === 'function') {
cb.cancel = cancelPromise;
}
promise.then(cb, function (error) {
return cb(error, true);
});
}
function resolveIterator(iterator, effectId, name, cb) {
proc(iterator, subscribe, dispatch, getState, taskContext, options, effectId, name, cb);
}
function runTakeEffect(_ref2, cb) {
var channel = _ref2.channel,
pattern = _ref2.pattern,
maybe = _ref2.maybe;
channel = channel || stdChannel;
var takeCb = function takeCb(inp) {
return inp instanceof Error ? cb(inp, true) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__channel__["e" /* isEnd */])(inp) && !maybe ? cb(CHANNEL_END) : cb(inp);
};
try {
channel.take(takeCb, matcher(pattern));
} catch (err) {
return cb(err, true);
}
cb.cancel = takeCb.cancel;
}
function runPutEffect(_ref3, cb) {
var channel = _ref3.channel,
action = _ref3.action,
resolve = _ref3.resolve;
/**
Schedule the put in case another saga is holding a lock.
The put will be executed atomically. ie nested puts will execute after
this put has terminated.
**/
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__scheduler__["a" /* asap */])(function () {
var result = void 0;
try {
result = (channel ? channel.put : dispatch)(action);
} catch (error) {
// If we have a channel or `put.resolve` was used then bubble up the error.
if (channel || resolve) return cb(error, true);
log('error', 'uncaught at ' + name, error.stack || error.message || error);
}
if (resolve && __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].promise(result)) {
resolvePromise(result, cb);
} else {
return cb(result);
}
});
// Put effects are non cancellables
}
function runCallEffect(_ref4, effectId, cb) {
var context = _ref4.context,
fn = _ref4.fn,
args = _ref4.args;
var result = void 0;
// catch synchronous failures; see #152
try {
result = fn.apply(context, args);
} catch (error) {
return cb(error, true);
}
return __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].promise(result) ? resolvePromise(result, cb) : __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator(result) ? resolveIterator(result, effectId, fn.name, cb) : cb(result);
}
function runCPSEffect(_ref5, cb) {
var context = _ref5.context,
fn = _ref5.fn,
args = _ref5.args;
// CPS (ie node style functions) can define their own cancellation logic
// by setting cancel field on the cb
// catch synchronous failures; see #152
try {
var cpsCb = function cpsCb(err, res) {
return __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].undef(err) ? cb(res) : cb(err, true);
};
fn.apply(context, args.concat(cpsCb));
if (cpsCb.cancel) {
cb.cancel = function () {
return cpsCb.cancel();
};
}
} catch (error) {
return cb(error, true);
}
}
function runForkEffect(_ref6, effectId, cb) {
var context = _ref6.context,
fn = _ref6.fn,
args = _ref6.args,
detached = _ref6.detached;
var taskIterator = createTaskIterator({ context: context, fn: fn, args: args });
try {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__scheduler__["b" /* suspend */])();
var _task = proc(taskIterator, subscribe, dispatch, getState, taskContext, options, effectId, fn.name, detached ? null : __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */]);
if (detached) {
cb(_task);
} else {
if (taskIterator._isRunning) {
taskQueue.addTask(_task);
cb(_task);
} else if (taskIterator._error) {
taskQueue.abort(taskIterator._error);
} else {
cb(_task);
}
}
} finally {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__scheduler__["c" /* flush */])();
}
// Fork effects are non cancellables
}
function runJoinEffect(t, cb) {
if (t.isRunning()) {
var joiner = { task: task, cb: cb };
cb.cancel = function () {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["m" /* remove */])(t.joiners, joiner);
};
t.joiners.push(joiner);
} else {
t.isAborted() ? cb(t.error(), true) : cb(t.result());
}
}
function runCancelEffect(taskToCancel, cb) {
if (taskToCancel === __WEBPACK_IMPORTED_MODULE_0__utils__["f" /* SELF_CANCELLATION */]) {
taskToCancel = task;
}
if (taskToCancel.isRunning()) {
taskToCancel.cancel();
}
cb();
// cancel effects are non cancellables
}
function runAllEffect(effects, effectId, cb) {
var keys = Object.keys(effects);
if (!keys.length) {
return cb(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].array(effects) ? [] : {});
}
var completedCount = 0;
var completed = void 0;
var results = {};
var childCbs = {};
function checkEffectEnd() {
if (completedCount === keys.length) {
completed = true;
cb(__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].array(effects) ? __WEBPACK_IMPORTED_MODULE_0__utils__["y" /* array */].from(_extends({}, results, { length: keys.length })) : results);
}
}
keys.forEach(function (key) {
var chCbAtKey = function chCbAtKey(res, isErr) {
if (completed) {
return;
}
if (isErr || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__channel__["e" /* isEnd */])(res) || res === CHANNEL_END || res === TASK_CANCEL) {
cb.cancel();
cb(res, isErr);
} else {
results[key] = res;
completedCount++;
checkEffectEnd();
}
};
chCbAtKey.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
childCbs[key] = chCbAtKey;
});
cb.cancel = function () {
if (!completed) {
completed = true;
keys.forEach(function (key) {
return childCbs[key].cancel();
});
}
};
keys.forEach(function (key) {
return runEffect(effects[key], effectId, key, childCbs[key]);
});
}
function runRaceEffect(effects, effectId, cb) {
var completed = void 0;
var keys = Object.keys(effects);
var childCbs = {};
keys.forEach(function (key) {
var chCbAtKey = function chCbAtKey(res, isErr) {
if (completed) {
return;
}
if (isErr) {
// Race Auto cancellation
cb.cancel();
cb(res, true);
} else if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__channel__["e" /* isEnd */])(res) && res !== CHANNEL_END && res !== TASK_CANCEL) {
var _cb;
cb.cancel();
completed = true;
cb((_cb = {}, _cb[key] = res, _cb));
}
};
chCbAtKey.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
childCbs[key] = chCbAtKey;
});
cb.cancel = function () {
// prevents unnecessary cancellation
if (!completed) {
completed = true;
keys.forEach(function (key) {
return childCbs[key].cancel();
});
}
};
keys.forEach(function (key) {
if (completed) {
return;
}
runEffect(effects[key], effectId, key, childCbs[key]);
});
}
function runSelectEffect(_ref7, cb) {
var selector = _ref7.selector,
args = _ref7.args;
try {
var state = selector.apply(undefined, [getState()].concat(args));
cb(state);
} catch (error) {
cb(error, true);
}
}
function runChannelEffect(_ref8, cb) {
var pattern = _ref8.pattern,
buffer = _ref8.buffer;
var match = matcher(pattern);
match.pattern = pattern;
cb(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__channel__["b" /* eventChannel */])(subscribe, buffer || __WEBPACK_IMPORTED_MODULE_4__buffers__["a" /* buffers */].fixed(), match));
}
function runCancelledEffect(data, cb) {
cb(!!mainTask.isCancelled);
}
function runFlushEffect(channel, cb) {
channel.flush(cb);
}
function runGetContextEffect(prop, cb) {
cb(taskContext[prop]);
}
function runSetContextEffect(props, cb) {
__WEBPACK_IMPORTED_MODULE_0__utils__["z" /* object */].assign(taskContext, props);
cb();
}
function newTask(id, name, iterator, cont) {
var _done, _ref9, _mutatorMap;
iterator._deferredEnd = null;
return _ref9 = {}, _ref9[__WEBPACK_IMPORTED_MODULE_0__utils__["r" /* TASK */]] = true, _ref9.id = id, _ref9.name = name, _done = 'done', _mutatorMap = {}, _mutatorMap[_done] = _mutatorMap[_done] || {}, _mutatorMap[_done].get = function () {
if (iterator._deferredEnd) {
return iterator._deferredEnd.promise;
} else {
var def = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["s" /* deferred */])();
iterator._deferredEnd = def;
if (!iterator._isRunning) {
iterator._error ? def.reject(iterator._error) : def.resolve(iterator._result);
}
return def.promise;
}
}, _ref9.cont = cont, _ref9.joiners = [], _ref9.cancel = cancel, _ref9.isRunning = function isRunning() {
return iterator._isRunning;
}, _ref9.isCancelled = function isCancelled() {
return iterator._isCancelled;
}, _ref9.isAborted = function isAborted() {
return iterator._isAborted;
}, _ref9.result = function result() {
return iterator._result;
}, _ref9.error = function error() {
return iterator._error;
}, _ref9.setContext = function setContext(props) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(props, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].object, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["h" /* createSetContextWarning */])('task', props));
__WEBPACK_IMPORTED_MODULE_0__utils__["z" /* object */].assign(taskContext, props);
}, _defineEnumerableProperties(_ref9, _mutatorMap), _ref9;
}
}
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/runSaga.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = runSaga;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__proc__ = __webpack_require__("./node_modules/redux-saga/es/internal/proc.js");
var RUN_SAGA_SIGNATURE = 'runSaga(storeInterface, saga, ...args)';
var NON_GENERATOR_ERR = RUN_SAGA_SIGNATURE + ': saga argument must be a Generator function!';
function runSaga(storeInterface, saga) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
var iterator = void 0;
if (__WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator(storeInterface)) {
if (process.env.NODE_ENV === 'development') {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["w" /* log */])('warn', 'runSaga(iterator, storeInterface) has been deprecated in favor of ' + RUN_SAGA_SIGNATURE);
}
iterator = storeInterface;
storeInterface = saga;
} else {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(saga, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].func, NON_GENERATOR_ERR);
iterator = saga.apply(undefined, args);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["b" /* check */])(iterator, __WEBPACK_IMPORTED_MODULE_0__utils__["c" /* is */].iterator, NON_GENERATOR_ERR);
}
var _storeInterface = storeInterface,
subscribe = _storeInterface.subscribe,
dispatch = _storeInterface.dispatch,
getState = _storeInterface.getState,
context = _storeInterface.context,
sagaMonitor = _storeInterface.sagaMonitor,
logger = _storeInterface.logger,
onError = _storeInterface.onError;
var effectId = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["x" /* uid */])();
if (sagaMonitor) {
// monitors are expected to have a certain interface, let's fill-in any missing ones
sagaMonitor.effectTriggered = sagaMonitor.effectTriggered || __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
sagaMonitor.effectResolved = sagaMonitor.effectResolved || __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
sagaMonitor.effectRejected = sagaMonitor.effectRejected || __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
sagaMonitor.effectCancelled = sagaMonitor.effectCancelled || __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
sagaMonitor.actionDispatched = sagaMonitor.actionDispatched || __WEBPACK_IMPORTED_MODULE_0__utils__["l" /* noop */];
sagaMonitor.effectTriggered({ effectId: effectId, root: true, parentEffectId: 0, effect: { root: true, saga: saga, args: args } });
}
var task = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__proc__["b" /* default */])(iterator, subscribe, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["A" /* wrapSagaDispatch */])(dispatch), getState, context, { sagaMonitor: sagaMonitor, logger: logger, onError: onError }, effectId, saga.name);
if (sagaMonitor) {
sagaMonitor.effectResolved(effectId, task);
}
return task;
}
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/sagaHelpers.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = takeEveryHelper;
/* harmony export (immutable) */ __webpack_exports__["b"] = takeLatestHelper;
/* harmony export (immutable) */ __webpack_exports__["c"] = throttleHelper;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return takeEvery; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return takeLatest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return throttle; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__channel__ = __webpack_require__("./node_modules/redux-saga/es/internal/channel.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__io__ = __webpack_require__("./node_modules/redux-saga/es/internal/io.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__buffers__ = __webpack_require__("./node_modules/redux-saga/es/internal/buffers.js");
var done = { done: true, value: undefined };
var qEnd = {};
function fsmIterator(fsm, q0) {
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'iterator';
var updateState = void 0,
qNext = q0;
function next(arg, error) {
if (qNext === qEnd) {
return done;
}
if (error) {
qNext = qEnd;
throw error;
} else {
updateState && updateState(arg);
var _fsm$qNext = fsm[qNext](),
q = _fsm$qNext[0],
output = _fsm$qNext[1],
_updateState = _fsm$qNext[2];
qNext = q;
updateState = _updateState;
return qNext === qEnd ? done : output;
}
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["i" /* makeIterator */])(next, function (error) {
return next(null, error);
}, name, true);
}
function safeName(patternOrChannel) {
if (__WEBPACK_IMPORTED_MODULE_1__utils__["c" /* is */].channel(patternOrChannel)) {
return 'channel';
} else if (Array.isArray(patternOrChannel)) {
return String(patternOrChannel.map(function (entry) {
return String(entry);
}));
} else {
return String(patternOrChannel);
}
}
function takeEveryHelper(patternOrChannel, worker) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
var yTake = { done: false, value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__io__["a" /* take */])(patternOrChannel) };
var yFork = function yFork(ac) {
return { done: false, value: __WEBPACK_IMPORTED_MODULE_2__io__["i" /* fork */].apply(undefined, [worker].concat(args, [ac])) };
};
var action = void 0,
setAction = function setAction(ac) {
return action = ac;
};
return fsmIterator({
q1: function q1() {
return ['q2', yTake, setAction];
},
q2: function q2() {
return action === __WEBPACK_IMPORTED_MODULE_0__channel__["a" /* END */] ? [qEnd] : ['q1', yFork(action)];
}
}, 'q1', 'takeEvery(' + safeName(patternOrChannel) + ', ' + worker.name + ')');
}
function takeLatestHelper(patternOrChannel, worker) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
var yTake = { done: false, value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__io__["a" /* take */])(patternOrChannel) };
var yFork = function yFork(ac) {
return { done: false, value: __WEBPACK_IMPORTED_MODULE_2__io__["i" /* fork */].apply(undefined, [worker].concat(args, [ac])) };
};
var yCancel = function yCancel(task) {
return { done: false, value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__io__["l" /* cancel */])(task) };
};
var task = void 0,
action = void 0;
var setTask = function setTask(t) {
return task = t;
};
var setAction = function setAction(ac) {
return action = ac;
};
return fsmIterator({
q1: function q1() {
return ['q2', yTake, setAction];
},
q2: function q2() {
return action === __WEBPACK_IMPORTED_MODULE_0__channel__["a" /* END */] ? [qEnd] : task ? ['q3', yCancel(task)] : ['q1', yFork(action), setTask];
},
q3: function q3() {
return ['q1', yFork(action), setTask];
}
}, 'q1', 'takeLatest(' + safeName(patternOrChannel) + ', ' + worker.name + ')');
}
function throttleHelper(delayLength, pattern, worker) {
for (var _len3 = arguments.length, args = Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
args[_key3 - 3] = arguments[_key3];
}
var action = void 0,
channel = void 0;
var yActionChannel = { done: false, value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__io__["n" /* actionChannel */])(pattern, __WEBPACK_IMPORTED_MODULE_3__buffers__["a" /* buffers */].sliding(1)) };
var yTake = function yTake() {
return { done: false, value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__io__["a" /* take */])(channel) };
};
var yFork = function yFork(ac) {
return { done: false, value: __WEBPACK_IMPORTED_MODULE_2__io__["i" /* fork */].apply(undefined, [worker].concat(args, [ac])) };
};
var yDelay = { done: false, value: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__io__["f" /* call */])(__WEBPACK_IMPORTED_MODULE_1__utils__["j" /* delay */], delayLength) };
var setAction = function setAction(ac) {
return action = ac;
};
var setChannel = function setChannel(ch) {
return channel = ch;
};
return fsmIterator({
q1: function q1() {
return ['q2', yActionChannel, setChannel];
},
q2: function q2() {
return ['q3', yTake(), setAction];
},
q3: function q3() {
return action === __WEBPACK_IMPORTED_MODULE_0__channel__["a" /* END */] ? [qEnd] : ['q4', yFork(action)];
},
q4: function q4() {
return ['q2', yDelay];
}
}, 'q1', 'throttle(' + safeName(pattern) + ', ' + worker.name + ')');
}
var deprecationWarning = function deprecationWarning(helperName) {
return 'import ' + helperName + ' from \'redux-saga\' has been deprecated in favor of import ' + helperName + ' from \'redux-saga/effects\'.\nThe latter will not work with yield*, as helper effects are wrapped automatically for you in fork effect.\nTherefore yield ' + helperName + ' will return task descriptor to your saga and execute next lines of code.';
};
var takeEvery = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["d" /* deprecate */])(takeEveryHelper, deprecationWarning('takeEvery'));
var takeLatest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["d" /* deprecate */])(takeLatestHelper, deprecationWarning('takeLatest'));
var throttle = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["d" /* deprecate */])(throttleHelper, deprecationWarning('throttle'));
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/scheduler.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = asap;
/* harmony export (immutable) */ __webpack_exports__["b"] = suspend;
/* harmony export (immutable) */ __webpack_exports__["c"] = flush;
var queue = [];
/**
Variable to hold a counting semaphore
- Incrementing adds a lock and puts the scheduler in a `suspended` state (if it's not
already suspended)
- Decrementing releases a lock. Zero locks puts the scheduler in a `released` state. This
triggers flushing the queued tasks.
**/
var semaphore = 0;
/**
Executes a task 'atomically'. Tasks scheduled during this execution will be queued
and flushed after this task has finished (assuming the scheduler endup in a released
state).
**/
function exec(task) {
try {
suspend();
task();
} finally {
release();
}
}
/**
Executes or queues a task depending on the state of the scheduler (`suspended` or `released`)
**/
function asap(task) {
queue.push(task);
if (!semaphore) {
suspend();
flush();
}
}
/**
Puts the scheduler in a `suspended` state. Scheduled tasks will be queued until the
scheduler is released.
**/
function suspend() {
semaphore++;
}
/**
Puts the scheduler in a `released` state.
**/
function release() {
semaphore--;
}
/**
Releases the current lock. Executes all queued tasks if the scheduler is in the released state.
**/
function flush() {
release();
var task = void 0;
while (!semaphore && (task = queue.shift()) !== undefined) {
exec(task);
}
}
/***/ }),
/***/ "./node_modules/redux-saga/es/internal/utils.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return sym; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return TASK; });
/* unused harmony export HELPER */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return MATCH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return CANCEL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return SAGA_ACTION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return SELF_CANCELLATION; });
/* unused harmony export konst */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return kTrue; });
/* unused harmony export kFalse */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return noop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ident; });
/* harmony export (immutable) */ __webpack_exports__["b"] = check;
/* unused harmony export hasOwn */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return is; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return object; });
/* harmony export (immutable) */ __webpack_exports__["m"] = remove;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return array; });
/* harmony export (immutable) */ __webpack_exports__["s"] = deferred;
/* harmony export (immutable) */ __webpack_exports__["t"] = arrayOfDeffered;
/* harmony export (immutable) */ __webpack_exports__["j"] = delay;
/* harmony export (immutable) */ __webpack_exports__["u"] = createMockTask;
/* unused harmony export autoInc */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return uid; });
/* harmony export (immutable) */ __webpack_exports__["i"] = makeIterator;
/* harmony export (immutable) */ __webpack_exports__["w"] = log;
/* harmony export (immutable) */ __webpack_exports__["d"] = deprecate;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return updateIncentive; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return internalErr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return createSetContextWarning; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return wrapSagaDispatch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return cloneableGenerator; });
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 sym = function sym(id) {
return '@@redux-saga/' + id;
};
var TASK = sym('TASK');
var HELPER = sym('HELPER');
var MATCH = sym('MATCH');
var CANCEL = sym('CANCEL_PROMISE');
var SAGA_ACTION = sym('SAGA_ACTION');
var SELF_CANCELLATION = sym('SELF_CANCELLATION');
var konst = function konst(v) {
return function () {
return v;
};
};
var kTrue = konst(true);
var kFalse = konst(false);
var noop = function noop() {};
var ident = function ident(v) {
return v;
};
function check(value, predicate, error) {
if (!predicate(value)) {
log('error', 'uncaught at check', error);
throw new Error(error);
}
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwn(object, property) {
return is.notUndef(object) && hasOwnProperty.call(object, property);
}
var is = {
undef: function undef(v) {
return v === null || v === undefined;
},
notUndef: function notUndef(v) {
return v !== null && v !== undefined;
},
func: function func(f) {
return typeof f === 'function';
},
number: function number(n) {
return typeof n === 'number';
},
string: function string(s) {
return typeof s === 'string';
},
array: Array.isArray,
object: function object(obj) {
return obj && !is.array(obj) && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object';
},
promise: function promise(p) {
return p && is.func(p.then);
},
iterator: function iterator(it) {
return it && is.func(it.next) && is.func(it.throw);
},
iterable: function iterable(it) {
return it && is.func(Symbol) ? is.func(it[Symbol.iterator]) : is.array(it);
},
task: function task(t) {
return t && t[TASK];
},
observable: function observable(ob) {
return ob && is.func(ob.subscribe);
},
buffer: function buffer(buf) {
return buf && is.func(buf.isEmpty) && is.func(buf.take) && is.func(buf.put);
},
pattern: function pattern(pat) {
return pat && (is.string(pat) || (typeof pat === 'undefined' ? 'undefined' : _typeof(pat)) === 'symbol' || is.func(pat) || is.array(pat));
},
channel: function channel(ch) {
return ch && is.func(ch.take) && is.func(ch.close);
},
helper: function helper(it) {
return it && it[HELPER];
},
stringableFunc: function stringableFunc(f) {
return is.func(f) && hasOwn(f, 'toString');
}
};
var object = {
assign: function assign(target, source) {
for (var i in source) {
if (hasOwn(source, i)) {
target[i] = source[i];
}
}
}
};
function remove(array, item) {
var index = array.indexOf(item);
if (index >= 0) {
array.splice(index, 1);
}
}
var array = {
'from': function from(obj) {
var arr = Array(obj.length);
for (var i in obj) {
if (hasOwn(obj, i)) {
arr[i] = obj[i];
}
}
return arr;
}
};
function deferred() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var def = _extends({}, props);
var promise = new Promise(function (resolve, reject) {
def.resolve = resolve;
def.reject = reject;
});
def.promise = promise;
return def;
}
function arrayOfDeffered(length) {
var arr = [];
for (var i = 0; i < length; i++) {
arr.push(deferred());
}
return arr;
}
function delay(ms) {
var val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var timeoutId = void 0;
var promise = new Promise(function (resolve) {
timeoutId = setTimeout(function () {
return resolve(val);
}, ms);
});
promise[CANCEL] = function () {
return clearTimeout(timeoutId);
};
return promise;
}
function createMockTask() {
var _ref;
var running = true;
var _result = void 0,
_error = void 0;
return _ref = {}, _ref[TASK] = true, _ref.isRunning = function isRunning() {
return running;
}, _ref.result = function result() {
return _result;
}, _ref.error = function error() {
return _error;
}, _ref.setRunning = function setRunning(b) {
return running = b;
}, _ref.setResult = function setResult(r) {
return _result = r;
}, _ref.setError = function setError(e) {
return _error = e;
}, _ref;
}
function autoInc() {
var seed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
return function () {
return ++seed;
};
}
var uid = autoInc();
var kThrow = function kThrow(err) {
throw err;
};
var kReturn = function kReturn(value) {
return { value: value, done: true };
};
function makeIterator(next) {
var thro = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : kThrow;
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var isHelper = arguments[3];
var iterator = { name: name, next: next, throw: thro, return: kReturn };
if (isHelper) {
iterator[HELPER] = true;
}
if (typeof Symbol !== 'undefined') {
iterator[Symbol.iterator] = function () {
return iterator;
};
}
return iterator;
}
/**
Print error in a useful way whether in a browser environment
(with expandable error stack traces), or in a node.js environment
(text-only log output)
**/
function log(level, message) {
var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
/*eslint-disable no-console*/
if (typeof window === 'undefined') {
console.log('redux-saga ' + level + ': ' + message + '\n' + (error && error.stack || error));
} else {
console[level](message, error);
}
}
function deprecate(fn, deprecationWarning) {
return function () {
if (process.env.NODE_ENV === 'development') log('warn', deprecationWarning);
return fn.apply(undefined, arguments);
};
}
var updateIncentive = function updateIncentive(deprecated, preferred) {
return deprecated + ' has been deprecated in favor of ' + preferred + ', please update your code';
};
var internalErr = function internalErr(err) {
return new Error('\n redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug\n in redux-saga code and not yours. Thanks for reporting this in the project\'s github repo.\n Error: ' + err + '\n');
};
var createSetContextWarning = function createSetContextWarning(ctx, props) {
return (ctx ? ctx + '.' : '') + 'setContext(props): argument ' + props + ' is not a plain object';
};
var wrapSagaDispatch = function wrapSagaDispatch(dispatch) {
return function (action) {
return dispatch(Object.defineProperty(action, SAGA_ACTION, { value: true }));
};
};
var cloneableGenerator = function cloneableGenerator(generatorFunc) {
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var history = [];
var gen = generatorFunc.apply(undefined, args);
return {
next: function next(arg) {
history.push(arg);
return gen.next(arg);
},
clone: function clone() {
var clonedGen = cloneableGenerator(generatorFunc).apply(undefined, args);
history.forEach(function (arg) {
return clonedGen.next(arg);
});
return clonedGen;
},
return: function _return(value) {
return gen.return(value);
},
throw: function _throw(exception) {
return gen.throw(exception);
}
};
};
};
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("./node_modules/process/browser.js")))
/***/ }),
/***/ "./node_modules/redux-saga/es/utils.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_utils__ = __webpack_require__("./node_modules/redux-saga/es/internal/utils.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TASK", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["r"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "SAGA_ACTION", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["p"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["l"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "is", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["c"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "deferred", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["s"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "arrayOfDeffered", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["t"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createMockTask", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["u"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "cloneableGenerator", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_utils__["v"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_io__ = __webpack_require__("./node_modules/redux-saga/es/internal/io.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asEffect", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_io__["v"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_proc__ = __webpack_require__("./node_modules/redux-saga/es/internal/proc.js");
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CHANNEL_END", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_proc__["a"]; });
/***/ }),
/***/ "./node_modules/regenerator-runtime/runtime-module.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be
// kept identical to the way it is obtained in runtime.js
var g =
typeof global === "object" ? global :
typeof window === "object" ? window :
typeof self === "object" ? self : this;
// Use `getOwnPropertyNames` because not all browsers support calling
// `hasOwnProperty` on the global `self` object in a worker. See #183.
var hadRuntime = g.regeneratorRuntime &&
Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
// Save the old regeneratorRuntime in case it needs to be restored later.
var oldRuntime = hadRuntime && g.regeneratorRuntime;
// Force reevalutation of runtime.js.
g.regeneratorRuntime = undefined;
module.exports = __webpack_require__("./node_modules/regenerator-runtime/runtime.js");
if (hadRuntime) {
// Restore the original runtime.
g.regeneratorRuntime = oldRuntime;
} else {
// Remove the global property added by runtime.js.
try {
delete g.regeneratorRuntime;
} catch(e) {
g.regeneratorRuntime = undefined;
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/regenerator-runtime/runtime.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* https://raw.github.com/facebook/regenerator/master/LICENSE file. An
* additional grant of patent rights can be found in the PATENTS file in
* the same directory.
*/
!(function(global) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var inModule = typeof module === "object";
var runtime = global.regeneratorRuntime;
if (runtime) {
if (inModule) {
// If regeneratorRuntime is defined globally and we're in a module,
// make the exports object identical to regeneratorRuntime.
module.exports = runtime;
}
// Don't bother evaluating the rest of this file if the runtime was
// already defined globally.
return;
}
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
runtime = global.regeneratorRuntime = inModule ? module.exports : {};
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
runtime.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
runtime.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
}
if (typeof global.process === "object" && global.process.domain) {
invoke = global.process.domain.bind(invoke);
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
runtime.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
if (delegate.iterator.return) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (! info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
return this;
};
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
runtime.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
runtime.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !! caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
};
})(
// Among the various tricks for obtaining a reference to the global
// object, this seems to be the most reliable technique that does not
// use indirect eval (which violates Content Security Policy).
typeof global === "object" ? global :
typeof window === "object" ? window :
typeof self === "object" ? self : this
);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./node_modules/style-loader/addStyles.js":
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var stylesInDom = {},
memoize = function(fn) {
var memo;
return function () {
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
return memo;
};
},
isOldIE = memoize(function() {
// Test for IE <= 9 as proposed by Browserhacks
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// Tests for existence of standard globals is to allow style-loader
// to operate correctly into non-standard environments
// @see https://github.com/webpack-contrib/style-loader/issues/177
return window && document && document.all && !window.atob;
}),
getElement = (function(fn) {
var memo = {};
return function(selector) {
if (typeof memo[selector] === "undefined") {
memo[selector] = fn.call(this, selector);
}
return memo[selector]
};
})(function (styleTarget) {
return document.querySelector(styleTarget)
}),
singletonElement = null,
singletonCounter = 0,
styleElementsInsertedAtTop = [],
fixUrls = __webpack_require__("./node_modules/style-loader/fixUrls.js");
module.exports = function(list, options) {
if(typeof DEBUG !== "undefined" && DEBUG) {
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
}
options = options || {};
options.attrs = typeof options.attrs === "object" ? options.attrs : {};
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
// By default, add <style> tags to the <head> element
if (typeof options.insertInto === "undefined") options.insertInto = "head";
// By default, add <style> tags to the bottom of the target
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
var styles = listToStyles(list, options);
addStylesToDom(styles, options);
return function update(newList) {
var mayRemove = [];
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
domStyle.refs--;
mayRemove.push(domStyle);
}
if(newList) {
var newStyles = listToStyles(newList, options);
addStylesToDom(newStyles, options);
}
for(var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i];
if(domStyle.refs === 0) {
for(var j = 0; j < domStyle.parts.length; j++)
domStyle.parts[j]();
delete stylesInDom[domStyle.id];
}
}
};
};
function addStylesToDom(styles, options) {
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
if(domStyle) {
domStyle.refs++;
for(var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j]);
}
for(; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j], options));
}
} else {
var parts = [];
for(var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j], options));
}
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
}
}
}
function listToStyles(list, options) {
var styles = [];
var newStyles = {};
for(var i = 0; i < list.length; i++) {
var item = list[i];
var id = options.base ? item[0] + options.base : item[0];
var css = item[1];
var media = item[2];
var sourceMap = item[3];
var part = {css: css, media: media, sourceMap: sourceMap};
if(!newStyles[id])
styles.push(newStyles[id] = {id: id, parts: [part]});
else
newStyles[id].parts.push(part);
}
return styles;
}
function insertStyleElement(options, styleElement) {
var styleTarget = getElement(options.insertInto)
if (!styleTarget) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
}
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
if (options.insertAt === "top") {
if(!lastStyleElementInsertedAtTop) {
styleTarget.insertBefore(styleElement, styleTarget.firstChild);
} else if(lastStyleElementInsertedAtTop.nextSibling) {
styleTarget.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
} else {
styleTarget.appendChild(styleElement);
}
styleElementsInsertedAtTop.push(styleElement);
} else if (options.insertAt === "bottom") {
styleTarget.appendChild(styleElement);
} else {
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
}
}
function removeStyleElement(styleElement) {
styleElement.parentNode.removeChild(styleElement);
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
if(idx >= 0) {
styleElementsInsertedAtTop.splice(idx, 1);
}
}
function createStyleElement(options) {
var styleElement = document.createElement("style");
options.attrs.type = "text/css";
attachTagAttrs(styleElement, options.attrs);
insertStyleElement(options, styleElement);
return styleElement;
}
function createLinkElement(options) {
var linkElement = document.createElement("link");
options.attrs.type = "text/css";
options.attrs.rel = "stylesheet";
attachTagAttrs(linkElement, options.attrs);
insertStyleElement(options, linkElement);
return linkElement;
}
function attachTagAttrs(element, attrs) {
Object.keys(attrs).forEach(function (key) {
element.setAttribute(key, attrs[key]);
});
}
function addStyle(obj, options) {
var styleElement, update, remove, transformResult;
// If a transform function was defined, run it on the css
if (options.transform && obj.css) {
transformResult = options.transform(obj.css);
if (transformResult) {
// If transform returns a value, use that instead of the original css.
// This allows running runtime transformations on the css.
obj.css = transformResult;
} else {
// If the transform function returns a falsy value, don't add this css.
// This allows conditional loading of css
return function() {
// noop
};
}
}
if (options.singleton) {
var styleIndex = singletonCounter++;
styleElement = singletonElement || (singletonElement = createStyleElement(options));
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
} else if(obj.sourceMap &&
typeof URL === "function" &&
typeof URL.createObjectURL === "function" &&
typeof URL.revokeObjectURL === "function" &&
typeof Blob === "function" &&
typeof btoa === "function") {
styleElement = createLinkElement(options);
update = updateLink.bind(null, styleElement, options);
remove = function() {
removeStyleElement(styleElement);
if(styleElement.href)
URL.revokeObjectURL(styleElement.href);
};
} else {
styleElement = createStyleElement(options);
update = applyToTag.bind(null, styleElement);
remove = function() {
removeStyleElement(styleElement);
};
}
update(obj);
return function updateStyle(newObj) {
if(newObj) {
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
return;
update(obj = newObj);
} else {
remove();
}
};
}
var replaceText = (function () {
var textStore = [];
return function (index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join('\n');
};
})();
function applyToSingletonTag(styleElement, index, remove, obj) {
var css = remove ? "" : obj.css;
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css);
} else {
var cssNode = document.createTextNode(css);
var childNodes = styleElement.childNodes;
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index]);
} else {
styleElement.appendChild(cssNode);
}
}
}
function applyToTag(styleElement, obj) {
var css = obj.css;
var media = obj.media;
if(media) {
styleElement.setAttribute("media", media)
}
if(styleElement.styleSheet) {
styleElement.styleSheet.cssText = css;
} else {
while(styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild);
}
styleElement.appendChild(document.createTextNode(css));
}
}
function updateLink(linkElement, options, obj) {
var css = obj.css;
var sourceMap = obj.sourceMap;
/* If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
and there is no publicPath defined then lets turn convertToAbsoluteUrls
on by default. Otherwise default to the convertToAbsoluteUrls option
directly
*/
var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
if (options.convertToAbsoluteUrls || autoFixUrls){
css = fixUrls(css);
}
if(sourceMap) {
// http://stackoverflow.com/a/26603875
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
}
var blob = new Blob([css], { type: "text/css" });
var oldSrc = linkElement.href;
linkElement.href = URL.createObjectURL(blob);
if(oldSrc)
URL.revokeObjectURL(oldSrc);
}
/***/ }),
/***/ "./node_modules/style-loader/fixUrls.js":
/***/ (function(module, exports) {
/**
* When source maps are enabled, `style-loader` uses a link element with a data-uri to
* embed the css on the page. This breaks all relative urls because now they are relative to a
* bundle instead of the current page.
*
* One solution is to only use full urls, but that may be impossible.
*
* Instead, this function "fixes" the relative urls to be absolute according to the current page location.
*
* A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
*
*/
module.exports = function (css) {
// get current location
var location = typeof window !== "undefined" && window.location;
if (!location) {
throw new Error("fixUrls requires window.location");
}
// blank or null?
if (!css || typeof css !== "string") {
return css;
}
var baseUrl = location.protocol + "//" + location.host;
var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
// convert each url(...)
/*
This regular expression is just a way to recursively match brackets within
a string.
/url\s*\( = Match on the word "url" with any whitespace after it and then a parens
( = Start a capturing group
(?: = Start a non-capturing group
[^)(] = Match anything that isn't a parentheses
| = OR
\( = Match a start parentheses
(?: = Start another non-capturing groups
[^)(]+ = Match anything that isn't a parentheses
| = OR
\( = Match a start parentheses
[^)(]* = Match anything that isn't a parentheses
\) = Match a end parentheses
) = End Group
*\) = Match anything and then a close parens
) = Close non-capturing group
* = Match anything
) = Close capturing group
\) = Match a close parens
/gi = Get all matches, not the first. Be case insensitive.
*/
var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
// strip quotes (if they exist)
var unquotedOrigUrl = origUrl
.trim()
.replace(/^"(.*)"$/, function(o, $1){ return $1; })
.replace(/^'(.*)'$/, function(o, $1){ return $1; });
// already a full url? no change
if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
return fullMatch;
}
// convert the url to a full url
var newUrl;
if (unquotedOrigUrl.indexOf("//") === 0) {
//TODO: should we add protocol?
newUrl = unquotedOrigUrl;
} else if (unquotedOrigUrl.indexOf("/") === 0) {
// path should be relative to the base url
newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
} else {
// path should be relative to current directory
newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
}
// send back the fixed url(...)
return "url(" + JSON.stringify(newUrl) + ")";
});
// send back the fixed css
return fixedCss;
};
/***/ }),
/***/ "./node_modules/webpack/hot/emitter.js":
/***/ (function(module, exports, __webpack_require__) {
var EventEmitter = __webpack_require__("./node_modules/events/events.js");
module.exports = new EventEmitter();
/***/ }),
/***/ "./node_modules/webpack/hot/log-apply-result.js":
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
module.exports = function(updatedModules, renewedModules) {
var unacceptedModules = updatedModules.filter(function(moduleId) {
return renewedModules && renewedModules.indexOf(moduleId) < 0;
});
if(unacceptedModules.length > 0) {
console.warn("[HMR] The following modules couldn't be hot updated: (They would need a full reload!)");
unacceptedModules.forEach(function(moduleId) {
console.warn("[HMR] - " + moduleId);
});
}
if(!renewedModules || renewedModules.length === 0) {
console.log("[HMR] Nothing hot updated.");
} else {
console.log("[HMR] Updated modules:");
renewedModules.forEach(function(moduleId) {
console.log("[HMR] - " + moduleId);
});
var numberIds = renewedModules.every(function(moduleId) {
return typeof moduleId === "number";
});
if(numberIds)
console.log("[HMR] Consider using the NamedModulesPlugin for module names.");
}
};
/***/ }),
/***/ "./node_modules/webpack/hot/only-dev-server.js":
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals __webpack_hash__ */
if(true) {
var lastHash;
var upToDate = function upToDate() {
return lastHash.indexOf(__webpack_require__.h()) >= 0;
};
var check = function check() {
module.hot.check().then(function(updatedModules) {
if(!updatedModules) {
console.warn("[HMR] Cannot find update. Need to do a full reload!");
console.warn("[HMR] (Probably because of restarting the webpack-dev-server)");
return;
}
return module.hot.apply({
ignoreUnaccepted: true,
ignoreDeclined: true,
ignoreErrored: true,
onUnaccepted: function(data) {
console.warn("Ignored an update to unaccepted module " + data.chain.join(" -> "));
},
onDeclined: function(data) {
console.warn("Ignored an update to declined module " + data.chain.join(" -> "));
},
onErrored: function(data) {
console.warn("Ignored an error while updating module " + data.moduleId + " (" + data.type + ")");
}
}).then(function(renewedModules) {
if(!upToDate()) {
check();
}
__webpack_require__("./node_modules/webpack/hot/log-apply-result.js")(updatedModules, renewedModules);
if(upToDate()) {
console.log("[HMR] App is up to date.");
}
});
}).catch(function(err) {
var status = module.hot.status();
if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot check for update. Need to do a full reload!");
console.warn("[HMR] " + err.stack || err.message);
} else {
console.warn("[HMR] Update check failed: " + err.stack || err.message);
}
});
};
var hotEmitter = __webpack_require__("./node_modules/webpack/hot/emitter.js");
hotEmitter.on("webpackHotUpdate", function(currentHash) {
lastHash = currentHash;
if(!upToDate()) {
var status = module.hot.status();
if(status === "idle") {
console.log("[HMR] Checking for updates on the server...");
check();
} else if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot apply update as a previous update " + status + "ed. Need to do a full reload!");
}
}
});
console.log("[HMR] Waiting for update signal from WDS...");
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}
/***/ }),
/***/ 1:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("./node_modules/react-hot-loader/patch.js");
__webpack_require__("./node_modules/webpack/hot/only-dev-server.js");
module.exports = __webpack_require__("./PC_client/index.js");
/***/ })
},[1]);
//# sourceMappingURL=main.d6a9dbb643442c12a8e0.js.map |
src/components/pagination/NoResults/NoResults.js | CtrHellenicStudies/Commentary | import React from 'react';
import { Grid, Row, Col } from 'react-bootstrap';
import './NoResults.css';
const NoResults = ({ message }) => (
<Grid>
<Row>
<Col>
<div className="noResults">
<p>
{message}
</p>
</div>
</Col>
</Row>
</Grid>
);
export default NoResults;
|
resources/react/components/parts/schedule/ScheduleCard.js | fetus-hina/stat.ink | import PropTypes from 'prop-types';
import React from 'react';
import { createUseStyles } from 'react-jss';
const useStyles = createUseStyles({
root: {
backgroundColor: '#fff',
borderRadius: '4px',
boxShadow: [
'0 2px 1px -1px rgb(0 0 0 / 20%)',
'0 1px 1px 0 rgb(0 0 0 / 14%)',
'0 1px 3px 0 rgb(0 0 0 / 12%)'
].join(', '),
color: '#333',
overflow: 'hidden',
transition: 'box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms'
},
outlined: {
// border: '1px solid rgba(0, 0, 0, 0.12)',
border: '1px solid #ddd'
},
media: {
backgroundClip: 'padding-box',
backgroundColor: 'transparent',
backgroundOrigin: 'padding-box',
backgroundPosition: '50% 50%',
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
display: 'block',
margin: '0',
overflow: 'hidden',
padding: '0',
position: 'relative',
width: '100%'
},
media16x9: {
'&::before': {
display: 'block',
paddingTop: 'calc(9 / 16 * 100%)',
content: '""'
}
},
media32x9: {
'&::before': {
display: 'block',
paddingTop: 'calc(9 / 32 * 100%)',
content: '""'
}
},
content: {
padding: '15px'
},
weapons: {
backgroundColor: 'rgba(255, 255, 255, 0.8)',
borderTopLeftRadius: '4px',
bottom: '0',
color: '#ccc',
fontSize: '24px',
lineHeight: '1',
margin: '0',
padding: '8px',
position: 'absolute',
right: '0',
'& img': {
height: '24px',
width: 'auto'
},
'& ul, & li': {
display: 'inline-block',
listStyleImage: 'none',
listStyleType: 'none',
margin: '0',
padding: '0',
lineHeight: '1'
},
'& li': {
display: 'inline',
marginRight: '0.5em',
'&:last-child': {
marginRight: '0'
}
}
}
});
export default function ScheduleCard (props) {
const { map, mode, schedule } = props;
const isSalmon = (mode === 'salmon');
const classes = useStyles();
return (
<div className={[classes.root, classes.outlined].join(' ')}>
<div
className={[
classes.media,
isSalmon ? classes.media32x9 : classes.media16x9
].join(' ')}
style={{
backgroundImage: `url(${map.image})`
}}
>
{isSalmon && schedule && schedule.weapons
? (
<div className={classes.weapons}>
<ul>
{schedule.weapons.map((weapon, i) => (
<li key={weapon.key + '-' + i}>
{(weapon.key === 'random')
? <span
className='fas fa-question fa-fw'
title={weapon.name}
/>
: <img
alt={weapon.name}
src={weapon.icon}
title={weapon.name}
/>}
</li>
))}
</ul>
</div>
)
: null}
</div>
<div className={classes.content}>
{map.name}
</div>
</div>
);
}
ScheduleCard.propTypes = {
map: PropTypes.object.isRequired,
mode: PropTypes.string.isRequired,
schedule: PropTypes.object.isRequired
};
|
node_modules/react-sparklines/bootstrap-tests.js | aleksandrsmolin/react-redux-weather | // bootstrap-tests.js - A tool for updating the test cases in __tests__/fixtures.js
//
// 1) Reads __tests__/fixtures.js and looks for a "dynamic part", which should be a list of fields
// belonging to that file's default export, enclosed in a pair of markers (see "signal" constants
// below).
// 2) Imports the same fixtures file and (re-)renders each ReactElement to a static SVG string.
// 3) On success, overwrites __tests__/fixtures.js with an updated copy.
//
// Run with babel-node or using "npm run test:bootstrap".
import path from 'path';
import { render } from 'enzyme';
import LineByLineReader from 'line-by-line';
import reactElementToJsx from 'react-element-to-jsx-string';
import { writeFileSync } from 'fs';
import replaceAll from 'replaceall';
import React from 'react';
const fixturesFile = path.resolve(__dirname, './__tests__/fixtures.js');
const dynamicPartStartSignal = '// AUTO-GENERATED PART STARTS HERE';
const dynamicPartEndSignal = '// AUTO-GENERATED PART ENDS HERE';
const fixtures = require(fixturesFile).default;
// Handle recurring data constants
import { sampleData, sampleData100 } from './__tests__/data';
const recognizedDataConstants = {
sampleData, sampleData100
};
const recognizedDataStrings = {};
for (let dataKey of Object.keys(recognizedDataConstants)) {
recognizedDataStrings[dataKey] = markupToOneLine(reactElementToJsx(<div data-value={recognizedDataConstants[dataKey]} />)
.replace(/[^{]*\{|\}[^}]*/g, ''));
}
// Output control
let outData = '';
const write = content => { outData += content + '\n'; }
const save = () => writeFileSync(fixturesFile, outData);
function writeFixtures() {
for (let key of Object.keys(fixtures)) {
const jsx = fixtures[key].jsx;
const wrapper = render(jsx);
let jsxCode = `(${markupToOneLine(reactElementToJsx(jsx))})`;
const htmlCode = JSON.stringify(wrapper.html());
for (let dataKey of Object.keys(recognizedDataStrings)) {
jsxCode = replaceAll(recognizedDataStrings[dataKey], dataKey, jsxCode);
}
write(`\t${JSON.stringify(key)}: {jsx: ${jsxCode}, svg: ${htmlCode}},`);
}
}
function markupToOneLine(code) {
return code.replace(/\s*[\r\n]\s*/g, ' ').replace(/\s+/g, ' ').replace(/\s*([<>])\s*/g, '$1');
}
// Input control
const lr = new LineByLineReader(fixturesFile, {skipEmptyLines: false});
let inDynamicPart = false, dynamicPartCount = 0, lineCount = 0;
lr.on('line', line => {
++lineCount;
if (line === dynamicPartStartSignal) {
if (inDynamicPart)
throw new LineError('Dynamic part opened again');
++dynamicPartCount;
if (dynamicPartCount > 1)
throw new LineError('Multiple dynamic parts found');
inDynamicPart = true;
write(line);
try {
writeFixtures();
} catch(e) {
throw new LineError(e);
}
}
else if (line === dynamicPartEndSignal) {
if (!inDynamicPart)
throw new LineError('Dynamic part closed again');
inDynamicPart = false;
write(line);
}
else if (!inDynamicPart)
write(line);
});
lr.on('end', () => {
if (inDynamicPart) {
throw new LineError('Dynamic part not closed');
}
if (!dynamicPartCount) {
throw new LineError('No dynamic part found in file!');
}
save();
});
lr.on('error', function (err) {
throw new LineError(err);
});
class LineError extends Error {
constructor(message) {
super(`${fixturesFile}:${lineCount}: ${message}`);
}
}
|
app/containers/AdminRelaisCommandes/components/DetailsParUtilisateur.js | Proxiweb/react-boilerplate | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import { createStructuredSelector } from 'reselect';
import Helmet from 'react-helmet';
import round from 'lodash/round';
import RaisedButton from 'material-ui/RaisedButton';
import { Tabs, Tab } from 'material-ui/Tabs';
import {
makeSelectCommandeCommandeContenus,
makeSelectCommandeContenus,
makeSelectFournisseursCommande,
makeSelectCommandeProduits,
makeSelectCommandeStellarAdresse,
makeSelectOffres,
} from 'containers/Commande/selectors';
import { makeSelectUtilisateurStellarAdresse } from 'containers/AdminUtilisateurs/selectors';
import capitalize from 'lodash/capitalize';
import isAfter from 'date-fns/is_after';
import { format } from 'utils/dates';
const formatPattern = 'DD/MM/YY à HH:mm';
import styles from './styles.css';
import DetailCommande from './DetailCommande';
import DetailCommandeTotal from './DetailCommandeTotal';
import CommandePaiementsUtilisateur from './CommandePaiementsUtilisateur';
import LivraisonCommande from './LivraisonCommande';
import { calculeTotauxCommande } from 'containers/Commande/utils';
import StellarAccount from 'components/StellarAccount';
import HistoriqueCommandeUtilisateur from './HistoriqueCommandeUtilisateur';
import ListeEffetsCompteStellar from 'components/ListeEffetsCompteStellar/ListeEffetsCompteStellar';
// eslint-disable-next-line
class DetailsParUtilisateur extends Component {
static propTypes = {
roles: PropTypes.array.isRequired,
commandeUtilisateur: PropTypes.object.isRequired,
commande: PropTypes.object.isRequired,
commandeContenus: PropTypes.array.isRequired,
contenus: PropTypes.object.isRequired,
offres: PropTypes.object.isRequired,
params: PropTypes.object.isRequired,
utilisateur: PropTypes.object.isRequired,
produits: PropTypes.array.isRequired,
commandeStellarAdresse: PropTypes.string.isRequired,
utilisateurStellarAdresse: PropTypes.string.isRequired,
depots: PropTypes.array.isRequired,
pushState: PropTypes.func.isRequired,
};
constructor(props) {
super(props);
this.state = {
account: null,
view: 0,
};
}
handleAccountLoaded = account => {
this.setState({ ...this.state, account });
};
render() {
const {
utilisateur,
contenus,
produits,
params,
roles,
offres,
commandeContenus,
commandeUtilisateur,
commande,
utilisateurStellarAdresse,
commandeStellarAdresse,
pushState,
depots,
} = this.props;
const { commandeId, relaiId, utilisateurId } = params;
const contenusUtilisateur = Object.keys(commandeContenus)
.map(key => commandeContenus[key])
.filter(
c => c.utilisateurId === utilisateur.id && c.commandeId === commandeId
);
const depot = depots.find(
d =>
d.utilisateurId === utilisateurId &&
!d.transfertEffectue &&
d.type === 'depot_relais'
);
const totaux = calculeTotauxCommande({
// contenus: contenusUtilisateur,
filter: cc => cc.utilisateurId === utilisateurId,
offres,
commandeContenus,
commandeId: params.commandeId,
});
const credit =
parseFloat(this.state.account ? this.state.account.balance : 0) +
(depot ? depot.montant : 0);
const totalCommande = round(totaux.prix + totaux.recolteFond, 2);
const paiementOk = this.state.account ? credit >= totalCommande : false;
const identite = `${capitalize(
utilisateur.prenom
)} ${utilisateur.nom.toUpperCase()}`;
return (
<div className={`row center-md ${styles.detailsParUtilisateur}`}>
<Helmet title={`Commande de ${identite}`} />
<Tabs>
<Tab label="Détail commande">
<div className={`col-md-12 ${styles.etatCommandeUtilisateur}`}>
<div className="row">
<div className="col-md">
<strong>
{identite}
{commandeUtilisateur.createdAt &&
` passée le ${format(
commandeUtilisateur.createdAt,
formatPattern
)}`}
</strong>
</div>
<div className="col-md">
<div className="row arround-md">
<div className="col-md">
{commandeUtilisateur.datePaiement
? `Payée le ${format(
commandeUtilisateur.datePaiement,
formatPattern
)}`
: 'Non payée'}
</div>
<div className="col-md">
{commandeUtilisateur.dateLivraison
? `Livrée le ${format(
commandeUtilisateur.dateLivraison,
formatPattern
)}`
: 'Non livrée'}
</div>
</div>
</div>
</div>
</div>
<div className="col-md-12">
<DetailCommande
contenusFiltered={contenusUtilisateur}
commandeContenus={Object.keys(commandeContenus).map(
key => commandeContenus[key]
)}
produits={produits}
commandeId={params.commandeId}
offres={offres}
roles={roles}
souligneQte
/>
<DetailCommandeTotal totaux={totaux} />
{false &&
<CommandePaiementsUtilisateur
adresseStellarUtilisateur={utilisateurStellarAdresse}
adresseStellarCommande={commandeStellarAdresse}
/>}
</div>
{!commandeUtilisateur.dateLivraison &&
paiementOk &&
<LivraisonCommande commandeUtilisateur={commandeUtilisateur} />}
{!commandeUtilisateur.datePaiement &&
isAfter(commande.dateCommande, new Date()) &&
<div className="col-md-12" style={{ marginTop: '1em' }}>
<div className="row center-md">
<div className="col-md-4">
<RaisedButton
fullWidth
primary
label="Modifier"
onClick={() =>
pushState(
`/relais/${relaiId}/commandes/${commandeId}?utilisateurId=${utilisateurId}`
)}
/>
</div>
<div className="col-md-4">
<RaisedButton
fullWidth
secondary
label="Annuler"
onClick={() =>
pushState(
`/relais/${relaiId}/commandes/${commandeId}?utilisateurId=${utilisateurId}`
)}
/>
</div>
</div>
</div>}
<div className="col-md-6" style={{ marginTop: '1em' }}>
{utilisateur.stellarKeys &&
<StellarAccount
stellarAdr={utilisateur.stellarKeys.adresse}
onAccountLoaded={this.handleAccountLoaded}
/>}
{!utilisateur.stellarKeys && <h3>Pas de compte</h3>}
</div>
<div className="col-md-6" style={{ marginTop: '1em' }}>
<h3>
{this.state.account &&
!paiementOk &&
<p>Manque {round(totalCommande - credit, 2)} €</p>}
{this.state.account &&
paiementOk &&
<p>Restera {round(credit - totalCommande, 2)} €</p>}
</h3>
</div>
</Tab>
<Tab label="Historique commandes">
<HistoriqueCommandeUtilisateur utilisateurId={utilisateur.id} />
</Tab>
<Tab label="Comptes">
{utilisateur.stellarKeys &&
<ListeEffetsCompteStellar
stellarAddress={utilisateur.stellarKeys.adresse}
/>}
</Tab>
</Tabs>
</div>
);
}
}
const mapStateToProps = createStructuredSelector({
// contenus: makeSelectCommandeContenus(),
commandeContenus: makeSelectCommandeContenus(),
offres: makeSelectOffres(),
fournisseurs: makeSelectFournisseursCommande(),
produits: makeSelectCommandeProduits(),
utilisateurStellarAdresse: makeSelectUtilisateurStellarAdresse(),
commandeStellarAdresse: makeSelectCommandeStellarAdresse(),
});
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
pushState: push,
},
dispatch
);
export default connect(mapStateToProps, mapDispatchToProps)(
DetailsParUtilisateur
);
|
projects/starter/src/index.js | ebemunk/blog | import React from 'react'
import ReactDOM from 'react-dom'
import 'react-vis/dist/style.css'
const render = (component, selector) =>
ReactDOM.render(component, document.querySelector(selector))
import A from './A'
render(<A />, '#hi')
|
src/components/SelectCountry.js | dixitc/cherry-web-portal | import React from 'react';
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
import countryCodes from '../constants/country-codes';
const items = [];
for (let i = 0; i < countryCodes.length; i++ ) {
items.push(<MenuItem value={i} key={i} primaryText={countryCodes[i].name + ' '+ countryCodes[i].dial_code} />);
}
export default class SelectFieldExampleSimple extends React.Component {
constructor(props) {
super(props);
}
handleChange = (event, index, value) => this.setState({value});
render() {
return (
<div >
<SelectField
primary={true}
value={this.props.countryValue}
onChange={this.props.setCountry}
floatingLabelText='Country code'
>
{items}
</SelectField>
<br />
</div>
);
}
}
|
src/ModalHeader.js | Sipree/react-bootstrap | import React from 'react';
import classNames from 'classnames';
import tbsUtils, { bsClass } from './utils/bootstrapUtils';
import createChainedFunction from './utils/createChainedFunction';
class ModalHeader extends React.Component {
render() {
let { 'aria-label': label, ...props } = this.props;
let onHide = createChainedFunction(this.context.$bs_onModalHide, this.props.onHide);
return (
<div
{...props}
className={classNames(this.props.className, tbsUtils.prefix(this.props, 'header'))}
>
{ this.props.closeButton &&
<button
type="button"
className="close"
aria-label={label}
onClick={onHide}>
<span aria-hidden="true">
×
</span>
</button>
}
{ this.props.children }
</div>
);
}
}
ModalHeader.propTypes = {
/**
* The 'aria-label' attribute provides an accessible label for the close button.
* It is used for Assistive Technology when the label text is not readable.
*/
'aria-label': React.PropTypes.string,
bsClass: React.PropTypes.string,
/**
* Specify whether the Component should contain a close button
*/
closeButton: React.PropTypes.bool,
/**
* A Callback fired when the close button is clicked. If used directly inside a Modal component, the onHide will automatically
* be propagated up to the parent Modal `onHide`.
*/
onHide: React.PropTypes.func
};
ModalHeader.contextTypes = {
'$bs_onModalHide': React.PropTypes.func
};
ModalHeader.defaultProps = {
'aria-label': 'Close',
closeButton: false
};
export default bsClass('modal', ModalHeader);
|
node_modules/react-icons/fa/pagelines.js | bairrada97/festival |
import React from 'react'
import Icon from 'react-icon-base'
const FaPagelines = props => (
<Icon viewBox="0 0 40 40" {...props}>
<g><path d="m35.8 24.6q-0.7 1.8-1.7 3.1t-2 2-2.2 1-2.3 0.3-2.2-0.2-1.9-0.4-1.5-0.7-1.1-0.5l-0.4-0.2q-2.5 5.1-6.4 8t-8.6 3q-0.4 0-0.7-0.3t-0.3-0.7 0.3-0.7 0.7-0.3q3.9 0 7.2-2.4t5.6-6.6q-0.8 0.4-1.6 0.6t-1.8 0.2-2.1 0-2-0.6-2.1-1.4-1.9-2.2-1.6-3.3q2.5-1 4.7-1.2t3.8 0.1 2.7 1.3 2 1.7 1.3 1.9q1.2-3 1.7-6.5-0.1 0-0.4 0t-1 0.1-1.5 0-1.9-0.3-1.9-0.5-1.9-0.9-1.7-1.5-1.2-2.1-0.6-2.8q1.5-0.7 2.9-0.9t2.5 0.1 2.1 0.6 1.6 1.2 1.3 1.3 0.9 1.4 0.6 1.3 0.4 0.9l0.1 0.3q0.3-2.7 0.3-4.3-0.2-0.2-0.5-0.4t-1.1-1-1.4-1.6-1.2-2.1-0.8-2.5 0.3-2.8 1.6-3.1q1.6 0.6 2.8 1.4t1.9 1.7 1.1 1.9 0.4 2 0 1.9-0.3 1.7-0.4 1.4-0.4 0.9l-0.1 0.3q0 0.2 0 1.2t0 1.6q0-0.2 0.2-0.4t0.7-1 1.1-1.3 1.6-1.2 2-1 2.5-0.4 3 0.6q-0.1 1.7-0.5 3.1t-1.1 2.4-1.6 1.6-1.8 1-1.9 0.5-1.8 0.2-1.5 0-1-0.1l-0.4-0.1q-0.5 3.3-1.6 6.4 0.1-0.2 0.4-0.5t1.1-0.9 1.7-1.1 2.2-1 2.7-0.4 2.8 0.5 3.1 1.7z"/></g>
</Icon>
)
export default FaPagelines
|
src/svg-icons/av/featured-video.js | andrejunges/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let AvFeaturedVideo = (props) => (
<SvgIcon {...props}>
<path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 9H3V5h9v7z"/>
</SvgIcon>
);
AvFeaturedVideo = pure(AvFeaturedVideo);
AvFeaturedVideo.displayName = 'AvFeaturedVideo';
AvFeaturedVideo.muiName = 'SvgIcon';
export default AvFeaturedVideo;
|
ajax/libs/muicss/0.9.27/react/mui-react.min.js | froala/cdnjs | !function(e){var t=e.babelHelpers={};t.classCallCheck=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.createClass=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}}(),t.extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.inherits=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},t.interopRequireDefault=function(e){return e&&e.__esModule?e:{default:e}},t.interopRequireWildcard=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},t.objectWithoutProperties=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},t.possibleConstructorReturn=function(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}}("undefined"==typeof global?self:global),function e(t,r,n){function l(i,s){if(!r[i]){if(!t[i]){var a="function"==typeof require&&require;if(!s&&a)return a(i,!0);if(o)return o(i,!0);throw new Error("Cannot find module '"+i+"'")}var u=r[i]={exports:{}};t[i][0].call(u.exports,function(e){var r=t[i][1][e];return l(r||e)},u,u.exports,e,t,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)l(n[i]);return l}({1:[function(e,t,r){function n(){}var l=t.exports={};l.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),r.length>0&&r.shift()())},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),l.title="browser",l.browser=!0,l.env={},l.argv=[],l.on=n,l.addListener=n,l.once=n,l.off=n,l.removeListener=n,l.removeAllListeners=n,l.emit=n,l.binding=function(e){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],2:[function(e,t,r){"use strict";!function(t){if(!t._muiReactLoaded){t._muiReactLoaded=!0;var r=(t.mui=t.mui||[]).react={};r.Appbar=e("src/react/appbar"),r.Button=e("src/react/button"),r.Caret=e("src/react/caret"),r.Checkbox=e("src/react/checkbox"),r.Col=e("src/react/col"),r.Container=e("src/react/container"),r.Divider=e("src/react/divider"),r.Dropdown=e("src/react/dropdown"),r.DropdownItem=e("src/react/dropdown-item"),r.Form=e("src/react/form"),r.Input=e("src/react/input"),r.Option=e("src/react/option"),r.Panel=e("src/react/panel"),r.Radio=e("src/react/radio"),r.Row=e("src/react/row"),r.Select=e("src/react/select"),r.Tab=e("src/react/tab"),r.Tabs=e("src/react/tabs"),r.Textarea=e("src/react/textarea")}}(window)},{"src/react/appbar":12,"src/react/button":13,"src/react/caret":14,"src/react/checkbox":15,"src/react/col":16,"src/react/container":17,"src/react/divider":18,"src/react/dropdown":20,"src/react/dropdown-item":19,"src/react/form":21,"src/react/input":22,"src/react/option":23,"src/react/panel":24,"src/react/radio":25,"src/react/row":26,"src/react/select":27,"src/react/tab":28,"src/react/tabs":29,"src/react/textarea":30}],3:[function(e,t,r){"use strict";t.exports={debug:!0}},{}],4:[function(e,t,r){"use strict";var n=15,l=32,o=42,i=8;t.exports={getMenuPositionalCSS:function(e,t,r){var s,a,u,c,p=document.documentElement.clientHeight,d=t*o+2*i,f=Math.min(d,p);a=i+o-(n+l),a-=r*o,c=p-f+(u=-1*e.getBoundingClientRect().top),s=Math.min(Math.max(a,u),c);var b,h,v=0;return d>p&&(b=i+(r+1)*o-(-1*s+n+l),h=t*o+2*i-f,v=Math.min(b,h)),{height:f+"px",top:s+"px",scrollTop:v}}}},{}],5:[function(e,t,r){"use strict";function n(e){if(void 0===e)return"undefined";var t=Object.prototype.toString.call(e);if(0===t.indexOf("[object "))return t.slice(8,-1).toLowerCase();throw new Error("MUI: Could not understand type: "+t)}function l(e,t,r,n){n=void 0!==n&&n;var l=e._muiEventCache=e._muiEventCache||{};t.split(" ").map(function(t){e.addEventListener(t,r,n),l[t]=l[t]||[],l[t].push([r,n])})}function o(e,t,r,n){n=void 0!==n&&n;var l,o,i,s=e._muiEventCache=e._muiEventCache||{};t.split(" ").map(function(t){for(i=(l=s[t]||[]).length;i--;)o=l[i],(void 0===r||o[0]===r&&o[1]===n)&&(l.splice(i,1),e.removeEventListener(t,o[0],o[1]))})}function i(e,t){var r=window;if(void 0===t){if(e===r){var n=document.documentElement;return(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}return e.scrollLeft}e===r?r.scrollTo(t,s(r)):e.scrollLeft=t}function s(e,t){var r=window;if(void 0===t){if(e===r){var n=document.documentElement;return(r.pageYOffset||n.scrollTop)-(n.clientTop||0)}return e.scrollTop}e===r?r.scrollTo(i(r),t):e.scrollTop=t}function a(e){return" "+(e.getAttribute("class")||"").replace(/[\n\t]/g,"")+" "}function u(e){return e.replace(p,function(e,t,r,n){return n?r.toUpperCase():r}).replace(d,"Moz$1")}function c(e,t,r){var n;return""!==(n=r.getPropertyValue(t))||e.ownerDocument||(n=e.style[u(t)]),n}var p=/([\:\-\_]+(.))/g,d=/^moz([A-Z])/;t.exports={addClass:function(e,t){if(t&&e.setAttribute){for(var r,n=a(e),l=t.split(" "),o=0;o<l.length;o++)r=l[o].trim(),-1===n.indexOf(" "+r+" ")&&(n+=r+" ");e.setAttribute("class",n.trim())}},css:function(e,t,r){if(void 0===t)return getComputedStyle(e);var l=n(t);{if("object"!==l){"string"===l&&void 0!==r&&(e.style[u(t)]=r);var o=getComputedStyle(e);if("array"!==n(t))return c(e,t,o);for(var i={},s=0;s<t.length;s++)i[a=t[s]]=c(e,a,o);return i}for(var a in t)e.style[u(a)]=t[a]}},hasClass:function(e,t){return!(!t||!e.getAttribute)&&a(e).indexOf(" "+t+" ")>-1},off:o,offset:function(e){var t=window,r=e.getBoundingClientRect(),n=s(t),l=i(t);return{top:r.top+n,left:r.left+l,height:r.height,width:r.width}},on:l,one:function(e,t,r,n){t.split(" ").map(function(t){l(e,t,function l(i){r&&r.apply(this,arguments),o(e,t,l,n)},n)})},ready:function(e){var t=!1,r=!0,n=document,l=n.defaultView,o=n.documentElement,i=n.addEventListener?"addEventListener":"attachEvent",s=n.addEventListener?"removeEventListener":"detachEvent",a=n.addEventListener?"":"on",u=function r(o){"readystatechange"==o.type&&"complete"!=n.readyState||(("load"==o.type?l:n)[s](a+o.type,r,!1),!t&&(t=!0)&&e.call(l,o.type||o))};if("complete"==n.readyState)e.call(l,"lazy");else{if(n.createEventObject&&o.doScroll){try{r=!l.frameElement}catch(e){}r&&function e(){try{o.doScroll("left")}catch(t){return void setTimeout(e,50)}u("poll")}()}n[i](a+"DOMContentLoaded",u,!1),n[i](a+"readystatechange",u,!1),l[i](a+"load",u,!1)}},removeClass:function(e,t){if(t&&e.setAttribute){for(var r,n=a(e),l=t.split(" "),o=0;o<l.length;o++)for(r=l[o].trim();n.indexOf(" "+r+" ")>=0;)n=n.replace(" "+r+" "," ");e.setAttribute("class",n.trim())}},type:n,scrollLeft:i,scrollTop:s}},{}],6:[function(e,t,r){"use strict";function n(e){var t,r=document;t=r.head||r.getElementsByTagName("head")[0]||r.documentElement;var n=r.createElement("style");return n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(r.createTextNode(e)),t.insertBefore(n,t.firstChild),n}var l,o,i,s,a,u=e("../config"),c=e("./jqLite"),p=0,d="mui-scroll-lock";i=function(e){e.target.tagName||e.stopImmediatePropagation()};var f=function(){if(void 0!==s)return s;var e=document,t=e.body,r=e.createElement("div");return r.innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',r=r.firstChild,t.appendChild(r),s=r.offsetWidth-r.clientWidth,t.removeChild(r),s};t.exports={callback:function(e,t){return function(){e[t].apply(e,arguments)}},classNames:function(e){var t="";for(var r in e)t+=e[r]?r+" ":"";return t.trim()},disableScrollLock:function(e){0!==p&&0==(p-=1)&&(c.removeClass(document.body,d),o.parentNode.removeChild(o),e&&window.scrollTo(l.left,l.top),c.off(window,"scroll",i,!0))},dispatchEvent:function(e,t,r,n,l){var o,i=document.createEvent("HTMLEvents"),r=void 0===r||r,n=void 0===n||n;if(i.initEvent(t,r,n),l)for(o in l)i[o]=l[o];return e&&e.dispatchEvent(i),i},enableScrollLock:function(){if(1===(p+=1)){var e,t,r,s=document,a=window,u=s.documentElement,b=s.body,h=f();e=["overflow:hidden"],h&&(u.scrollHeight>u.clientHeight&&(r=parseInt(c.css(b,"padding-right"))+h,e.push("padding-right:"+r+"px")),u.scrollWidth>u.clientWidth&&(r=parseInt(c.css(b,"padding-bottom"))+h,e.push("padding-bottom:"+r+"px"))),t="."+d+"{",t+=e.join(" !important;")+" !important;}",o=n(t),c.on(a,"scroll",i,!0),l={left:c.scrollLeft(a),top:c.scrollTop(a)},c.addClass(b,d)}},log:function(){var e=window;if(u.debug&&void 0!==e.console)try{e.console.log.apply(e.console,arguments)}catch(r){var t=Array.prototype.slice.call(arguments);e.console.log(t.join("\n"))}},loadStyle:n,raiseError:function(e,t){if(!t)throw new Error("MUI: "+e);"undefined"!=typeof console&&console.warn("MUI Warning: "+e)},requestAnimationFrame:function(e){var t=window.requestAnimationFrame;t?t(e):setTimeout(e,0)},supportsPointerEvents:function(){if(void 0!==a)return a;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",a="auto"===e.style.pointerEvents}}},{"../config":3,"./jqLite":5}],7:[function(e,t,r){"use strict";t.exports={controlledMessage:"You provided a `value` prop to a form field without an `OnChange` handler. Please see React documentation on controlled components"}},{}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/jqLite"),i=babelHelpers.interopRequireWildcard(o),s=e("../js/lib/util"),a=babelHelpers.interopRequireWildcard(s),u={color:1,variant:1,size:1},c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.state={rippleStyle:{},rippleIsVisible:!1};var n=a.callback;return r.onMouseDownCB=n(r,"onMouseDown"),r.onMouseUpCB=n(r,"onMouseUp"),r.onMouseLeaveCB=n(r,"onMouseLeave"),r.onTouchStartCB=n(r,"onTouchStart"),r.onTouchEndCB=n(r,"onTouchEnd"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){var e=this.buttonElRef;e._muiDropdown=!0,e._muiRipple=!0}},{key:"onMouseDown",value:function(e){this.showRipple(e);var t=this.props.onMouseDown;t&&t(e)}},{key:"onMouseUp",value:function(e){this.hideRipple(e);var t=this.props.onMouseUp;t&&t(e)}},{key:"onMouseLeave",value:function(e){this.hideRipple(e);var t=this.props.onMouseLeave;t&&t(e)}},{key:"onTouchStart",value:function(e){this.showRipple(e);var t=this.props.onTouchStart;t&&t(e)}},{key:"onTouchEnd",value:function(e){this.hideRipple(e);var t=this.props.onTouchEnd;t&&t(e)}},{key:"showRipple",value:function(e){if(!("ontouchstart"in this.buttonElRef&&"mousedown"===e.type)){var t=i.offset(this.buttonElRef),r=void 0;r="touchstart"===e.type&&e.touches?e.touches[0]:e;var n=Math.sqrt(t.width*t.width+t.height*t.height),l=2*n+"px";this.setState({rippleStyle:{top:Math.round(r.pageY-t.top-n)+"px",left:Math.round(r.pageX-t.left-n)+"px",width:l,height:l},rippleIsVisible:!0})}}},{key:"hideRipple",value:function(e){this.setState({rippleIsVisible:!1})}},{key:"componentDidUpdate",value:function(e,t){var r=this.state,n=this.rippleElRef;r.rippleIsVisible&&!t.rippleIsVisible&&(i.removeClass(n,"mui--is-animating"),i.addClass(n,"mui--is-visible"),a.requestAnimationFrame(function(){i.addClass(n,"mui--is-animating")})),!r.rippleIsVisible&&t.rippleIsVisible&&a.requestAnimationFrame(function(){i.removeClass(n,"mui--is-visible")})}},{key:"render",value:function(){var e=this,t="mui-btn",r=void 0,n=void 0,o=this.props,i=(o.color,o.size,o.variant,babelHelpers.objectWithoutProperties(o,["color","size","variant"]));for(r in u)"default"!==(n=this.props[r])&&(t+=" mui-btn--"+n);return l.default.createElement("button",babelHelpers.extends({},i,{ref:function(t){e.buttonElRef=t},className:t+" "+this.props.className,onMouseUp:this.onMouseUpCB,onMouseDown:this.onMouseDownCB,onMouseLeave:this.onMouseLeaveCB,onTouchStart:this.onTouchStartCB,onTouchEnd:this.onTouchEndCB}),this.props.children,l.default.createElement("span",{className:"mui-btn__ripple-container"},l.default.createElement("span",{ref:function(t){e.rippleElRef=t},className:"mui-ripple",style:this.state.rippleStyle})))}}]),t}(l.default.Component);c.defaultProps={className:"",color:"default",size:"default",variant:"default"},r.default=c,t.exports=r.default},{"../js/lib/jqLite":5,"../js/lib/util":6,react:"1n8/MK"}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,babelHelpers.objectWithoutProperties(e,["children"]));return l.default.createElement("span",babelHelpers.extends({},t,{className:"mui-caret "+this.props.className}))}}]),t}(l.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"1n8/MK"}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){return null}}]),t}(babelHelpers.interopRequireDefault(n).default.Component);l.defaultProps={value:null,label:"",onActive:null},r.default=l,t.exports=r.default},{react:"1n8/MK"}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.TextField=void 0;var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/jqLite"),i=babelHelpers.interopRequireWildcard(o),s=e("../js/lib/util"),a=babelHelpers.interopRequireWildcard(s),u=e("./_helpers"),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.value,l=n||e.defaultValue;void 0===l&&(l=""),r.state={innerValue:l,isTouched:!1,isPristine:!0},void 0===n||e.onChange||a.raiseError(u.controlledMessage,!0);var o=a.callback;return r.onBlurCB=o(r,"onBlur"),r.onChangeCB=o(r,"onChange"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){this.inputElRef._muiTextfield=!0}},{key:"componentWillReceiveProps",value:function(e){"value"in e&&this.setState({innerValue:e.value})}},{key:"onBlur",value:function(e){document.activeElement!==this.inputElRef&&this.setState({isTouched:!0});var t=this.props.onBlur;t&&t(e)}},{key:"onChange",value:function(e){this.setState({innerValue:e.target.value,isPristine:!1});var t=this.props.onChange;t&&t(e)}},{key:"triggerFocus",value:function(){this.inputElRef.focus()}},{key:"render",value:function(){var e=this,t={},r=Boolean(this.state.innerValue.toString()),n=this.props,o=n.hint,i=n.invalid,s=n.rows,u=n.type,c=babelHelpers.objectWithoutProperties(n,["hint","invalid","rows","type"]);return t["mui--is-touched"]=this.state.isTouched,t["mui--is-untouched"]=!this.state.isTouched,t["mui--is-pristine"]=this.state.isPristine,t["mui--is-dirty"]=!this.state.isPristine,t["mui--is-empty"]=!r,t["mui--is-not-empty"]=r,t["mui--is-invalid"]=i,t=a.classNames(t),"textarea"===u?l.default.createElement("textarea",babelHelpers.extends({},c,{ref:function(t){e.inputElRef=t},className:t,rows:s,placeholder:o,onBlur:this.onBlurCB,onChange:this.onChangeCB})):l.default.createElement("input",babelHelpers.extends({},c,{ref:function(t){e.inputElRef=t},className:t,type:u,placeholder:this.props.hint,onBlur:this.onBlurCB,onChange:this.onChangeCB}))}}]),t}(l.default.Component);c.defaultProps={hint:null,invalid:!1,rows:2};var p=function(e){function t(){var e,r,n,l;babelHelpers.classCallCheck(this,t);for(var o=arguments.length,i=Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=n=babelHelpers.possibleConstructorReturn(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.state={style:{}},l=r,babelHelpers.possibleConstructorReturn(n,l)}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){var e=this;this.styleTimer=setTimeout(function(){var t=".15s ease-out",r=void 0;r={transition:t,WebkitTransition:t,MozTransition:t,OTransition:t,msTransform:t},e.setState({style:r})},150)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.styleTimer)}},{key:"render",value:function(){return l.default.createElement("label",{style:this.state.style,onClick:this.props.onClick},this.props.text)}}]),t}(l.default.Component);p.defaultProps={text:"",onClick:null};var d=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.onClickCB=a.callback(r,"onClick"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"onClick",value:function(e){!1===a.supportsPointerEvents()&&(e.target.style.cursor="text",this.inputElRef.triggerFocus())}},{key:"render",value:function(){var e=this,t={},r=void 0,n=this.props,o=(n.children,n.className),s=n.style,u=n.label,d=n.floatingLabel,f=babelHelpers.objectWithoutProperties(n,["children","className","style","label","floatingLabel"]),b=i.type(u);return("string"===b&&u.length||"object"===b)&&(r=l.default.createElement(p,{text:u,onClick:this.onClickCB})),t["mui-textfield"]=!0,t["mui-textfield--float-label"]=d,t=a.classNames(t),l.default.createElement("div",{className:t+" "+o,style:s},l.default.createElement(c,babelHelpers.extends({ref:function(t){e.inputElRef=t}},f)),r)}}]),t}(l.default.Component);d.defaultProps={className:"",label:null,floatingLabel:!1},r.TextField=d},{"../js/lib/jqLite":5,"../js/lib/util":6,"./_helpers":7,react:"1n8/MK"}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=babelHelpers.objectWithoutProperties(e,["children"]);return l.default.createElement("div",babelHelpers.extends({},r,{className:"mui-appbar "+this.props.className}),t)}}]),t}(l.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"1n8/MK"}],13:[function(e,t,r){t.exports=e(8)},{"../js/lib/jqLite":5,"../js/lib/util":6,react:"1n8/MK"}],14:[function(e,t,r){t.exports=e(9)},{react:"1n8/MK"}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/util"),i=(babelHelpers.interopRequireWildcard(o),e("./_helpers"),function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this,t=this.props,r=(t.children,t.className),n=t.label,o=t.autoFocus,i=t.checked,s=t.defaultChecked,a=t.defaultValue,u=t.disabled,c=t.form,p=t.name,d=t.required,f=t.value,b=t.onChange,h=babelHelpers.objectWithoutProperties(t,["children","className","label","autoFocus","checked","defaultChecked","defaultValue","disabled","form","name","required","value","onChange"]);return l.default.createElement("div",babelHelpers.extends({},h,{className:"mui-checkbox "+r}),l.default.createElement("label",null,l.default.createElement("input",{ref:function(t){e.controlEl=t},type:"checkbox",autoFocus:o,checked:i,defaultChecked:s,defaultValue:a,disabled:u,form:c,name:p,required:d,value:f,onChange:b}),n))}}]),t}(l.default.Component));i.defaultProps={className:"",label:null},r.default=i,t.exports=r.default},{"../js/lib/util":6,"./_helpers":7,react:"1n8/MK"}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/util"),i=babelHelpers.interopRequireWildcard(o),s=["xs","sm","md","lg","xl"],a=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e={},t=void 0,r=void 0,n=void 0,o=void 0,a=this.props,u=a.children,c=a.className,p=babelHelpers.objectWithoutProperties(a,["children","className"]);for(t=s.length-1;t>-1;t--)o="mui-col-"+(r=s[t]),(n=this.props[r])&&(e[o+"-"+n]=!0),(n=this.props[r+"-offset"])&&(e[o+"-offset-"+n]=!0),delete p[r],delete p[r+"-offset"];return e=i.classNames(e),l.default.createElement("div",babelHelpers.extends({},p,{className:e+" "+c}),u)}}]),t}(l.default.Component);a.defaultProps={className:"",xs:null,sm:null,md:null,lg:null,xl:null,"xs-offset":null,"sm-offset":null,"md-offset":null,"lg-offset":null,"xl-offset":null},r.default=a,t.exports=r.default},{"../js/lib/util":6,react:"1n8/MK"}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.fluid,o=babelHelpers.objectWithoutProperties(e,["children","className","fluid"]),i="mui-container";return n&&(i+="-fluid"),l.default.createElement("div",babelHelpers.extends({},o,{className:i+" "+r}),t)}}]),t}(l.default.Component);o.defaultProps={className:"",fluid:!1},r.default=o,t.exports=r.default},{react:"1n8/MK"}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,e.className),r=babelHelpers.objectWithoutProperties(e,["children","className"]);return l.default.createElement("div",babelHelpers.extends({},r,{className:"mui-divider "+t}))}}]),t}(l.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"1n8/MK"}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/util"),i=(babelHelpers.interopRequireWildcard(o),function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.link,n=e.target,o=e.value,i=e.onClick,s=babelHelpers.objectWithoutProperties(e,["children","link","target","value","onClick"]);return l.default.createElement("li",s,l.default.createElement("a",{href:r,target:n,"data-mui-value":o,onClick:i},t))}}]),t}(l.default.Component));r.default=i,t.exports=r.default},{"../js/lib/util":6,react:"1n8/MK"}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("./button"),i=babelHelpers.interopRequireDefault(o),s=e("./caret"),a=babelHelpers.interopRequireDefault(s),u=e("../js/lib/jqLite"),c=babelHelpers.interopRequireWildcard(u),p=e("../js/lib/util"),d=babelHelpers.interopRequireWildcard(p),f=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.state={opened:!1,menuTop:0};var n=d.callback;return r.selectCB=n(r,"select"),r.onClickCB=n(r,"onClick"),r.onOutsideClickCB=n(r,"onOutsideClick"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.onOutsideClickCB)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.onOutsideClickCB)}},{key:"onClick",value:function(e){if(0===e.button&&!this.props.disabled&&!e.defaultPrevented){this.toggle();var t=this.props.onClick;t&&t(e)}}},{key:"toggle",value:function(){if(!this.props.children)return d.raiseError("Dropdown menu element not found");this.state.opened?this.close():this.open()}},{key:"open",value:function(){var e=this.wrapperElRef.getBoundingClientRect(),t=void 0;t=this.buttonElRef.buttonElRef.getBoundingClientRect(),this.setState({opened:!0,menuTop:t.top-e.top+t.height})}},{key:"close",value:function(){this.setState({opened:!1})}},{key:"select",value:function(e){this.props.onSelect&&"A"===e.target.tagName&&this.props.onSelect(e.target.getAttribute("data-mui-value")),e.defaultPrevented||this.close()}},{key:"onOutsideClick",value:function(e){this.wrapperElRef.contains(e.target)||this.close()}},{key:"render",value:function(){var e=this,t=void 0,r=void 0,n=void 0,o=this.props,s=o.children,u=o.className,p=o.color,f=o.variant,b=o.size,h=o.label,v=o.alignMenu,m=(o.onClick,o.onSelect,o.disabled),C=babelHelpers.objectWithoutProperties(o,["children","className","color","variant","size","label","alignMenu","onClick","onSelect","disabled"]);if(n="string"===c.type(h)?l.default.createElement("span",null,h," ",l.default.createElement(a.default,null)):h,t=l.default.createElement(i.default,{ref:function(t){e.buttonElRef=t},type:"button",onClick:this.onClickCB,color:p,variant:f,size:b,disabled:m},n),this.state.opened){var y={};y["mui-dropdown__menu"]=!0,y["mui--is-open"]=this.state.opened,y["mui-dropdown__menu--right"]="right"===v,y=d.classNames(y),r=l.default.createElement("ul",{ref:function(t){e.menuElRef=t},className:y,style:{top:this.state.menuTop},onClick:this.selectCB},s)}else r=l.default.createElement("div",null);return l.default.createElement("div",babelHelpers.extends({},C,{ref:function(t){e.wrapperElRef=t},className:"mui-dropdown "+u}),t,r)}}]),t}(l.default.Component);f.defaultProps={className:"",color:"default",variant:"default",size:"default",label:"",alignMenu:"left",onClick:null,onSelect:null,disabled:!1},r.default=f,t.exports=r.default},{"../js/lib/jqLite":5,"../js/lib/util":6,"./button":8,"./caret":9,react:"1n8/MK"}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=e.inline,o=babelHelpers.objectWithoutProperties(e,["children","className","inline"]),i="mui-form";return n&&(i+=" mui-form--inline"),l.default.createElement("form",babelHelpers.extends({},o,{className:i+" "+r}),t)}}]),t}(l.default.Component);o.defaultProps={className:"",inline:!1},r.default=o,t.exports=r.default},{react:"1n8/MK"}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("./text-field"),i=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this;return l.default.createElement(o.TextField,babelHelpers.extends({},this.props,{ref:function(t){t&&t.inputElRef&&(e.controlEl=t.inputElRef.inputElRef)}}))}}]),t}(l.default.Component);i.defaultProps={type:"text"},r.default=i,t.exports=r.default},{"./text-field":11,react:"1n8/MK"}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/forms"),i=(babelHelpers.interopRequireWildcard(o),e("../js/lib/jqLite")),s=(babelHelpers.interopRequireWildcard(i),e("../js/lib/util")),a=(babelHelpers.interopRequireWildcard(s),e("./_helpers"),function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=(e.children,e.label),r=babelHelpers.objectWithoutProperties(e,["children","label"]);return l.default.createElement("option",r,t)}}]),t}(l.default.Component));a.defaultProps={className:"",label:null},r.default=a,t.exports=r.default},{"../js/lib/forms":4,"../js/lib/jqLite":5,"../js/lib/util":6,"./_helpers":7,react:"1n8/MK"}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=babelHelpers.objectWithoutProperties(e,["children","className"]);return l.default.createElement("div",babelHelpers.extends({},n,{className:"mui-panel "+r}),t)}}]),t}(l.default.Component);o.defaultProps={className:""},r.default=o,t.exports=r.default},{react:"1n8/MK"}],25:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this,t=this.props,r=(t.children,t.className),n=t.label,o=t.autoFocus,i=t.checked,s=t.defaultChecked,a=t.defaultValue,u=t.disabled,c=t.form,p=t.name,d=t.required,f=t.value,b=t.onChange,h=babelHelpers.objectWithoutProperties(t,["children","className","label","autoFocus","checked","defaultChecked","defaultValue","disabled","form","name","required","value","onChange"]);return l.default.createElement("div",babelHelpers.extends({},h,{className:"mui-radio "+r}),l.default.createElement("label",null,l.default.createElement("input",{ref:function(t){e.controlEl=t},type:"radio",autoFocus:o,checked:i,defaultChecked:s,defaultValue:a,disabled:u,form:c,name:p,required:d,value:f,onChange:b}),n))}}]),t}(l.default.Component);o.defaultProps={className:"",label:null},r.default=o,t.exports=r.default},{react:"1n8/MK"}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/util"),i=(babelHelpers.interopRequireWildcard(o),function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=e.className,n=babelHelpers.objectWithoutProperties(e,["children","className"]);return l.default.createElement("div",babelHelpers.extends({},n,{className:"mui-row "+r}),t)}}]),t}(l.default.Component));i.defaultProps={className:""},r.default=i,t.exports=r.default},{"../js/lib/util":6,react:"1n8/MK"}],27:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("../js/lib/forms"),i=babelHelpers.interopRequireWildcard(o),s=e("../js/lib/jqLite"),a=babelHelpers.interopRequireWildcard(s),u=e("../js/lib/util"),c=babelHelpers.interopRequireWildcard(u),p=e("./_helpers"),d=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.state={showMenu:!1},!1===e.readOnly&&void 0!==e.value&&null===e.onChange&&c.raiseError(p.controlledMessage,!0),r.state.value=e.value;var n=c.callback;return r.onInnerChangeCB=n(r,"onInnerChange"),r.onInnerMouseDownCB=n(r,"onInnerMouseDown"),r.onOuterClickCB=n(r,"onOuterClick"),r.onOuterKeyDownCB=n(r,"onOuterKeyDown"),r.hideMenuCB=n(r,"hideMenu"),r.onMenuChangeCB=n(r,"onMenuChange"),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentDidMount",value:function(){this.controlEl._muiSelect=!0}},{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.value})}},{key:"componentWillUnmount",value:function(){a.off(window,"resize",this.hideMenuCB),a.off(document,"click",this.hideMenuCB)}},{key:"onInnerChange",value:function(e){var t=e.target.value;this.setState({value:t})}},{key:"onInnerMouseDown",value:function(e){0!==e.button||this.props.useDefault||e.preventDefault()}},{key:"onOuterClick",value:function(e){if(0===e.button&&!this.controlEl.disabled){var t=this.props.onClick;t&&t(e),e.defaultPrevented||this.props.useDefault||(this.wrapperElRef.focus(),this.showMenu())}}},{key:"onOuterKeyDown",value:function(e){var t=this.props.onKeyDown;if(t&&t(e),!e.defaultPrevented&&!this.props.useDefault&&!1===this.state.showMenu){var r=e.keyCode;32!==r&&38!==r&&40!==r||(e.preventDefault(),this.showMenu())}}},{key:"showMenu",value:function(){this.props.useDefault||(a.on(window,"resize",this.hideMenuCB),a.on(document,"click",this.hideMenuCB),this.setState({showMenu:!0}))}},{key:"hideMenu",value:function(){a.off(window,"resize",this.hideMenuCB),a.off(document,"click",this.hideMenuCB),this.setState({showMenu:!1}),this.wrapperElRef.focus()}},{key:"onMenuChange",value:function(e){this.props.readOnly||(this.controlEl.value=e,c.dispatchEvent(this.controlEl,"change"))}},{key:"render",value:function(){var e=this,t=void 0;this.state.showMenu&&(t=l.default.createElement(f,{optionEls:this.controlEl.children,wrapperEl:this.wrapperElRef,onChange:this.onMenuChangeCB,onClose:this.hideMenuCB}));var r="-1",n="0";!1===this.props.useDefault&&(r="0",n="-1");var o=this.props,i=o.children,s=o.className,a=o.style,u=o.label,c=o.defaultValue,p=(o.readOnly,o.useDefault,o.name),d=babelHelpers.objectWithoutProperties(o,["children","className","style","label","defaultValue","readOnly","useDefault","name"]);return l.default.createElement("div",babelHelpers.extends({},d,{ref:function(t){e.wrapperElRef=t},tabIndex:r,style:a,className:"mui-select "+s,onClick:this.onOuterClickCB,onKeyDown:this.onOuterKeyDownCB}),l.default.createElement("select",{ref:function(t){e.controlEl=t},name:p,tabIndex:n,value:this.state.value,defaultValue:c,readOnly:this.props.readOnly,onChange:this.onInnerChangeCB,onMouseDown:this.onInnerMouseDownCB,required:this.props.required},i),l.default.createElement("label",null,u),t)}}]),t}(l.default.Component);d.defaultProps={className:"",name:"",readOnly:!1,useDefault:"undefined"!=typeof document&&"ontouchstart"in document.documentElement,onChange:null,onClick:null,onKeyDown:null};var f=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={origIndex:null,currentIndex:null},r.onKeyDownCB=c.callback(r,"onKeyDown"),r.onKeyPressCB=c.callback(r,"onKeyPress"),r.q="",r.qTimeout=null,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentWillMount",value:function(){var e=this.props.optionEls,t=0,r=void 0;for(r=e.length-1;r>-1;r--)e[r].selected&&(t=r);this.setState({origIndex:t,currentIndex:t})}},{key:"componentDidMount",value:function(){c.enableScrollLock();var e=i.getMenuPositionalCSS(this.props.wrapperEl,this.props.optionEls.length,this.state.currentIndex),t=this.wrapperElRef;a.css(t,e),a.scrollTop(t,e.scrollTop),a.on(document,"keydown",this.onKeyDownCB),a.on(document,"keypress",this.onKeyPressCB)}},{key:"componentWillUnmount",value:function(){c.disableScrollLock(!0),a.off(document,"keydown",this.onKeyDownCB),a.off(document,"keypress",this.onKeyPressCB)}},{key:"onClick",value:function(e,t){t.stopPropagation(),this.selectAndDestroy(e)}},{key:"onKeyDown",value:function(e){var t=e.keyCode;if(9===t)return this.destroy();27!==t&&40!==t&&38!==t&&13!==t||e.preventDefault(),27===t?this.destroy():40===t?this.increment():38===t?this.decrement():13===t&&this.selectAndDestroy()}},{key:"onKeyPress",value:function(e){var t=this;clearTimeout(this.qTimeout),this.q+=e.key,this.qTimeout=setTimeout(function(){t.q=""},300);var r=new RegExp("^"+this.q,"i"),n=this.props.optionEls,l=n.length,o=void 0;for(o=0;o<l;o++)if(r.test(n[o].innerText)){this.setState({currentIndex:o});break}}},{key:"increment",value:function(){this.state.currentIndex!==this.props.optionEls.length-1&&this.setState({currentIndex:this.state.currentIndex+1})}},{key:"decrement",value:function(){0!==this.state.currentIndex&&this.setState({currentIndex:this.state.currentIndex-1})}},{key:"selectAndDestroy",value:function(e){(e=void 0===e?this.state.currentIndex:e)!==this.state.origIndex&&this.props.onChange(this.props.optionEls[e].value),this.destroy()}},{key:"destroy",value:function(){this.props.onClose()}},{key:"render",value:function(){var e=this,t=[],r=this.props.optionEls,n=r.length,o=void 0,i=void 0;for(i=0;i<n;i++)o=i===this.state.currentIndex?"mui--is-selected ":"",o+=r[i].className,t.push(l.default.createElement("div",{key:i,className:o,onClick:this.onClick.bind(this,i)},r[i].textContent));return l.default.createElement("div",{ref:function(t){e.wrapperElRef=t},className:"mui-select__menu"},t)}}]),t}(l.default.Component);f.defaultProps={optionEls:[],wrapperEl:null,onChange:null,onClose:null},r.default=d,t.exports=r.default},{"../js/lib/forms":4,"../js/lib/jqLite":5,"../js/lib/util":6,"./_helpers":7,react:"1n8/MK"}],28:[function(e,t,r){t.exports=e(10)},{react:"1n8/MK"}],29:[function(e,t,r){(function(n){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=window.React,o=babelHelpers.interopRequireDefault(l),i=e("./tab"),s=babelHelpers.interopRequireDefault(i),a=e("../js/lib/util"),u=babelHelpers.interopRequireWildcard(a),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=void 0;"number"==typeof e.initialSelectedIndex?(r=e.initialSelectedIndex,console&&n&&n.env&&"production"!==n.NODE_ENV&&console.warn('MUICSS DEPRECATION WARNING: property "initialSelectedIndex" on the muicss Tabs component is deprecated in favor of "defaultSelectedIndex". It will be removed in a future release.')):r=e.defaultSelectedIndex;var l=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return l.state={currentSelectedIndex:"number"==typeof e.selectedIndex?e.selectedIndex:r},l}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"onClick",value:function(e,t,r){("number"==typeof this.props.selectedIndex&&e!==this.props.selectedIndex||e!==this.state.currentSelectedIndex)&&(this.setState({currentSelectedIndex:e}),t.props.onActive&&t.props.onActive(t),this.props.onChange&&this.props.onChange(e,t.props.value,t,r))}},{key:"render",value:function(){var e=this.props,t=e.children,r=(e.defaultSelectedIndex,e.initialSelectedIndex,e.justified),n=e.selectedIndex,l=babelHelpers.objectWithoutProperties(e,["children","defaultSelectedIndex","initialSelectedIndex","justified","selectedIndex"]),i=o.default.Children.toArray(t),a=[],c=[],p=i.length,d=("number"==typeof n?n:this.state.currentSelectedIndex)%p,f=void 0,b=void 0,h=void 0,v=void 0;for(v=0;v<p;v++)(b=i[v]).type!==s.default&&u.raiseError("Expecting MUITab React Element"),f=v===d,a.push(o.default.createElement("li",{key:v,className:f?"mui--is-active":""},o.default.createElement("a",{onClick:this.onClick.bind(this,v,b)},b.props.label))),h="mui-tabs__pane ",f&&(h+="mui--is-active"),c.push(o.default.createElement("div",{key:v,className:h},b.props.children));return h="mui-tabs__bar",r&&(h+=" mui-tabs__bar--justified"),o.default.createElement("div",l,o.default.createElement("ul",{className:h},a),c)}}]),t}(o.default.Component);c.defaultProps={className:"",defaultSelectedIndex:0,initialSelectedIndex:null,justified:!1,onChange:null,selectedIndex:null},r.default=c,t.exports=r.default}).call(this,e("rh2vBp"))},{"../js/lib/util":6,"./tab":10,react:"1n8/MK",rh2vBp:1}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=window.React,l=babelHelpers.interopRequireDefault(n),o=e("./text-field"),i=function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){var e=this;return l.default.createElement(o.TextField,babelHelpers.extends({},this.props,{ref:function(t){t&&t.inputElRef&&(e.controlEl=t.inputElRef.inputElRef)}}))}}]),t}(l.default.Component);i.defaultProps={type:"textarea"},r.default=i,t.exports=r.default},{"./text-field":11,react:"1n8/MK"}]},{},[2]); |
internals/templates/containers/HomePage/index.js | talal7860/punch-assignment-react | /*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*
* 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 { FormattedMessage } from 'react-intl';
import messages from './messages';
export default class HomePage extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
render() {
return (
<h1>
<FormattedMessage {...messages.header} />
</h1>
);
}
}
|
src/components/case-study/single/templates/tnt/proof.js | adrienhobbs/redux-glow | import React from 'react';
import BaseTemplate from '../base-study-template';
import AboutSection from '../../../content-modules/about.js';
export class Proof extends BaseTemplate {
static propTypes = {
data: React.PropTypes.object
};
constructor (props) {
super(props);
}
render () {
const copyStyle = this.getCopyStyle();
const ResultsSection = this.getResultsTemplate();
return (
<div ref='studyContent' className='study-content'>
<div className='content-container'>
<AboutSection data={this.props.data} />
<ResultsSection data={this.props.data} />
<article className='strategy'>
{this.createHeadlineEl('approach')}
<div className='copy'>
<div className='copy-inner'>
<p style={copyStyle}>GLOW crafted an integrated marketing creative strategy to embrace both skeptics and believers using display and social channels to expand awareness for the new show. We provided entry points to the conversation within media through the hashtags #ihaveproof and #ineedproof, and developed a series of similar creative elements for TNT’s social properties.</p>
<p style={copyStyle}>We approached the Rich Media inventory with sampling as a key goal, leveraged the placements’ capabilities to provide multiple opportunities to view different content within units, and developed high impact custom units that used large-format video to break through the ad clutter.</p>
<p style={copyStyle}>The creative approach worked. By organically incorporating the social hashtag elements into the creative, we leveraged the reach of the media campaign to drive the audience directly to the conversation on social, spiking conversation leading up to premiere and providing sustained engagement to fans for the length of the campaign.</p>
</div>
</div>
<div className='inner_section'>
<div className='img-single'>
<img src='https://s3.amazonaws.com/weareglow-assets/case-studies/tnt/proof/media-01.png' alt='' />
</div>
<div className='img-single'>
<img src='https://s3.amazonaws.com/weareglow-assets/case-studies/tnt/proof/media-02.jpg' alt='' />
</div>
</div>
</article>
</div>
</div>
);
}
}
export default Proof;
|
app/containers/FeaturePage/index.js | nguyenduong127/kong-dashboard | /*
* FeaturePage
*
* List all the features
*/
import React from 'react';
import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl';
import H1 from 'components/H1';
import messages from './messages';
import List from './List';
import ListItem from './ListItem';
import ListItemTitle from './ListItemTitle';
export default class FeaturePage extends React.Component { // eslint-disable-line react/prefer-stateless-function
// Since state and props are static,
// there's no need to re-render this component
shouldComponentUpdate() {
return false;
}
render() {
return (
<div>
<Helmet
title="Feature Page"
meta={[
{ name: 'description', content: 'Feature page of React.js Boilerplate application' },
]}
/>
<H1>
<FormattedMessage {...messages.header} />
</H1>
<List>
<ListItem>
<ListItemTitle>
<FormattedMessage {...messages.scaffoldingHeader} />
</ListItemTitle>
<p>
<FormattedMessage {...messages.scaffoldingMessage} />
</p>
</ListItem>
<ListItem>
<ListItemTitle>
<FormattedMessage {...messages.feedbackHeader} />
</ListItemTitle>
<p>
<FormattedMessage {...messages.feedbackMessage} />
</p>
</ListItem>
<ListItem>
<ListItemTitle>
<FormattedMessage {...messages.routingHeader} />
</ListItemTitle>
<p>
<FormattedMessage {...messages.routingMessage} />
</p>
</ListItem>
<ListItem>
<ListItemTitle>
<FormattedMessage {...messages.networkHeader} />
</ListItemTitle>
<p>
<FormattedMessage {...messages.networkMessage} />
</p>
</ListItem>
<ListItem>
<ListItemTitle>
<FormattedMessage {...messages.intlHeader} />
</ListItemTitle>
<p>
<FormattedMessage {...messages.intlMessage} />
</p>
</ListItem>
</List>
</div>
);
}
}
|
ajax/libs/zeroclipboard/2.0.0/ZeroClipboard.js | mival/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
*/
(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, _Math = _window.Math, _Date = _window.Date, _ActiveXObject = _window.ActiveXObject, _slice = _window.Array.prototype.slice, _keys = _window.Object.keys, _hasOwn = _window.Object.prototype.hasOwnProperty, _defineProperty = function() {
if (typeof _window.Object.defineProperty === "function" && function() {
try {
var x = {};
_window.Object.defineProperty(x, "y", {
value: "z"
});
return x.y === "z";
} catch (e) {
return false;
}
}()) {
return _window.Object.defineProperty;
}
}();
/**
* 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.call(this, 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-(disabled|outdated|unavailable|deactivated|overdue)$/.test(event.name)) {
_extend(event, {
target: null,
minimumVersion: _minimumFlashVersion
});
}
if (/^flash-(outdated|unavailable|deactivated|overdue)$/.test(event.name)) {
_extend(event, {
version: _flashState.version
});
}
}
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);
}
event = _addMouseData(event);
return 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";
_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;
}()); |
app/components/photography/PhotoHeaderXL/index.js | vkurzweg/aloha | /**
*
* PhotoHeaderXl
*
*/
import React from 'react';
// import styled from 'styled-components';
function PhotoHeaderXl() {
return (
<div>
<h3 style={{ textAlign: 'center', color: '#7C4DFF', letterSpacing: '5px', textTransform: 'uppercase', paddingTop: '8%', fontSize: '28px' }}>Photography</h3>
<div style={{ fontSize: '16px', fontFamily: 'Josefin Sans', width: '75%', margin: '0 auto', textAlign: 'center', marginTop: '2%' }}>
<p style={{ fontFamily: 'Josefin Sans', fontSize: '18px' }}><b>Add professional photography to your lesson</b></p>
<ul style={{ width: '50%', display: 'block', margin: '0 auto', textAlign: 'left' }}>
<li style={{ fontFamily: 'Josefin Sans' }}>Your best images, edited & exported in high-quality JPG format</li>
<li style={{ fontFamily: 'Josefin Sans' }}>Email delivery 1-3 days after lesson</li>
</ul>
<div style={{ width: '50%', textAlign: 'center', display: 'block', margin: '0 auto', marginTop: '2%' }}>
<table className="table" style={{ width: '100%', textAlign: 'center' }}>
<tbody>
<tr>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>1 person</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>20 images</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>$85*</td>
</tr>
<tr>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>2 people</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>30 images</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>$60 per person*</td>
</tr>
<tr>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>3 people</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>40 images</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>$45 per person*</td>
</tr>
<tr>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>4 people</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>50 images</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>$37.50 per person*</td>
</tr>
<tr>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>Deluxe (1-5 people)</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>75 images</td>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>$175*</td>
</tr>
<tr>
<td style={{ fontWeight: 'bold', fontSize: '16px' }}>*Add 15% if paying via PayPal (permit fees)</td>
<td />
<td style={{ fontWeight: 'bold', fontSize: '16px' }}></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
);
}
PhotoHeaderXl.propTypes = {
};
export default PhotoHeaderXl;
|
bower_components/monaco-editor-samples/node_modules/monaco-editor/min/vs/editor/editor.main.nls.zh-tw.js | cr7boulos/ast_interpreter | /*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.5.3(793ede49d53dba79d39e52205f16321278f5183c)
* Released under the MIT license
* https://github.com/Microsoft/vscode/blob/master/LICENSE.txt
*-----------------------------------------------------------*/
define("vs/editor/editor.main.nls.zh-tw",{"vs/base/browser/ui/actionbar/actionbar":["{0} ({1})"],"vs/base/browser/ui/aria/aria":["{0} (再次出現)"],"vs/base/browser/ui/findinput/findInput":["使用規則運算式","全字拼寫須相符","大小寫須相符","輸入"],"vs/base/browser/ui/inputbox/inputBox":["錯誤: {0}","警告: {0}","資訊: {0}"],"vs/base/common/errors":["{0}。錯誤碼: {1}","權限被拒絕 (HTTP {0})","權限被拒絕","{0} (HTTP {1}: {2})","{0} (HTTP {1})","未知的連接錯誤 ({0})","發生未知的連接錯誤。可能是您已經沒有連線到網際網路,或是您連接的伺服器已離線。","{0}: {1}","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","發生系統錯誤 ({0})","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","{0} (總計 {1} 個錯誤)","發生未知的錯誤。如需詳細資訊,請參閱記錄檔。","未實作","不合法的狀態: {0}","不合法的引數","不合法的狀態: {0}","不合法的狀態","無法載入需要的檔案。可能是您已經沒有連線到網際網路,或是您連接的伺服器已離線。請重新整理瀏覽器,再試一次。","無法載入必要的檔案。請重新啟動該應用程式,然後再試一次。詳細資料: {0}"],"vs/base/common/json":["符號無效","數字格式無效","Property name expected","Value expected","Colon expected","Comma expected","Closing brace expected","Closing bracket expected","必須為檔案結尾"],"vs/base/common/keyCodes":["Windows","Control","Shift","Alt","Command","Windows","Ctrl","Shift","Alt","Command","Windows"],"vs/base/common/severity":["錯誤","警告","資訊"],"vs/base/parts/quickopen/browser/quickOpenModel":["{0},選擇器","選擇器"],"vs/base/parts/quickopen/browser/quickOpenWidget":["快速選擇器。輸入以縮小結果範圍。","快速選擇器"],"vs/base/parts/tree/browser/treeDefaults":["Collapse"],"vs/editor/browser/standalone/standaloneSchemas":["JSON schema for ASP.NET project.json files","Compilation options that are passed through to Roslyn","The version of the dependency.","The type of the dependency. 'build' dependencies only exist at build time","The dependencies of the application. Each entry specifes the name and the version of a Nuget package.","A command line script or scripts.\r\rAvailable variables:\r%project:Directory% - The project directory\r%project:Name% - The project name\r%project:Version% - The project version","The author of the application","List of files to exclude from publish output (kpm bundle).","Glob pattern to specify all the code files that needs to be compiled. (data type: string or array with glob pattern(s)). Example: [ 'Folder1\\*.cs', 'Folder2\\*.cs' ]","Commands that are available for this application","Configurations are named groups of compilation settings. There are 2 defaults built into the runtime namely 'Debug' and 'Release'.","The description of the application","Glob pattern to indicate all the code files to be excluded from compilation. (data type: string or array with glob pattern(s)).","Target frameworks that will be built, and dependencies that are specific to the configuration.","Glob pattern to indicate all the code files to be preprocessed. (data type: string with glob pattern).","Glob pattern to indicate all the files that need to be compiled as resources.","Scripts to execute during the various stages.","Glob pattern to specify the code files to share with dependent projects. Example: [ 'Folder1\\*.cs', 'Folder2\\*.cs' ]","The version of the application. Example: 1.2.0.0","Specifying the webroot property in the project.json file specifies the web server root (aka public folder). In visual studio, this folder will be used to root IIS. Static files should be put in here.","JSON schema for Bower configuration files","Any property starting with _ is valid.","The name of your package.","Help users identify and search for your package with a brief description.","A semantic version number.","The primary acting files necessary to use your package.","SPDX license identifier or path/url to a license.","A list of files for Bower to ignore when installing your package.","Used for search by keyword. Helps make your package easier to discover without people needing to know its name.","A list of people that authored the contents of the package.","URL to learn more about the package. Falls back to GitHub project if not specified and it's a GitHub endpoint.","The repository in which the source code can be found.","Dependencies are specified with a simple hash of package name to a semver compatible identifier or URL.","Dependencies that are only needed for development of the package, e.g., test framework or building documentation.","Dependency versions to automatically resolve with if conflicts occur between packages.","If you set it to true it will refuse to publish it. This is a way to prevent accidental publication of private repositories.","Used by grunt-bower-task to specify custom install locations.","The types of modules this package exposes","NPM configuration for this package.","A person who has been involved in creating or maintaining this package","Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.","Any property starting with _ is valid.","The name of the package.","Version must be parseable by node-semver, which is bundled with npm as a dependency.","This helps people discover your package, as it's listed in 'npm search'.","The relative path to the icon of the package.","This helps people discover your package as it's listed in 'npm search'.","The url to the project homepage.","The url to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.","The url to your project's issue tracker.","The email address to which issues should be reported.","You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.","You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.","A list of people who contributed to this package.","A list of people who maintains this package.","The 'files' field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder.","The main field is a module ID that is the primary entry point to your program.","Specify either a single file or an array of filenames to put in place for the man program to find.","If you specify a 'bin' directory, then all the files in that folder will be used as the 'bin' hash.","Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.","Put example scripts in here. Someday, it might be exposed in some clever way.","Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.","A folder that is full of man pages. Sugar to generate a 'man' array by walking the folder.","Specify the place where your code lives. This is helpful for people who want to contribute.","The 'scripts' member is an object hash of script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.","A 'config' hash can be used to set configuration parameters used in package scripts that persist across upgrades.","Array of package names that will be bundled when publishing the package.","Array of package names that will be bundled when publishing the package.","If your package is primarily a command-line application that should be installed globally, then set this value to true to provide a warning if it is installed locally.","If set to true, then npm will refuse to publish it.","JSON schema for the ASP.NET global configuration files","A list of project folders relative to this file.","A list of source folders relative to this file.","The runtime to use.","The runtime version to use.","The runtime to use, e.g. coreclr","The runtime architecture to use, e.g. x64.","JSON schema for the TypeScript compiler's configuration file","Instructs the TypeScript compiler how to compile .ts files","The character set of the input files","Generates corresponding d.ts files.","Show diagnostic information.","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.","Emit a single file with source maps instead of having a separate file.","Emit the source alongside the sourcemaps within a single file; requires --inlineSourceMap to be set.","Print names of files part of the compilation.","The locale to use to show error messages, e.g. en-us.","Specifies the location where debugger should locate map files instead of generated locations","Specify module code generation: 'CommonJS', 'Amd', 'System', or 'UMD'.","Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).)","Do not emit output.","Do not emit outputs if any type checking errors were reported.","Do not generate custom helper functions like __extends in compiled output.","Warn on expressions and declarations with an implied 'any' type.","Do not include the default library file (lib.d.ts).","Do not add triple-slash references or module import targets to the list of compiled files.","Concatenate and emit output to single file.","Redirect output structure to the directory.","Do not erase const enum declarations in generated code.","Do not emit comments to output.","Specifies the root directory of input files. Use to control the output directory structure with --outDir.","Generates corresponding '.map' file.","Specifies the location where debugger should locate TypeScript files instead of source locations.","Suppress noImplicitAny errors for indexing objects lacking index signatures.","Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental).","Watch input files.","Enable the JSX option (requires TypeScript 1.6): 'preserve', 'react'.","Emits meta data.for ES7 decorators.","Supports transpiling single TS files into JS files.","Enables experimental support for ES7 decorators.","Enables experimental support for async functions (requires TypeScript 1.6).","If no 'files' property is present in a tsconfig.json, the compiler defaults to including all files the containing directory and subdirectories. When a 'files' property is specified, only those files are included.","JSON schema for the JavaScript configuration file","Instructs the JavaScript language service how to validate .js files","The character set of the input files","Show diagnostic information.","The locale to use to show error messages, e.g. en-us.","Specifies the location where debugger should locate map files instead of generated locations","Module code generation to resolve against: 'commonjs', 'amd', 'system', or 'umd'.","Do not include the default library file (lib.d.ts).","Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental).","Enables experimental support for ES7 decorators.","If no 'files' property is present in a jsconfig.json, the language service defaults to including all files the containing directory and subdirectories. When a 'files' property is specified, only those files are included.","List files and folders that should not be included. This property is not honored when the 'files' property is present."],"vs/editor/common/config/commonEditorConfig":["編輯器組態","控制字型家族。","控制字型大小。","控制行高。","控制是否顯示行號","控制是否顯示字符邊界","要在其中顯示垂直尺規的資料行","執行文字相關導覽或作業時將作為文字分隔符號的字元","與 Tab 相等的空格數量。","必須是 'number'。請注意,值 \"auto\" 已由 `editor.detectIndentation` 設定取代。","按 Tab 時插入空格。","必須是 'boolean'。請注意,值 \"auto\" 已由 `editor.detect Indentation` 設定取代。","開啟檔案時,會依據檔案內容來偵測 `editor.tabSize` 及 `editor.insertSpaces`。","控制選取範圍是否有圓角","控制編輯器是否會捲動到最後一行之後","控制編輯器換行到下一行的字元數。若將此項目設為 0,將會開啟檢視區寬度換行 (自動換行)。若將此項目設為 -1,將會強制編輯器永不換行。","控制換行的縮排。可以是 [無]、[相同] 或 [縮排]。","滑鼠滾輪捲動事件的 'deltaX' 與 'deltaY' 所使用的乘數","控制輸入時是否應顯示快速建議","控制延遲顯示快速建議的毫秒數","Enables parameter hints","控制編輯器是否應在左括號後自動插入右括號","控制編輯器是否應在輸入一行後自動格式化","控制輸入觸發字元時,是否應自動顯示建議","控制除了 'Tab' 外,是否也藉由按下 'Enter' 接受建議。如此可避免混淆要插入新行或接受建議。","控制編輯器是否應反白顯示與選取範圍相似的符合項","控制可在概觀尺規中相同位置顯示的裝飾項目數","控制游標閃爍動畫,接受的值為 'blink'、'visible' 和 'hidden'","控制游標樣式,接受的值為 'block' 和 'line'","啟用連字字型","控制游標是否應隱藏在概觀尺規中。","控制編輯器是否應顯示空白字元","控制編輯器是否會顯示支援編輯器的模式之參考資訊","控制編輯器是否已啟用程式碼摺疊功能","插入和刪除接在定位停駐點後的空白字元","移除尾端自動插入的空白字元","Keep peek editors open even when double clicking their content or when hitting Escape.","控制 Diff 編輯器要並排或內嵌顯示差異","控制 Diff 編輯器是否將開頭或尾端空白字元的變更顯示為差異","控制是否應支援 Linux 主要剪貼簿。"],"vs/editor/common/config/defaultConfig":["編輯器內容"],"vs/editor/common/controller/cursor":["執行命令時發生未預期的例外狀況。"],"vs/editor/common/model/textModelWithTokens":["將輸入語彙基元化時,模式失敗。"],"vs/editor/common/modes/modesRegistry":["純文字"],"vs/editor/common/modes/supports/suggestSupport":["啟用字組式建議。"],"vs/editor/common/services/bulkEdit":["這些檔案已同時變更: {0}"],"vs/editor/common/services/modeServiceImpl":["提供語言宣告。","語言的識別碼。","語言的別名名稱。","與語言相關聯的副檔名。","與語言相關聯的檔案名稱。","與語言相關聯的檔案名稱 Glob 模式。","與語言相關聯的 MIME 類型。","規則運算式,符合語言檔案的第一行。","檔案的相對路徑,其中該檔案包含語言組態選項。","`contributes.{0}` 值為空值","屬性 '{0}' 為強制項目且必須屬於 `string` 類型","屬性 '{0}' 可以省略且必須屬於 `string[]` 類型","屬性 '{0}' 可以省略且必須屬於 `string[]` 類型","屬性 '{0}' 可以省略且必須屬於 `string` 類型","屬性 '{0}' 可以省略且必須屬於 `string` 類型","屬性 '{0}' 可以省略且必須屬於 `string[]` 類型","屬性 '{0}' 可以省略且必須屬於 `string[]` 類型","`contributes.{0}` 無效。必須是陣列。"],"vs/editor/common/services/modelServiceImpl":['請更新您的設定: `editor.detect Indentation` 會取代 `editor.tabSize`: "auto" 或 `editor.insertSpaces`: "auto"'],"vs/editor/contrib/accessibility/browser/accessibility":["顯示協助工具說明","感謝您試用 VSCode 的實驗協助工具選項。","狀態:","在此編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。按 {0} 可切換此行為。","在此編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。目前無法透過按鍵繫結關係觸發命令 {0}。","在此編輯器中按 Tab 鍵會插入定位字元。按 {0} 可切換此行為。","在此編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。目前無法透過按鍵繫結關係觸發命令 {0}。","您可以按 Esc 鍵來解除此工具提示並返回編輯器。"],"vs/editor/contrib/carretOperations/common/carretOperations":["Move Carret Left","Move Carret Right"],"vs/editor/contrib/clipboard/browser/clipboard":["剪下","複製","貼上"],"vs/editor/contrib/comment/common/comment":["切換行註解","加入行註解","移除行註解","切換區塊註解"],"vs/editor/contrib/contextmenu/browser/contextmenu":["顯示編輯器內容功能表"],"vs/editor/contrib/defineKeybinding/browser/defineKeybinding":["定義按鍵繫結關係","按下所需的按鍵組合,再按 ENTER 鍵","定義按鍵繫結關係","針對您目前的鍵盤配置,請按 ","您無法在目前的鍵盤配置下產生此按鍵組合。"],"vs/editor/contrib/find/browser/findWidget":["尋找","尋找","上一個符合項","下一個相符項","在選取範圍中尋找","關閉","取代","取代","取代","全部取代","切換取代模式","只會將前 999 筆結果醒目提示,但所有尋找作業會在完整文字上執行。","{0} / {1}","沒有結果"],"vs/editor/contrib/find/common/findController":["選取所有找到的相符項出現處","變更所有發生次數","尋找","尋找下一個","尋找上一個","尋找下一個選取項目","尋找上一個選取項目","取代","將最後一個選擇項目移至下一個找到的相符項","將選取項目加入下一個找到的相符項"],"vs/editor/contrib/folding/browser/folding":["展開","Unfold Recursively","摺疊","Fold Recursively","全部摺疊","全部展開","摺疊層級 1","摺疊層級 2","摺疊層級 3","摺疊層級 4","摺疊層級 5"],"vs/editor/contrib/format/common/formatActions":["格式化程式碼"],"vs/editor/contrib/goToDeclaration/browser/goToDeclaration":[" - {0} 個定義","按一下以顯示找到的 {0} 個定義。","預覽定義","移至定義","在一側開啟定義"],"vs/editor/contrib/gotoError/browser/gotoError":["建議的修正程式: ","建議的修正程式: ","({0}/{1}) [{2}]","({0}/{1})","移至下一個錯誤或警告","移至上一個錯誤或警告"],"vs/editor/contrib/hover/browser/hover":["動態顯示"],"vs/editor/contrib/hover/browser/modesContentHover":["正在載入..."],"vs/editor/contrib/inPlaceReplace/common/inPlaceReplace":["以上一個值取代","以下一個值取代"],"vs/editor/contrib/indentation/common/indentation":["已設定的定位點大小","選取目前檔案的定位點大小","將縮排轉換成空格","將縮排轉換成定位點","使用空格鍵進行縮排","使用 Tab 進行縮排","偵測內容中的縮排","切換轉譯空白字元"],"vs/editor/contrib/linesOperations/common/linesOperations":["刪除行","遞增排序行","遞減排序行","修剪尾端空白","下移一行","上移一行","將行向下複製","將行向上複製","縮排行","凸排行","在上方插入行","在下方插入行"],"vs/editor/contrib/links/browser/links":["按住 Cmd 並按一下按鍵以追蹤連結","按住 CTRL 並按一下按鍵以追蹤連結","URI 無效: 無法開啟 {0}","開啟連結"],"vs/editor/contrib/multicursor/common/multicursor":["在上方加入游標","在下方加入游標","從選取的行建立多個游標"],"vs/editor/contrib/parameterHints/browser/parameterHints":["觸發參數提示"],"vs/editor/contrib/parameterHints/browser/parameterHintsWidget":["{0},提示"],"vs/editor/contrib/quickFix/browser/quickFix":["Quick Fix"],"vs/editor/contrib/quickFix/browser/quickFixSelectionWidget":["{0},快速檢修建議","正在載入...","沒有修正建議。","Quick Fix","{0},接受"],"vs/editor/contrib/quickOpen/browser/gotoLine":["移至行 {0} 和資料行 {1}","移至第 {0} 行","輸入介於 1 到 {0} 之間要瀏覽至的行號","輸入介於 1 和 {0} 之間要瀏覽至的資料行","Go to line {0}","移至行...","輸入行號,後接選擇性的冒號和資料行數字,以瀏覽至"],"vs/editor/contrib/quickOpen/browser/gotoLine.contribution":["移至行..."],"vs/editor/contrib/quickOpen/browser/quickCommand":["{0}, commands","命令選擇區","輸入您想要執行的動作名稱"],"vs/editor/contrib/quickOpen/browser/quickCommand.contribution":["命令選擇區"],"vs/editor/contrib/quickOpen/browser/quickOutline":["{0}, symbols","移至符號...","請輸入您想要瀏覽至的識別項名稱","符號 ({0})","模組 ({0})","類別 ({0})","介面 ({0})","方法 ({0})","函式 ({0})","屬性 ({0})","變數 ({0})","變數 ({0})","建構函式 ({0})","呼叫 ({0})"],"vs/editor/contrib/quickOpen/browser/quickOutline.contribution":["移至符號..."],"vs/editor/contrib/referenceSearch/browser/referenceSearch":[" - {0} 個參考","尋找所有參考","顯示參考"],"vs/editor/contrib/referenceSearch/browser/referencesController":["正在載入..."],"vs/editor/contrib/referenceSearch/browser/referencesWidget":["Failed to resolve file.","{0} 個參考","{0} 個參考","no preview available","參考","沒有結果","參考"],"vs/editor/contrib/rename/browser/rename":["重新命名符號"],"vs/editor/contrib/rename/browser/renameInputField":["為輸入重新命名。請鍵入新名稱,然後按 Enter 以認可。"],"vs/editor/contrib/rename/common/rename":["沒有結果。"],"vs/editor/contrib/smartSelect/common/jumpToBracket":["移至方括弧"],"vs/editor/contrib/smartSelect/common/smartSelect":["展開選取","縮小選取"],"vs/editor/contrib/suggest/browser/suggest":["觸發建議"],"vs/editor/contrib/suggest/browser/suggestWidget":["進一步了解...{0}","{0},建議,有詳細資料","{0},建議","返回","正在載入...","無建議。","{0},接受","{0},建議,有詳細資料","{0},建議"],"vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode":["切換使用 TAB 鍵來設定焦點"],"vs/editor/contrib/toggleWordWrap/common/toggleWordWrap":["檢視: 切換自動換行"],"vs/editor/contrib/zoneWidget/browser/peekViewWidget":["關閉"],"vs/languages/html/common/html.contribution":["HTML 設定","每行的字元數上限 (0 = 停用)。","不應重新格式化的標記清單,須以逗號分隔。'null' 的預設值為所有內嵌標記。","縮排 <head> 及 <body> 區段。","是否應保留項目前方現有的分行符號。僅適用於項目前方,而不適用於標記內或文字。","一個區塊要保留的最大分行符號數。使用 'null' 表示無限制。","格式化並縮排 {{#foo}} 及 {{/foo}}。","以新行字元結尾。","前方應有額外新行字元的標記清單,須以逗號分隔。'null' 的預設值為 \"head, body, /html\"。"],"vs/platform/actions/browser/menuItemActionItem":["{0} ({1})"],"vs/platform/configuration/common/configurationRegistry":["提供組態設定。","設定的摘要。此標籤將會在設定檔中作為分隔註解使用。","組態屬性的描述。","如果已設定,'configuration.type' 必須設定為物件","'configuration.title' 必須是字串","'configuration.properties' 必須是物件"],"vs/platform/extensions/common/abstractExtensionService":["擴充功能 `{1}` 無法啟動。原因: 未知的相依性 `{0}`。","擴充功能 `{1}` 無法啟動。原因: 相依性 `{0}` 無法啟動。","擴充功能 `{0}` 無法啟動。原因: 相依性超過 10 個層級 (很可能是相依性迴圈)。","啟動擴充功能 `{0}` 失敗: {1}。"],"vs/platform/extensions/common/extensionsRegistry":["得到空白擴充功能描述","屬性 '{0}' 為強制項目且必須屬於 `string` 類型","屬性 '{0}' 為強制項目且必須屬於 `string` 類型","屬性 '{0}' 為強制項目且必須屬於 `string` 類型","屬性 '{0}' 為強制項目且必須屬於 `object` 類型","屬性 '{0}' 為強制項目且必須屬於 `string` 類型","屬性 `{0}` 可以省略或必須屬於 `string[]` 類型","屬性 `{0}` 可以省略或必須屬於 `string[]` 類型","屬性 `{0}` 和 `{1}` 必須同時指定或同時忽略","屬性 `{0}` 可以省略或必須屬於 `string` 類型","`main` ({0}) 必須包含在擴充功能的資料夾 ({1}) 中。這可能會使擴充功能無法移植。","屬性 `{0}` 和 `{1}` 必須同時指定或同時忽略","VS Code 資源庫中使用的擴充功能顯示名稱。","VS Code 資源庫用來將擴充功能歸類的分類。","用於 VS Code Marketplace 的橫幅。","VS Code Marketplace 頁首的橫幅色彩。","橫幅中使用的字型色彩佈景主題。","VS Code 擴充功能的發行者。","VS Code 擴充功能的啟動事件。","其它擴充功能的相依性。擴充功能的識別碼一律為 ${publisher}.${name}。例如: vscode.csharp。","在封裝作為 VS Code 擴充功能發行前所執行的指令碼。","此封裝所代表的所有 VS Code 擴充功能比重。"],"vs/platform/jsonschemas/common/jsonContributionRegistry":["使用結構描述來描述 JSON 檔案。如需詳細資訊,請參閱 json-schema.org。","結構描述的唯一識別碼。","結構描述,用來驗證此文件","元素的描述性標題","元素的詳細描述。用於暫留功能表和建議。","預設值。供建議使用。","應該會整除目前值的數字 (即沒有餘數)","最大數值,預設為包含。","將最大值屬性設為排除。","最小數值,預設為包含。","將最小值屬性設為排除。","字串的最大長度。","字串的最小長度。","規則運算式,用來比對字串。其未隱含錨定。","用於陣列 (只有在項目設為陣列時)。如果為結構描述,這個結構描述會驗證項目陣列所指定的項目之後的項目。如果為 False,則額外的項目會導致驗證失敗。","用於陣列。可以是用來比對驗證每個元素的結構描述,或是用來依序比對驗證每個項目的結構描述陣列 (第一個結構描述驗證第一個元素,第二個結構描述驗證第二個元素,依此類推)。","可包含在陣列中的最大項目數。包含。","可包含在陣列中的最小項目數。包含。","陣列中的所有項目是否都必須為唯一。預設為 False。","物件可具有的最大屬性數目。包含。","物件可具有的最小屬性數目。包含。","這個字串陣列會列出這個物件所需的所有屬性的名稱。","為結構描述或布林值。若為結構描述,將會用以驗證所有不符合 'properties' 或 'patternProperties' 的屬性。若為 false,則所有不符合這兩項其中之一的屬性,都會導致此結構描述失敗。","不用於驗證。將您要利用 $ref 內嵌參考的子結構描述置於此","每個屬性的屬性名稱對結構描述對應。","屬性名稱的規則運算式對結構描述的對應,用於比對屬性。","屬性名稱對屬性名稱陣列或結構描述的對應。屬性名稱陣列表示索引鍵中的命名屬性若要有效,陣列中的屬性必須出現在物件中。如果值是結構描述,則只有在索引鍵中的屬性存在物件上時才會將結構描述套用到該物件。","有效常值的集合","可以是其中一個基本結構描述類型 (數字、整數、null、陣列、物件、布林值、字串) 的字串,或是指定這些類型子集的字串陣列。","描述此值預期的格式。","結構描述的陣列,必須全部符合。","結構描述的陣列,其中至少一個必須符合。","結構描述的陣列,其中剛好一個必須符合。","不能相符的結構描述。"],"vs/platform/keybinding/browser/keybindingServiceImpl":["其他可用命令如下: ","已按下 ({0})。請等待第二個套索鍵...","按鍵組合 ({0}, {1}) 不是命令。"],"vs/platform/message/common/message":["關閉","取消"]});
//# sourceMappingURL=../../../min-maps/vs/editor/editor.main.nls.zh-tw.js.map |
draft-js-counter-plugin/src/CustomCounter/__test__/index.js | draft-js-plugins/draft-js-plugins-v1 | import React from 'react';
import { mount } from 'enzyme';
import createCounterPlugin from '../../index';
import { expect } from 'chai';
import { EditorState, ContentState } from 'draft-js';
describe('CounterPlugin Line Counter', () => {
const createEditorStateFromText = (text) => {
const contentState = ContentState.createFromText(text);
return EditorState.createWithContent(contentState);
};
let counterPlugin;
beforeEach(() => {
counterPlugin = createCounterPlugin();
});
it('instantiates plugin with word counter and counts 5 words', () => {
const text = 'Hello there, how are you?';
const editorState = createEditorStateFromText(text);
counterPlugin.initialize({
getEditorState: () => editorState,
});
const { CustomCounter } = counterPlugin;
// a function that takes a string and returns the number of words
const countFunction = (str) => {
const wordArray = str.match(/\S+/g); // matches words according to whitespace
return wordArray ? wordArray.length : 0;
};
const result = mount(
<CustomCounter countFunction={ countFunction } />
);
expect(result).to.have.text('5');
});
it('instantiates plugin with number counter and counts 6 number characters', () => {
const text = 'I am a 1337 h4x0r';
const editorState = createEditorStateFromText(text);
counterPlugin.initialize({
getEditorState: () => editorState,
});
const { CustomCounter } = counterPlugin;
// a function that takes a string and returns the number of number characters
const countFunction = (str) => {
const numArray = str.match(/\d/g); // matches only number characters
return numArray ? numArray.length : 0;
};
const result = mount(
<CustomCounter countFunction={ countFunction } />
);
expect(result).to.have.text('6');
});
});
|
ajax/libs/react-native-web/0.0.0-0d489d046/exports/Touchable/index.js | cdnjs/cdnjs | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
*/
'use strict';
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
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 _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; }
import AccessibilityUtil from '../../modules/AccessibilityUtil';
import BoundingDimensions from './BoundingDimensions';
import findNodeHandle from '../findNodeHandle';
import normalizeColor from 'normalize-css-color';
import Position from './Position';
import React from 'react';
import UIManager from '../UIManager';
import View from '../View';
var extractSingleTouch = function extractSingleTouch(nativeEvent) {
var touches = nativeEvent.touches;
var changedTouches = nativeEvent.changedTouches;
var hasTouches = touches && touches.length > 0;
var hasChangedTouches = changedTouches && changedTouches.length > 0;
return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;
};
/**
* `Touchable`: Taps done right.
*
* You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable`
* will measure time/geometry and tells you when to give feedback to the user.
*
* ====================== Touchable Tutorial ===============================
* The `Touchable` mixin helps you handle the "press" interaction. It analyzes
* the geometry of elements, and observes when another responder (scroll view
* etc) has stolen the touch lock. It notifies your component when it should
* give feedback to the user. (bouncing/highlighting/unhighlighting).
*
* - When a touch was activated (typically you highlight)
* - When a touch was deactivated (typically you unhighlight)
* - When a touch was "pressed" - a touch ended while still within the geometry
* of the element, and no other element (like scroller) has "stolen" touch
* lock ("responder") (Typically you bounce the element).
*
* A good tap interaction isn't as simple as you might think. There should be a
* slight delay before showing a highlight when starting a touch. If a
* subsequent touch move exceeds the boundary of the element, it should
* unhighlight, but if that same touch is brought back within the boundary, it
* should rehighlight again. A touch can move in and out of that boundary
* several times, each time toggling highlighting, but a "press" is only
* triggered if that touch ends while within the element's boundary and no
* scroller (or anything else) has stolen the lock on touches.
*
* To create a new type of component that handles interaction using the
* `Touchable` mixin, do the following:
*
* - Initialize the `Touchable` state.
*
* getInitialState: function() {
* return merge(this.touchableGetInitialState(), yourComponentState);
* }
*
* - Choose the rendered component who's touches should start the interactive
* sequence. On that rendered node, forward all `Touchable` responder
* handlers. You can choose any rendered node you like. Choose a node whose
* hit target you'd like to instigate the interaction sequence:
*
* // In render function:
* return (
* <View
* onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
* onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
* onResponderGrant={this.touchableHandleResponderGrant}
* onResponderMove={this.touchableHandleResponderMove}
* onResponderRelease={this.touchableHandleResponderRelease}
* onResponderTerminate={this.touchableHandleResponderTerminate}>
* <View>
* Even though the hit detection/interactions are triggered by the
* wrapping (typically larger) node, we usually end up implementing
* custom logic that highlights this inner one.
* </View>
* </View>
* );
*
* - You may set up your own handlers for each of these events, so long as you
* also invoke the `touchable*` handlers inside of your custom handler.
*
* - Implement the handlers on your component class in order to provide
* feedback to the user. See documentation for each of these class methods
* that you should implement.
*
* touchableHandlePress: function() {
* this.performBounceAnimation(); // or whatever you want to do.
* },
* touchableHandleActivePressIn: function() {
* this.beginHighlighting(...); // Whatever you like to convey activation
* },
* touchableHandleActivePressOut: function() {
* this.endHighlighting(...); // Whatever you like to convey deactivation
* },
*
* - There are more advanced methods you can implement (see documentation below):
* touchableGetHighlightDelayMS: function() {
* return 20;
* }
* // In practice, *always* use a predeclared constant (conserve memory).
* touchableGetPressRectOffset: function() {
* return {top: 20, left: 20, right: 20, bottom: 100};
* }
*/
/**
* Touchable states.
*/
var States = {
NOT_RESPONDER: 'NOT_RESPONDER',
// Not the responder
RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN',
// Responder, inactive, in the `PressRect`
RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT',
// Responder, inactive, out of `PressRect`
RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN',
// Responder, active, in the `PressRect`
RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT',
// Responder, active, out of `PressRect`
RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN',
// Responder, active, in the `PressRect`, after long press threshold
RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',
// Responder, active, out of `PressRect`, after long press threshold
ERROR: 'ERROR'
};
/*
* Quick lookup map for states that are considered to be "active"
*/
var baseStatesConditions = {
NOT_RESPONDER: false,
RESPONDER_INACTIVE_PRESS_IN: false,
RESPONDER_INACTIVE_PRESS_OUT: false,
RESPONDER_ACTIVE_PRESS_IN: false,
RESPONDER_ACTIVE_PRESS_OUT: false,
RESPONDER_ACTIVE_LONG_PRESS_IN: false,
RESPONDER_ACTIVE_LONG_PRESS_OUT: false,
ERROR: false
};
var IsActive = _objectSpread(_objectSpread({}, baseStatesConditions), {}, {
RESPONDER_ACTIVE_PRESS_OUT: true,
RESPONDER_ACTIVE_PRESS_IN: true
});
/**
* Quick lookup for states that are considered to be "pressing" and are
* therefore eligible to result in a "selection" if the press stops.
*/
var IsPressingIn = _objectSpread(_objectSpread({}, baseStatesConditions), {}, {
RESPONDER_INACTIVE_PRESS_IN: true,
RESPONDER_ACTIVE_PRESS_IN: true,
RESPONDER_ACTIVE_LONG_PRESS_IN: true
});
var IsLongPressingIn = _objectSpread(_objectSpread({}, baseStatesConditions), {}, {
RESPONDER_ACTIVE_LONG_PRESS_IN: true
});
/**
* Inputs to the state machine.
*/
var Signals = {
DELAY: 'DELAY',
RESPONDER_GRANT: 'RESPONDER_GRANT',
RESPONDER_RELEASE: 'RESPONDER_RELEASE',
RESPONDER_TERMINATED: 'RESPONDER_TERMINATED',
ENTER_PRESS_RECT: 'ENTER_PRESS_RECT',
LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT',
LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED'
};
/**
* Mapping from States x Signals => States
*/
var Transitions = {
NOT_RESPONDER: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
RESPONDER_RELEASE: States.ERROR,
RESPONDER_TERMINATED: States.ERROR,
ENTER_PRESS_RECT: States.ERROR,
LEAVE_PRESS_RECT: States.ERROR,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_INACTIVE_PRESS_IN: {
DELAY: States.RESPONDER_ACTIVE_PRESS_IN,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_INACTIVE_PRESS_OUT: {
DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_ACTIVE_PRESS_IN: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
},
RESPONDER_ACTIVE_PRESS_OUT: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_ACTIVE_LONG_PRESS_IN: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
},
RESPONDER_ACTIVE_LONG_PRESS_OUT: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
error: {
DELAY: States.NOT_RESPONDER,
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.NOT_RESPONDER,
LEAVE_PRESS_RECT: States.NOT_RESPONDER,
LONG_PRESS_DETECTED: States.NOT_RESPONDER
}
}; // ==== Typical Constants for integrating into UI components ====
// var HIT_EXPAND_PX = 20;
// var HIT_VERT_OFFSET_PX = 10;
var HIGHLIGHT_DELAY_MS = 130;
var PRESS_EXPAND_PX = 20;
var LONG_PRESS_THRESHOLD = 500;
var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;
var LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount "active" region protrudes beyond box
/**
* By convention, methods prefixed with underscores are meant to be @private,
* and not @protected. Mixers shouldn't access them - not even to provide them
* as callback handlers.
*
*
* ========== Geometry =========
* `Touchable` only assumes that there exists a `HitRect` node. The `PressRect`
* is an abstract box that is extended beyond the `HitRect`.
*
* +--------------------------+
* | | - "Start" events in `HitRect` cause `HitRect`
* | +--------------------+ | to become the responder.
* | | +--------------+ | | - `HitRect` is typically expanded around
* | | | | | | the `VisualRect`, but shifted downward.
* | | | VisualRect | | | - After pressing down, after some delay,
* | | | | | | and before letting up, the Visual React
* | | +--------------+ | | will become "active". This makes it eligible
* | | HitRect | | for being highlighted (so long as the
* | +--------------------+ | press remains in the `PressRect`).
* | PressRect o |
* +----------------------|---+
* Out Region |
* +-----+ This gap between the `HitRect` and
* `PressRect` allows a touch to move far away
* from the original hit rect, and remain
* highlighted, and eligible for a "Press".
* Customize this via
* `touchableGetPressRectOffset()`.
*
*
*
* ======= State Machine =======
*
* +-------------+ <---+ RESPONDER_RELEASE
* |NOT_RESPONDER|
* +-------------+ <---+ RESPONDER_TERMINATED
* +
* | RESPONDER_GRANT (HitRect)
* v
* +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+
* |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN|
* +---------------------------+ +-------------------------+ +------------------------------+
* + ^ + ^ + ^
* |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_
* |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT
* | | | | | |
* v + v + v +
* +----------------------------+ DELAY +--------------------------+ +-------------------------------+
* |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT|
* +----------------------------+ +--------------------------+ +-------------------------------+
*
* T + DELAY => LONG_PRESS_DELAY_MS + DELAY
*
* Not drawn are the side effects of each transition. The most important side
* effect is the `touchableHandlePress` abstract method invocation that occurs
* when a responder is released while in either of the "Press" states.
*
* The other important side effects are the highlight abstract method
* invocations (internal callbacks) to be implemented by the mixer.
*
*
* @lends Touchable.prototype
*/
var TouchableMixin = {
// HACK (part 1): basic support for touchable interactions using a keyboard
componentDidMount: function componentDidMount() {
var _this = this;
this._touchableNode = findNodeHandle(this);
if (this._touchableNode && this._touchableNode.addEventListener) {
this._touchableBlurListener = function (e) {
if (_this._isTouchableKeyboardActive) {
if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) {
_this.touchableHandleResponderTerminate({
nativeEvent: e
});
}
_this._isTouchableKeyboardActive = false;
}
};
this._touchableNode.addEventListener('blur', this._touchableBlurListener);
}
},
/**
* Clear all timeouts on unmount
*/
componentWillUnmount: function componentWillUnmount() {
if (this._touchableNode && this._touchableNode.addEventListener) {
this._touchableNode.removeEventListener('blur', this._touchableBlurListener);
}
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); // Clear DOM nodes
this.pressInLocation = null;
this.state.touchable.responderID = null;
this._touchableNode = null;
},
/**
* It's prefer that mixins determine state in this way, having the class
* explicitly mix the state in the one and only `getInitialState` method.
*
* @return {object} State object to be placed inside of
* `this.state.touchable`.
*/
touchableGetInitialState: function touchableGetInitialState() {
return {
touchable: {
touchState: undefined,
responderID: null
}
};
},
// ==== Hooks to Gesture Responder system ====
/**
* Must return true if embedded in a native platform scroll view.
*/
touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() {
return !this.props.rejectResponderTermination;
},
/**
* Must return true to start the process of `Touchable`.
*/
touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() {
return !this.props.disabled;
},
/**
* Return true to cancel press on long press.
*/
touchableLongPressCancelsPress: function touchableLongPressCancelsPress() {
return true;
},
/**
* Place as callback for a DOM element's `onResponderGrant` event.
* @param {SyntheticEvent} e Synthetic event from event system.
*
*/
touchableHandleResponderGrant: function touchableHandleResponderGrant(e) {
var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop
// (as in setTimeout etc), we need to call e.persist() on the
// event to make sure it doesn't get reused in the event object pool.
e.persist();
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
this.pressOutDelayTimeout = null;
this.state.touchable.touchState = States.NOT_RESPONDER;
this.state.touchable.responderID = dispatchID;
this._receiveSignal(Signals.RESPONDER_GRANT, e);
var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
if (delayMS !== 0) {
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
} else {
this._handleDelay(e);
}
var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);
},
/**
* Place as callback for a DOM element's `onResponderRelease` event.
*/
touchableHandleResponderRelease: function touchableHandleResponderRelease(e) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
},
/**
* Place as callback for a DOM element's `onResponderTerminate` event.
*/
touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
},
/**
* Place as callback for a DOM element's `onResponderMove` event.
*/
touchableHandleResponderMove: function touchableHandleResponderMove(e) {
// Measurement may not have returned yet.
if (!this.state.touchable.positionOnActivate) {
return;
}
var positionOnActivate = this.state.touchable.positionOnActivate;
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {
left: PRESS_EXPAND_PX,
right: PRESS_EXPAND_PX,
top: PRESS_EXPAND_PX,
bottom: PRESS_EXPAND_PX
};
var pressExpandLeft = pressRectOffset.left;
var pressExpandTop = pressRectOffset.top;
var pressExpandRight = pressRectOffset.right;
var pressExpandBottom = pressRectOffset.bottom;
var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;
if (hitSlop) {
pressExpandLeft += hitSlop.left || 0;
pressExpandTop += hitSlop.top || 0;
pressExpandRight += hitSlop.right || 0;
pressExpandBottom += hitSlop.bottom || 0;
}
var touch = extractSingleTouch(e.nativeEvent);
var pageX = touch && touch.pageX;
var pageY = touch && touch.pageY;
if (this.pressInLocation) {
var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);
if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {
this._cancelLongPressDelayTimeout();
}
}
var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;
if (isTouchWithinActive) {
var prevState = this.state.touchable.touchState;
this._receiveSignal(Signals.ENTER_PRESS_RECT, e);
var curState = this.state.touchable.touchState;
if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) {
// fix for t7967420
this._cancelLongPressDelayTimeout();
}
} else {
this._cancelLongPressDelayTimeout();
this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);
}
},
/**
* Invoked when the item receives focus. Mixers might override this to
* visually distinguish the `VisualRect` so that the user knows that it
* currently has the focus. Most platforms only support a single element being
* focused at a time, in which case there may have been a previously focused
* element that was blurred just prior to this. This can be overridden when
* using `Touchable.Mixin.withoutDefaultFocusAndBlur`.
*/
touchableHandleFocus: function touchableHandleFocus(e) {
this.props.onFocus && this.props.onFocus(e);
},
/**
* Invoked when the item loses focus. Mixers might override this to
* visually distinguish the `VisualRect` so that the user knows that it
* no longer has focus. Most platforms only support a single element being
* focused at a time, in which case the focus may have moved to another.
* This can be overridden when using
* `Touchable.Mixin.withoutDefaultFocusAndBlur`.
*/
touchableHandleBlur: function touchableHandleBlur(e) {
this.props.onBlur && this.props.onBlur(e);
},
// ==== Abstract Application Callbacks ====
/**
* Invoked when the item should be highlighted. Mixers should implement this
* to visually distinguish the `VisualRect` so that the user knows that
* releasing a touch will result in a "selection" (analog to click).
*
* @abstract
* touchableHandleActivePressIn: function,
*/
/**
* Invoked when the item is "active" (in that it is still eligible to become
* a "select") but the touch has left the `PressRect`. Usually the mixer will
* want to unhighlight the `VisualRect`. If the user (while pressing) moves
* back into the `PressRect` `touchableHandleActivePressIn` will be invoked
* again and the mixer should probably highlight the `VisualRect` again. This
* event will not fire on an `touchEnd/mouseUp` event, only move events while
* the user is depressing the mouse/touch.
*
* @abstract
* touchableHandleActivePressOut: function
*/
/**
* Invoked when the item is "selected" - meaning the interaction ended by
* letting up while the item was either in the state
* `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.
*
* @abstract
* touchableHandlePress: function
*/
/**
* Invoked when the item is long pressed - meaning the interaction ended by
* letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If
* `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will
* be called as it normally is. If `touchableHandleLongPress` is provided, by
* default any `touchableHandlePress` callback will not be invoked. To
* override this default behavior, override `touchableLongPressCancelsPress`
* to return false. As a result, `touchableHandlePress` will be called when
* lifting up, even if `touchableHandleLongPress` has also been called.
*
* @abstract
* touchableHandleLongPress: function
*/
/**
* Returns the number of millis to wait before triggering a highlight.
*
* @abstract
* touchableGetHighlightDelayMS: function
*/
/**
* Returns the amount to extend the `HitRect` into the `PressRect`. Positive
* numbers mean the size expands outwards.
*
* @abstract
* touchableGetPressRectOffset: function
*/
// ==== Internal Logic ====
/**
* Measures the `HitRect` node on activation. The Bounding rectangle is with
* respect to viewport - not page, so adding the `pageXOffset/pageYOffset`
* should result in points that are in the same coordinate system as an
* event's `globalX/globalY` data values.
*
* - Consider caching this for the lifetime of the component, or possibly
* being able to share this cache between any `ScrollMap` view.
*
* @sideeffects
* @private
*/
_remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() {
var tag = this.state.touchable.responderID;
if (tag == null) {
return;
}
UIManager.measure(tag, this._handleQueryLayout);
},
_handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) {
//don't do anything UIManager failed to measure node
if (!l && !t && !w && !h && !globalX && !globalY) {
return;
}
this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate);
this.state.touchable.dimensionsOnActivate && // $FlowFixMe
BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);
this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe
this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h);
},
_handleDelay: function _handleDelay(e) {
this.touchableDelayTimeout = null;
this._receiveSignal(Signals.DELAY, e);
},
_handleLongDelay: function _handleLongDelay(e) {
this.longPressDelayTimeout = null;
var curState = this.state.touchable.touchState;
if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');
} else {
this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
}
},
/**
* Receives a state machine signal, performs side effects of the transition
* and stores the new state. Validates the transition as well.
*
* @param {Signals} signal State machine signal.
* @throws Error if invalid state transition or unrecognized signal.
* @sideeffects
*/
_receiveSignal: function _receiveSignal(signal, e) {
var responderID = this.state.touchable.responderID;
var curState = this.state.touchable.touchState;
var nextState = Transitions[curState] && Transitions[curState][signal];
if (!responderID && signal === Signals.RESPONDER_RELEASE) {
return;
}
if (!nextState) {
throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`');
}
if (nextState === States.ERROR) {
throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`');
}
if (curState !== nextState) {
this._performSideEffectsForTransition(curState, nextState, signal, e);
this.state.touchable.touchState = nextState;
}
},
_cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() {
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.longPressDelayTimeout = null;
},
_isHighlight: function _isHighlight(state) {
return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;
},
_savePressInLocation: function _savePressInLocation(e) {
var touch = extractSingleTouch(e.nativeEvent);
var pageX = touch && touch.pageX;
var pageY = touch && touch.pageY;
var locationX = touch && touch.locationX;
var locationY = touch && touch.locationY;
this.pressInLocation = {
pageX: pageX,
pageY: pageY,
locationX: locationX,
locationY: locationY
};
},
_getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) {
var deltaX = aX - bX;
var deltaY = aY - bY;
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
},
/**
* Will perform a transition between touchable states, and identify any
* highlighting or unhighlighting that must be performed for this particular
* transition.
*
* @param {States} curState Current Touchable state.
* @param {States} nextState Next Touchable state.
* @param {Signal} signal Signal that triggered the transition.
* @param {Event} e Native event.
* @sideeffects
*/
_performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) {
var curIsHighlight = this._isHighlight(curState);
var newIsHighlight = this._isHighlight(nextState);
var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;
if (isFinalSignal) {
this._cancelLongPressDelayTimeout();
}
var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN;
var isActiveTransition = !IsActive[curState] && IsActive[nextState];
if (isInitialTransition || isActiveTransition) {
this._remeasureMetricsOnActivation();
}
if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {
this.touchableHandleLongPress && this.touchableHandleLongPress(e);
}
if (newIsHighlight && !curIsHighlight) {
this._startHighlight(e);
} else if (!newIsHighlight && curIsHighlight) {
this._endHighlight(e);
}
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
var hasLongPressHandler = !!this.props.onLongPress;
var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. // But either has no long handler
!hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it.
var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;
if (shouldInvokePress && this.touchableHandlePress) {
if (!newIsHighlight && !curIsHighlight) {
// we never highlighted because of delay, but we should highlight now
this._startHighlight(e);
this._endHighlight(e);
}
this.touchableHandlePress(e);
}
}
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.touchableDelayTimeout = null;
},
_playTouchSound: function _playTouchSound() {
UIManager.playTouchSound();
},
_startHighlight: function _startHighlight(e) {
this._savePressInLocation(e);
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
},
_endHighlight: function _endHighlight(e) {
var _this2 = this;
if (this.touchableHandleActivePressOut) {
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
this.pressOutDelayTimeout = setTimeout(function () {
_this2.touchableHandleActivePressOut(e);
}, this.touchableGetPressOutDelayMS());
} else {
this.touchableHandleActivePressOut(e);
}
}
},
// HACK (part 2): basic support for touchable interactions using a keyboard (including
// delays and longPress)
touchableHandleKeyEvent: function touchableHandleKeyEvent(e) {
var type = e.type,
key = e.key;
if (key === 'Enter' || key === ' ') {
if (type === 'keydown') {
if (!this._isTouchableKeyboardActive) {
if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {
this.touchableHandleResponderGrant(e);
this._isTouchableKeyboardActive = true;
}
}
} else if (type === 'keyup') {
if (this._isTouchableKeyboardActive) {
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
this.touchableHandleResponderRelease(e);
this._isTouchableKeyboardActive = false;
}
}
}
e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link
// and Enter is pressed
if (!(key === 'Enter' && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) {
e.preventDefault();
}
}
},
withoutDefaultFocusAndBlur: {}
};
/**
* Provide an optional version of the mixin where `touchableHandleFocus` and
* `touchableHandleBlur` can be overridden. This allows appropriate defaults to
* be set on TV platforms, without breaking existing implementations of
* `Touchable`.
*/
var touchableHandleFocus = TouchableMixin.touchableHandleFocus,
touchableHandleBlur = TouchableMixin.touchableHandleBlur,
TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]);
TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur;
var Touchable = {
Mixin: TouchableMixin,
TOUCH_TARGET_DEBUG: false,
// Highlights all touchable targets. Toggle with Inspector.
/**
* Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).
*/
renderDebugView: function renderDebugView(_ref) {
var color = _ref.color,
hitSlop = _ref.hitSlop;
if (!Touchable.TOUCH_TARGET_DEBUG) {
return null;
}
if (process.env.NODE_ENV !== 'production') {
throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!');
}
var debugHitSlopStyle = {};
hitSlop = hitSlop || {
top: 0,
bottom: 0,
left: 0,
right: 0
};
for (var key in hitSlop) {
debugHitSlopStyle[key] = -hitSlop[key];
}
var normalizedColor = normalizeColor(color);
if (typeof normalizedColor !== 'number') {
return null;
}
var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8);
return /*#__PURE__*/React.createElement(View, {
pointerEvents: "none",
style: _objectSpread({
position: 'absolute',
borderColor: hexColor.slice(0, -2) + '55',
// More opaque
borderWidth: 1,
borderStyle: 'dashed',
backgroundColor: hexColor.slice(0, -2) + '0F'
}, debugHitSlopStyle)
});
}
};
export default Touchable; |
components/common/Button.js | FuzzyHatPublishing/isleep | import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
const Button = ({ onPress, children }) => {
return (
<TouchableOpacity onPress={onPress} style={styles.buttonStyle}>
<Text style={styles.textStyle}>
{children}
</Text>
</TouchableOpacity>
);
};
const styles = {
textStyle: {
alignSelf: 'center',
color: '#990000',
fontSize: 16,
fontWeight: '600',
paddingTop: 10,
paddingBottom: 10
},
buttonStyle: {
flex: 1,
backgroundColor: '#fff',
borderRadius: 5,
borderWidth: 1,
borderColor: '#990000',
marginLeft: 5,
marginRight: 5,
}
};
export default Button;
|
src/js/components/ui/reduxForm/HorizontalSelect.js | knowncitizen/tripleo-ui | /**
* Copyright 2017 Red Hat Inc.
*
* 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.
*/
import cx from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import { ControlLabel, FormGroup, Col, FormControl } from 'react-bootstrap';
import { getValidationState, InputDescription, InputMessage } from './utils';
const HorizontalSelect = ({
id,
children,
label,
labelColumns,
inputColumns,
description,
input,
multiple,
meta,
required,
...rest
}) => (
<FormGroup controlId={id} validationState={getValidationState(meta)}>
<Col
componentClass={ControlLabel}
sm={labelColumns}
className={cx({ 'required-pf': required })}
>
{label}
</Col>
<Col sm={inputColumns}>
<FormControl
componentClass="select"
multiple={multiple}
{...rest}
{...input}
>
{children}
</FormControl>
<InputMessage {...meta} />
<InputDescription description={description} />
</Col>
</FormGroup>
);
HorizontalSelect.propTypes = {
children: PropTypes.node,
description: PropTypes.node,
id: PropTypes.string.isRequired,
input: PropTypes.object,
inputColumns: PropTypes.number.isRequired,
label: PropTypes.node,
labelColumns: PropTypes.number.isRequired,
meta: PropTypes.object.isRequired,
multiple: PropTypes.bool.isRequired,
required: PropTypes.bool.isRequired
};
HorizontalSelect.defaultProps = {
labelColumns: 5,
inputColumns: 7,
multiple: false,
required: false
};
export default HorizontalSelect;
|
src/Home/Home.js | zhaohuanwener/company-search-react | import React from 'react'
// import App from './App';
export default class Home extends React.Component {
render () {
console.log(this.props)
return <div className="content">
{this.props.children}
</div>
}
} |
js/vendor/jquery-1.8.2.min.js | keisans/keisans.github.com | /*! jQuery v1.8.2 jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(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 cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,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%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&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 p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},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(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.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]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.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){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(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 bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(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 bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={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,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.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=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,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||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=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):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); |
client.js | hobinjk/illuminate | /*global document, window */
import React from 'react';
import debug from 'debug';
import { createElementWithContext } from 'fluxible-addons-react';
import app from './app';
const debugClient = debug('illuminate');
const dehydratedState = window.App; // Sent from the server
window.React = React; // For chrome dev tool support
// expose debug object to browser, so that it can be enabled/disabled from browser:
// https://github.com/visionmedia/debug#browser-support
window.fluxibleDebug = debug;
debugClient('rehydrating app');
// pass in the dehydrated server state from server.js
app.rehydrate(dehydratedState, (err, context) => {
if (err) {
throw err;
}
window.context = context;
const mountNode = document.getElementById('app');
debugClient('React Rendering');
React.render(
createElementWithContext(context),
mountNode,
() => debugClient('React Rendered')
);
});
|
app/components/GeometryCanvas/index.js | mhoffman/CatAppBrowser | /**
*
* GeometryCanvas
*
*/
import React from 'react';
import styled from 'styled-components';
import Button from 'material-ui/Button';
import { withStyles } from 'material-ui/styles';
import axios from 'axios';
import PropTypes from 'prop-types';
import { download } from 'utils';
import { MdFileDownload } from 'react-icons/lib/md';
const MButton = styled(Button)`
margin: 12px,
`;
const styles = (xtheme) => ({
MuiButton: {
margin: '12px',
[xtheme.breakpoints.down('sm')]: {
visibility: 'hidden',
},
},
});
class GeometryCanvas extends React.Component { // eslint-disable-line react/prefer-stateless-function
componentDidMount() {
let cifdata = this.props.cifdata;
if (this.props.cifurl !== '') {
axios.get(this.props.cifurl).then((res) => {
cifdata = res.data.cifdata;
const script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.innerHTML = `
function _load_lib(url, callback){
id = 'load_' + url;
var s = document.createElement('script');
s.src = url;
s.id = id;
s.async = true;
s.onreadystatechange = s.onload = callback;
s.onerror = function(){console.warn("failed to load library " + url);};
document.getElementsByTagName("head")[0].appendChild(s);
}
// Load Libraries
_load_lib("https://code.jquery.com/jquery-3.2.1.min.js", function(){
_load_lib("https://hub.chemdoodle.com/cwc/8.0.0/ChemDoodleWeb.js", function(){
var rotationMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
//Code
let tfcanvas = new ChemDoodle.TransformCanvas3D('${this.props.id}_view');
let cif = ChemDoodle.readCIF(\`${cifdata}\`, ${this.props.x}, ${this.props.y}, ${this.props.z});
tfcanvas.specs.set3DRepresentation('Ball and Stick');
tfcanvas.specs.backgroundColor = '${this.props.color}';
tfcanvas.specs.projectionPerspective_3D = true;
tfcanvas.specs.atoms_displayLabels_3D = true;
tfcanvas.specs.crystals_unitCellLineWidth = 5;
tfcanvas.specs.shapes_color = 'black';
tfcanvas.specs.shapes_lineWidth = 1;
tfcanvas.specs.fog_mode_3D = 0;
tfcanvas.specs.shadow_3D = false;
tfcanvas.specs.atoms_useJMOLColors = true;
tfcanvas.specs.compass_display = true;
tfcanvas.loadContent([cif.molecule], [cif.unitCell]);
});
});`;
document.getElementById(`${this.props.id}_view`).appendChild(script);
});
} else {
const script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.innerHTML = `
function _load_lib(url, callback){
id = 'load_' + url;
var s = document.createElement('script');
s.src = url;
s.id = id;
s.async = true;
s.onreadystatechange = s.onload = callback;
s.onerror = function(){console.warn("failed to load library " + url);};
document.getElementsByTagName("head")[0].appendChild(s);
}
// Load Libraries
_load_lib("https://code.jquery.com/jquery-3.2.1.min.js", function(){
_load_lib("https://hub.chemdoodle.com/cwc/8.0.0/ChemDoodleWeb.js", function(){
var rotationMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
//Code
let tfcanvas = new ChemDoodle.TransformCanvas3D('${this.props.id}_view');
let cif = ChemDoodle.readCIF(\`${cifdata}\`, ${this.props.x}, ${this.props.y}, ${this.props.z});
tfcanvas.specs.set3DRepresentation('Ball and Stick');
tfcanvas.specs.backgroundColor = '${this.props.color}';
tfcanvas.specs.projectionPerspective_3D = true;
tfcanvas.specs.atoms_displayLabels_3D = true;
tfcanvas.specs.crystals_unitCellLineWidth = 5;
tfcanvas.specs.shapes_color = 'black';
tfcanvas.specs.shapes_lineWidth = 1;
tfcanvas.loadContent([cif.molecule], [cif.unitCell]);
});
});
`;
const item = document.getElementById(`${this.props.id}_view`);
if (item.childNodes.length > 0) {
item.replaceChild(script, item.childNodes[0]);
} else {
item.appendChild(script);
}
}
}
render() {
return (
<div>
<p id={`${this.props.id}_script`} />
<canvas
id={`${this.props.id}_view`}
height={this.props.height}
width={this.props.width}
style={{
borderWidth: 0,
borderColor: '#000000',
borderStyle: 'solid',
}}
/>
<br />
<MButton
className={this.props.classes.MuiButton}
raised
onClick={() => { download(`structure_${this.props.id}.cif`, this.props.cifdata); }}
style={{
margin: 12,
}}
>
<MdFileDownload /> Download CIF
</MButton>
</div>
);
}
}
GeometryCanvas.defaultProps = {
height: Math.max(Math.min(window.innerWidth * 0.5, 600), 300),
width: Math.max(Math.min(window.innerWidth * 0.5, 600), 300),
color: '#fff',
cifdata: '',
cifurl: '',
x: 2,
y: 2,
z: 1,
};
GeometryCanvas.propTypes = {
id: PropTypes.string.isRequired,
cifdata: PropTypes.string,
cifurl: PropTypes.string,
height: PropTypes.number,
width: PropTypes.number,
color: PropTypes.string,
classes: PropTypes.object,
x: PropTypes.number,
y: PropTypes.number,
z: PropTypes.number,
};
export default (withStyles(styles, { withTheme: true }))(GeometryCanvas);
|
src/svg-icons/communication/location-off.js | spiermar/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let CommunicationLocationOff = (props) => (
<SvgIcon {...props}>
<path d="M12 6.5c1.38 0 2.5 1.12 2.5 2.5 0 .74-.33 1.39-.83 1.85l3.63 3.63c.98-1.86 1.7-3.8 1.7-5.48 0-3.87-3.13-7-7-7-1.98 0-3.76.83-5.04 2.15l3.19 3.19c.46-.52 1.11-.84 1.85-.84zm4.37 9.6l-4.63-4.63-.11-.11L3.27 3 2 4.27l3.18 3.18C5.07 7.95 5 8.47 5 9c0 5.25 7 13 7 13s1.67-1.85 3.38-4.35L18.73 21 20 19.73l-3.63-3.63z"/>
</SvgIcon>
);
CommunicationLocationOff = pure(CommunicationLocationOff);
CommunicationLocationOff.displayName = 'CommunicationLocationOff';
CommunicationLocationOff.muiName = 'SvgIcon';
export default CommunicationLocationOff;
|
ajax/libs/webshim/1.15.2/dev/shims/moxie/js/moxie-html4.js | menuka94/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/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/image/Image.js
/**
* Image.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/image/Image", [
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/Exceptions",
"moxie/file/FileReaderSync",
"moxie/xhr/XMLHttpRequest",
"moxie/runtime/Runtime",
"moxie/runtime/RuntimeClient",
"moxie/runtime/Transporter",
"moxie/core/utils/Env",
"moxie/core/EventTarget",
"moxie/file/Blob",
"moxie/file/File",
"moxie/core/utils/Encode"
], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) {
/**
Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data.
@class Image
@constructor
@extends EventTarget
*/
var dispatches = [
'progress',
/**
Dispatched when loading is complete.
@event load
@param {Object} event
*/
'load',
'error',
/**
Dispatched when resize operation is complete.
@event resize
@param {Object} event
*/
'resize',
/**
Dispatched when visual representation of the image is successfully embedded
into the corresponsing container.
@event embedded
@param {Object} event
*/
'embedded'
];
function Image() {
RuntimeClient.call(this);
Basic.extend(this, {
/**
Unique id of the component
@property uid
@type {String}
*/
uid: Basic.guid('uid_'),
/**
Unique id of the connected runtime, if any.
@property ruid
@type {String}
*/
ruid: null,
/**
Name of the file, that was used to create an image, if available. If not equals to empty string.
@property name
@type {String}
@default ""
*/
name: "",
/**
Size of the image in bytes. Actual value is set only after image is preloaded.
@property size
@type {Number}
@default 0
*/
size: 0,
/**
Width of the image. Actual value is set only after image is preloaded.
@property width
@type {Number}
@default 0
*/
width: 0,
/**
Height of the image. Actual value is set only after image is preloaded.
@property height
@type {Number}
@default 0
*/
height: 0,
/**
Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded.
@property type
@type {String}
@default ""
*/
type: "",
/**
Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded.
@property meta
@type {Object}
@default {}
*/
meta: {},
/**
Alias for load method, that takes another mOxie.Image object as a source (see load).
@method clone
@param {Image} src Source for the image
@param {Boolean} [exact=false] Whether to activate in-depth clone mode
*/
clone: function() {
this.load.apply(this, arguments);
},
/**
Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File,
native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL,
Image will be downloaded from remote destination and loaded in memory.
@example
var img = new mOxie.Image();
img.onload = function() {
var blob = img.getAsBlob();
var formData = new mOxie.FormData();
formData.append('file', blob);
var xhr = new mOxie.XMLHttpRequest();
xhr.onload = function() {
// upload complete
};
xhr.open('post', 'upload.php');
xhr.send(formData);
};
img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg)
@method load
@param {Image|Blob|File|String} src Source for the image
@param {Boolean|Object} [mixed]
*/
load: function() {
// this is here because to bind properly we need an uid first, which is created above
this.bind('Load Resize', function() {
_updateInfo.call(this);
}, 999);
this.convertEventPropsToHandlers(dispatches);
_load.apply(this, arguments);
},
/**
Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions.
@method downsize
@param {Number} width Resulting width
@param {Number} [height=width] Resulting height (optional, if not supplied will default to width)
@param {Boolean} [crop=false] Whether to crop the image to exact dimensions
@param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize)
*/
downsize: function(opts) {
var defaults = {
width: this.width,
height: this.height,
crop: false,
preserveHeaders: true
};
if (typeof(opts) === 'object') {
opts = Basic.extend(defaults, opts);
} else {
opts = Basic.extend(defaults, {
width: arguments[0],
height: arguments[1],
crop: arguments[2],
preserveHeaders: arguments[3]
});
}
try {
if (!this.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// no way to reliably intercept the crash due to high resolution, so we simply avoid it
if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) {
throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR);
}
this.getRuntime().exec.call(this, 'Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders);
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
},
/**
Alias for downsize(width, height, true). (see downsize)
@method crop
@param {Number} width Resulting width
@param {Number} [height=width] Resulting height (optional, if not supplied will default to width)
@param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize)
*/
crop: function(width, height, preserveHeaders) {
this.downsize(width, height, true, preserveHeaders);
},
getAsCanvas: function() {
if (!Env.can('create_canvas')) {
throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR);
}
var runtime = this.connectRuntime(this.ruid);
return runtime.exec.call(this, 'Image', 'getAsCanvas');
},
/**
Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsBlob
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {Blob} Image as Blob
*/
getAsBlob: function(type, quality) {
if (!this.size) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
if (!type) {
type = 'image/jpeg';
}
if (type === 'image/jpeg' && !quality) {
quality = 90;
}
return this.getRuntime().exec.call(this, 'Image', 'getAsBlob', type, quality);
},
/**
Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsDataURL
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {String} Image as dataURL string
*/
getAsDataURL: function(type, quality) {
if (!this.size) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return this.getRuntime().exec.call(this, 'Image', 'getAsDataURL', type, quality);
},
/**
Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws
DOMException.INVALID_STATE_ERR).
@method getAsBinaryString
@param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png
@param {Number} [quality=90] Applicable only together with mime type image/jpeg
@return {String} Image as binary string
*/
getAsBinaryString: function(type, quality) {
var dataUrl = this.getAsDataURL(type, quality);
return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7));
},
/**
Embeds a visual representation of the image into the specified node. Depending on the runtime,
it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare,
can be used in legacy browsers that do not have canvas or proper dataURI support).
@method embed
@param {DOMElement} el DOM element to insert the image object into
@param {Object} [options]
@param {Number} [options.width] The width of an embed (defaults to the image width)
@param {Number} [options.height] The height of an embed (defaults to the image height)
@param {String} [type="image/jpeg"] Mime type
@param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg
@param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions
*/
embed: function(el) {
var self = this
, imgCopy
, type, quality, crop
, options = arguments[1] || {}
, width = this.width
, height = this.height
, runtime // this has to be outside of all the closures to contain proper runtime
;
function onResize() {
// if possible, embed a canvas element directly
if (Env.can('create_canvas')) {
var canvas = imgCopy.getAsCanvas();
if (canvas) {
el.appendChild(canvas);
canvas = null;
imgCopy.destroy();
self.trigger('embedded');
return;
}
}
var dataUrl = imgCopy.getAsDataURL(type, quality);
if (!dataUrl) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
if (Env.can('use_data_uri_of', dataUrl.length)) {
el.innerHTML = '<img src="' + dataUrl + '" width="' + imgCopy.width + '" height="' + imgCopy.height + '" />';
imgCopy.destroy();
self.trigger('embedded');
} else {
var tr = new Transporter();
tr.bind("TransportingComplete", function() {
runtime = self.connectRuntime(this.result.ruid);
self.bind("Embedded", function() {
// position and size properly
Basic.extend(runtime.getShimContainer().style, {
//position: 'relative',
top: '0px',
left: '0px',
width: imgCopy.width + 'px',
height: imgCopy.height + 'px'
});
// some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's
// position type changes (in Gecko), but since we basically need this only in IEs 6/7 and
// sometimes 8 and they do not have this problem, we can comment this for now
/*tr.bind("RuntimeInit", function(e, runtime) {
tr.destroy();
runtime.destroy();
onResize.call(self); // re-feed our image data
});*/
runtime = null;
}, 999);
runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height);
imgCopy.destroy();
});
tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, Basic.extend({}, options, {
required_caps: {
display_media: true
},
runtime_order: 'flash,silverlight',
container: el
}));
}
}
try {
if (!(el = Dom.get(el))) {
throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR);
}
if (!this.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) {
throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR);
}
type = options.type || this.type || 'image/jpeg';
quality = options.quality || 90;
crop = Basic.typeOf(options.crop) !== 'undefined' ? options.crop : false;
// figure out dimensions for the thumb
if (options.width) {
width = options.width;
height = options.height || width;
} else {
// if container element has measurable dimensions, use them
var dimensions = Dom.getSize(el);
if (dimensions.w && dimensions.h) { // both should be > 0
width = dimensions.w;
height = dimensions.h;
}
}
imgCopy = new Image();
imgCopy.bind("Resize", function() {
onResize.call(self);
});
imgCopy.bind("Load", function() {
imgCopy.downsize(width, height, crop, false);
});
imgCopy.clone(this, false);
return imgCopy;
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
},
/**
Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object.
@method destroy
*/
destroy: function() {
if (this.ruid) {
this.getRuntime().exec.call(this, 'Image', 'destroy');
this.disconnectRuntime();
}
this.unbindAll();
}
});
function _updateInfo(info) {
if (!info) {
info = this.getRuntime().exec.call(this, 'Image', 'getInfo');
}
this.size = info.size;
this.width = info.width;
this.height = info.height;
this.type = info.type;
this.meta = info.meta;
// update file name, only if empty
if (this.name === '') {
this.name = info.name;
}
}
function _load(src) {
var srcType = Basic.typeOf(src);
try {
// if source is Image
if (src instanceof Image) {
if (!src.size) { // only preloaded image objects can be used as source
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
_loadFromImage.apply(this, arguments);
}
// if source is o.Blob/o.File
else if (src instanceof Blob) {
if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
_loadFromBlob.apply(this, arguments);
}
// if native blob/file
else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) {
_load.call(this, new File(null, src), arguments[1]);
}
// if String
else if (srcType === 'string') {
// if dataUrl String
if (/^data:[^;]*;base64,/.test(src)) {
_load.call(this, new Blob(null, { data: src }), arguments[1]);
}
// else assume Url, either relative or absolute
else {
_loadFromUrl.apply(this, arguments);
}
}
// if source seems to be an img node
else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') {
_load.call(this, src.src, arguments[1]);
}
else {
throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR);
}
} catch(ex) {
// for now simply trigger error event
this.trigger('error', ex.code);
}
}
function _loadFromImage(img, exact) {
var runtime = this.connectRuntime(img.ruid);
this.ruid = runtime.uid;
runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact));
}
function _loadFromBlob(blob, options) {
var self = this;
self.name = blob.name || '';
function exec(runtime) {
self.ruid = runtime.uid;
runtime.exec.call(self, 'Image', 'loadFromBlob', blob);
}
if (blob.isDetached()) {
this.bind('RuntimeInit', function(e, runtime) {
exec(runtime);
});
// convert to object representation
if (options && typeof(options.required_caps) === 'string') {
options.required_caps = Runtime.parseCaps(options.required_caps);
}
this.connectRuntime(Basic.extend({
required_caps: {
access_image_binary: true,
resize_image: true
}
}, options));
} else {
exec(this.connectRuntime(blob.ruid));
}
}
function _loadFromUrl(url, options) {
var self = this, xhr;
xhr = new XMLHttpRequest();
xhr.open('get', url);
xhr.responseType = 'blob';
xhr.onprogress = function(e) {
self.trigger(e);
};
xhr.onload = function() {
_loadFromBlob.call(self, xhr.response, true);
};
xhr.onerror = function(e) {
self.trigger(e);
};
xhr.onloadend = function() {
xhr.destroy();
};
xhr.bind('RuntimeError', function(e, err) {
self.trigger('RuntimeError', err);
});
xhr.send(null, options);
}
}
// virtual world will crash on you if image has a resolution higher than this:
Image.MAX_RESIZE_WIDTH = 6500;
Image.MAX_RESIZE_HEIGHT = 6500;
Image.prototype = EventTarget.instance;
return Image;
});
// 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/html5/utils/BinaryReader.js
/**
* BinaryReader.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/utils/BinaryReader
@private
*/
define("moxie/runtime/html5/utils/BinaryReader", [], function() {
return function() {
var II = false, bin;
// Private functions
function read(idx, size) {
var mv = II ? 0 : -8 * (size - 1), sum = 0, i;
for (i = 0; i < size; i++) {
sum |= (bin.charCodeAt(idx + i) << Math.abs(mv + i*8));
}
return sum;
}
function putstr(segment, idx, length) {
length = arguments.length === 3 ? length : bin.length - idx - 1;
bin = bin.substr(0, idx) + segment + bin.substr(length + idx);
}
function write(idx, num, size) {
var str = '', mv = II ? 0 : -8 * (size - 1), i;
for (i = 0; i < size; i++) {
str += String.fromCharCode((num >> Math.abs(mv + i*8)) & 255);
}
putstr(str, idx, size);
}
// Public functions
return {
II: function(order) {
if (order === undefined) {
return II;
} else {
II = order;
}
},
init: function(binData) {
II = false;
bin = binData;
},
SEGMENT: function(idx, length, segment) {
switch (arguments.length) {
case 1:
return bin.substr(idx, bin.length - idx - 1);
case 2:
return bin.substr(idx, length);
case 3:
putstr(segment, idx, length);
break;
default: return bin;
}
},
BYTE: function(idx) {
return read(idx, 1);
},
SHORT: function(idx) {
return read(idx, 2);
},
LONG: function(idx, num) {
if (num === undefined) {
return read(idx, 4);
} else {
write(idx, num, 4);
}
},
SLONG: function(idx) { // 2's complement notation
var num = read(idx, 4);
return (num > 2147483647 ? num - 4294967296 : num);
},
STRING: function(idx, size) {
var str = '';
for (size += idx; idx < size; idx++) {
str += String.fromCharCode(read(idx, 1));
}
return str;
}
};
};
});
// Included from: src/javascript/runtime/html5/image/JPEGHeaders.js
/**
* JPEGHeaders.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/image/JPEGHeaders
@private
*/
define("moxie/runtime/html5/image/JPEGHeaders", [
"moxie/runtime/html5/utils/BinaryReader"
], function(BinaryReader) {
return function JPEGHeaders(data) {
var headers = [], read, idx, marker, length = 0;
read = new BinaryReader();
read.init(data);
// Check if data is jpeg
if (read.SHORT(0) !== 0xFFD8) {
return;
}
idx = 2;
while (idx <= data.length) {
marker = read.SHORT(idx);
// omit RST (restart) markers
if (marker >= 0xFFD0 && marker <= 0xFFD7) {
idx += 2;
continue;
}
// no headers allowed after SOS marker
if (marker === 0xFFDA || marker === 0xFFD9) {
break;
}
length = read.SHORT(idx + 2) + 2;
// APPn marker detected
if (marker >= 0xFFE1 && marker <= 0xFFEF) {
headers.push({
hex: marker,
name: 'APP' + (marker & 0x000F),
start: idx,
length: length,
segment: read.SEGMENT(idx, length)
});
}
idx += length;
}
read.init(null); // free memory
return {
headers: headers,
restore: function(data) {
var max, i;
read.init(data);
idx = read.SHORT(2) == 0xFFE0 ? 4 + read.SHORT(4) : 2;
for (i = 0, max = headers.length; i < max; i++) {
read.SEGMENT(idx, 0, headers[i].segment);
idx += headers[i].length;
}
data = read.SEGMENT();
read.init(null);
return data;
},
strip: function(data) {
var headers, jpegHeaders, i;
jpegHeaders = new JPEGHeaders(data);
headers = jpegHeaders.headers;
jpegHeaders.purge();
read.init(data);
i = headers.length;
while (i--) {
read.SEGMENT(headers[i].start, headers[i].length, '');
}
data = read.SEGMENT();
read.init(null);
return data;
},
get: function(name) {
var array = [];
for (var i = 0, max = headers.length; i < max; i++) {
if (headers[i].name === name.toUpperCase()) {
array.push(headers[i].segment);
}
}
return array;
},
set: function(name, segment) {
var array = [], i, ii, max;
if (typeof(segment) === 'string') {
array.push(segment);
} else {
array = segment;
}
for (i = ii = 0, max = headers.length; i < max; i++) {
if (headers[i].name === name.toUpperCase()) {
headers[i].segment = array[ii];
headers[i].length = array[ii].length;
ii++;
}
if (ii >= array.length) {
break;
}
}
},
purge: function() {
headers = [];
read.init(null);
read = null;
}
};
};
});
// Included from: src/javascript/runtime/html5/image/ExifParser.js
/**
* ExifParser.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/image/ExifParser
@private
*/
define("moxie/runtime/html5/image/ExifParser", [
"moxie/core/utils/Basic",
"moxie/runtime/html5/utils/BinaryReader"
], function(Basic, BinaryReader) {
return function ExifParser() {
// Private ExifParser fields
var data, tags, Tiff, offsets = {}, tagDescs;
data = new BinaryReader();
tags = {
tiff : {
/*
The image orientation viewed in terms of rows and columns.
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
*/
0x0112: 'Orientation',
0x010E: 'ImageDescription',
0x010F: 'Make',
0x0110: 'Model',
0x0131: 'Software',
0x8769: 'ExifIFDPointer',
0x8825: 'GPSInfoIFDPointer'
},
exif : {
0x9000: 'ExifVersion',
0xA001: 'ColorSpace',
0xA002: 'PixelXDimension',
0xA003: 'PixelYDimension',
0x9003: 'DateTimeOriginal',
0x829A: 'ExposureTime',
0x829D: 'FNumber',
0x8827: 'ISOSpeedRatings',
0x9201: 'ShutterSpeedValue',
0x9202: 'ApertureValue' ,
0x9207: 'MeteringMode',
0x9208: 'LightSource',
0x9209: 'Flash',
0x920A: 'FocalLength',
0xA402: 'ExposureMode',
0xA403: 'WhiteBalance',
0xA406: 'SceneCaptureType',
0xA404: 'DigitalZoomRatio',
0xA408: 'Contrast',
0xA409: 'Saturation',
0xA40A: 'Sharpness'
},
gps : {
0x0000: 'GPSVersionID',
0x0001: 'GPSLatitudeRef',
0x0002: 'GPSLatitude',
0x0003: 'GPSLongitudeRef',
0x0004: 'GPSLongitude'
}
};
tagDescs = {
'ColorSpace': {
1: 'sRGB',
0: 'Uncalibrated'
},
'MeteringMode': {
0: 'Unknown',
1: 'Average',
2: 'CenterWeightedAverage',
3: 'Spot',
4: 'MultiSpot',
5: 'Pattern',
6: 'Partial',
255: 'Other'
},
'LightSource': {
1: 'Daylight',
2: 'Fliorescent',
3: 'Tungsten',
4: 'Flash',
9: 'Fine weather',
10: 'Cloudy weather',
11: 'Shade',
12: 'Daylight fluorescent (D 5700 - 7100K)',
13: 'Day white fluorescent (N 4600 -5400K)',
14: 'Cool white fluorescent (W 3900 - 4500K)',
15: 'White fluorescent (WW 3200 - 3700K)',
17: 'Standard light A',
18: 'Standard light B',
19: 'Standard light C',
20: 'D55',
21: 'D65',
22: 'D75',
23: 'D50',
24: 'ISO studio tungsten',
255: 'Other'
},
'Flash': {
0x0000: 'Flash did not fire.',
0x0001: 'Flash fired.',
0x0005: 'Strobe return light not detected.',
0x0007: 'Strobe return light detected.',
0x0009: 'Flash fired, compulsory flash mode',
0x000D: 'Flash fired, compulsory flash mode, return light not detected',
0x000F: 'Flash fired, compulsory flash mode, return light detected',
0x0010: 'Flash did not fire, compulsory flash mode',
0x0018: 'Flash did not fire, auto mode',
0x0019: 'Flash fired, auto mode',
0x001D: 'Flash fired, auto mode, return light not detected',
0x001F: 'Flash fired, auto mode, return light detected',
0x0020: 'No flash function',
0x0041: 'Flash fired, red-eye reduction mode',
0x0045: 'Flash fired, red-eye reduction mode, return light not detected',
0x0047: 'Flash fired, red-eye reduction mode, return light detected',
0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',
0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
0x0059: 'Flash fired, auto mode, red-eye reduction mode',
0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
},
'ExposureMode': {
0: 'Auto exposure',
1: 'Manual exposure',
2: 'Auto bracket'
},
'WhiteBalance': {
0: 'Auto white balance',
1: 'Manual white balance'
},
'SceneCaptureType': {
0: 'Standard',
1: 'Landscape',
2: 'Portrait',
3: 'Night scene'
},
'Contrast': {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
'Saturation': {
0: 'Normal',
1: 'Low saturation',
2: 'High saturation'
},
'Sharpness': {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
// GPS related
'GPSLatitudeRef': {
N: 'North latitude',
S: 'South latitude'
},
'GPSLongitudeRef': {
E: 'East longitude',
W: 'West longitude'
}
};
function extractTags(IFD_offset, tags2extract) {
var length = data.SHORT(IFD_offset), i, ii,
tag, type, count, tagOffset, offset, value, values = [], hash = {};
for (i = 0; i < length; i++) {
// Set binary reader pointer to beginning of the next tag
offset = tagOffset = IFD_offset + 12 * i + 2;
tag = tags2extract[data.SHORT(offset)];
if (tag === undefined) {
continue; // Not the tag we requested
}
type = data.SHORT(offset+=2);
count = data.LONG(offset+=2);
offset += 4;
values = [];
switch (type) {
case 1: // BYTE
case 7: // UNDEFINED
if (count > 4) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
for (ii = 0; ii < count; ii++) {
values[ii] = data.BYTE(offset + ii);
}
break;
case 2: // STRING
if (count > 4) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
hash[tag] = data.STRING(offset, count - 1);
continue;
case 3: // SHORT
if (count > 2) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
for (ii = 0; ii < count; ii++) {
values[ii] = data.SHORT(offset + ii*2);
}
break;
case 4: // LONG
if (count > 1) {
offset = data.LONG(offset) + offsets.tiffHeader;
}
for (ii = 0; ii < count; ii++) {
values[ii] = data.LONG(offset + ii*4);
}
break;
case 5: // RATIONAL
offset = data.LONG(offset) + offsets.tiffHeader;
for (ii = 0; ii < count; ii++) {
values[ii] = data.LONG(offset + ii*4) / data.LONG(offset + ii*4 + 4);
}
break;
case 9: // SLONG
offset = data.LONG(offset) + offsets.tiffHeader;
for (ii = 0; ii < count; ii++) {
values[ii] = data.SLONG(offset + ii*4);
}
break;
case 10: // SRATIONAL
offset = data.LONG(offset) + offsets.tiffHeader;
for (ii = 0; ii < count; ii++) {
values[ii] = data.SLONG(offset + ii*4) / data.SLONG(offset + ii*4 + 4);
}
break;
default:
continue;
}
value = (count == 1 ? values[0] : values);
if (tagDescs.hasOwnProperty(tag) && typeof value != 'object') {
hash[tag] = tagDescs[tag][value];
} else {
hash[tag] = value;
}
}
return hash;
}
function getIFDOffsets() {
var idx = offsets.tiffHeader;
// Set read order of multi-byte data
data.II(data.SHORT(idx) == 0x4949);
// Check if always present bytes are indeed present
if (data.SHORT(idx+=2) !== 0x002A) {
return false;
}
offsets.IFD0 = offsets.tiffHeader + data.LONG(idx += 2);
Tiff = extractTags(offsets.IFD0, tags.tiff);
if ('ExifIFDPointer' in Tiff) {
offsets.exifIFD = offsets.tiffHeader + Tiff.ExifIFDPointer;
delete Tiff.ExifIFDPointer;
}
if ('GPSInfoIFDPointer' in Tiff) {
offsets.gpsIFD = offsets.tiffHeader + Tiff.GPSInfoIFDPointer;
delete Tiff.GPSInfoIFDPointer;
}
return true;
}
// At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported
function setTag(ifd, tag, value) {
var offset, length, tagOffset, valueOffset = 0;
// If tag name passed translate into hex key
if (typeof(tag) === 'string') {
var tmpTags = tags[ifd.toLowerCase()];
for (var hex in tmpTags) {
if (tmpTags[hex] === tag) {
tag = hex;
break;
}
}
}
offset = offsets[ifd.toLowerCase() + 'IFD'];
length = data.SHORT(offset);
for (var i = 0; i < length; i++) {
tagOffset = offset + 12 * i + 2;
if (data.SHORT(tagOffset) == tag) {
valueOffset = tagOffset + 8;
break;
}
}
if (!valueOffset) {
return false;
}
data.LONG(valueOffset, value);
return true;
}
// Public functions
return {
init: function(segment) {
// Reset internal data
offsets = {
tiffHeader: 10
};
if (segment === undefined || !segment.length) {
return false;
}
data.init(segment);
// Check if that's APP1 and that it has EXIF
if (data.SHORT(0) === 0xFFE1 && data.STRING(4, 5).toUpperCase() === "EXIF\0") {
return getIFDOffsets();
}
return false;
},
TIFF: function() {
return Tiff;
},
EXIF: function() {
var Exif;
// Populate EXIF hash
Exif = extractTags(offsets.exifIFD, tags.exif);
// Fix formatting of some tags
if (Exif.ExifVersion && Basic.typeOf(Exif.ExifVersion) === 'array') {
for (var i = 0, exifVersion = ''; i < Exif.ExifVersion.length; i++) {
exifVersion += String.fromCharCode(Exif.ExifVersion[i]);
}
Exif.ExifVersion = exifVersion;
}
return Exif;
},
GPS: function() {
var GPS;
GPS = extractTags(offsets.gpsIFD, tags.gps);
// iOS devices (and probably some others) do not put in GPSVersionID tag (why?..)
if (GPS.GPSVersionID && Basic.typeOf(GPS.GPSVersionID) === 'array') {
GPS.GPSVersionID = GPS.GPSVersionID.join('.');
}
return GPS;
},
setExif: function(tag, value) {
// Right now only setting of width/height is possible
if (tag !== 'PixelXDimension' && tag !== 'PixelYDimension') {return false;}
return setTag('exif', tag, value);
},
getBinary: function() {
return data.SEGMENT();
},
purge: function() {
data.init(null);
data = Tiff = null;
offsets = {};
}
};
};
});
// Included from: src/javascript/runtime/html5/image/JPEG.js
/**
* JPEG.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/image/JPEG
@private
*/
define("moxie/runtime/html5/image/JPEG", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/runtime/html5/image/JPEGHeaders",
"moxie/runtime/html5/utils/BinaryReader",
"moxie/runtime/html5/image/ExifParser"
], function(Basic, x, JPEGHeaders, BinaryReader, ExifParser) {
function JPEG(binstr) {
var _binstr, _br, _hm, _ep, _info, hasExif;
function _getDimensions() {
var idx = 0, marker, length;
// examine all through the end, since some images might have very large APP segments
while (idx <= _binstr.length) {
marker = _br.SHORT(idx += 2);
if (marker >= 0xFFC0 && marker <= 0xFFC3) { // SOFn
idx += 5; // marker (2 bytes) + length (2 bytes) + Sample precision (1 byte)
return {
height: _br.SHORT(idx),
width: _br.SHORT(idx += 2)
};
}
length = _br.SHORT(idx += 2);
idx += length - 2;
}
return null;
}
_binstr = binstr;
_br = new BinaryReader();
_br.init(_binstr);
// check if it is jpeg
if (_br.SHORT(0) !== 0xFFD8) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
// backup headers
_hm = new JPEGHeaders(binstr);
// extract exif info
_ep = new ExifParser();
hasExif = !!_ep.init(_hm.get('app1')[0]);
// get dimensions
_info = _getDimensions.call(this);
Basic.extend(this, {
type: 'image/jpeg',
size: _binstr.length,
width: _info && _info.width || 0,
height: _info && _info.height || 0,
setExif: function(tag, value) {
if (!hasExif) {
return false; // or throw an exception
}
if (Basic.typeOf(tag) === 'object') {
Basic.each(tag, function(value, tag) {
_ep.setExif(tag, value);
});
} else {
_ep.setExif(tag, value);
}
// update internal headers
_hm.set('app1', _ep.getBinary());
},
writeHeaders: function() {
if (!arguments.length) {
// if no arguments passed, update headers internally
return (_binstr = _hm.restore(_binstr));
}
return _hm.restore(arguments[0]);
},
stripHeaders: function(binstr) {
return _hm.strip(binstr);
},
purge: function() {
_purge.call(this);
}
});
if (hasExif) {
this.meta = {
tiff: _ep.TIFF(),
exif: _ep.EXIF(),
gps: _ep.GPS()
};
}
function _purge() {
if (!_ep || !_hm || !_br) {
return; // ignore any repeating purge requests
}
_ep.purge();
_hm.purge();
_br.init(null);
_binstr = _info = _hm = _ep = _br = null;
}
}
return JPEG;
});
// Included from: src/javascript/runtime/html5/image/PNG.js
/**
* PNG.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/image/PNG
@private
*/
define("moxie/runtime/html5/image/PNG", [
"moxie/core/Exceptions",
"moxie/core/utils/Basic",
"moxie/runtime/html5/utils/BinaryReader"
], function(x, Basic, BinaryReader) {
function PNG(binstr) {
var _binstr, _br, _hm, _ep, _info;
_binstr = binstr;
_br = new BinaryReader();
_br.init(_binstr);
// check if it's png
(function() {
var idx = 0, i = 0
, signature = [0x8950, 0x4E47, 0x0D0A, 0x1A0A]
;
for (i = 0; i < signature.length; i++, idx += 2) {
if (signature[i] != _br.SHORT(idx)) {
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}
}
}());
function _getDimensions() {
var chunk, idx;
chunk = _getChunkAt.call(this, 8);
if (chunk.type == 'IHDR') {
idx = chunk.start;
return {
width: _br.LONG(idx),
height: _br.LONG(idx += 4)
};
}
return null;
}
function _purge() {
if (!_br) {
return; // ignore any repeating purge requests
}
_br.init(null);
_binstr = _info = _hm = _ep = _br = null;
}
_info = _getDimensions.call(this);
Basic.extend(this, {
type: 'image/png',
size: _binstr.length,
width: _info.width,
height: _info.height,
purge: function() {
_purge.call(this);
}
});
// for PNG we can safely trigger purge automatically, as we do not keep any data for later
_purge.call(this);
function _getChunkAt(idx) {
var length, type, start, CRC;
length = _br.LONG(idx);
type = _br.STRING(idx += 4, 4);
start = idx += 4;
CRC = _br.LONG(idx + length);
return {
length: length,
type: type,
start: start,
CRC: CRC
};
}
}
return PNG;
});
// Included from: src/javascript/runtime/html5/image/ImageInfo.js
/**
* ImageInfo.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/image/ImageInfo
@private
*/
define("moxie/runtime/html5/image/ImageInfo", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/runtime/html5/image/JPEG",
"moxie/runtime/html5/image/PNG"
], function(Basic, x, JPEG, PNG) {
/**
Optional image investigation tool for HTML5 runtime. Provides the following features:
- ability to distinguish image type (JPEG or PNG) by signature
- ability to extract image width/height directly from it's internals, without preloading in memory (fast)
- ability to extract APP headers from JPEGs (Exif, GPS, etc)
- ability to replace width/height tags in extracted JPEG headers
- ability to restore APP headers, that were for example stripped during image manipulation
@class ImageInfo
@constructor
@param {String} binstr Image source as binary string
*/
return function(binstr) {
var _cs = [JPEG, PNG], _img;
// figure out the format, throw: ImageError.WRONG_FORMAT if not supported
_img = (function() {
for (var i = 0; i < _cs.length; i++) {
try {
return new _cs[i](binstr);
} catch (ex) {
// console.info(ex);
}
}
throw new x.ImageError(x.ImageError.WRONG_FORMAT);
}());
Basic.extend(this, {
/**
Image Mime Type extracted from it's depths
@property type
@type {String}
@default ''
*/
type: '',
/**
Image size in bytes
@property size
@type {Number}
@default 0
*/
size: 0,
/**
Image width extracted from image source
@property width
@type {Number}
@default 0
*/
width: 0,
/**
Image height extracted from image source
@property height
@type {Number}
@default 0
*/
height: 0,
/**
Sets Exif tag. Currently applicable only for width and height tags. Obviously works only with JPEGs.
@method setExif
@param {String} tag Tag to set
@param {Mixed} value Value to assign to the tag
*/
setExif: function() {},
/**
Restores headers to the source.
@method writeHeaders
@param {String} data Image source as binary string
@return {String} Updated binary string
*/
writeHeaders: function(data) {
return data;
},
/**
Strip all headers from the source.
@method stripHeaders
@param {String} data Image source as binary string
@return {String} Updated binary string
*/
stripHeaders: function(data) {
return data;
},
/**
Dispose resources.
@method purge
*/
purge: function() {}
});
Basic.extend(this, _img);
this.purge = function() {
_img.purge();
_img = null;
};
};
});
// Included from: src/javascript/runtime/html5/image/MegaPixel.js
/**
(The MIT License)
Copyright (c) 2012 Shinichi Tomita <[email protected]>;
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.
*/
/**
* Mega pixel image rendering library for iOS6 Safari
*
* Fixes iOS6 Safari's image file rendering issue for large size image (over mega-pixel),
* which causes unexpected subsampling when drawing it in canvas.
* By using this library, you can safely render the image with proper stretching.
*
* Copyright (c) 2012 Shinichi Tomita <[email protected]>
* Released under the MIT license
*/
/**
@class moxie/runtime/html5/image/MegaPixel
@private
*/
define("moxie/runtime/html5/image/MegaPixel", [], function() {
/**
* Rendering image element (with resizing) into the canvas element
*/
function renderImageToCanvas(img, canvas, options) {
var iw = img.naturalWidth, ih = img.naturalHeight;
var width = options.width, height = options.height;
var x = options.x || 0, y = options.y || 0;
var ctx = canvas.getContext('2d');
if (detectSubsampling(img)) {
iw /= 2;
ih /= 2;
}
var d = 1024; // size of tiling canvas
var tmpCanvas = document.createElement('canvas');
tmpCanvas.width = tmpCanvas.height = d;
var tmpCtx = tmpCanvas.getContext('2d');
var vertSquashRatio = detectVerticalSquash(img, iw, ih);
var sy = 0;
while (sy < ih) {
var sh = sy + d > ih ? ih - sy : d;
var sx = 0;
while (sx < iw) {
var sw = sx + d > iw ? iw - sx : d;
tmpCtx.clearRect(0, 0, d, d);
tmpCtx.drawImage(img, -sx, -sy);
var dx = (sx * width / iw + x) << 0;
var dw = Math.ceil(sw * width / iw);
var dy = (sy * height / ih / vertSquashRatio + y) << 0;
var dh = Math.ceil(sh * height / ih / vertSquashRatio);
ctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh);
sx += d;
}
sy += d;
}
tmpCanvas = tmpCtx = null;
}
/**
* Detect subsampling in loaded image.
* In iOS, larger images than 2M pixels may be subsampled in rendering.
*/
function detectSubsampling(img) {
var iw = img.naturalWidth, ih = img.naturalHeight;
if (iw * ih > 1024 * 1024) { // subsampling may happen over megapixel image
var canvas = document.createElement('canvas');
canvas.width = canvas.height = 1;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, -iw + 1, 0);
// subsampled image becomes half smaller in rendering size.
// check alpha channel value to confirm image is covering edge pixel or not.
// if alpha value is 0 image is not covering, hence subsampled.
return ctx.getImageData(0, 0, 1, 1).data[3] === 0;
} else {
return false;
}
}
/**
* Detecting vertical squash in loaded image.
* Fixes a bug which squash image vertically while drawing into canvas for some images.
*/
function detectVerticalSquash(img, iw, ih) {
var canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = ih;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
var data = ctx.getImageData(0, 0, 1, ih).data;
// search image edge pixel position in case it is squashed vertically.
var sy = 0;
var ey = ih;
var py = ih;
while (py > sy) {
var alpha = data[(py - 1) * 4 + 3];
if (alpha === 0) {
ey = py;
} else {
sy = py;
}
py = (ey + sy) >> 1;
}
canvas = null;
var ratio = (py / ih);
return (ratio === 0) ? 1 : ratio;
}
return {
isSubsampled: detectSubsampling,
renderTo: renderImageToCanvas
};
});
// Included from: src/javascript/runtime/html5/image/Image.js
/**
* Image.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/image/Image
@private
*/
define("moxie/runtime/html5/image/Image", [
"moxie/runtime/html5/Runtime",
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/core/utils/Encode",
"moxie/file/File",
"moxie/runtime/html5/image/ImageInfo",
"moxie/runtime/html5/image/MegaPixel",
"moxie/core/utils/Mime",
"moxie/core/utils/Env"
], function(extensions, Basic, x, Encode, File, ImageInfo, MegaPixel, Mime, Env) {
function HTML5Image() {
var me = this
, _img, _imgInfo, _canvas, _binStr, _blob
, _modified = false // is set true whenever image is modified
, _preserveHeaders = true
;
Basic.extend(this, {
loadFromBlob: function(blob) {
var comp = this, I = comp.getRuntime()
, asBinary = arguments.length > 1 ? arguments[1] : true
;
if (!I.can('access_binary')) {
throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR);
}
_blob = blob;
if (blob.isDetached()) {
_binStr = blob.getSource();
_preload.call(this, _binStr);
return;
} else {
_readAsDataUrl.call(this, blob.getSource(), function(dataUrl) {
if (asBinary) {
_binStr = _toBinary(dataUrl);
}
_preload.call(comp, dataUrl);
});
}
},
loadFromImage: function(img, exact) {
this.meta = img.meta;
_blob = new File(null, {
name: img.name,
size: img.size,
type: img.type
});
_preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL());
},
getInfo: function() {
var I = this.getRuntime(), info;
if (!_imgInfo && _binStr && I.can('access_image_binary')) {
_imgInfo = new ImageInfo(_binStr);
}
info = {
width: _getImg().width || 0,
height: _getImg().height || 0,
type: _blob.type || Mime.getFileMime(_blob.name),
size: _binStr && _binStr.length || _blob.size || 0,
name: _blob.name || '',
meta: _imgInfo && _imgInfo.meta || this.meta || {}
};
return info;
},
downsize: function() {
_downsize.apply(this, arguments);
},
getAsCanvas: function() {
if (_canvas) {
_canvas.id = this.uid + '_canvas';
}
return _canvas;
},
getAsBlob: function(type, quality) {
if (type !== this.type) {
// if different mime type requested prepare image for conversion
_downsize.call(this, this.width, this.height, false);
}
return new File(null, {
name: _blob.name || '',
type: type,
data: me.getAsBinaryString.call(this, type, quality)
});
},
getAsDataURL: function(type) {
var quality = arguments[1] || 90;
// if image has not been modified, return the source right away
if (!_modified) {
return _img.src;
}
if ('image/jpeg' !== type) {
return _canvas.toDataURL('image/png');
} else {
try {
// older Geckos used to result in an exception on quality argument
return _canvas.toDataURL('image/jpeg', quality/100);
} catch (ex) {
return _canvas.toDataURL('image/jpeg');
}
}
},
getAsBinaryString: function(type, quality) {
// if image has not been modified, return the source right away
if (!_modified) {
// if image was not loaded from binary string
if (!_binStr) {
_binStr = _toBinary(me.getAsDataURL(type, quality));
}
return _binStr;
}
if ('image/jpeg' !== type) {
_binStr = _toBinary(me.getAsDataURL(type, quality));
} else {
var dataUrl;
// if jpeg
if (!quality) {
quality = 90;
}
try {
// older Geckos used to result in an exception on quality argument
dataUrl = _canvas.toDataURL('image/jpeg', quality/100);
} catch (ex) {
dataUrl = _canvas.toDataURL('image/jpeg');
}
_binStr = _toBinary(dataUrl);
if (_imgInfo) {
_binStr = _imgInfo.stripHeaders(_binStr);
if (_preserveHeaders) {
// update dimensions info in exif
if (_imgInfo.meta && _imgInfo.meta.exif) {
_imgInfo.setExif({
PixelXDimension: this.width,
PixelYDimension: this.height
});
}
// re-inject the headers
_binStr = _imgInfo.writeHeaders(_binStr);
}
// will be re-created from fresh on next getInfo call
_imgInfo.purge();
_imgInfo = null;
}
}
_modified = false;
return _binStr;
},
destroy: function() {
me = null;
_purge.call(this);
this.getRuntime().getShim().removeInstance(this.uid);
}
});
function _getImg() {
if (!_canvas && !_img) {
throw new x.ImageError(x.DOMException.INVALID_STATE_ERR);
}
return _canvas || _img;
}
function _toBinary(str) {
return Encode.atob(str.substring(str.indexOf('base64,') + 7));
}
function _toDataUrl(str, type) {
return 'data:' + (type || '') + ';base64,' + Encode.btoa(str);
}
function _preload(str) {
var comp = this;
_img = new Image();
_img.onerror = function() {
_purge.call(this);
comp.trigger('error', x.ImageError.WRONG_FORMAT);
};
_img.onload = function() {
comp.trigger('load');
};
_img.src = /^data:[^;]*;base64,/.test(str) ? str : _toDataUrl(str, _blob.type);
}
function _readAsDataUrl(file, callback) {
var comp = this, fr;
// use FileReader if it's available
if (window.FileReader) {
fr = new FileReader();
fr.onload = function() {
callback(this.result);
};
fr.onerror = function() {
comp.trigger('error', x.ImageError.WRONG_FORMAT);
};
fr.readAsDataURL(file);
} else {
return callback(file.getAsDataURL());
}
}
function _downsize(width, height, crop, preserveHeaders) {
var self = this
, scale
, mathFn
, x = 0
, y = 0
, img
, destWidth
, destHeight
, orientation
;
_preserveHeaders = preserveHeaders; // we will need to check this on export (see getAsBinaryString())
// take into account orientation tag
orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1;
if (Basic.inArray(orientation, [5,6,7,8]) !== -1) { // values that require 90 degree rotation
// swap dimensions
var tmp = width;
width = height;
height = tmp;
}
img = _getImg();
// unify dimensions
if (!crop) {
scale = Math.min(width/img.width, height/img.height);
} else {
// one of the dimensions may exceed the actual image dimensions - we need to take the smallest value
width = Math.min(width, img.width);
height = Math.min(height, img.height);
scale = Math.max(width/img.width, height/img.height);
}
// we only downsize here
if (scale > 1 && !crop && preserveHeaders) {
this.trigger('Resize');
return;
}
// prepare canvas if necessary
if (!_canvas) {
_canvas = document.createElement("canvas");
}
// calculate dimensions of proportionally resized image
destWidth = Math.round(img.width * scale);
destHeight = Math.round(img.height * scale);
// scale image and canvas
if (crop) {
_canvas.width = width;
_canvas.height = height;
// if dimensions of the resulting image still larger than canvas, center it
if (destWidth > width) {
x = Math.round((destWidth - width) / 2);
}
if (destHeight > height) {
y = Math.round((destHeight - height) / 2);
}
} else {
_canvas.width = destWidth;
_canvas.height = destHeight;
}
// rotate if required, according to orientation tag
if (!_preserveHeaders) {
_rotateToOrientaion(_canvas.width, _canvas.height, orientation);
}
_drawToCanvas.call(this, img, _canvas, -x, -y, destWidth, destHeight);
this.width = _canvas.width;
this.height = _canvas.height;
_modified = true;
self.trigger('Resize');
}
function _drawToCanvas(img, canvas, x, y, w, h) {
if (Env.OS === 'iOS') {
// avoid squish bug in iOS6
MegaPixel.renderTo(img, canvas, { width: w, height: h, x: x, y: y });
} else {
var ctx = canvas.getContext('2d');
ctx.drawImage(img, x, y, w, h);
}
}
/**
* Transform canvas coordination according to specified frame size and orientation
* Orientation value is from EXIF tag
* @author Shinichi Tomita <[email protected]>
*/
function _rotateToOrientaion(width, height, orientation) {
switch (orientation) {
case 5:
case 6:
case 7:
case 8:
_canvas.width = height;
_canvas.height = width;
break;
default:
_canvas.width = width;
_canvas.height = height;
}
/**
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
*/
var ctx = _canvas.getContext('2d');
switch (orientation) {
case 2:
// horizontal flip
ctx.translate(width, 0);
ctx.scale(-1, 1);
break;
case 3:
// 180 rotate left
ctx.translate(width, height);
ctx.rotate(Math.PI);
break;
case 4:
// vertical flip
ctx.translate(0, height);
ctx.scale(1, -1);
break;
case 5:
// vertical flip + 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.scale(1, -1);
break;
case 6:
// 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.translate(0, -height);
break;
case 7:
// horizontal flip + 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.translate(width, -height);
ctx.scale(-1, 1);
break;
case 8:
// 90 rotate left
ctx.rotate(-0.5 * Math.PI);
ctx.translate(-width, 0);
break;
}
}
function _purge() {
if (_imgInfo) {
_imgInfo.purge();
_imgInfo = null;
}
_binStr = _img = _canvas = _blob = null;
_modified = false;
}
}
return (extensions.Image = HTML5Image);
});
// Included from: src/javascript/runtime/html4/image/Image.js
/**
* Image.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/image/Image
@private
*/
define("moxie/runtime/html4/image/Image", [
"moxie/runtime/html4/Runtime",
"moxie/runtime/html5/image/Image"
], function(extensions, Image) {
return (extensions.Image = Image);
});
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/image/Image","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);
|
src/components/Template/Tracking/index.js | tscanlin/tocbot | import React from 'react'
function getGaScript (siteId) {
return `
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','${siteId}','auto');ga('send','pageview');
`
}
export default (props) => {
return (
<div>
<script dangerouslySetInnerHTML={{ __html: getGaScript(props.siteId) }} />
</div>
)
}
|
mobile/Tests/Components/FullButtonTest.js | JasonQSong/SoulDistance | // https://github.com/airbnb/enzyme/blob/master/docs/api/shallow.md
import test from 'ava'
import React from 'react'
import FullButton from '../../App/Components/FullButton'
import { shallow } from 'enzyme'
// Basic wrapper
const wrapper = shallow(<FullButton onPress={() => {}} text='hi' />)
test('component exists', (t) => {
t.is(wrapper.length, 1) // exists
})
test('component structure', (t) => {
t.is(wrapper.name(), 'TouchableOpacity') // the right root component
t.is(wrapper.children().length, 1) // has 1 child
t.is(wrapper.children().first().name(), 'Text') // that child is Text
})
test('onPress', (t) => {
let i = 0 // i guess i could have used sinon here too... less is more i guess
const onPress = () => i++
const wrapperPress = shallow(<FullButton onPress={onPress} text='hi' />)
t.is(wrapperPress.prop('onPress'), onPress) // uses the right handler
t.is(i, 0)
wrapperPress.simulate('press')
t.is(i, 1)
})
|
client/modules/App/__tests__/App.spec.js | suchostone/ekinder | import React from 'react';
import test from 'ava';
import sinon from 'sinon';
import { shallow, mount } from 'enzyme';
import { App } from '../App';
import styles from '../App.css';
import { intlShape } from 'react-intl';
import { intl } from '../../../util/react-intl-test-helper';
import { toggleAddPost } from '../AppActions';
const intlProp = { ...intl, enabledLanguages: ['en', 'fr'] };
const children = <h1>Test</h1>;
const dispatch = sinon.spy();
const props = {
children,
dispatch,
intl: intlProp,
};
test('renders properly', t => {
const wrapper = shallow(
<App {...props} />
);
// t.is(wrapper.find('Helmet').length, 1);
t.is(wrapper.find('Header').length, 1);
t.is(wrapper.find('Footer').length, 1);
t.is(wrapper.find('Header').prop('toggleAddPost'), wrapper.instance().toggleAddPostSection);
t.truthy(wrapper.find('Header + div').hasClass(styles.container));
t.truthy(wrapper.find('Header + div').children(), children);
});
test('calls componentDidMount', t => {
sinon.spy(App.prototype, 'componentDidMount');
mount(
<App {...props} />,
{
context: {
router: {
isActive: sinon.stub().returns(true),
push: sinon.stub(),
replace: sinon.stub(),
go: sinon.stub(),
goBack: sinon.stub(),
goForward: sinon.stub(),
setRouteLeaveHook: sinon.stub(),
createHref: sinon.stub(),
},
intl,
},
childContextTypes: {
router: React.PropTypes.object,
intl: intlShape,
},
},
);
t.truthy(App.prototype.componentDidMount.calledOnce);
App.prototype.componentDidMount.restore();
});
test('calling toggleAddPostSection dispatches toggleAddPost', t => {
const wrapper = shallow(
<App {...props} />
);
wrapper.instance().toggleAddPostSection();
t.truthy(dispatch.calledOnce);
t.truthy(dispatch.calledWith(toggleAddPost()));
});
|
frontend/src/containers/PatchWidget/PatchWidget.js | webrecorder/webrecorder | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { getRemoteArchiveStats } from 'store/selectors';
import { PatchWidgetUI } from 'components/controls';
class PatchWidget extends Component {
static propTypes = {
params: PropTypes.object,
stats: PropTypes.object
};
render() {
const { params: { rec, ts }, stats } = this.props;
return (
<PatchWidgetUI
toRecording={rec}
timestamp={ts}
stats={stats} />
);
}
}
const mapStateToProps = ({ app }) => {
return {
stats: getRemoteArchiveStats(app)
};
};
export default connect(
mapStateToProps
)(PatchWidget);
|
code/workspaces/web-app/src/components/stacks/StackStatus.js | NERC-CEH/datalab | import { withStyles } from '@material-ui/core/styles';
import PropTypes from 'prop-types';
import React from 'react';
import Typography from '@material-ui/core/Typography';
import { statusTypes } from 'common';
const { getStatusKeys, getStatusProps } = statusTypes;
const styles = theme => ({
stackStatus: {
padding: `${theme.spacing(0.5)}px 0`,
borderRadius: 50, // make round
userSelect: 'none',
marginBottom: theme.spacing(2),
},
});
const StackStatus = ({ classes, status }) => {
const { displayName, backgroundColor, color } = getStatusProps(status);
return (
<Typography
className={classes.stackStatus}
style={{ backgroundColor, color }}
type="caption"
align="center"
>
{displayName}
</Typography>
);
};
StackStatus.propTypes = {
status: PropTypes.oneOf(getStatusKeys()),
};
export default withStyles(styles)(StackStatus);
|
ajax/libs/material-ui/4.9.9/CardMedia/CardMedia.js | cdnjs/cdnjs | "use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.styles = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
var _utils = require("@material-ui/utils");
var styles = {
/* Styles applied to the root element. */
root: {
display: 'block',
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center'
},
/* Styles applied to the root element if `component="video, audio, picture, iframe, or img"`. */
media: {
width: '100%'
},
/* Styles applied to the root element if `component="picture or img"`. */
img: {
// ⚠️ object-fit is not supported by IE 11.
objectFit: 'cover'
}
};
exports.styles = styles;
var MEDIA_COMPONENTS = ['video', 'audio', 'picture', 'iframe', 'img'];
var CardMedia = React.forwardRef(function CardMedia(props, ref) {
var children = props.children,
classes = props.classes,
className = props.className,
_props$component = props.component,
Component = _props$component === void 0 ? 'div' : _props$component,
image = props.image,
src = props.src,
style = props.style,
other = (0, _objectWithoutProperties2.default)(props, ["children", "classes", "className", "component", "image", "src", "style"]);
var isMediaComponent = MEDIA_COMPONENTS.indexOf(Component) !== -1;
var composedStyle = !isMediaComponent && image ? (0, _extends2.default)({
backgroundImage: "url(\"".concat(image, "\")")
}, style) : style;
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({
className: (0, _clsx.default)(classes.root, className, isMediaComponent && classes.media, "picture img".indexOf(Component) !== -1 && classes.img),
ref: ref,
style: composedStyle,
src: isMediaComponent ? image || src : undefined
}, other), children);
});
process.env.NODE_ENV !== "production" ? CardMedia.propTypes = {
/**
* The content of the component.
*/
children: (0, _utils.chainPropTypes)(_propTypes.default.node, function (props) {
if (!props.children && !props.image && !props.src && !props.component) {
return new Error('Material-UI: either `children`, `image`, `src` or `component` prop must be specified.');
}
return null;
}),
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: _propTypes.default.object.isRequired,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* Component for rendering image.
* Either a string to use a DOM element or a component.
*/
component: _propTypes.default.elementType,
/**
* Image to be displayed as a background image.
* Either `image` or `src` prop must be specified.
* Note that caller must specify height otherwise the image will not be visible.
*/
image: _propTypes.default.string,
/**
* An alias for `image` property.
* Available only with media components.
* Media components: `video`, `audio`, `picture`, `iframe`, `img`.
*/
src: _propTypes.default.string,
/**
* @ignore
*/
style: _propTypes.default.object
} : void 0;
var _default = (0, _withStyles.default)(styles, {
name: 'MuiCardMedia'
})(CardMedia);
exports.default = _default; |
library/src/pivotal-ui-react/table/table.js | sjolicoeur/pivotal-ui | import classnames from 'classnames';
import {Icon} from 'pui-react-iconography';
import {mergeProps} from 'pui-react-helpers';
import PropTypes from 'prop-types';
import React from 'react';
import sortBy from 'lodash.sortby';
import 'pui-css-tables';
import {FlexTableHeader} from './flex-table-header';
export {FlexTableHeader} from './flex-table-header';
import {FlexTableCell} from './flex-table-cell';
export {FlexTableCell} from './flex-table-cell';
import {FlexTableRow} from './flex-table-row';
export {FlexTableRow} from './flex-table-row';
import {TableHeader} from './table-header';
export {TableHeader} from './table-header';
import {TableCell} from './table-cell';
export {TableCell} from './table-cell';
import {TableRow} from './table-row';
export {TableRow} from './table-row';
const SORT_ORDER = {
asc: 0,
desc: 1,
none: 2
};
export class Table extends React.Component {
static propTypes = {
bodyRowClassName: PropTypes.string,
columns: PropTypes.array.isRequired,
CustomRow: PropTypes.func,
data: PropTypes.array.isRequired,
defaultSort: PropTypes.string,
rowProps: PropTypes.object
};
constructor(props, context) {
super(props, context);
const {columns, defaultSort} = props;
const sortColumn = columns.find(({sortable, attribute}) => {
return defaultSort ? attribute === defaultSort : sortable;
});
this.state = {sortColumn, sortOrder: SORT_ORDER.asc};
this.defaultCell = TableCell;
this.defaultRow = TableRow;
this.defaultHeader = TableHeader;
}
componentWillReceiveProps({columns, defaultSort}) {
if (columns) {
const sortColumn = columns.find(({sortable, attribute}) => {
return defaultSort ? attribute === defaultSort : sortable;
});
this.setState({sortColumn, sortOrder: SORT_ORDER.asc});
}
}
updateSort = (sortColumn, isSortColumn) => {
if (isSortColumn) {
return this.setState({sortOrder: ++this.state.sortOrder % Object.keys(SORT_ORDER).length});
}
this.setState({sortColumn, sortOrder: SORT_ORDER.asc});
};
sortedRows = data => {
const {sortColumn, sortOrder} = this.state;
if (sortOrder === SORT_ORDER.none) return this.rows(data);
const sortedData = sortBy(data, datum => {
const rankFunction = sortColumn.sortBy || (i => i);
return rankFunction(datum[sortColumn.attribute]);
});
if (sortOrder === SORT_ORDER.desc) sortedData.reverse();
return this.rows(sortedData);
};
rows = data => {
const {bodyRowClassName, columns, CustomRow, rowProps} = this.props;
return data.map((rowDatum, rowKey) => {
const cells = columns.map((opts, key) => {
const {attribute, CustomCell, width} = opts;
let style, {cellClass} = opts;
if (width) {
style = {width};
opts.cellClass = classnames(cellClass, 'col-fixed');
}
const Cell = CustomCell || this.defaultCell;
const cellProps = {
key,
index: rowKey,
value: rowDatum[attribute],
rowDatum,
style,
...opts
};
return (<Cell {...cellProps}>{rowDatum[attribute]}</Cell>);
});
const Row = CustomRow || this.defaultRow;
return (<Row key={rowKey} index={rowKey} {...{
key: rowKey,
index: rowKey,
className: bodyRowClassName,
rowDatum,
...rowProps
}}
>{cells}</Row>);
});
};
renderHeaders = () => {
const {sortColumn, sortOrder} = this.state;
return this.props.columns.map((column, index) => {
let {attribute, sortable, displayName, cellClass, headerProps = {}, width} = column;
const isSortColumn = column === sortColumn;
let className, icon;
if (isSortColumn) {
className = ['sorted-asc', 'sorted-desc', ''][sortOrder];
icon = [<Icon verticalAlign="baseline" src="arrow_drop_up"/>,
<Icon verticalAlign="baseline" src="arrow_drop_down"/>, null][sortOrder];
}
className = classnames(className, headerProps.className, cellClass);
headerProps = {
...headerProps,
className,
sortable,
key: index,
onSortableTableHeaderClick: () => this.updateSort(column, isSortColumn)
};
if (width) {
headerProps = {
...headerProps,
className: classnames(className, 'col-fixed'),
style: {width}
};
}
const Header = this.defaultHeader;
return (<Header {...headerProps}>
<div>{displayName || attribute}{icon}</div>
</Header>);
});
};
render() {
const {sortColumn} = this.state;
let {columns, CustomRow, data, defaultSort, ...props} = this.props;
props = mergeProps(props, {className: ['table', 'table-sortable', 'table-data']});
const rows = sortColumn ? this.sortedRows(data) : this.rows(data);
return (<table {...props}>
<thead>
<tr>{this.renderHeaders()}</tr>
</thead>
<tbody>
{rows}
</tbody>
</table>);
}
}
export class FlexTable extends Table {
static propTypes = {
bodyRowClassName: PropTypes.string,
columns: PropTypes.array.isRequired,
CustomRow: PropTypes.func,
data: PropTypes.array.isRequired,
defaultSort: PropTypes.string,
headerRowClassName: PropTypes.string,
hideHeaderRow: PropTypes.bool,
rowProps: PropTypes.object
};
constructor(props, context) {
super(props, context);
const {columns, defaultSort} = props;
const sortColumn = columns.find(({sortable, attribute}) => {
return defaultSort ? attribute === defaultSort : sortable;
});
this.state = {sortColumn, sortOrder: SORT_ORDER.asc};
this.defaultCell = FlexTableCell;
this.defaultRow = FlexTableRow;
this.defaultHeader = FlexTableHeader;
}
render() {
const {sortColumn} = this.state;
let {bodyRowClassName, columns, CustomRow, data, defaultSort, headerRowClassName, hideHeaderRow, rowProps, ...props} = this.props;
props = mergeProps(props, {className: ['table', 'table-sortable', 'table-data']});
let header;
if (!hideHeaderRow) {
header = (
<div className={classnames('tr', 'grid', headerRowClassName)}>
{this.renderHeaders()}
</div>
);
}
const rows = sortColumn ? this.sortedRows(data) : this.rows(data);
return (<div {...props}>
{header}
{rows}
</div>);
}
} |
ajax/libs/fluentui-react/7.163.0/fluentui-react.min.js | cdnjs/cdnjs | var FluentUIReact=function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=23)}({0:function(e,t){e.exports=React},1:function(e,t,o){"use strict";(function(e){o.d(t,"a",(function(){return u})),o.d(t,"b",(function(){return p}));var n=function(){return(n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r="undefined"==typeof window?e:window,i=r&&r.CSPSettings&&r.CSPSettings.nonce,s=function(){var e=r.__themeState__||{theme:void 0,lastStyleElement:void 0,registeredStyles:[]};e.runState||(e=n({},e,{perf:{count:0,duration:0},runState:{flushTimer:0,mode:0,buffer:[]}}));e.registeredThemableStyles||(e=n({},e,{registeredThemableStyles:[]}));return r.__themeState__=e,e}(),a=/[\'\"]\[theme:\s*(\w+)\s*(?:\,\s*default:\s*([\\"\']?[\.\,\(\)\#\-\s\w]*[\.\,\(\)\#\-\w][\"\']?))?\s*\][\'\"]/g,l=function(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()};function c(e){var t=l();e();var o=l();s.perf.duration+=o-t}function u(e,t){void 0===t&&(t=!1),c((function(){var o=Array.isArray(e)?e:g(e),n=s.runState,r=n.mode,i=n.buffer,a=n.flushTimer;t||1===r?(i.push(o),a||(s.runState.flushTimer=setTimeout((function(){s.runState.flushTimer=0,c((function(){var e=s.runState.buffer.slice();s.runState.buffer=[];var t=[].concat.apply([],e);t.length>0&&d(t)}))}),0))):d(o)}))}function d(e,t){s.loadStyles?s.loadStyles(m(e).styleString,e):function(e){if("undefined"==typeof document)return;var t=document.getElementsByTagName("head")[0],o=document.createElement("style"),n=m(e),r=n.styleString,a=n.themable;o.setAttribute("data-load-themed-styles","true"),o.type="text/css",i&&o.setAttribute("nonce",i);o.appendChild(document.createTextNode(r)),s.perf.count++,t.appendChild(o);var l=document.createEvent("HTMLEvents");l.initEvent("styleinsert",!0,!1),l.args={newStyle:o},document.dispatchEvent(l);var c={styleElement:o,themableStyle:e};a?s.registeredThemableStyles.push(c):s.registeredStyles.push(c)}(e)}function p(e){s.theme=e,function(){if(s.theme){for(var e=[],t=0,o=s.registeredThemableStyles;t<o.length;t++){var n=o[t];e.push(n.themableStyle)}e.length>0&&(!function(e){void 0===e&&(e=3);3!==e&&2!==e||(h(s.registeredStyles),s.registeredStyles=[]);3!==e&&1!==e||(h(s.registeredThemableStyles),s.registeredThemableStyles=[])}(1),d([].concat.apply([],e)))}}()}function h(e){e.forEach((function(e){var t=e&&e.styleElement;t&&t.parentElement&&t.parentElement.removeChild(t)}))}function m(e){var t=s.theme,o=!1;return{styleString:(e||[]).map((function(e){var n=e.theme;if(n){o=!0;var r=t?t[n]:void 0,i=e.defaultValue||"inherit";return t&&!r&&console&&!(n in t)&&"undefined"!=typeof DEBUG&&DEBUG&&console.warn('Theming value not provided for "'+n+'". Falling back to "'+i+'".'),r||i}return e.rawString})).join(""),themable:o}}function g(e){var t=[];if(e){for(var o=0,n=void 0;n=a.exec(e);){var r=n.index;r>o&&t.push({rawString:e.substring(o,r)}),t.push({theme:n[1],defaultValue:n[2]}),o=a.lastIndex}t.push({rawString:e.substring(o)})}return t}}).call(this,o(22))},14:function(e,t){e.exports=ReactDOM},22:function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"==typeof window&&(o=window)}e.exports=o},23:function(e,t,o){"use strict";o.r(t),o.d(t,"ActivityItem",(function(){return oi})),o.d(t,"Autofill",(function(){return pi})),o.d(t,"BaseAutoFill",(function(){return hi})),o.d(t,"Announced",(function(){return vi})),o.d(t,"AnnouncedBase",(function(){return fi})),o.d(t,"Breadcrumb",(function(){return Eu})),o.d(t,"BreadcrumbBase",(function(){return wu})),o.d(t,"BaseButton",(function(){return qc})),o.d(t,"ElementType",(function(){return fu})),o.d(t,"ButtonType",(function(){return vu})),o.d(t,"Button",(function(){return Uu})),o.d(t,"ActionButton",(function(){return zu})),o.d(t,"CommandBarButton",(function(){return ju})),o.d(t,"CommandButton",(function(){return Yu})),o.d(t,"CompoundButton",(function(){return Vu})),o.d(t,"DefaultButton",(function(){return Hu})),o.d(t,"MessageBarButton",(function(){return Zu})),o.d(t,"PrimaryButton",(function(){return Ku})),o.d(t,"IconButton",(function(){return eu})),o.d(t,"getSplitButtonClassNames",(function(){return Yc})),o.d(t,"ButtonGrid",(function(){return Ju})),o.d(t,"Grid",(function(){return $u})),o.d(t,"ButtonGridCell",(function(){return ed})),o.d(t,"GridCell",(function(){return td})),o.d(t,"Calendar",(function(){return kh})),o.d(t,"DayOfWeek",(function(){return Bu})),o.d(t,"DateRangeType",(function(){return Au})),o.d(t,"FirstWeekOfYear",(function(){return Fu})),o.d(t,"Callout",(function(){return uc})),o.d(t,"CalloutContent",(function(){return Kl})),o.d(t,"CalloutContentBase",(function(){return zl})),o.d(t,"FocusTrapCallout",(function(){return Dh})),o.d(t,"DirectionalHint",(function(){return ya})),o.d(t,"Check",(function(){return Mh})),o.d(t,"CheckBase",(function(){return Th})),o.d(t,"Checkbox",(function(){return Fh})),o.d(t,"CheckboxBase",(function(){return Bh})),o.d(t,"ChoiceGroup",(function(){return Jh})),o.d(t,"ChoiceGroupBase",(function(){return Zh})),o.d(t,"ChoiceGroupOption",(function(){return Yh})),o.d(t,"Coachmark",(function(){return pm})),o.d(t,"COACHMARK_ATTRIBUTE_NAME",(function(){return um})),o.d(t,"CoachmarkBase",(function(){return dm})),o.d(t,"MAX_COLOR_SATURATION",(function(){return hm})),o.d(t,"MAX_COLOR_HUE",(function(){return mm})),o.d(t,"MAX_COLOR_VALUE",(function(){return gm})),o.d(t,"MAX_COLOR_RGB",(function(){return fm})),o.d(t,"MAX_COLOR_RGBA",(function(){return vm})),o.d(t,"MAX_COLOR_ALPHA",(function(){return bm})),o.d(t,"MIN_HEX_LENGTH",(function(){return _m})),o.d(t,"MAX_HEX_LENGTH",(function(){return ym})),o.d(t,"MIN_RGBA_LENGTH",(function(){return Cm})),o.d(t,"MAX_RGBA_LENGTH",(function(){return Sm})),o.d(t,"HEX_REGEX",(function(){return xm})),o.d(t,"RGBA_REGEX",(function(){return km})),o.d(t,"cssColor",(function(){return Pm})),o.d(t,"rgb2hex",(function(){return Mm})),o.d(t,"clamp",(function(){return Em})),o.d(t,"hsl2rgb",(function(){return Dm})),o.d(t,"hsl2hsv",(function(){return wm})),o.d(t,"hsv2rgb",(function(){return Im})),o.d(t,"hsv2hex",(function(){return Bm})),o.d(t,"rgb2hsv",(function(){return Nm})),o.d(t,"hsv2hsl",(function(){return Fm})),o.d(t,"getColorFromString",(function(){return Hm})),o.d(t,"getColorFromRGBA",(function(){return Lm})),o.d(t,"getColorFromHSV",(function(){return Om})),o.d(t,"getFullColorString",(function(){return zm})),o.d(t,"updateSV",(function(){return Wm})),o.d(t,"updateH",(function(){return Vm})),o.d(t,"updateRGB",(function(){return Km})),o.d(t,"updateA",(function(){return Um})),o.d(t,"correctRGB",(function(){return Gm})),o.d(t,"correctHSV",(function(){return jm})),o.d(t,"correctHex",(function(){return Ym})),o.d(t,"Shade",(function(){return qm})),o.d(t,"isValidShade",(function(){return ng})),o.d(t,"isDark",(function(){return sg})),o.d(t,"getShade",(function(){return ag})),o.d(t,"getBackgroundShade",(function(){return lg})),o.d(t,"getContrastRatio",(function(){return cg})),o.d(t,"updateT",(function(){return ug})),o.d(t,"ColorPicker",(function(){return Ag})),o.d(t,"ColorPickerBase",(function(){return Mg})),o.d(t,"SelectableOptionMenuItemType",(function(){return Bg})),o.d(t,"ComboBox",(function(){return Zg})),o.d(t,"VirtualizedComboBox",(function(){return nf})),o.d(t,"CommandBar",(function(){return ff})),o.d(t,"CommandBarBase",(function(){return gf})),o.d(t,"ContextualMenu",(function(){return Uc})),o.d(t,"getSubmenuItems",(function(){return Ac})),o.d(t,"canAnyMenuItemsCheck",(function(){return Lc})),o.d(t,"ContextualMenuBase",(function(){return Oc})),o.d(t,"ContextualMenuItemType",(function(){return va})),o.d(t,"ContextualMenuItem",(function(){return Ic})),o.d(t,"ContextualMenuItemBase",(function(){return fc})),o.d(t,"getMenuItemStyles",(function(){return yc})),o.d(t,"DatePicker",(function(){return Cf})),o.d(t,"DatePickerBase",(function(){return _f})),o.d(t,"addDays",(function(){return ad})),o.d(t,"addWeeks",(function(){return ld})),o.d(t,"addMonths",(function(){return cd})),o.d(t,"addYears",(function(){return ud})),o.d(t,"getMonthStart",(function(){return dd})),o.d(t,"getMonthEnd",(function(){return pd})),o.d(t,"getYearStart",(function(){return hd})),o.d(t,"getYearEnd",(function(){return md})),o.d(t,"setMonth",(function(){return gd})),o.d(t,"compareDates",(function(){return fd})),o.d(t,"compareDatePart",(function(){return vd})),o.d(t,"getDateRangeArray",(function(){return bd})),o.d(t,"isInDateRangeArray",(function(){return _d})),o.d(t,"getWeekNumbersInMonth",(function(){return yd})),o.d(t,"getWeekNumber",(function(){return Cd})),o.d(t,"getStartDateOfWeek",(function(){return Sd})),o.d(t,"getEndDateOfWeek",(function(){return xd})),o.d(t,"getDatePartHashValue",(function(){return wd})),o.d(t,"MonthOfYear",(function(){return Nu})),o.d(t,"DAYS_IN_WEEK",(function(){return od})),o.d(t,"SELECTION_CHANGE",(function(){return Sf})),o.d(t,"SelectionDirection",(function(){return lf})),o.d(t,"SelectionMode",(function(){return af})),o.d(t,"Selection",(function(){return xf})),o.d(t,"SelectionZone",(function(){return Mf})),o.d(t,"CollapseAllVisibility",(function(){return wf})),o.d(t,"DetailsHeader",(function(){return iv})),o.d(t,"DetailsHeaderBase",(function(){return ev})),o.d(t,"SelectAllVisibility",(function(){return Gf})),o.d(t,"DetailsList",(function(){return Xv})),o.d(t,"DetailsListBase",(function(){return Gv})),o.d(t,"buildColumns",(function(){return jv})),o.d(t,"ColumnActionsMode",(function(){return If})),o.d(t,"ConstrainMode",(function(){return Df})),o.d(t,"ColumnDragEndLocation",(function(){return Pf})),o.d(t,"DetailsListLayoutMode",(function(){return Tf})),o.d(t,"CheckboxVisibility",(function(){return Ef})),o.d(t,"DetailsRow",(function(){return hv})),o.d(t,"DetailsRowBase",(function(){return cv})),o.d(t,"DetailsRowGlobalClassNames",(function(){return Bf})),o.d(t,"DEFAULT_CELL_STYLE_PROPS",(function(){return Nf})),o.d(t,"DEFAULT_ROW_HEIGHTS",(function(){return Ff})),o.d(t,"getDetailsRowStyles",(function(){return Lf})),o.d(t,"DetailsRowCheck",(function(){return jf})),o.d(t,"DetailsRowFields",(function(){return sv})),o.d(t,"DetailsColumnBase",(function(){return Zf})),o.d(t,"Dialog",(function(){return Ib})),o.d(t,"DialogBase",(function(){return kb})),o.d(t,"DialogContent",(function(){return yb})),o.d(t,"DialogContentBase",(function(){return bb})),o.d(t,"DialogFooter",(function(){return gb})),o.d(t,"DialogFooterBase",(function(){return hb})),o.d(t,"ResponsiveMode",(function(){return Ra})),o.d(t,"DialogType",(function(){return qv})),o.d(t,"VerticalDivider",(function(){return Rc})),o.d(t,"DocumentCard",(function(){return Fb})),o.d(t,"DocumentCardType",(function(){return Qv})),o.d(t,"DocumentCardActions",(function(){return Ob})),o.d(t,"DocumentCardActivity",(function(){return Wb})),o.d(t,"DocumentCardDetails",(function(){return Gb})),o.d(t,"DocumentCardLocation",(function(){return Yb})),o.d(t,"DocumentCardPreview",(function(){return Zb})),o.d(t,"DocumentCardImage",(function(){return Jb})),o.d(t,"DocumentCardTitle",(function(){return e_})),o.d(t,"DocumentCardLogo",(function(){return r_})),o.d(t,"DocumentCardStatus",(function(){return l_})),o.d(t,"DragDropHelper",(function(){return Yf})),o.d(t,"Dropdown",(function(){return Z_})),o.d(t,"DropdownBase",(function(){return K_})),o.d(t,"DropdownMenuItemType",(function(){return Bg})),o.d(t,"BaseExtendedPicker",(function(){return ty})),o.d(t,"BaseExtendedPeoplePicker",(function(){return oy})),o.d(t,"ExtendedPeoplePicker",(function(){return ny})),o.d(t,"Fabric",(function(){return Jl})),o.d(t,"FabricBase",(function(){return Zl})),o.d(t,"OverflowButtonType",(function(){return X_})),o.d(t,"FacepileBase",(function(){return dy})),o.d(t,"Facepile",(function(){return hy})),o.d(t,"BaseFloatingPicker",(function(){return Gy})),o.d(t,"BaseFloatingPeoplePicker",(function(){return jy})),o.d(t,"FloatingPeoplePicker",(function(){return Yy})),o.d(t,"createItem",(function(){return qy})),o.d(t,"SuggestionsStore",(function(){return Zy})),o.d(t,"SuggestionItemType",(function(){return By})),o.d(t,"SuggestionsHeaderFooterItem",(function(){return Vy})),o.d(t,"SuggestionsControl",(function(){return Ky})),o.d(t,"SuggestionsCore",(function(){return Ry})),o.d(t,"FocusTrapZone",(function(){return Ih})),o.d(t,"FocusZone",(function(){return ks})),o.d(t,"FocusZoneTabbableElements",(function(){return bs})),o.d(t,"FocusZoneDirection",(function(){return vs})),o.d(t,"GroupedList",(function(){return zv})),o.d(t,"GroupedListBase",(function(){return Ov})),o.d(t,"GroupHeader",(function(){return Pv})),o.d(t,"GroupFooter",(function(){return Nv})),o.d(t,"GroupShowAll",(function(){return Mv})),o.d(t,"GroupSpacer",(function(){return Rf})),o.d(t,"GroupedListSection",(function(){return Fv})),o.d(t,"HoverCard",(function(){return dC})),o.d(t,"HoverCardBase",(function(){return uC})),o.d(t,"OpenCardMode",(function(){return Xy})),o.d(t,"HoverCardType",(function(){return Qy})),o.d(t,"ExpandingCard",(function(){return rC})),o.d(t,"ExpandingCardBase",(function(){return nC})),o.d(t,"ExpandingCardMode",(function(){return $y})),o.d(t,"PlainCard",(function(){return lC})),o.d(t,"PlainCardBase",(function(){return aC})),o.d(t,"Icon",(function(){return Fr})),o.d(t,"IconBase",(function(){return Nr})),o.d(t,"IconType",(function(){return zn})),o.d(t,"getIconContent",(function(){return Er})),o.d(t,"FontIcon",(function(){return Mr})),o.d(t,"getFontIcon",(function(){return Rr})),o.d(t,"ImageIcon",(function(){return _a})),o.d(t,"initializeIcons",(function(){return RC})),o.d(t,"Image",(function(){return yr})),o.d(t,"ImageBase",(function(){return br})),o.d(t,"ImageFit",(function(){return Wn})),o.d(t,"ImageCoverStyle",(function(){return Vn})),o.d(t,"ImageLoadState",(function(){return Kn})),o.d(t,"Keytip",(function(){return LC})),o.d(t,"KeytipData",(function(){return Zs})),o.d(t,"useKeytipRef",(function(){return HC})),o.d(t,"KeytipLayer",(function(){return XC})),o.d(t,"KeytipLayerBase",(function(){return ZC})),o.d(t,"transitionKeysAreEqual",(function(){return KC})),o.d(t,"transitionKeysContain",(function(){return UC})),o.d(t,"buildKeytipConfigMap",(function(){return QC})),o.d(t,"constructKeytip",(function(){return JC})),o.d(t,"KTP_PREFIX",(function(){return ws})),o.d(t,"KTP_SEPARATOR",(function(){return Is})),o.d(t,"KTP_FULL_PREFIX",(function(){return Ds})),o.d(t,"DATAKTP_TARGET",(function(){return Ps})),o.d(t,"DATAKTP_EXECUTE_TARGET",(function(){return Ts})),o.d(t,"DATAKTP_ARIA_TARGET",(function(){return Es})),o.d(t,"KTP_LAYER_ID",(function(){return Ms})),o.d(t,"KTP_ARIA_SEPARATOR",(function(){return Rs})),o.d(t,"KeytipEvents",(function(){return ys})),o.d(t,"KeytipManager",(function(){return Vs})),o.d(t,"sequencesToID",(function(){return Ks})),o.d(t,"mergeOverflows",(function(){return Us})),o.d(t,"ktpTargetFromSequences",(function(){return Gs})),o.d(t,"ktpTargetFromId",(function(){return js})),o.d(t,"getAriaDescribedBy",(function(){return Ys})),o.d(t,"LabelBase",(function(){return Lh})),o.d(t,"Label",(function(){return Hh})),o.d(t,"Layer",(function(){return cc})),o.d(t,"LayerBase",(function(){return sc})),o.d(t,"LayerHost",(function(){return $C})),o.d(t,"Link",(function(){return $s})),o.d(t,"LinkBase",(function(){return Qs})),o.d(t,"List",(function(){return tf})),o.d(t,"ScrollToMode",(function(){return Xg})),o.d(t,"MarqueeSelection",(function(){return aS})),o.d(t,"MessageBar",(function(){return bS})),o.d(t,"MessageBarBase",(function(){return hS})),o.d(t,"MessageBarType",(function(){return iS})),o.d(t,"Modal",(function(){return db})),o.d(t,"ModalBase",(function(){return ub})),o.d(t,"Nav",(function(){return wS})),o.d(t,"isRelativeUrl",(function(){return CS})),o.d(t,"NavBase",(function(){return kS})),o.d(t,"OverflowSet",(function(){return pf})),o.d(t,"OverflowSetBase",(function(){return uf})),o.d(t,"Overlay",(function(){return nb})),o.d(t,"OverlayBase",(function(){return tb})),o.d(t,"Panel",(function(){return W_})),o.d(t,"PanelBase",(function(){return C_})),o.d(t,"PanelType",(function(){return Db})),o.d(t,"Persona",(function(){return cy})),o.d(t,"PersonaBase",(function(){return ay})),o.d(t,"PersonaSize",(function(){return xr})),o.d(t,"PersonaPresence",(function(){return kr})),o.d(t,"PersonaInitialsColor",(function(){return wr})),o.d(t,"PersonaCoin",(function(){return ti})),o.d(t,"PersonaCoinBase",(function(){return $r})),o.d(t,"personaSize",(function(){return Dr})),o.d(t,"personaPresenceSize",(function(){return Tr})),o.d(t,"sizeBoolean",(function(){return Ar})),o.d(t,"sizeToPixels",(function(){return Lr})),o.d(t,"presenceBoolean",(function(){return Hr})),o.d(t,"getPersonaInitialsColor",(function(){return Xr})),o.d(t,"Suggestions",(function(){return MS})),o.d(t,"SuggestionActionType",(function(){return SS})),o.d(t,"SuggestionsItem",(function(){return Ty})),o.d(t,"SuggestionsController",(function(){return RS})),o.d(t,"BasePicker",(function(){return VS})),o.d(t,"BasePickerListBelow",(function(){return KS})),o.d(t,"ValidationState",(function(){return DS})),o.d(t,"BasePeoplePicker",(function(){return ex})),o.d(t,"MemberListPeoplePicker",(function(){return tx})),o.d(t,"NormalPeoplePickerBase",(function(){return ox})),o.d(t,"CompactPeoplePickerBase",(function(){return nx})),o.d(t,"ListPeoplePickerBase",(function(){return rx})),o.d(t,"createGenericItem",(function(){return ix})),o.d(t,"NormalPeoplePicker",(function(){return sx})),o.d(t,"CompactPeoplePicker",(function(){return ax})),o.d(t,"ListPeoplePicker",(function(){return lx})),o.d(t,"PeoplePickerItemBase",(function(){return jS})),o.d(t,"PeoplePickerItem",(function(){return YS})),o.d(t,"PeoplePickerItemSuggestionBase",(function(){return XS})),o.d(t,"PeoplePickerItemSuggestion",(function(){return QS})),o.d(t,"TagPickerBase",(function(){return _x})),o.d(t,"TagPicker",(function(){return yx})),o.d(t,"TagItemBase",(function(){return dx})),o.d(t,"TagItem",(function(){return px})),o.d(t,"TagItemSuggestionBase",(function(){return vx})),o.d(t,"TagItemSuggestion",(function(){return bx})),o.d(t,"Pivot",(function(){return Px})),o.d(t,"PivotBase",(function(){return xx})),o.d(t,"PivotItem",(function(){return Cx})),o.d(t,"PivotLinkFormat",(function(){return mx})),o.d(t,"PivotLinkSize",(function(){return gx})),o.d(t,"Popup",(function(){return Rl})),o.d(t,"getBoundsFromTargetWindow",(function(){return El})),o.d(t,"getMaxHeight",(function(){return Pl})),o.d(t,"getOppositeEdge",(function(){return Tl})),o.d(t,"positionCallout",(function(){return Il})),o.d(t,"positionCard",(function(){return Dl})),o.d(t,"positionElement",(function(){return wl})),o.d(t,"RectangleEdge",(function(){return Oa})),o.d(t,"Position",(function(){return za})),o.d(t,"PositioningContainer",(function(){return sm})),o.d(t,"ProgressIndicator",(function(){return Nx})),o.d(t,"ProgressIndicatorBase",(function(){return Ex})),o.d(t,"Rating",(function(){return zx})),o.d(t,"RatingBase",(function(){return Ox})),o.d(t,"RatingSize",(function(){return wx})),o.d(t,"ResizeGroup",(function(){return lu})),o.d(t,"getMeasurementCache",(function(){return ou})),o.d(t,"getNextResizeGroupStateProvider",(function(){return nu})),o.d(t,"MeasuredContext",(function(){return ru})),o.d(t,"ResizeGroupBase",(function(){return au})),o.d(t,"ResizeGroupDirection",(function(){return Vc})),o.d(t,"ScrollablePane",(function(){return jx})),o.d(t,"ScrollablePaneBase",(function(){return Gx})),o.d(t,"ScrollbarVisibility",(function(){return Vx})),o.d(t,"ScrollablePaneContext",(function(){return Kx})),o.d(t,"SearchBox",(function(){return Xx})),o.d(t,"SearchBoxBase",(function(){return qx})),o.d(t,"getAllSelectedOptions",(function(){return Yg})),o.d(t,"BaseSelectedItemsList",(function(){return Qx})),o.d(t,"BasePeopleSelectedItemsList",(function(){return gk})),o.d(t,"SelectedPeopleList",(function(){return fk})),o.d(t,"ExtendedSelectedItem",(function(){return uk})),o.d(t,"SeparatorBase",(function(){return bk})),o.d(t,"Separator",(function(){return _k})),o.d(t,"Shimmer",(function(){return Gk})),o.d(t,"ShimmerBase",(function(){return Uk})),o.d(t,"ShimmerElementType",(function(){return yk})),o.d(t,"ShimmerElementsDefaultHeights",(function(){return Ck})),o.d(t,"ShimmerLine",(function(){return Pk})),o.d(t,"ShimmerLineBase",(function(){return Ik})),o.d(t,"ShimmerCircle",(function(){return Ak})),o.d(t,"ShimmerCircleBase",(function(){return Fk})),o.d(t,"ShimmerGap",(function(){return Rk})),o.d(t,"ShimmerGapBase",(function(){return Ek})),o.d(t,"ShimmerElementsGroup",(function(){return Vk})),o.d(t,"ShimmerElementsGroupBase",(function(){return Hk})),o.d(t,"ShimmeredDetailsList",(function(){return qk})),o.d(t,"ShimmeredDetailsListBase",(function(){return Yk})),o.d(t,"Slider",(function(){return $k})),o.d(t,"ONKEYDOWN_TIMEOUT_DURATION",(function(){return Xk})),o.d(t,"SliderBase",(function(){return Qk})),o.d(t,"KeyboardSpinDirection",(function(){return Wk})),o.d(t,"SpinButton",(function(){return sw})),o.d(t,"Spinner",(function(){return kv})),o.d(t,"SpinnerBase",(function(){return Cv})),o.d(t,"SpinnerSize",(function(){return dv})),o.d(t,"SpinnerType",(function(){return pv})),o.d(t,"StackItem",(function(){return fw})),o.d(t,"Stack",(function(){return xw})),o.d(t,"Sticky",(function(){return kw})),o.d(t,"StickyPositionType",(function(){return Sw})),o.d(t,"AnimationClassNames",(function(){return Ye})),o.d(t,"FontClassNames",(function(){return ft})),o.d(t,"ColorClassNames",(function(){return Kt})),o.d(t,"AnimationStyles",(function(){return Ae})),o.d(t,"AnimationVariables",(function(){return Fe})),o.d(t,"DefaultPalette",(function(){return vt})),o.d(t,"DefaultEffects",(function(){return Pt})),o.d(t,"DefaultFontStyles",(function(){return pt})),o.d(t,"registerDefaultFontFaces",(function(){return gt})),o.d(t,"FontSizes",(function(){return Ue})),o.d(t,"FontWeights",(function(){return Ge})),o.d(t,"IconFontSizes",(function(){return je})),o.d(t,"createFontStyles",(function(){return Je})),o.d(t,"getFocusStyle",(function(){return go})),o.d(t,"focusClear",(function(){return vo})),o.d(t,"getFocusOutlineStyle",(function(){return bo})),o.d(t,"getInputFocusStyle",(function(){return _o})),o.d(t,"hiddenContentStyle",(function(){return yo})),o.d(t,"PulsingBeaconAnimationStyles",(function(){return wo})),o.d(t,"getGlobalClassNames",(function(){return Oo})),o.d(t,"getThemedContext",(function(){return Ko})),o.d(t,"ThemeSettingName",(function(){return Lt})),o.d(t,"getTheme",(function(){return Ot})),o.d(t,"loadTheme",(function(){return Vt})),o.d(t,"createTheme",(function(){return Nt})),o.d(t,"registerOnThemeChangeCallback",(function(){return zt})),o.d(t,"removeOnThemeChangeCallback",(function(){return Wt})),o.d(t,"HighContrastSelector",(function(){return jt})),o.d(t,"HighContrastSelectorWhite",(function(){return Yt})),o.d(t,"HighContrastSelectorBlack",(function(){return qt})),o.d(t,"EdgeChromiumHighContrastSelector",(function(){return Zt})),o.d(t,"ScreenWidthMinSmall",(function(){return Xt})),o.d(t,"ScreenWidthMinMedium",(function(){return Qt})),o.d(t,"ScreenWidthMinLarge",(function(){return Jt})),o.d(t,"ScreenWidthMinXLarge",(function(){return $t})),o.d(t,"ScreenWidthMinXXLarge",(function(){return eo})),o.d(t,"ScreenWidthMinXXXLarge",(function(){return to})),o.d(t,"ScreenWidthMaxSmall",(function(){return oo})),o.d(t,"ScreenWidthMaxMedium",(function(){return no})),o.d(t,"ScreenWidthMaxLarge",(function(){return ro})),o.d(t,"ScreenWidthMaxXLarge",(function(){return io})),o.d(t,"ScreenWidthMaxXXLarge",(function(){return so})),o.d(t,"ScreenWidthMinUhfMobile",(function(){return ao})),o.d(t,"getScreenSelector",(function(){return lo})),o.d(t,"getHighContrastNoAdjustStyle",(function(){return co})),o.d(t,"getEdgeChromiumNoHighContrastAdjustSelector",(function(){return uo})),o.d(t,"normalize",(function(){return Uo})),o.d(t,"noWrap",(function(){return Go})),o.d(t,"getFadedOverflowStyle",(function(){return jo})),o.d(t,"getPlaceholderStyles",(function(){return qo})),o.d(t,"ZIndexes",(function(){return po})),o.d(t,"buildClassMap",(function(){return $})),o.d(t,"getIcon",(function(){return nn})),o.d(t,"registerIcons",(function(){return en})),o.d(t,"registerIconAlias",(function(){return on})),o.d(t,"unregisterIcons",(function(){return tn})),o.d(t,"setIconOptions",(function(){return rn})),o.d(t,"getIconClassName",(function(){return un})),o.d(t,"InjectionMode",(function(){return _})),o.d(t,"Stylesheet",(function(){return x})),o.d(t,"concatStyleSets",(function(){return dn})),o.d(t,"concatStyleSetsWithProps",(function(){return pn})),o.d(t,"fontFace",(function(){return qe})),o.d(t,"keyframes",(function(){return ee})),o.d(t,"mergeStyleSets",(function(){return hn})),o.d(t,"mergeStyles",(function(){return Q})),o.d(t,"SwatchColorPicker",(function(){return Aw})),o.d(t,"SwatchColorPickerBase",(function(){return Bw})),o.d(t,"ColorPickerGridCell",(function(){return Mw})),o.d(t,"ColorPickerGridCellBase",(function(){return Tw})),o.d(t,"TeachingBubble",(function(){return Yw})),o.d(t,"TeachingBubbleBase",(function(){return jw})),o.d(t,"TeachingBubbleContent",(function(){return Uw})),o.d(t,"TeachingBubbleContentBase",(function(){return Hw})),o.d(t,"Text",(function(){return Xw})),o.d(t,"TextView",(function(){return qw})),o.d(t,"TextStyles",(function(){return Zw})),o.d(t,"TextField",(function(){return yg})),o.d(t,"TextFieldBase",(function(){return gg})),o.d(t,"DEFAULT_MASK_CHAR",(function(){return sI})),o.d(t,"MaskedTextField",(function(){return aI})),o.d(t,"ThemeGenerator",(function(){return lI})),o.d(t,"BaseSlots",(function(){return nI})),o.d(t,"FabricSlots",(function(){return rI})),o.d(t,"SemanticColorSlots",(function(){return iI})),o.d(t,"themeRulesStandardCreator",(function(){return cI})),o.d(t,"Toggle",(function(){return pI})),o.d(t,"ToggleBase",(function(){return dI})),o.d(t,"Tooltip",(function(){return gu})),o.d(t,"TooltipBase",(function(){return mu})),o.d(t,"TooltipDelay",(function(){return pu})),o.d(t,"TooltipHost",(function(){return Cu})),o.d(t,"TooltipHostBase",(function(){return _u})),o.d(t,"TooltipOverflowMode",(function(){return tu})),o.d(t,"Async",(function(){return di})),o.d(t,"AutoScroll",(function(){return eS})),o.d(t,"BaseComponent",(function(){return ra})),o.d(t,"nullRender",(function(){return sa})),o.d(t,"DelayedRender",(function(){return mi})),o.d(t,"EventGroup",(function(){return Ws})),o.d(t,"FabricPerformance",(function(){return mI})),o.d(t,"GlobalSettings",(function(){return _t})),o.d(t,"KeyCodes",(function(){return wn})),o.d(t,"Rectangle",(function(){return Ya})),o.d(t,"appendFunction",(function(){return ri})),o.d(t,"mergeAriaAttributeValues",(function(){return Ns})),o.d(t,"findIndex",(function(){return bi})),o.d(t,"find",(function(){return _i})),o.d(t,"createArray",(function(){return yi})),o.d(t,"toMatrix",(function(){return Ci})),o.d(t,"removeIndex",(function(){return Si})),o.d(t,"replaceElement",(function(){return xi})),o.d(t,"addElementAtIndex",(function(){return ki})),o.d(t,"flatten",(function(){return wi})),o.d(t,"arraysEqual",(function(){return Ii})),o.d(t,"asAsync",(function(){return fI})),o.d(t,"assertNever",(function(){return vI})),o.d(t,"classNamesFunction",(function(){return Mn})),o.d(t,"composeComponentAs",(function(){return sf})),o.d(t,"isControlled",(function(){return Oh})),o.d(t,"css",(function(){return Sr})),o.d(t,"Customizations",(function(){return It})),o.d(t,"Customizer",(function(){return jl})),o.d(t,"CustomizerContext",(function(){return yn})),o.d(t,"customizable",(function(){return ec})),o.d(t,"useCustomizationSettings",(function(){return Cn})),o.d(t,"mergeCustomizations",(function(){return Gl})),o.d(t,"mergeSettings",(function(){return zo})),o.d(t,"mergeScopedSettings",(function(){return Wo})),o.d(t,"elementContains",(function(){return Ni})),o.d(t,"elementContainsAttribute",(function(){return Bi})),o.d(t,"findElementRecursive",(function(){return Ri})),o.d(t,"getChildren",(function(){return bI})),o.d(t,"getDocument",(function(){return tt})),o.d(t,"getParent",(function(){return Mi})),o.d(t,"getRect",(function(){return Wv})),o.d(t,"getVirtualParent",(function(){return Ei})),o.d(t,"getWindow",(function(){return rt})),o.d(t,"isVirtualElement",(function(){return Ti})),o.d(t,"on",(function(){return Ga})),o.d(t,"portalContainsElement",(function(){return fs})),o.d(t,"raiseClick",(function(){return ns})),o.d(t,"DATA_PORTAL_ATTRIBUTE",(function(){return ms})),o.d(t,"setPortalAttribute",(function(){return gs})),o.d(t,"setVirtualParent",(function(){return $l})),o.d(t,"extendComponent",(function(){return ii})),o.d(t,"getFirstFocusable",(function(){return Fi})),o.d(t,"getLastFocusable",(function(){return Ai})),o.d(t,"getFirstTabbable",(function(){return Li})),o.d(t,"getLastTabbable",(function(){return Hi})),o.d(t,"focusFirstChild",(function(){return Oi})),o.d(t,"getPreviousElement",(function(){return zi})),o.d(t,"getNextElement",(function(){return Wi})),o.d(t,"isElementVisible",(function(){return Vi})),o.d(t,"isElementTabbable",(function(){return Ki})),o.d(t,"isElementFocusZone",(function(){return Ui})),o.d(t,"isElementFocusSubZone",(function(){return Gi})),o.d(t,"doesElementContainFocus",(function(){return ji})),o.d(t,"shouldWrapFocus",(function(){return Yi})),o.d(t,"focusAsync",(function(){return Zi})),o.d(t,"getFocusableByIndexPath",(function(){return Xi})),o.d(t,"getElementIndexPath",(function(){return Qi})),o.d(t,"getId",(function(){return ts})),o.d(t,"resetIds",(function(){return os})),o.d(t,"getNativeElementProps",(function(){return yI})),o.d(t,"hoistMethods",(function(){return Pa})),o.d(t,"unhoistMethods",(function(){return Ta})),o.d(t,"hoistStatics",(function(){return Ma})),o.d(t,"initializeComponentRef",(function(){return si})),o.d(t,"initializeFocusRects",(function(){return CI})),o.d(t,"useFocusRects",(function(){return pa})),o.d(t,"FocusRects",(function(){return ha})),o.d(t,"getInitials",(function(){return On})),o.d(t,"isDirectionalKeyCode",(function(){return la})),o.d(t,"addDirectionalKeyCode",(function(){return ca})),o.d(t,"getLanguage",(function(){return at})),o.d(t,"setLanguage",(function(){return lt})),o.d(t,"getDistanceBetweenPoints",(function(){return tS})),o.d(t,"fitContentToBounds",(function(){return oS})),o.d(t,"calculatePrecision",(function(){return nS})),o.d(t,"precisionRound",(function(){return rS})),o.d(t,"setMemoizeWeakMap",(function(){return Mo})),o.d(t,"resetMemoizations",(function(){return Ro})),o.d(t,"memoize",(function(){return Bo})),o.d(t,"memoizeFunction",(function(){return No})),o.d(t,"createMemoizer",(function(){return Fo})),o.d(t,"merge",(function(){return Tt})),o.d(t,"isIOS",(function(){return Sa})),o.d(t,"modalize",(function(){return wh})),o.d(t,"assign",(function(){return As})),o.d(t,"filteredAssign",(function(){return Ls})),o.d(t,"mapEnumByName",(function(){return Hs})),o.d(t,"shallowCompare",(function(){return Fs})),o.d(t,"values",(function(){return Os})),o.d(t,"omit",(function(){return zs})),o.d(t,"isMac",(function(){return Ca})),o.d(t,"hasHorizontalOverflow",(function(){return cu})),o.d(t,"hasVerticalOverflow",(function(){return uu})),o.d(t,"hasOverflow",(function(){return du})),o.d(t,"baseElementEvents",(function(){return Gn})),o.d(t,"baseElementProperties",(function(){return jn})),o.d(t,"htmlElementProperties",(function(){return Yn})),o.d(t,"labelProperties",(function(){return qn})),o.d(t,"audioProperties",(function(){return Zn})),o.d(t,"videoProperties",(function(){return Xn})),o.d(t,"olProperties",(function(){return Qn})),o.d(t,"liProperties",(function(){return Jn})),o.d(t,"anchorProperties",(function(){return $n})),o.d(t,"buttonProperties",(function(){return er})),o.d(t,"inputProperties",(function(){return tr})),o.d(t,"textAreaProperties",(function(){return or})),o.d(t,"selectProperties",(function(){return nr})),o.d(t,"optionProperties",(function(){return rr})),o.d(t,"tableProperties",(function(){return ir})),o.d(t,"trProperties",(function(){return sr})),o.d(t,"thProperties",(function(){return ar})),o.d(t,"tdProperties",(function(){return lr})),o.d(t,"colGroupProperties",(function(){return cr})),o.d(t,"colProperties",(function(){return ur})),o.d(t,"formProperties",(function(){return dr})),o.d(t,"iframeProperties",(function(){return pr})),o.d(t,"imgProperties",(function(){return hr})),o.d(t,"imageProperties",(function(){return mr})),o.d(t,"divProperties",(function(){return gr})),o.d(t,"getNativeProps",(function(){return fr})),o.d(t,"composeRenderFunction",(function(){return Wh})),o.d(t,"getResourceUrl",(function(){return II})),o.d(t,"setBaseUrl",(function(){return DI})),o.d(t,"getRTL",(function(){return In})),o.d(t,"setRTL",(function(){return Dn})),o.d(t,"getRTLSafeKeyCode",(function(){return Pn})),o.d(t,"safeRequestAnimationFrame",(function(){return c_})),o.d(t,"safeSetTimeout",(function(){return PI})),o.d(t,"DATA_IS_SCROLLABLE_ATTRIBUTE",(function(){return ss})),o.d(t,"allowScrollOnElement",(function(){return as})),o.d(t,"allowOverscrollOnElement",(function(){return ls})),o.d(t,"disableBodyScroll",(function(){return us})),o.d(t,"enableBodyScroll",(function(){return ds})),o.d(t,"getScrollbarWidth",(function(){return ps})),o.d(t,"findScrollableParent",(function(){return hs})),o.d(t,"format",(function(){return id})),o.d(t,"styled",(function(){return xn})),o.d(t,"warn",(function(){return Zo})),o.d(t,"setWarningCallback",(function(){return Xo})),o.d(t,"warnConditionallyRequiredProps",(function(){return ea})),o.d(t,"resetControlledWarnings",(function(){return dg})),o.d(t,"warnControlledUsage",(function(){return pg})),o.d(t,"warnDeprecations",(function(){return ta})),o.d(t,"warnMutuallyExclusive",(function(){return oa})),o.d(t,"isIE11",(function(){return ni})),o.d(t,"getPropsWithDefaults",(function(){return TI})),o.d(t,"setFocusVisibility",(function(){return mo})),o.d(t,"IsFocusVisibleClassName",(function(){return ho})),o.d(t,"setSSR",(function(){return et})),o.d(t,"createMergedRef",(function(){return Pi})),o.d(t,"WindowContext",(function(){return Ba})),o.d(t,"useWindow",(function(){return Na})),o.d(t,"useDocument",(function(){return Fa})),o.d(t,"WindowProvider",(function(){return Aa}));var n={};o.r(n),o.d(n,"root",(function(){return Td})),o.d(n,"picker",(function(){return Ed})),o.d(n,"holder",(function(){return Md})),o.d(n,"pickerIsOpened",(function(){return Rd})),o.d(n,"frame",(function(){return Bd})),o.d(n,"wrap",(function(){return Nd})),o.d(n,"goTodaySpacing",(function(){return Fd})),o.d(n,"dayPicker",(function(){return Ad})),o.d(n,"header",(function(){return Ld})),o.d(n,"divider",(function(){return Hd})),o.d(n,"monthAndYear",(function(){return Od})),o.d(n,"year",(function(){return zd})),o.d(n,"decade",(function(){return Wd})),o.d(n,"currentYear",(function(){return Vd})),o.d(n,"currentDecade",(function(){return Kd})),o.d(n,"table",(function(){return Ud})),o.d(n,"dayWrapper",(function(){return Gd})),o.d(n,"weekday",(function(){return jd})),o.d(n,"day",(function(){return Yd})),o.d(n,"daySelection",(function(){return qd})),o.d(n,"dayIsToday",(function(){return Zd})),o.d(n,"dayIsDisabled",(function(){return Xd})),o.d(n,"dayIsUnfocused",(function(){return Qd})),o.d(n,"dayIsFocused",(function(){return Jd})),o.d(n,"dayIsHighlighted",(function(){return $d})),o.d(n,"pickerIsFocused",(function(){return ep})),o.d(n,"dayDisabled",(function(){return tp})),o.d(n,"dayBackground",(function(){return op})),o.d(n,"dayHover",(function(){return np})),o.d(n,"dayPress",(function(){return rp})),o.d(n,"weekBackground",(function(){return ip})),o.d(n,"showWeekNumbers",(function(){return sp})),o.d(n,"weekNumbers",(function(){return ap})),o.d(n,"weekIsHighlighted",(function(){return lp})),o.d(n,"showWeekNumbersRTL",(function(){return cp})),o.d(n,"monthComponents",(function(){return up})),o.d(n,"yearComponents",(function(){return dp})),o.d(n,"decadeComponents",(function(){return pp})),o.d(n,"closeButton",(function(){return hp})),o.d(n,"prevMonth",(function(){return mp})),o.d(n,"nextMonth",(function(){return gp})),o.d(n,"prevYear",(function(){return fp})),o.d(n,"nextYear",(function(){return vp})),o.d(n,"prevDecade",(function(){return bp})),o.d(n,"nextDecade",(function(){return _p})),o.d(n,"prevMonthIsDisabled",(function(){return yp})),o.d(n,"nextMonthIsDisabled",(function(){return Cp})),o.d(n,"prevYearIsDisabled",(function(){return Sp})),o.d(n,"nextYearIsDisabled",(function(){return xp})),o.d(n,"prevDecadeIsDisabled",(function(){return kp})),o.d(n,"nextDecadeIsDisabled",(function(){return wp})),o.d(n,"headerToggleView",(function(){return Ip})),o.d(n,"optionGrid",(function(){return Dp})),o.d(n,"monthOption",(function(){return Pp})),o.d(n,"yearOption",(function(){return Tp})),o.d(n,"isHighlighted",(function(){return Ep})),o.d(n,"monthOptionIsDisabled",(function(){return Mp})),o.d(n,"yearOptionIsDisabled",(function(){return Rp})),o.d(n,"goToday",(function(){return Bp})),o.d(n,"goToTodayIsDisabled",(function(){return Np})),o.d(n,"goTodayInlineMonth",(function(){return Fp})),o.d(n,"isPickingYears",(function(){return Ap})),o.d(n,"monthPicker",(function(){return Lp})),o.d(n,"yearPicker",(function(){return Hp})),o.d(n,"monthPickerVisible",(function(){return Op})),o.d(n,"toggleMonthView",(function(){return zp})),o.d(n,"calendarsInline",(function(){return Wp})),o.d(n,"monthPickerOnly",(function(){return Vp})),o.d(n,"monthPickerAsOverlay",(function(){return Kp})),o.d(n,"holderWithButton",(function(){return Up})),o.d(n,"monthIsHighlighted",(function(){return Gp})),o.d(n,"monthIsCurrentMonth",(function(){return jp})),o.d(n,"yearIsHighlighted",(function(){return Yp})),o.d(n,"yearIsCurrentYear",(function(){return qp})),o.d(n,"topLeftCornerDate",(function(){return Zp})),o.d(n,"topRightCornerDate",(function(){return Xp})),o.d(n,"bottomLeftCornerDate",(function(){return Qp})),o.d(n,"bottomRightCornerDate",(function(){return Jp})),o.d(n,"weekSelection",(function(){return $p})),o.d(n,"monthSelection",(function(){return eh})),o.d(n,"topDate",(function(){return th})),o.d(n,"rightDate",(function(){return oh})),o.d(n,"bottomDate",(function(){return nh})),o.d(n,"leftdate",(function(){return rh}));var r={};o.r(r),o.d(r,"pickerText",(function(){return J_})),o.d(r,"pickerInput",(function(){return $_}));var i={};o.r(i),o.d(i,"callout",(function(){return my}));var s={};o.r(s),o.d(s,"root",(function(){return gy})),o.d(s,"suggestionsItem",(function(){return fy})),o.d(s,"closeButton",(function(){return vy})),o.d(s,"suggestionsItemIsSuggested",(function(){return by})),o.d(s,"itemButton",(function(){return _y})),o.d(s,"actionButton",(function(){return yy})),o.d(s,"buttonSelected",(function(){return Cy})),o.d(s,"suggestionsTitle",(function(){return Sy})),o.d(s,"suggestionsContainer",(function(){return xy})),o.d(s,"suggestionsNone",(function(){return ky})),o.d(s,"suggestionsSpinner",(function(){return wy})),o.d(s,"suggestionsAvailable",(function(){return Iy}));var a={};o.r(a),o.d(a,"suggestionsContainer",(function(){return Ey}));var l={};o.r(l),o.d(l,"root",(function(){return Ny})),o.d(l,"actionButton",(function(){return Fy})),o.d(l,"buttonSelected",(function(){return Ay})),o.d(l,"suggestionsTitle",(function(){return Ly})),o.d(l,"suggestionsSpinner",(function(){return Hy})),o.d(l,"itemButton",(function(){return Oy})),o.d(l,"screenReaderOnly",(function(){return zy}));var c={};o.r(c),o.d(c,"pickerText",(function(){return FS})),o.d(c,"inputFocused",(function(){return AS})),o.d(c,"pickerInput",(function(){return LS})),o.d(c,"pickerItems",(function(){return HS})),o.d(c,"screenReaderOnly",(function(){return OS}));var u={};o.r(u),o.d(u,"personaContainer",(function(){return Jx})),o.d(u,"hover",(function(){return $x})),o.d(u,"actionButton",(function(){return ek})),o.d(u,"personaContainerIsSelected",(function(){return tk})),o.d(u,"validationError",(function(){return ok})),o.d(u,"itemContent",(function(){return nk})),o.d(u,"removeButton",(function(){return rk})),o.d(u,"expandButton",(function(){return ik})),o.d(u,"personaWrapper",(function(){return sk})),o.d(u,"personaDetails",(function(){return ak})),o.d(u,"itemContainer",(function(){return lk}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function p(e,t){function o(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var h=function(){return(h=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function m(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}function g(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s}function f(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var n=Array(e),r=0;for(t=0;t<o;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,r++)n[r]=i[s];return n}var v,b=o(0),_={none:0,insertNode:1,appendChild:2},y="undefined"!=typeof navigator&&/rv:11.0/.test(navigator.userAgent),C={};try{C=window}catch(ct){}var S,x=function(){function e(e){this._rules=[],this._preservedRules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._onResetCallbacks=[],this._classNameToArgs={},this._config=h({injectionMode:_.insertNode,defaultPrefix:"css",namespace:void 0,cspSettings:void 0},e),this._keyToClassName=this._config.classNameCache||{}}return e.getInstance=function(){var t;if(!(v=C.__stylesheet__)||v._lastStyleElement&&v._lastStyleElement.ownerDocument!==document){var o=(null===(t=C)||void 0===t?void 0:t.FabricConfig)||{};v=C.__stylesheet__=new e(o.mergeStyles)}return v},e.prototype.setConfig=function(e){this._config=h(h({},this._config),e)},e.prototype.onReset=function(e){this._onResetCallbacks.push(e)},e.prototype.getClassName=function(e){var t=this._config.namespace;return(t?t+"-":"")+(e||this._config.defaultPrefix)+"-"+this._counter++},e.prototype.cacheClassName=function(e,t,o,n){this._keyToClassName[t]=e,this._classNameToArgs[e]={args:o,rules:n}},e.prototype.classNameFromKey=function(e){return this._keyToClassName[e]},e.prototype.getClassNameCache=function(){return this._keyToClassName},e.prototype.argsFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.args},e.prototype.insertedRulesFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.rules},e.prototype.insertRule=function(e,t){var o=this._config.injectionMode!==_.none?this._getStyleElement():void 0;if(t&&this._preservedRules.push(e),o)switch(this._config.injectionMode){case _.insertNode:var n=o.sheet;try{n.insertRule(e,n.cssRules.length)}catch(e){}break;case _.appendChild:o.appendChild(document.createTextNode(e))}else this._rules.push(e);this._config.onInsertRule&&this._config.onInsertRule(e)},e.prototype.getRules=function(e){return(e?this._preservedRules.join(""):"")+this._rules.join("")+this._rulesToInsert.join("")},e.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={},this._onResetCallbacks.forEach((function(e){return e()}))},e.prototype.resetKeys=function(){this._keyToClassName={}},e.prototype._getStyleElement=function(){var e=this;return this._styleElement||"undefined"==typeof document||(this._styleElement=this._createStyleElement(),y||window.requestAnimationFrame((function(){e._styleElement=void 0}))),this._styleElement},e.prototype._createStyleElement=function(){var e=document.head,t=document.createElement("style");t.setAttribute("data-merge-styles","true");var o=this._config.cspSettings;if(o&&o.nonce&&t.setAttribute("nonce",o.nonce),this._lastStyleElement)e.insertBefore(t,this._lastStyleElement.nextElementSibling);else{var n=this._findPlaceholderStyleTag();n?e.insertBefore(t,n.nextElementSibling):e.insertBefore(t,e.childNodes[0])}return this._lastStyleElement=t,t},e.prototype._findPlaceholderStyleTag=function(){var e=document.head;return e?e.querySelector("style[data-merge-styles]"):null},e}();function k(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=[],n=[],r=x.getInstance();function i(e){for(var t=0,s=e;t<s.length;t++){var a=s[t];if(a)if("string"==typeof a)if(a.indexOf(" ")>=0)i(a.split(" "));else{var l=r.argsFromClassName(a);l?i(l):-1===o.indexOf(a)&&o.push(a)}else Array.isArray(a)?i(a):"object"==typeof a&&n.push(a)}}return i(e),{classes:o,objects:n}}function w(e){S!==e&&(S=e)}function I(){return void 0===S&&(S="undefined"!=typeof document&&!!document.documentElement&&"rtl"===document.documentElement.getAttribute("dir")),S}function D(){return{rtl:I()}}S=I();var P,T={};var E={"user-select":1};function M(e,t){var o=function(){if(!P){var e="undefined"!=typeof document?document:void 0,t="undefined"!=typeof navigator?navigator:void 0,o=t?t.userAgent.toLowerCase():void 0;P=e?{isWebkit:!(!e||!("WebkitAppearance"in e.documentElement.style)),isMoz:!!(o&&o.indexOf("firefox")>-1),isOpera:!!(o&&o.indexOf("opera")>-1),isMs:!(!t||!/rv:11.0/i.test(t.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent))}:{isWebkit:!0,isMoz:!0,isOpera:!0,isMs:!0}}return P}(),n=e[t];if(E[n]){var r=e[t+1];E[n]&&(o.isWebkit&&e.push("-webkit-"+n,r),o.isMoz&&e.push("-moz-"+n,r),o.isMs&&e.push("-ms-"+n,r),o.isOpera&&e.push("-o-"+n,r))}}var R,B=["column-count","font-weight","flex","flex-grow","flex-shrink","fill-opacity","opacity","order","z-index","zoom"];function N(e,t){var o=e[t],n=e[t+1];if("number"==typeof n){var r=B.indexOf(o)>-1,i=o.indexOf("--")>-1,s=r||i?"":"px";e[t+1]=""+n+s}}var F="left",A="right",L=((R={})[F]=A,R[A]=F,R),H={"w-resize":"e-resize","sw-resize":"se-resize","nw-resize":"ne-resize"};function O(e,t,o){if(e.rtl){var n=t[o];if(!n)return;var r=t[o+1];if("string"==typeof r&&r.indexOf("@noflip")>=0)t[o+1]=r.replace(/\s*(?:\/\*\s*)?\@noflip\b(?:\s*\*\/)?\s*?/g,"");else if(n.indexOf(F)>=0)t[o]=n.replace(F,A);else if(n.indexOf(A)>=0)t[o]=n.replace(A,F);else if(String(r).indexOf(F)>=0)t[o+1]=r.replace(F,A);else if(String(r).indexOf(A)>=0)t[o+1]=r.replace(A,F);else if(L[n])t[o]=L[n];else if(H[r])t[o+1]=H[r];else switch(n){case"margin":case"padding":t[o+1]=function(e){if("string"==typeof e){var t=e.split(" ");if(4===t.length)return t[0]+" "+t[3]+" "+t[2]+" "+t[1]}return e}(r);break;case"box-shadow":t[o+1]=function(e,t){var o=e.split(" "),n=parseInt(o[t],10);return o[0]=o[0].replace(String(n),String(-1*n)),o.join(" ")}(r,0)}}}function z(e){var t=e&&e["&"];return t?t.displayName:void 0}var W=/\:global\((.+?)\)/g;function V(e,t){return e.indexOf(":global(")>=0?e.replace(W,"$1"):0===e.indexOf(":")?t+e:e.indexOf("&")<0?t+" "+e:e}function K(e,t,o,n){void 0===t&&(t={__order:[]}),0===o.indexOf("@")?U([n],t,o=o+"{"+e):o.indexOf(",")>-1?function(e){if(!W.test(e))return e;for(var t=[],o=/\:global\((.+?)\)/g,n=null;n=o.exec(e);)n[1].indexOf(",")>-1&&t.push([n.index,n.index+n[0].length,n[1].split(",").map((function(e){return":global("+e.trim()+")"})).join(", ")]);return t.reverse().reduce((function(e,t){var o=t[0],n=t[1],r=t[2];return e.slice(0,o)+r+e.slice(n)}),e)}(o).split(",").map((function(e){return e.trim()})).forEach((function(o){return U([n],t,V(o,e))})):U([n],t,V(o,e))}function U(e,t,o){void 0===t&&(t={__order:[]}),void 0===o&&(o="&");var n=x.getInstance(),r=t[o];r||(r={},t[o]=r,t.__order.push(o));for(var i=0,s=e;i<s.length;i++){var a=s[i];if("string"==typeof a){var l=n.argsFromClassName(a);l&&U(l,t,o)}else if(Array.isArray(a))U(a,t,o);else for(var c in a)if(a.hasOwnProperty(c)){var u=a[c];if("selectors"===c){var d=a.selectors;for(var p in d)d.hasOwnProperty(p)&&K(o,t,p,d[p])}else"object"==typeof u?null!==u&&K(o,t,c,u):void 0!==u&&("margin"===c||"padding"===c?G(r,c,u):r[c]=u)}}return t}function G(e,t,o){var n="string"==typeof o?o.split(" "):[o];e[t+"Top"]=n[0],e[t+"Right"]=n[1]||n[0],e[t+"Bottom"]=n[2]||n[0],e[t+"Left"]=n[3]||n[1]||n[0]}function j(e,t){for(var o=[e.rtl?"rtl":"ltr"],n=!1,r=0,i=t.__order;r<i.length;r++){var s=i[r];o.push(s);var a=t[s];for(var l in a)a.hasOwnProperty(l)&&void 0!==a[l]&&(n=!0,o.push(l,a[l]))}return n?o.join(""):void 0}function Y(e,t){return t<=0?"":1===t?e:e+Y(e,t-1)}function q(e,t){if(!t)return"";var o,n,r,i=[];for(var s in t)t.hasOwnProperty(s)&&"displayName"!==s&&void 0!==t[s]&&i.push(s,t[s]);for(var a=0;a<i.length;a+=2)r=void 0,"-"!==(r=(o=i)[n=a]).charAt(0)&&(o[n]=T[r]=T[r]||r.replace(/([A-Z])/g,"-$1").toLowerCase()),N(i,a),O(e,i,a),M(i,a);for(a=1;a<i.length;a+=4)i.splice(a,1,":",i[a],";");return i.join("")}function Z(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var n=U(t),r=j(e,n);if(r){var i=x.getInstance(),s={className:i.classNameFromKey(r),key:r,args:t};if(!s.className){s.className=i.getClassName(z(n));for(var a=[],l=0,c=n.__order;l<c.length;l++){var u=c[l];a.push(u,q(e,n[u]))}s.rulesToInsert=a}return s}}function X(e,t){void 0===t&&(t=1);var o=x.getInstance(),n=e.className,r=e.key,i=e.args,s=e.rulesToInsert;if(s){for(var a=0;a<s.length;a+=2){var l=s[a+1];if(l){var c=s[a],u=(c=c.replace(/&/g,Y("."+e.className,t)))+"{"+l+"}"+(0===c.indexOf("@")?"}":"");o.insertRule(u)}}o.cacheClassName(n,r,i,s)}}function Q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return J(e,D())}function J(e,t){var o=k(e instanceof Array?e:[e]),n=o.classes,r=o.objects;return r.length&&n.push(function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var n=Z.apply(void 0,f([e],t));return n?(X(n,e.specificityMultiplier),n.className):""}(t||{},r)),n.join(" ")}function $(e){var t={},o=function(o){var n;e.hasOwnProperty(o)&&Object.defineProperty(t,o,{get:function(){return void 0===n&&(n=Q(e[o]).toString()),n},enumerable:!0,configurable:!0})};for(var n in e)o(n);return t}function ee(e){var t=x.getInstance(),o=t.getClassName(),n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(r,"{",q(D(),e[r]),"}");var i=n.join("");return t.insertRule("@keyframes "+o+"{"+i+"}",!0),t.cacheClassName(o,i,[],["keyframes",i]),o}var te="cubic-bezier(.1,.9,.2,1)",oe="cubic-bezier(.1,.25,.75,.9)",ne=ee({from:{opacity:0},to:{opacity:1}}),re=ee({from:{opacity:1},to:{opacity:0,visibility:"hidden"}}),ie=He(-10),se=He(-20),ae=He(-40),le=He(-400),ce=He(10),ue=He(20),de=He(40),pe=He(400),he=Oe(10),me=Oe(20),ge=Oe(-10),fe=Oe(-20),ve=ze(10),be=ze(20),_e=ze(40),ye=ze(400),Ce=ze(-10),Se=ze(-20),xe=ze(-40),ke=ze(-400),we=We(-10),Ie=We(-20),De=We(10),Pe=We(20),Te=ee({from:{transform:"scale3d(.98,.98,1)"},to:{transform:"scale3d(1,1,1)"}}),Ee=ee({from:{transform:"scale3d(1,1,1)"},to:{transform:"scale3d(.98,.98,1)"}}),Me=ee({from:{transform:"scale3d(1.03,1.03,1)"},to:{transform:"scale3d(1,1,1)"}}),Re=ee({from:{transform:"scale3d(1,1,1)"},to:{transform:"scale3d(1.03,1.03,1)"}}),Be=ee({from:{transform:"rotateZ(0deg)"},to:{transform:"rotateZ(90deg)"}}),Ne=ee({from:{transform:"rotateZ(0deg)"},to:{transform:"rotateZ(-90deg)"}}),Fe={easeFunction1:te,easeFunction2:oe,durationValue1:"0.167s",durationValue2:"0.267s",durationValue3:"0.367s",durationValue4:"0.467s"},Ae={slideRightIn10:Le(ne+","+ie,"0.367s",te),slideRightIn20:Le(ne+","+se,"0.367s",te),slideRightIn40:Le(ne+","+ae,"0.367s",te),slideRightIn400:Le(ne+","+le,"0.367s",te),slideLeftIn10:Le(ne+","+ce,"0.367s",te),slideLeftIn20:Le(ne+","+ue,"0.367s",te),slideLeftIn40:Le(ne+","+de,"0.367s",te),slideLeftIn400:Le(ne+","+pe,"0.367s",te),slideUpIn10:Le(ne+","+he,"0.367s",te),slideUpIn20:Le(ne+","+me,"0.367s",te),slideDownIn10:Le(ne+","+ge,"0.367s",te),slideDownIn20:Le(ne+","+fe,"0.367s",te),slideRightOut10:Le(re+","+ve,"0.367s",te),slideRightOut20:Le(re+","+be,"0.367s",te),slideRightOut40:Le(re+","+_e,"0.367s",te),slideRightOut400:Le(re+","+ye,"0.367s",te),slideLeftOut10:Le(re+","+Ce,"0.367s",te),slideLeftOut20:Le(re+","+Se,"0.367s",te),slideLeftOut40:Le(re+","+xe,"0.367s",te),slideLeftOut400:Le(re+","+ke,"0.367s",te),slideUpOut10:Le(re+","+we,"0.367s",te),slideUpOut20:Le(re+","+Ie,"0.367s",te),slideDownOut10:Le(re+","+De,"0.367s",te),slideDownOut20:Le(re+","+Pe,"0.367s",te),scaleUpIn100:Le(ne+","+Te,"0.367s",te),scaleDownIn100:Le(ne+","+Me,"0.367s",te),scaleUpOut103:Le(re+","+Re,"0.167s",oe),scaleDownOut98:Le(re+","+Ee,"0.167s",oe),fadeIn100:Le(ne,"0.167s",oe),fadeIn200:Le(ne,"0.267s",oe),fadeIn400:Le(ne,"0.367s",oe),fadeIn500:Le(ne,"0.467s",oe),fadeOut100:Le(re,"0.167s",oe),fadeOut200:Le(re,"0.267s",oe),fadeOut400:Le(re,"0.367s",oe),fadeOut500:Le(re,"0.467s",oe),rotate90deg:Le(Be,"0.1s",oe),rotateN90deg:Le(Ne,"0.1s",oe)};function Le(e,t,o){return{animationName:e,animationDuration:t,animationTimingFunction:o,animationFillMode:"both"}}function He(e){return ee({from:{transform:"translate3d("+e+"px,0,0)",pointerEvents:"none"},to:{transform:"translate3d(0,0,0)",pointerEvents:"auto"}})}function Oe(e){return ee({from:{transform:"translate3d(0,"+e+"px,0)",pointerEvents:"none"},to:{transform:"translate3d(0,0,0)",pointerEvents:"auto"}})}function ze(e){return ee({from:{transform:"translate3d(0,0,0)"},to:{transform:"translate3d("+e+"px,0,0)"}})}function We(e){return ee({from:{transform:"translate3d(0,0,0)"},to:{transform:"translate3d(0,"+e+"px,0)"}})}var Ve,Ke,Ue,Ge,je,Ye=$(Ae);function qe(e){x.getInstance().insertRule("@font-face{"+q(D(),e)+"}",!0)}!function(e){e.Arabic="Segoe UI Web (Arabic)",e.Cyrillic="Segoe UI Web (Cyrillic)",e.EastEuropean="Segoe UI Web (East European)",e.Greek="Segoe UI Web (Greek)",e.Hebrew="Segoe UI Web (Hebrew)",e.Thai="Leelawadee UI Web",e.Vietnamese="Segoe UI Web (Vietnamese)",e.WestEuropean="Segoe UI Web (West European)",e.Selawik="Selawik Web",e.Armenian="Segoe UI Web (Armenian)",e.Georgian="Segoe UI Web (Georgian)"}(Ve||(Ve={})),function(e){e.Arabic="'"+Ve.Arabic+"'",e.ChineseSimplified="'Microsoft Yahei UI', Verdana, Simsun",e.ChineseTraditional="'Microsoft Jhenghei UI', Pmingliu",e.Cyrillic="'"+Ve.Cyrillic+"'",e.EastEuropean="'"+Ve.EastEuropean+"'",e.Greek="'"+Ve.Greek+"'",e.Hebrew="'"+Ve.Hebrew+"'",e.Hindi="'Nirmala UI'",e.Japanese="'Yu Gothic UI', 'Meiryo UI', Meiryo, 'MS Pgothic', Osaka",e.Korean="'Malgun Gothic', Gulim",e.Selawik="'"+Ve.Selawik+"'",e.Thai="'Leelawadee UI Web', 'Kmer UI'",e.Vietnamese="'"+Ve.Vietnamese+"'",e.WestEuropean="'"+Ve.WestEuropean+"'",e.Armenian="'"+Ve.Armenian+"'",e.Georgian="'"+Ve.Georgian+"'"}(Ke||(Ke={})),function(e){e.size10="10px",e.size12="12px",e.size14="14px",e.size16="16px",e.size18="18px",e.size20="20px",e.size24="24px",e.size28="28px",e.size32="32px",e.size42="42px",e.size68="68px",e.mini="10px",e.xSmall="10px",e.small="12px",e.smallPlus="12px",e.medium="14px",e.mediumPlus="16px",e.icon="16px",e.large="18px",e.xLarge="20px",e.xLargePlus="24px",e.xxLarge="28px",e.xxLargePlus="32px",e.superLarge="42px",e.mega="68px"}(Ue||(Ue={})),function(e){e.light=100,e.semilight=300,e.regular=400,e.semibold=600,e.bold=700}(Ge||(Ge={})),function(e){e.xSmall="10px",e.small="12px",e.medium="16px",e.large="20px"}(je||(je={}));var Ze="'Segoe UI', '"+Ve.WestEuropean+"'",Xe={ar:Ke.Arabic,bg:Ke.Cyrillic,cs:Ke.EastEuropean,el:Ke.Greek,et:Ke.EastEuropean,he:Ke.Hebrew,hi:Ke.Hindi,hr:Ke.EastEuropean,hu:Ke.EastEuropean,ja:Ke.Japanese,kk:Ke.EastEuropean,ko:Ke.Korean,lt:Ke.EastEuropean,lv:Ke.EastEuropean,pl:Ke.EastEuropean,ru:Ke.Cyrillic,sk:Ke.EastEuropean,"sr-latn":Ke.EastEuropean,th:Ke.Thai,tr:Ke.EastEuropean,uk:Ke.Cyrillic,vi:Ke.Vietnamese,"zh-hans":Ke.ChineseSimplified,"zh-hant":Ke.ChineseTraditional,hy:Ke.Armenian,ka:Ke.Georgian};function Qe(e,t,o){return{fontFamily:o,MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontSize:e,fontWeight:t}}function Je(e){var t=function(e){for(var t in Xe)if(Xe.hasOwnProperty(t)&&e&&0===t.indexOf(e))return Xe[t];return Ze}(e),o=t+", 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif";return{tiny:Qe(Ue.mini,Ge.regular,o),xSmall:Qe(Ue.xSmall,Ge.regular,o),small:Qe(Ue.small,Ge.regular,o),smallPlus:Qe(Ue.smallPlus,Ge.regular,o),medium:Qe(Ue.medium,Ge.regular,o),mediumPlus:Qe(Ue.mediumPlus,Ge.regular,o),large:Qe(Ue.large,Ge.regular,o),xLarge:Qe(Ue.xLarge,Ge.semibold,o),xLargePlus:Qe(Ue.xLargePlus,Ge.semibold,o),xxLarge:Qe(Ue.xxLarge,Ge.semibold,o),xxLargePlus:Qe(Ue.xxLargePlus,Ge.semibold,o),superLarge:Qe(Ue.superLarge,Ge.semibold,o),mega:Qe(Ue.mega,Ge.semibold,o)}}var $e=!1;function et(e){$e=e}function tt(e){if(!$e&&"undefined"!=typeof document){var t=e;return t&&t.ownerDocument?t.ownerDocument:document}}var ot,nt=void 0;try{nt=window}catch(e){}function rt(e){if(!$e&&void 0!==nt){var t=e;return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:nt}}function it(e){var t=null;try{var o=rt();t=o?o.sessionStorage.getItem(e):null}catch(e){}return t}function st(e,t){var o;try{null===(o=rt())||void 0===o||o.sessionStorage.setItem(e,t)}catch(e){}}function at(e){if(void 0===e&&(e="localStorage"),void 0===ot){var t=tt(),o="localStorage"===e?function(e){var t=null;try{var o=rt();t=o?o.localStorage.getItem(e):null}catch(e){}return t}("language"):"sessionStorage"===e?it("language"):void 0;o&&(ot=o),void 0===ot&&t&&(ot=t.documentElement.getAttribute("lang")),void 0===ot&&(ot="en")}return ot}function lt(e,t){var o=tt();o&&o.documentElement.setAttribute("lang",e);var n=!0===t?"none":t||"localStorage";"localStorage"===n?function(e,t){try{var o=rt();o&&o.localStorage.setItem(e,t)}catch(e){}}("language",e):"sessionStorage"===n&&st("language",e),ot=e}var ct,ut,dt,pt=Je(at("sessionStorage"));function ht(e,t,o,n){qe({fontFamily:e="'"+e+"'",src:(void 0!==n?"local('"+n+"'),":"")+"url('"+t+".woff2') format('woff2'),url('"+t+".woff') format('woff')",fontWeight:o,fontStyle:"normal",fontDisplay:"swap"})}function mt(e,t,o,n,r){void 0===n&&(n="segoeui");var i=e+"/"+o+"/"+n;ht(t,i+"-light",Ge.light,r&&r+" Light"),ht(t,i+"-semilight",Ge.semilight,r&&r+" SemiLight"),ht(t,i+"-regular",Ge.regular,r),ht(t,i+"-semibold",Ge.semibold,r&&r+" SemiBold"),ht(t,i+"-bold",Ge.bold,r&&r+" Bold")}function gt(e){if(e){var t=e+"/fonts";mt(t,Ve.Thai,"leelawadeeui-thai","leelawadeeui"),mt(t,Ve.Arabic,"segoeui-arabic"),mt(t,Ve.Cyrillic,"segoeui-cyrillic"),mt(t,Ve.EastEuropean,"segoeui-easteuropean"),mt(t,Ve.Greek,"segoeui-greek"),mt(t,Ve.Hebrew,"segoeui-hebrew"),mt(t,Ve.Vietnamese,"segoeui-vietnamese"),mt(t,Ve.WestEuropean,"segoeui-westeuropean","segoeui","Segoe UI"),mt(t,Ke.Selawik,"selawik","selawik"),mt(t,Ve.Armenian,"segoeui-armenian"),mt(t,Ve.Georgian,"segoeui-georgian"),ht("Leelawadee UI Web",t+"/leelawadeeui-thai/leelawadeeui-semilight",Ge.light),ht("Leelawadee UI Web",t+"/leelawadeeui-thai/leelawadeeui-bold",Ge.semibold)}}gt(null!=(dt=null===(ut=null===(ct=rt())||void 0===ct?void 0:ct.FabricConfig)||void 0===ut?void 0:ut.fontBaseUrl)?dt:"https://static2.sharepointonline.com/files/fabric/assets");var ft=$(pt),vt={themeDarker:"#004578",themeDark:"#005a9e",themeDarkAlt:"#106ebe",themePrimary:"#0078d4",themeSecondary:"#2b88d8",themeTertiary:"#71afe5",themeLight:"#c7e0f4",themeLighter:"#deecf9",themeLighterAlt:"#eff6fc",black:"#000000",blackTranslucent40:"rgba(0,0,0,.4)",neutralDark:"#201f1e",neutralPrimary:"#323130",neutralPrimaryAlt:"#3b3a39",neutralSecondary:"#605e5c",neutralSecondaryAlt:"#8a8886",neutralTertiary:"#a19f9d",neutralTertiaryAlt:"#c8c6c4",neutralQuaternary:"#d2d0ce",neutralQuaternaryAlt:"#e1dfdd",neutralLight:"#edebe9",neutralLighter:"#f3f2f1",neutralLighterAlt:"#faf9f8",accent:"#0078d4",white:"#ffffff",whiteTranslucent40:"rgba(255,255,255,.4)",yellowDark:"#d29200",yellow:"#ffb900",yellowLight:"#fff100",orange:"#d83b01",orangeLight:"#ea4300",orangeLighter:"#ff8c00",redDark:"#a4262c",red:"#e81123",magentaDark:"#5c005c",magenta:"#b4009e",magentaLight:"#e3008c",purpleDark:"#32145a",purple:"#5c2d91",purpleLight:"#b4a0ff",blueDark:"#002050",blueMid:"#00188f",blue:"#0078d4",blueLight:"#00bcf2",tealDark:"#004b50",teal:"#008272",tealLight:"#00b294",greenDark:"#004b1c",green:"#107c10",greenLight:"#bad80a"},bt=0,_t=function(){function e(){}return e.getValue=function(e,t){var o=yt();return void 0===o[e]&&(o[e]="function"==typeof t?t():t),o[e]},e.setValue=function(e,t){var o=yt(),n=o.__callbacks__,r=o[e];if(t!==r){o[e]=t;var i={oldValue:r,value:t,key:e};for(var s in n)n.hasOwnProperty(s)&&n[s](i)}return t},e.addChangeListener=function(e){var t=e.__id__,o=Ct();t||(t=e.__id__=String(bt++)),o[t]=e},e.removeChangeListener=function(e){delete Ct()[e.__id__]},e}();function yt(){var e,t=rt()||{};return t.__globalSettings__||(t.__globalSettings__=((e={}).__callbacks__={},e)),t.__globalSettings__}function Ct(){return yt().__callbacks__}var St,xt={settings:{},scopedSettings:{},inCustomizerContext:!1},kt=_t.getValue("customizations",{settings:{},scopedSettings:{},inCustomizerContext:!1}),wt=[],It=function(){function e(){}return e.reset=function(){kt.settings={},kt.scopedSettings={}},e.applySettings=function(t){kt.settings=h(h({},kt.settings),t),e._raiseChange()},e.applyScopedSettings=function(t,o){kt.scopedSettings[t]=h(h({},kt.scopedSettings[t]),o),e._raiseChange()},e.getSettings=function(e,t,o){void 0===o&&(o=xt);for(var n={},r=t&&o.scopedSettings[t]||{},i=t&&kt.scopedSettings[t]||{},s=0,a=e;s<a.length;s++){var l=a[s];n[l]=r[l]||o.settings[l]||i[l]||kt.settings[l]}return n},e.applyBatchedUpdates=function(t,o){e._suppressUpdates=!0;try{t()}catch(e){}e._suppressUpdates=!1,o||e._raiseChange()},e.observe=function(e){wt.push(e)},e.unobserve=function(e){wt=wt.filter((function(t){return t!==e}))},e._raiseChange=function(){e._suppressUpdates||wt.forEach((function(e){return e()}))},e}(),Dt=o(1);!function(e){e.depth0="0 0 0 0 transparent",e.depth4="0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108)",e.depth8="0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108)",e.depth16="0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108)",e.depth64="0 25.6px 57.6px 0 rgba(0, 0, 0, 0.22), 0 4.8px 14.4px 0 rgba(0, 0, 0, 0.18)"}(St||(St={}));var Pt={elevation4:St.depth4,elevation8:St.depth8,elevation16:St.depth16,elevation64:St.depth64,roundedCorner2:"2px",roundedCorner4:"4px",roundedCorner6:"6px"};function Tt(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];for(var n=0,r=t;n<r.length;n++){var i=r[n];Et(e||{},i)}return e}function Et(e,t,o){for(var n in void 0===o&&(o=[]),o.push(t),t)if(t.hasOwnProperty(n)&&"__proto__"!==n&&"constructor"!==n&&"prototype"!==n){var r=t[n];if("object"!=typeof r||null===r||Array.isArray(r))e[n]=r;else{var i=o.indexOf(r)>-1;e[n]=i?r:Et(e[n]||{},r,o)}}return o.pop(),e}function Mt(e,t,o,n,r){return void 0===r&&(r=!1),function(e,t){var o="";!0===t&&(o=" /* @deprecated */");return e.listTextColor=e.listText+o,e.menuItemBackgroundChecked+=o,e.warningHighlight+=o,e.warningText=e.messageText+o,e.successText+=o,e}(Rt(e,t,h({primaryButtonBorder:"transparent",errorText:n?"#F1707B":"#a4262c",messageText:n?"#F3F2F1":"#323130",messageLink:n?"#6CB8F6":"#005A9E",messageLinkHovered:n?"#82C7FF":"#004578",infoIcon:n?"#C8C6C4":"#605e5c",errorIcon:n?"#F1707B":"#A80000",blockingIcon:n?"#442726":"#FDE7E9",warningIcon:n?"#C8C6C4":"#797775",severeWarningIcon:n?"#FCE100":"#D83B01",successIcon:n?"#92C353":"#107C10",infoBackground:n?"#323130":"#f3f2f1",errorBackground:n?"#442726":"#FDE7E9",blockingBackground:n?"#442726":"#FDE7E9",warningBackground:n?"#433519":"#FFF4CE",severeWarningBackground:n?"#4F2A0F":"#FED9CC",successBackground:n?"#393D1B":"#DFF6DD",warningHighlight:n?"#fff100":"#ffb900",successText:n?"#92c353":"#107C10"},o),n),r)}function Rt(e,t,o,n,r){var i,s,a;void 0===r&&(r=!1);var l={},c=e||{},u=c.white,d=c.black,p=c.themePrimary,m=c.themeDark,g=c.themeDarker,f=c.themeDarkAlt,v=c.themeLighter,b=c.neutralLight,_=c.neutralLighter,y=c.neutralDark,C=c.neutralQuaternary,S=c.neutralQuaternaryAlt,x=c.neutralPrimary,k=c.neutralSecondary,w=c.neutralSecondaryAlt,I=c.neutralTertiary,D=c.neutralTertiaryAlt,P=c.neutralLighterAlt,T=c.accent;return u&&(l.bodyBackground=u,l.bodyFrameBackground=u,l.accentButtonText=u,l.buttonBackground=u,l.primaryButtonText=u,l.primaryButtonTextHovered=u,l.primaryButtonTextPressed=u,l.inputBackground=u,l.inputForegroundChecked=u,l.listBackground=u,l.menuBackground=u,l.cardStandoutBackground=u),d&&(l.bodyTextChecked=d,l.buttonTextCheckedHovered=d),p&&(l.link=p,l.primaryButtonBackground=p,l.inputBackgroundChecked=p,l.inputIcon=p,l.inputFocusBorderAlt=p,l.menuIcon=p,l.menuHeader=p,l.accentButtonBackground=p),m&&(l.primaryButtonBackgroundPressed=m,l.inputBackgroundCheckedHovered=m,l.inputIconHovered=m),g&&(l.linkHovered=g),f&&(l.primaryButtonBackgroundHovered=f),v&&(l.inputPlaceholderBackgroundChecked=v),b&&(l.bodyBackgroundChecked=b,l.bodyFrameDivider=b,l.bodyDivider=b,l.variantBorder=b,l.buttonBackgroundCheckedHovered=b,l.buttonBackgroundPressed=b,l.listItemBackgroundChecked=b,l.listHeaderBackgroundPressed=b,l.menuItemBackgroundPressed=b,l.menuItemBackgroundChecked=b),_&&(l.bodyBackgroundHovered=_,l.buttonBackgroundHovered=_,l.buttonBackgroundDisabled=_,l.buttonBorderDisabled=_,l.primaryButtonBackgroundDisabled=_,l.disabledBackground=_,l.listItemBackgroundHovered=_,l.listHeaderBackgroundHovered=_,l.menuItemBackgroundHovered=_),C&&(l.primaryButtonTextDisabled=C,l.disabledSubtext=C),S&&(l.listItemBackgroundCheckedHovered=S),I&&(l.disabledBodyText=I,l.variantBorderHovered=(null===(i=o)||void 0===i?void 0:i.variantBorderHovered)||I,l.buttonTextDisabled=I,l.inputIconDisabled=I,l.disabledText=I),x&&(l.bodyText=x,l.actionLink=x,l.buttonText=x,l.inputBorderHovered=x,l.inputText=x,l.listText=x,l.menuItemText=x),P&&(l.bodyStandoutBackground=P,l.defaultStateBackground=P),y&&(l.actionLinkHovered=y,l.buttonTextHovered=y,l.buttonTextChecked=y,l.buttonTextPressed=y,l.inputTextHovered=y,l.menuItemTextHovered=y),k&&(l.bodySubtext=k,l.focusBorder=k,l.inputBorder=k,l.smallInputBorder=k,l.inputPlaceholderText=k),w&&(l.buttonBorder=w),D&&(l.disabledBodySubtext=D,l.disabledBorder=D,l.buttonBackgroundChecked=D,l.menuDivider=D),T&&(l.accentButtonBackground=T),(null===(s=t)||void 0===s?void 0:s.elevation4)&&(l.cardShadow=t.elevation4),!n&&(null===(a=t)||void 0===a?void 0:a.elevation8)?l.cardShadowHovered=t.elevation8:l.variantBorderHovered&&(l.cardShadowHovered="0 0 1px "+l.variantBorderHovered),l=h(h({},l),o)}var Bt={s2:"4px",s1:"8px",m:"16px",l1:"20px",l2:"32px"};function Nt(e,t){void 0===e&&(e={}),void 0===t&&(t=!1);var o=!!e.isInverted;return function(e,t){var o,n,r,i;void 0===t&&(t={});var s=Tt({},e,t,{semanticColors:Rt(t.palette,t.effects,t.semanticColors,void 0===t.isInverted?e.isInverted:t.isInverted)});if((null===(o=t.palette)||void 0===o?void 0:o.themePrimary)&&!(null===(n=t.palette)||void 0===n?void 0:n.accent)&&(s.palette.accent=t.palette.themePrimary),t.defaultFontStyle)for(var a=0,l=Object.keys(s.fonts);a<l.length;a++){var c=l[a];s.fonts[c]=Tt(s.fonts[c],t.defaultFontStyle,null===(i=null===(r=t)||void 0===r?void 0:r.fonts)||void 0===i?void 0:i[c])}return t.stylesheets&&(s.stylesheets=(e.stylesheets||[]).concat(t.stylesheets)),s}({palette:vt,effects:Pt,fonts:pt,spacing:Bt,isInverted:o,disableGlobalClassNames:!1,semanticColors:Mt(vt,Pt,void 0,o,t),rtl:void 0},e)}var Ft=Nt({}),At=[],Lt="theme";function Ht(){var e,t,o;if(!It.getSettings([Lt]).theme){var n=rt();(null===(o=null===(t=n)||void 0===t?void 0:t.FabricConfig)||void 0===o?void 0:o.theme)&&(Ft=Nt(n.FabricConfig.theme)),It.applySettings(((e={})[Lt]=Ft,e))}}function Ot(e){return void 0===e&&(e=!1),!0===e&&(Ft=Nt({},e)),Ft}function zt(e){-1===At.indexOf(e)&&At.push(e)}function Wt(e){var t=At.indexOf(e);-1!==t&&At.splice(t,1)}function Vt(e,t){var o;return void 0===t&&(t=!1),Ft=Nt(e,t),Object(Dt.b)(h(h(h(h({},Ft.palette),Ft.semanticColors),Ft.effects),function(e){for(var t={},o=0,n=Object.keys(e.fonts);o<n.length;o++)for(var r=n[o],i=e.fonts[r],s=0,a=Object.keys(i);s<a.length;s++){var l=a[s],c=r+l.charAt(0).toUpperCase()+l.slice(1),u=i[l];"fontSize"===l&&"number"==typeof u&&(u+="px"),t[c]=u}return t}(Ft))),It.applySettings(((o={})[Lt]=Ft,o)),At.forEach((function(e){try{e(Ft)}catch(e){}})),Ft}Ht();var Kt={};for(var Ut in vt)vt.hasOwnProperty(Ut)&&(Gt(Kt,Ut,"",!1,"color"),Gt(Kt,Ut,"Hover",!0,"color"),Gt(Kt,Ut,"Background",!1,"background"),Gt(Kt,Ut,"BackgroundHover",!0,"background"),Gt(Kt,Ut,"Border",!1,"borderColor"),Gt(Kt,Ut,"BorderHover",!0,"borderColor"));function Gt(e,t,o,n,r){Object.defineProperty(e,t+o,{get:function(){var e,o=((e={})[r]=Ot().palette[t],e);return Q(n?{selectors:{":hover":o}}:o).toString()},enumerable:!0,configurable:!0})}var jt="@media screen and (-ms-high-contrast: active), (forced-colors: active)",Yt="@media screen and (-ms-high-contrast: black-on-white), (forced-colors: black-on-white)",qt="@media screen and (-ms-high-contrast: white-on-black), (forced-colors: white-on-black)",Zt="@media screen and (forced-colors: active)",Xt=320,Qt=480,Jt=640,$t=1024,eo=1366,to=1920,oo=Qt-1,no=Jt-1,ro=$t-1,io=eo-1,so=to-1,ao=768;function lo(e,t){return"@media only screen and (min-width: "+e+"px) and (max-width: "+t+"px)"}function co(){return{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}}function uo(){var e;return(e={})[Zt]={forcedColorAdjust:"none"},e}var po,ho="ms-Fabric--isFocusVisible";function mo(e,t){var o=t?rt(t):rt();if(o){var n=o.document.body.classList;n.add(e?ho:"ms-Fabric--isFocusHidden"),n.remove(e?"ms-Fabric--isFocusHidden":ho)}}function go(e,t,o,n,r,i,s){return fo(e,"number"!=typeof t&&t?t:{inset:t,position:o,highContrastStyle:n,borderColor:r,outlineColor:i,isFocusedOnly:s})}function fo(e,t){var o,n;void 0===t&&(t={});var r=t.inset,i=void 0===r?0:r,s=t.width,a=void 0===s?1:s,l=t.position,c=void 0===l?"relative":l,u=t.highContrastStyle,d=t.borderColor,p=void 0===d?e.palette.white:d,h=t.outlineColor,m=void 0===h?e.palette.neutralSecondary:h,g=t.isFocusedOnly;return{outline:"transparent",position:c,selectors:(o={"::-moz-focus-inner":{border:"0"}},o["."+ho+" &"+(void 0===g||g?":focus":"")+":after"]={content:'""',position:"absolute",left:i+1,top:i+1,bottom:i+1,right:i+1,border:a+"px solid "+p,outline:a+"px solid "+m,zIndex:po.FocusStyle,selectors:(n={},n[jt]=u,n)},o)}}function vo(){return{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}}}function bo(e,t,o,n){var r;return void 0===t&&(t=0),void 0===o&&(o=1),{selectors:(r={},r[":global("+ho+") &:focus"]={outline:o+" solid "+(n||e.palette.neutralSecondary),outlineOffset:-t+"px"},r)}}!function(e){e.Nav=1,e.ScrollablePane=1,e.FocusStyle=1,e.Coachmark=1e3,e.Layer=1e6,e.KeytipLayer=1000001}(po||(po={}));var _o=function(e,t,o,n){var r,i,s;void 0===o&&(o="border"),void 0===n&&(n=-1);var a="borderBottom"===o;return{borderColor:e,selectors:{":after":(r={pointerEvents:"none",content:"''",position:"absolute",left:a?0:n,top:n,bottom:n,right:a?0:n},r[o]="2px solid "+e,r.borderRadius=t,r.width="borderBottom"===o?"100%":void 0,r.selectors=(i={},i[jt]=(s={},s["border"===o?"borderColor":"borderBottomColor"]="Highlight",s),i),r)}}},yo={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden"};function Co(e,t){return{borderColor:e,borderWidth:"0px",width:t,height:t}}function So(e){return{opacity:1,borderWidth:e}}function xo(e,t){return{borderWidth:"0",width:t,height:t,opacity:0,borderColor:e}}function ko(e,t){return h(h({},Co(e,t)),{opacity:0})}var wo={continuousPulseAnimationDouble:function(e,t,o,n,r){return ee({"0%":Co(e,o),"1.42%":So(r),"3.57%":{opacity:1},"7.14%":xo(t,n),"8%":ko(e,o),"29.99%":ko(e,o),"30%":Co(e,o),"31.42%":So(r),"33.57%":{opacity:1},"37.14%":xo(t,n),"38%":ko(e,o),"79.42%":ko(e,o),79.43:Co(e,o),81.85:So(r),83.42:{opacity:1},"87%":xo(t,n),"100%":{}})},continuousPulseAnimationSingle:function(e,t,o,n,r){return ee({"0%":Co(e,o),"14.2%":So(r),"35.7%":{opacity:1},"71.4%":xo(t,n),"100%":{}})},createDefaultAnimation:function(e,t){return{animationName:e,animationIterationCount:"1",animationDuration:"14s",animationDelay:t||"2s"}}},Io=!1,Do=0,Po={empty:!0},To={},Eo="undefined"==typeof WeakMap?null:WeakMap;function Mo(e){Eo=e}function Ro(){Do++}function Bo(e,t,o){var n=No(o.value&&o.value.bind(null));return{configurable:!0,get:function(){return n}}}function No(e,t,o){if(void 0===t&&(t=100),void 0===o&&(o=!1),!Eo)return e;if(!Io){var n=x.getInstance();n&&n.onReset&&x.getInstance().onReset(Ro),Io=!0}var r,i=0,s=Do;return function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var l=r;(void 0===r||s!==Do||t>0&&i>t)&&(r=Lo(),i=0,s=Do),l=r;for(var c=0;c<n.length;c++){var u=Ao(n[c]);l.map.has(u)||l.map.set(u,Lo()),l=l.map.get(u)}return l.hasOwnProperty("value")||(l.value=e.apply(void 0,n),i++),!o||null!==l.value&&void 0!==l.value||(l.value=e.apply(void 0,n)),l.value}}function Fo(e){if(!Eo)return e;var t=new Eo;return function(o){if(!o||"function"!=typeof o&&"object"!=typeof o)return e(o);if(t.has(o))return t.get(o);var n=e(o);return t.set(o,n),n}}function Ao(e){return e?"object"==typeof e||"function"==typeof e?e:(To[e]||(To[e]={val:e}),To[e]):Po}function Lo(){return{map:Eo?new Eo:null}}var Ho=No((function(e,t){var o=x.getInstance();return t?Object.keys(e).reduce((function(t,n){return t[n]=o.getClassName(e[n]),t}),{}):e}));function Oo(e,t,o){return Ho(e,void 0!==o?o:t.disableGlobalClassNames)}function zo(e,t){return void 0===e&&(e={}),(Vo(t)?t:function(e){return function(t){return e?h(h({},t),e):t}}(t))(e)}function Wo(e,t){return void 0===e&&(e={}),(Vo(t)?t:function(e){void 0===e&&(e={});return function(t){var o=h({},t);for(var n in e)e.hasOwnProperty(n)&&(o[n]=h(h({},t[n]),e[n]));return o}}(t))(e)}function Vo(e){return"function"==typeof e}function Ko(e,t,o){var n,r=e,i=o||It.getSettings(["theme"],void 0,e.customizations).theme;o&&(n={theme:o});var s=t&&i&&i.schemes&&i.schemes[t];return i&&s&&i!==s&&((n={theme:s}).theme.schemes=i.schemes),n&&(r={customizations:{settings:zo(e.customizations.settings,n),scopedSettings:e.customizations.scopedSettings}}),r}var Uo={boxShadow:"none",margin:0,padding:0,boxSizing:"border-box"},Go={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function jo(e,t,o,n,r){void 0===t&&(t="bodyBackground"),void 0===o&&(o="horizontal"),void 0===n&&(n=Yo("width",o)),void 0===r&&(r=Yo("height",o));var i=e.semanticColors[t]||e.palette[t],s=function(e){if("#"===e[0])return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)};if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2]}}return{r:255,g:255,b:255}}(i);return{content:'""',position:"absolute",right:0,bottom:0,width:n,height:r,pointerEvents:"none",backgroundImage:"linear-gradient("+("vertical"===o?"to bottom":"to right")+", "+("rgba("+s.r+", "+s.g+", "+s.b+", 0)")+" 0%, "+i+" 100%)"}}function Yo(e,t){return"width"===e?"horizontal"===t?20:"100%":"vertical"===t?"50%":"100%"}function qo(e){return{selectors:{"::placeholder":e,":-ms-input-placeholder":e,"::-ms-input-placeholder":e}}}function Zo(e){console&&console.warn&&console.warn(e)}function Xo(e){e}var Qo=_t.getValue("icons",{__options:{disableWarnings:!1,warnOnMissingIcons:!0},__remapped:{}}),Jo=x.getInstance();Jo&&Jo.onReset&&Jo.onReset((function(){for(var e in Qo)Qo.hasOwnProperty(e)&&Qo[e].subset&&(Qo[e].subset.className=void 0)}));var $o=function(e){return e.toLowerCase()};function en(e,t){var o=h(h({},e),{isRegistered:!1,className:void 0}),n=e.icons;for(var r in t=t?h(h({},Qo.__options),t):Qo.__options,n)if(n.hasOwnProperty(r)){var i=n[r],s=$o(r);Qo[s]?ln(r):Qo[s]={code:i,subset:o}}}function tn(e){for(var t=Qo.__options,o=function(e){var o=$o(e);Qo[o]?delete Qo[o]:t.disableWarnings||Zo('The icon "'+e+'" tried to unregister but was not registered.'),Qo.__remapped[o]&&delete Qo.__remapped[o],Object.keys(Qo.__remapped).forEach((function(e){Qo.__remapped[e]===o&&delete Qo.__remapped[e]}))},n=0,r=e;n<r.length;n++){o(r[n])}}function on(e,t){Qo.__remapped[$o(e)]=$o(t)}function nn(e){var t=void 0,o=Qo.__options;if(e=e?$o(e):"",e=Qo.__remapped[e]||e)if(t=Qo[e]){var n=t.subset;n&&n.fontFace&&(n.isRegistered||(qe(n.fontFace),n.isRegistered=!0),n.className||(n.className=Q(n.style,{fontFamily:n.fontFace.fontFamily,fontWeight:n.fontFace.fontWeight||"normal",fontStyle:n.fontFace.fontStyle||"normal"})))}else!o.disableWarnings&&o.warnOnMissingIcons&&Zo('The icon "'+e+'" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.');return t}function rn(e){Qo.__options=h(h({},Qo.__options),e)}var sn=[],an=void 0;function ln(e){var t=Qo.__options;t.disableWarnings||(sn.push(e),void 0===an&&(an=setTimeout((function(){Zo("Some icons were re-registered. Applications should only call registerIcons for any given icon once. Redefining what an icon is may have unintended consequences. Duplicates include: \n"+sn.slice(0,10).join(", ")+(sn.length>10?" (+ "+(sn.length-10)+" more)":"")),an=void 0,sn=[]}),2e3)))}var cn={display:"inline-block"};function un(e){var t="",o=nn(e);return o&&(t=Q(o.subset.className,cn,{selectors:{"::before":{content:'"'+o.code+'"'}}})),t}function dn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e&&1===e.length&&e[0]&&!e[0].subComponentStyles)return e[0];for(var o={},n={},r=0,i=e;r<i.length;r++){var s=i[r];if(s)for(var a in s)if(s.hasOwnProperty(a)){if("subComponentStyles"===a&&void 0!==s.subComponentStyles){var l=s.subComponentStyles;for(var c in l)l.hasOwnProperty(c)&&(n.hasOwnProperty(c)?n[c].push(l[c]):n[c]=[l[c]]);continue}var u=o[a],d=s[a];o[a]=void 0===u?d:f(Array.isArray(u)?u:[u],Array.isArray(d)?d:[d])}}if(Object.keys(n).length>0){o.subComponentStyles={};var p=o.subComponentStyles,h=function(e){if(n.hasOwnProperty(e)){var t=n[e];p[e]=function(e){return dn.apply(void 0,t.map((function(t){return"function"==typeof t?t(e):t})))}}};for(var c in n)h(c)}return o}function pn(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];for(var n=[],r=0,i=t;r<i.length;r++){var s=i[r];s&&n.push("function"==typeof s?s(e):s)}return 1===n.length?n[0]:n.length?dn.apply(void 0,n):{}}function hn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return mn(e,D())}function mn(e,t){var o,n,r={subComponentStyles:{}};if(!e[0]&&e.length<=1)return{subComponentStyles:{}};var i=dn.apply(void 0,e),s=[];for(var a in i)if(i.hasOwnProperty(a)){if("subComponentStyles"===a){r.subComponentStyles=i.subComponentStyles||{};continue}var l=k(i[a]),c=l.classes,u=l.objects;if(null===(o=u)||void 0===o?void 0:o.length)(h=Z(t||{},{displayName:a},u))&&(s.push(h),r[a]=c.concat([h.className]).join(" "));else r[a]=c.join(" ")}for(var d=0,p=s;d<p.length;d++){var h;(h=p[d])&&X(h,null===(n=t)||void 0===n?void 0:n.specificityMultiplier)}return r}var gn=o(4);Object(gn.a)("@uifabric/styling","7.18.1"),Ht();var fn=No((function(e,t,o,n){return{root:Q("ms-ActivityItem",t,e.root,n&&e.isCompactRoot),pulsingBeacon:Q("ms-ActivityItem-pulsingBeacon",e.pulsingBeacon),personaContainer:Q("ms-ActivityItem-personaContainer",e.personaContainer,n&&e.isCompactPersonaContainer),activityPersona:Q("ms-ActivityItem-activityPersona",e.activityPersona,n&&e.isCompactPersona,!n&&o&&2===o.length&&e.doublePersona),activityTypeIcon:Q("ms-ActivityItem-activityTypeIcon",e.activityTypeIcon,n&&e.isCompactIcon),activityContent:Q("ms-ActivityItem-activityContent",e.activityContent,n&&e.isCompactContent),activityText:Q("ms-ActivityItem-activityText",e.activityText),commentText:Q("ms-ActivityItem-commentText",e.commentText),timeStamp:Q("ms-ActivityItem-timeStamp",e.timeStamp,n&&e.isCompactTimeStamp)}})),vn=No((function(){return ee({from:{opacity:0},to:{opacity:1}})})),bn=No((function(){return ee({from:{transform:"translateX(-10px)"},to:{transform:"translateX(0)"}})})),_n=No((function(e,t,o,n,r,i){var s;void 0===e&&(e=Ot());var a={animationName:wo.continuousPulseAnimationSingle(n||e.palette.themePrimary,r||e.palette.themeTertiary,"4px","28px","4px"),animationIterationCount:"1",animationDuration:".8s",zIndex:1},l={animationName:bn(),animationIterationCount:"1",animationDuration:".5s"},c={animationName:vn(),animationIterationCount:"1",animationDuration:".5s"};return dn({root:[e.fonts.small,{display:"flex",justifyContent:"flex-start",alignItems:"flex-start",boxSizing:"border-box",color:e.palette.neutralSecondary},i&&o&&c],pulsingBeacon:[{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0px",height:"0px",borderRadius:"225px",borderStyle:"solid",opacity:0},i&&o&&a],isCompactRoot:{alignItems:"center"},personaContainer:{display:"flex",flexWrap:"wrap",minWidth:"32px",width:"32px",height:"32px"},isCompactPersonaContainer:{display:"inline-flex",flexWrap:"nowrap",flexBasis:"auto",height:"16px",width:"auto",minWidth:"0",paddingRight:"6px"},activityTypeIcon:{height:"32px",fontSize:"16px",lineHeight:"16px",marginTop:"3px"},isCompactIcon:{height:"16px",minWidth:"16px",fontSize:"13px",lineHeight:"13px",color:e.palette.themePrimary,marginTop:"1px",position:"relative",display:"flex",justifyContent:"center",alignItems:"center",selectors:{".ms-Persona-imageArea":{margin:"-2px 0 0 -2px",border:"2px solid"+e.palette.white,borderRadius:"50%",selectors:(s={},s[jt]={border:"none",margin:"0"},s)}}},activityPersona:{display:"block"},doublePersona:{selectors:{":first-child":{alignSelf:"flex-end"}}},isCompactPersona:{display:"inline-block",width:"8px",minWidth:"8px",overflow:"visible"},activityContent:[{padding:"0 8px"},i&&o&&l],activityText:{display:"inline"},isCompactContent:{flex:"1",padding:"0 4px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflowX:"hidden"},commentText:{color:e.palette.neutralPrimary},timeStamp:[e.fonts.tiny,{fontWeight:400,color:e.palette.neutralSecondary}],isCompactTimeStamp:{display:"inline-block",paddingLeft:"0.3em",fontSize:"1em"}},t)})),yn=b.createContext({customizations:{inCustomizerContext:!1,settings:{},scopedSettings:{}}});function Cn(e,t){var o,n=(o=b.useState(0)[1],function(){return o((function(e){return++e}))}),r=b.useContext(yn).customizations,i=r.inCustomizerContext;return b.useEffect((function(){return i||It.observe(n),function(){i||It.unobserve(n)}}),[i]),It.getSettings(e,t,r)}var Sn=["theme","styles"];function xn(e,t,o,n,r){var i=(n=n||{scope:"",fields:void 0}).scope,s=n.fields,a=void 0===s?Sn:s,l=b.forwardRef((function(n,r){var s=b.useRef(),l=Cn(a,i),c=l.styles,u=(l.dir,m(l,["styles","dir"])),d=o?o(n):void 0,p=s.current&&s.current.__cachedInputs__||[];if(!s.current||c!==p[1]||n.styles!==p[2]){var g=function(e){return pn(e,t,c,n.styles)};g.__cachedInputs__=[t,c,n.styles],g.__noStyleOverride__=!c&&!n.styles,s.current=g}return b.createElement(e,h({ref:r},u,d,n,{styles:s.current}))}));l.displayName="Styled"+(e.displayName||e.name);var c=r?b.memo(l):l;return l.displayName&&(c.displayName=l.displayName),c}var kn,wn={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pauseBreak:19,capslock:20,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,del:46,zero:48,one:49,two:50,three:51,four:52,five:53,six:54,seven:55,eight:56,nine:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftWindow:91,rightWindow:92,select:93,zero_numpad:96,one_numpad:97,two_numpad:98,three_numpad:99,four_numpad:100,five_numpad:101,six_numpad:102,seven_numpad:103,eight_numpad:104,nine_numpad:105,multiply:106,add:107,subtract:109,decimalPoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrollLock:145,semicolon:186,equalSign:187,comma:188,dash:189,period:190,forwardSlash:191,graveAccent:192,openBracket:219,backSlash:220,closeBracket:221,singleQuote:222};function In(e){if(void 0===e&&(e={}),void 0!==e.rtl)return e.rtl;if(void 0===kn){var t=it("isRTL");null!==t&&Dn(kn="1"===t);var o=tt();void 0===kn&&o&&w(kn="rtl"===(o.body&&o.body.getAttribute("dir")||o.documentElement.getAttribute("dir")))}return!!kn}function Dn(e,t){void 0===t&&(t=!1);var o=tt();o&&o.documentElement.setAttribute("dir",e?"rtl":"ltr"),t&&st("isRTL",e?"1":"0"),w(kn=e)}function Pn(e,t){return void 0===t&&(t={}),In(t)&&(e===wn.left?e=wn.right:e===wn.right&&(e=wn.left)),e}var Tn=0,En=x.getInstance();En&&En.onReset&&En.onReset((function(){return Tn++}));function Mn(e){void 0===e&&(e={});var t=new Map,o=0,n=0,r=Tn;return function(i,s){var a,l;if(void 0===s&&(s={}),e.useStaticStyles&&"function"==typeof i&&i.__noStyleOverride__)return i(s);n++;var c=t,u=s.theme,d=u&&void 0!==u.rtl?u.rtl:In(),p=e.disableCaching;(r!==Tn&&(r=Tn,t=new Map,o=0),e.disableCaching||(c=Bn(t,i),c=Bn(c,s)),!p&&c.__retval__||(c.__retval__=void 0===i?{}:mn(["function"==typeof i?i(s):i],{rtl:!!d,specificityMultiplier:e.useStaticStyles?5:void 0}),p||o++),o>(e.cacheSize||50))&&((null===(l=null===(a=rt())||void 0===a?void 0:a.FabricConfig)||void 0===l?void 0:l.enableClassNameCacheFullWarning)&&(console.warn("Styles are being recalculated too frequently. Cache miss rate is "+o+"/"+n+"."),console.trace()),t.clear(),o=0,e.disableCaching=!0);return c.__retval__}}function Rn(e,t){return t=function(e){switch(e){case void 0:return"__undefined__";case null:return"__null__";default:return e}}(t),e.has(t)||e.set(t,new Map),e.get(t)}function Bn(e,t){if("function"==typeof t)if(t.__cachedInputs__)for(var o=0,n=t.__cachedInputs__;o<n.length;o++){e=Rn(e,n[o])}else e=Rn(e,t);else if("object"==typeof t)for(var r in t)t.hasOwnProperty(r)&&(e=Rn(e,t[r]));return e}var Nn=/[\(\[\{][^\)\]\}]*[\)\]\}]/g,Fn=/[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g,An=/^\d+[\d\s]*(:?ext|x|)\s*\d+$/i,Ln=/\s+/g,Hn=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;function On(e,t,o){return e?(e=function(e){return e=(e=(e=(e=e.replace(Nn,"")).replace(Fn,"")).replace(Ln," ")).trim()}(e),Hn.test(e)||!o&&An.test(e)?"":function(e,t){var o="",n=e.split(" ");return 2===n.length?(o+=n[0].charAt(0).toUpperCase(),o+=n[1].charAt(0).toUpperCase()):3===n.length?(o+=n[0].charAt(0).toUpperCase(),o+=n[2].charAt(0).toUpperCase()):0!==n.length&&(o+=n[0].charAt(0).toUpperCase()),t&&o.length>1?o.charAt(1)+o.charAt(0):o}(e,t)):""}var zn,Wn,Vn,Kn,Un=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o={},n=0,r=e;n<r.length;n++)for(var i=r[n],s=Array.isArray(i)?i:Object.keys(i),a=0,l=s;a<l.length;a++){var c=l[a];o[c]=1}return o},Gn=Un(["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onInput","onSubmit","onLoad","onError","onKeyDown","onKeyDownCapture","onKeyPress","onKeyUp","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onClick","onClickCapture","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onMouseUpCapture","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onPointerCancel","onPointerDown","onPointerEnter","onPointerLeave","onPointerMove","onPointerOut","onPointerOver","onPointerUp","onGotPointerCapture","onLostPointerCapture"]),jn=Un(["accessKey","children","className","contentEditable","dir","draggable","hidden","htmlFor","id","lang","ref","role","style","tabIndex","title","translate","spellCheck","name"]),Yn=Un(jn,Gn),qn=Un(Yn,["form"]),Zn=Un(Yn,["height","loop","muted","preload","src","width"]),Xn=Un(Zn,["poster"]),Qn=Un(Yn,["start"]),Jn=Un(Yn,["value"]),$n=Un(Yn,["download","href","hrefLang","media","rel","target","type"]),er=Un(Yn,["autoFocus","disabled","form","formAction","formEncType","formMethod","formNoValidate","formTarget","type","value"]),tr=Un(er,["accept","alt","autoCapitalize","autoComplete","checked","dirname","form","height","inputMode","list","max","maxLength","min","multiple","pattern","placeholder","readOnly","required","src","step","size","type","value","width"]),or=Un(er,["autoCapitalize","cols","dirname","form","maxLength","placeholder","readOnly","required","rows","wrap"]),nr=Un(er,["form","multiple","required"]),rr=Un(Yn,["selected","value"]),ir=Un(Yn,["cellPadding","cellSpacing"]),sr=Yn,ar=Un(Yn,["rowSpan","scope"]),lr=Un(Yn,["colSpan","headers","rowSpan","scope"]),cr=Un(Yn,["span"]),ur=Un(Yn,["span"]),dr=Un(Yn,["acceptCharset","action","encType","encType","method","noValidate","target"]),pr=Un(Yn,["allow","allowFullScreen","allowPaymentRequest","allowTransparency","csp","height","importance","referrerPolicy","sandbox","src","srcDoc","width"]),hr=Un(Yn,["alt","crossOrigin","height","src","srcSet","useMap","width"]),mr=hr,gr=Yn;function fr(e,t,o){for(var n,r=Array.isArray(t),i={},s=0,a=Object.keys(e);s<a.length;s++){var l=a[s];!(!r&&t[l]||r&&t.indexOf(l)>=0||0===l.indexOf("data-")||0===l.indexOf("aria-"))||o&&-1!==(null===(n=o)||void 0===n?void 0:n.indexOf(l))||(i[l]=e[l])}return i}!function(e){e[e.default=0]="default",e[e.image=1]="image",e[e.Default=1e5]="Default",e[e.Image=100001]="Image"}(zn||(zn={})),function(e){e[e.center=0]="center",e[e.contain=1]="contain",e[e.cover=2]="cover",e[e.none=3]="none",e[e.centerCover=4]="centerCover",e[e.centerContain=5]="centerContain"}(Wn||(Wn={})),function(e){e[e.landscape=0]="landscape",e[e.portrait=1]="portrait"}(Vn||(Vn={})),function(e){e[e.notLoaded=0]="notLoaded",e[e.loaded=1]="loaded",e[e.error=2]="error",e[e.errorLoaded=3]="errorLoaded"}(Kn||(Kn={}));var vr=Mn(),br=function(e){function t(t){var o=e.call(this,t)||this;return o._coverStyle=Vn.portrait,o._imageElement=b.createRef(),o._frameElement=b.createRef(),o._onImageLoaded=function(e){var t=o.props,n=t.src,r=t.onLoad;r&&r(e),o._computeCoverStyle(o.props),n&&o.setState({loadState:Kn.loaded})},o._onImageError=function(e){o.props.onError&&o.props.onError(e),o.setState({loadState:Kn.error})},o.state={loadState:Kn.notLoaded},o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){e.src!==this.props.src?this.setState({loadState:Kn.notLoaded}):this.state.loadState===Kn.loaded&&this._computeCoverStyle(e)},t.prototype.componentDidUpdate=function(e,t){this._checkImageLoaded(),this.props.onLoadingStateChange&&t.loadState!==this.state.loadState&&this.props.onLoadingStateChange(this.state.loadState)},t.prototype.render=function(){var e=fr(this.props,hr,["width","height"]),t=this.props,o=t.src,n=t.alt,r=t.width,i=t.height,s=t.shouldFadeIn,a=t.shouldStartVisible,l=t.className,c=t.imageFit,u=t.role,d=t.maximizeFrame,p=t.styles,m=t.theme,g=this.state.loadState,f=void 0!==this.props.coverStyle?this.props.coverStyle:this._coverStyle,v=vr(p,{theme:m,className:l,width:r,height:i,maximizeFrame:d,shouldFadeIn:s,shouldStartVisible:a,isLoaded:g===Kn.loaded||g===Kn.notLoaded&&this.props.shouldStartVisible,isLandscape:f===Vn.landscape,isCenter:c===Wn.center,isCenterContain:c===Wn.centerContain,isCenterCover:c===Wn.centerCover,isContain:c===Wn.contain,isCover:c===Wn.cover,isNone:c===Wn.none,isError:g===Kn.error,isNotImageFit:void 0===c});return b.createElement("div",{className:v.root,style:{width:r,height:i},ref:this._frameElement},b.createElement("img",h({},e,{onLoad:this._onImageLoaded,onError:this._onImageError,key:"fabricImage"+this.props.src||"",className:v.image,ref:this._imageElement,src:o,alt:n,role:u})))},t.prototype._checkImageLoaded=function(){var e=this.props.src;this.state.loadState===Kn.notLoaded&&(!!this._imageElement.current&&(e&&this._imageElement.current.naturalWidth>0&&this._imageElement.current.naturalHeight>0||this._imageElement.current.complete&&t._svgRegex.test(e))&&(this._computeCoverStyle(this.props),this.setState({loadState:Kn.loaded})))},t.prototype._computeCoverStyle=function(e){var t=e.imageFit,o=e.width,n=e.height;if((t===Wn.cover||t===Wn.contain||t===Wn.centerContain||t===Wn.centerCover)&&void 0===this.props.coverStyle&&this._imageElement.current&&this._frameElement.current){var r=void 0;r="number"==typeof o&&"number"==typeof n&&t!==Wn.centerContain&&t!==Wn.centerCover?o/n:this._frameElement.current.clientWidth/this._frameElement.current.clientHeight;var i=this._imageElement.current.naturalWidth/this._imageElement.current.naturalHeight;this._coverStyle=i>r?Vn.landscape:Vn.portrait}},t.defaultProps={shouldFadeIn:!0},t._svgRegex=/\.svg$/i,t}(b.Component),_r={root:"ms-Image",rootMaximizeFrame:"ms-Image--maximizeFrame",image:"ms-Image-image",imageCenter:"ms-Image-image--center",imageContain:"ms-Image-image--contain",imageCover:"ms-Image-image--cover",imageCenterContain:"ms-Image-image--centerContain",imageCenterCover:"ms-Image-image--centerCover",imageNone:"ms-Image-image--none",imageLandscape:"ms-Image-image--landscape",imagePortrait:"ms-Image-image--portrait"},yr=xn(br,(function(e){var t=e.className,o=e.width,n=e.height,r=e.maximizeFrame,i=e.isLoaded,s=e.shouldFadeIn,a=e.shouldStartVisible,l=e.isLandscape,c=e.isCenter,u=e.isContain,d=e.isCover,p=e.isCenterContain,h=e.isCenterCover,m=e.isNone,g=e.isError,f=e.isNotImageFit,v=e.theme,b=Oo(_r,v),_={position:"absolute",left:"50% /* @noflip */",top:"50%",transform:"translate(-50%,-50%)"},y=rt(),C=void 0!==y&&void 0===y.navigator.msMaxTouchPoints,S=u&&l||d&&!l?{width:"100%",height:"auto"}:{width:"auto",height:"100%"};return{root:[b.root,v.fonts.medium,{overflow:"hidden"},r&&[b.rootMaximizeFrame,{height:"100%",width:"100%"}],i&&s&&!a&&Ye.fadeIn400,(c||u||d||p||h)&&{position:"relative"},t],image:[b.image,{display:"block",opacity:0},i&&["is-loaded",{opacity:1}],c&&[b.imageCenter,_],u&&[b.imageContain,C&&{width:"100%",height:"100%",objectFit:"contain"},!C&&S,_],d&&[b.imageCover,C&&{width:"100%",height:"100%",objectFit:"cover"},!C&&S,_],p&&[b.imageCenterContain,l&&{maxWidth:"100%"},!l&&{maxHeight:"100%"},_],h&&[b.imageCenterCover,l&&{maxHeight:"100%"},!l&&{maxWidth:"100%"},_],m&&[b.imageNone,{width:"auto",height:"auto"}],f&&[!!o&&!n&&{height:"auto",width:"100%"},!o&&!!n&&{height:"100%",width:"auto"},!!o&&!!n&&{height:"100%",width:"100%"}],l&&b.imageLandscape,!l&&b.imagePortrait,!i&&"is-notLoaded",s&&"is-fadeIn",g&&"is-error"]}}),void 0,{scope:"Image"},!0),Cr=hn({root:{display:"inline-block"},placeholder:["ms-Icon-placeHolder",{width:"1em"}],image:["ms-Icon-imageContainer",{overflow:"hidden"}]});function Sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=[],n=0,r=e;n<r.length;n++){var i=r[n];if(i)if("string"==typeof i)o.push(i);else if(i.hasOwnProperty("toString")&&"function"==typeof i.toString)o.push(i.toString());else for(var s in i)i[s]&&o.push(s)}return o.join(" ")}var xr,kr,wr,Ir,Dr,Pr,Tr,Er=No((function(e){var t=nn(e)||{subset:{},code:void 0},o=t.code,n=t.subset;return o?{children:o,iconClassName:n.className,fontFamily:n.fontFace&&n.fontFace.fontFamily}:null}),void 0,!0),Mr=function(e){var t=e.iconName,o=e.className,n=e.style,r=void 0===n?{}:n,i=Er(t)||{},s=i.iconClassName,a=i.children,l=i.fontFamily,c=fr(e,Yn),u=e["aria-label"]?{}:{role:"presentation","aria-hidden":!0};return b.createElement("i",h({"data-icon-name":t},u,c,{className:Sr("ms-Icon",Cr.root,s,!t&&Cr.placeholder,o),style:h({fontFamily:l},r)}),a)},Rr=No((function(e,t,o){return Mr({iconName:e,className:t,"aria-label":o})})),Br=Mn({cacheSize:100}),Nr=function(e){function t(t){var o=e.call(this,t)||this;return o._onImageLoadingStateChange=function(e){o.props.imageProps&&o.props.imageProps.onLoadingStateChange&&o.props.imageProps.onLoadingStateChange(e),e===Kn.error&&o.setState({imageLoadError:!0})},o.state={imageLoadError:!1},o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.children,o=e.className,n=e.styles,r=e.iconName,i=e.imageErrorAs,s=e.theme,a="string"==typeof r&&0===r.length,l=!!this.props.imageProps||this.props.iconType===zn.image||this.props.iconType===zn.Image,c=Er(r)||{},u=c.iconClassName,d=c.children,p=Br(n,{theme:s,className:o,iconClassName:u,isImage:l,isPlaceholder:a}),m=l?"span":"i",g=fr(this.props,Yn,["aria-label"]),f=this.state.imageLoadError,v=h(h({},this.props.imageProps),{onLoadingStateChange:this._onImageLoadingStateChange}),_=f&&i||yr,y=this.props["aria-label"]||this.props.ariaLabel,C=y?{"aria-label":y}:{"aria-hidden":!this.props["aria-labelledby"]&&!v["aria-labelledby"]};return b.createElement(m,h({"data-icon-name":r},C,g,{className:p.root}),l?b.createElement(_,h({},v)):t||d)},t}(b.Component),Fr=xn(Nr,(function(e){var t=e.className,o=e.iconClassName,n=e.isPlaceholder,r=e.isImage,i=e.styles;return{root:[n&&Cr.placeholder,Cr.root,r&&Cr.image,o,t,i&&i.root,i&&i.imageContainer]}}),void 0,{scope:"Icon"},!0);Fr.displayName="Icon",function(e){e[e.tiny=0]="tiny",e[e.extraExtraSmall=1]="extraExtraSmall",e[e.extraSmall=2]="extraSmall",e[e.small=3]="small",e[e.regular=4]="regular",e[e.large=5]="large",e[e.extraLarge=6]="extraLarge",e[e.size8=17]="size8",e[e.size10=9]="size10",e[e.size16=8]="size16",e[e.size24=10]="size24",e[e.size28=7]="size28",e[e.size32=11]="size32",e[e.size40=12]="size40",e[e.size48=13]="size48",e[e.size56=16]="size56",e[e.size72=14]="size72",e[e.size100=15]="size100",e[e.size120=18]="size120"}(xr||(xr={})),function(e){e[e.none=0]="none",e[e.offline=1]="offline",e[e.online=2]="online",e[e.away=3]="away",e[e.dnd=4]="dnd",e[e.blocked=5]="blocked",e[e.busy=6]="busy"}(kr||(kr={})),function(e){e[e.lightBlue=0]="lightBlue",e[e.blue=1]="blue",e[e.darkBlue=2]="darkBlue",e[e.teal=3]="teal",e[e.lightGreen=4]="lightGreen",e[e.green=5]="green",e[e.darkGreen=6]="darkGreen",e[e.lightPink=7]="lightPink",e[e.pink=8]="pink",e[e.magenta=9]="magenta",e[e.purple=10]="purple",e[e.black=11]="black",e[e.orange=12]="orange",e[e.red=13]="red",e[e.darkRed=14]="darkRed",e[e.transparent=15]="transparent",e[e.violet=16]="violet",e[e.lightRed=17]="lightRed",e[e.gold=18]="gold",e[e.burgundy=19]="burgundy",e[e.warmGray=20]="warmGray",e[e.coolGray=21]="coolGray",e[e.gray=22]="gray",e[e.cyan=23]="cyan",e[e.rust=24]="rust"}(wr||(wr={})),(Pr=Dr||(Dr={})).size8="20px",Pr.size10="20px",Pr.size16="16px",Pr.size24="24px",Pr.size28="28px",Pr.size32="32px",Pr.size40="40px",Pr.size48="48px",Pr.size56="56px",Pr.size72="72px",Pr.size100="100px",Pr.size120="120px",function(e){e.size6="6px",e.size8="8px",e.size12="12px",e.size16="16px",e.size20="20px",e.size28="28px",e.size32="32px",e.border="2px"}(Tr||(Tr={}));var Ar=function(e){return{isSize8:e===xr.size8,isSize10:e===xr.size10||e===xr.tiny,isSize16:e===xr.size16,isSize24:e===xr.size24||e===xr.extraExtraSmall,isSize28:e===xr.size28||e===xr.extraSmall,isSize32:e===xr.size32,isSize40:e===xr.size40||e===xr.small,isSize48:e===xr.size48||e===xr.regular,isSize56:e===xr.size56,isSize72:e===xr.size72||e===xr.large,isSize100:e===xr.size100||e===xr.extraLarge,isSize120:e===xr.size120}},Lr=((Ir={})[xr.tiny]=10,Ir[xr.extraExtraSmall]=24,Ir[xr.extraSmall]=28,Ir[xr.small]=40,Ir[xr.regular]=48,Ir[xr.large]=72,Ir[xr.extraLarge]=100,Ir[xr.size8]=8,Ir[xr.size10]=10,Ir[xr.size16]=16,Ir[xr.size24]=24,Ir[xr.size28]=28,Ir[xr.size32]=32,Ir[xr.size40]=40,Ir[xr.size48]=48,Ir[xr.size56]=56,Ir[xr.size72]=72,Ir[xr.size100]=100,Ir[xr.size120]=120,Ir),Hr=function(e){return{isAvailable:e===kr.online,isAway:e===kr.away,isBlocked:e===kr.blocked,isBusy:e===kr.busy,isDoNotDisturb:e===kr.dnd,isOffline:e===kr.offline}},Or=Mn({cacheSize:100}),zr=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderIcon=function(e,t){return b.createElement(Fr,{className:e,iconName:Wr(o.props.presence,o.props.isOutOfOffice),style:t})},o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.coinSize,o=e.isOutOfOffice,n=e.styles,r=e.presence,i=e.theme,s=e.presenceTitle,a=e.presenceColors,l=Ar(this.props.size),c=!(l.isSize8||l.isSize10||l.isSize16||l.isSize24||l.isSize28||l.isSize32)&&(!t||t>32),u=t?t/3<40?t/3+"px":"40px":"",d=t?{fontSize:t?t/6<20?t/6+"px":"20px":"",lineHeight:u}:void 0,p=t?{width:u,height:u}:void 0,h=Or(n,{theme:i,presence:r,size:this.props.size,isOutOfOffice:o,presenceColors:a});return r===kr.none?null:b.createElement("div",{role:"presentation",className:h.presence,style:p,title:s},c&&this._onRenderIcon(h.presenceIcon,d))},t}(b.Component);function Wr(e,t){if(e){switch(kr[e]){case"online":return"SkypeCheck";case"away":return t?"SkypeArrow":"SkypeClock";case"dnd":return"SkypeMinus";case"offline":return t?"SkypeArrow":""}return""}}var Vr={presence:"ms-Persona-presence",presenceIcon:"ms-Persona-presenceIcon"};function Kr(e){return{color:e,borderColor:e}}function Ur(e,t){return{selectors:{":before":{border:e+" solid "+t}}}}function Gr(e){return{height:e,width:e}}function jr(e){return{backgroundColor:e}}var Yr=xn(zr,(function(e){var t,o,n,r,i,s,a=e.theme,l=e.presenceColors,c=a.semanticColors,u=a.fonts,d=Oo(Vr,a),p=Ar(e.size),m=Hr(e.presence),g=l&&l.available||"#6BB700",f=l&&l.away||"#FFAA44",v=l&&l.busy||"#C43148",b=l&&l.dnd||"#C50F1F",_=l&&l.offline||"#8A8886",y=l&&l.oof||"#B4009E",C=l&&l.background||c.bodyBackground,S=m.isOffline||e.isOutOfOffice&&(m.isAvailable||m.isBusy||m.isAway||m.isDoNotDisturb),x=p.isSize72||p.isSize100?"2px":"1px";return{presence:[d.presence,h(h({position:"absolute",height:Tr.size12,width:Tr.size12,borderRadius:"50%",top:"auto",right:"-2px",bottom:"-2px",border:"2px solid "+C,textAlign:"center",boxSizing:"content-box",backgroundClip:"content-box"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:(t={},t[jt]={borderColor:"Window",backgroundColor:"WindowText"},t)}),(p.isSize8||p.isSize10)&&{right:"auto",top:"7px",left:0,border:0,selectors:(o={},o[jt]={top:"9px",border:"1px solid WindowText"},o)},(p.isSize8||p.isSize10||p.isSize24||p.isSize28||p.isSize32)&&Gr(Tr.size8),(p.isSize40||p.isSize48)&&Gr(Tr.size12),p.isSize16&&{height:Tr.size6,width:Tr.size6,borderWidth:"1.5px"},p.isSize56&&Gr(Tr.size16),p.isSize72&&Gr(Tr.size20),p.isSize100&&Gr(Tr.size28),p.isSize120&&Gr(Tr.size32),m.isAvailable&&{backgroundColor:g,selectors:(n={},n[jt]=jr("Highlight"),n)},m.isAway&&jr(f),m.isBlocked&&[{selectors:(r={":after":p.isSize40||p.isSize48||p.isSize72||p.isSize100?{content:'""',width:"100%",height:x,backgroundColor:v,transform:"translateY(-50%) rotate(-45deg)",position:"absolute",top:"50%",left:0}:void 0},r[jt]={selectors:{":after":{width:"calc(100% - 4px)",left:"2px",backgroundColor:"Window"}}},r)}],m.isBusy&&jr(v),m.isDoNotDisturb&&jr(b),m.isOffline&&jr(_),(S||m.isBlocked)&&[{backgroundColor:C,selectors:(i={":before":{content:'""',width:"100%",height:"100%",position:"absolute",top:0,left:0,border:x+" solid "+v,borderRadius:"50%",boxSizing:"border-box"}},i[jt]={backgroundColor:"WindowText",selectors:{":before":{width:"calc(100% - 2px)",height:"calc(100% - 2px)",top:"1px",left:"1px",borderColor:"Window"}}},i)}],S&&m.isAvailable&&Ur(x,g),S&&m.isBusy&&Ur(x,v),S&&m.isAway&&Ur(x,y),S&&m.isDoNotDisturb&&Ur(x,b),S&&m.isOffline&&Ur(x,_),S&&m.isOffline&&e.isOutOfOffice&&Ur(x,y)],presenceIcon:[d.presenceIcon,{color:C,fontSize:"6px",lineHeight:Tr.size12,verticalAlign:"top",selectors:(s={},s[jt]={color:"Window"},s)},p.isSize56&&{fontSize:"8px",lineHeight:Tr.size16},p.isSize72&&{fontSize:u.small.fontSize,lineHeight:Tr.size20},p.isSize100&&{fontSize:u.medium.fontSize,lineHeight:Tr.size28},p.isSize120&&{fontSize:u.medium.fontSize,lineHeight:Tr.size32},m.isAway&&{position:"relative",left:S?void 0:"1px"},S&&m.isAvailable&&Kr(g),S&&m.isBusy&&Kr(v),S&&m.isAway&&Kr(y),S&&m.isDoNotDisturb&&Kr(b),S&&m.isOffline&&Kr(_),S&&m.isOffline&&e.isOutOfOffice&&Kr(y)]}}),void 0,{scope:"PersonaPresence"}),qr=[wr.lightBlue,wr.blue,wr.darkBlue,wr.teal,wr.green,wr.darkGreen,wr.lightPink,wr.pink,wr.magenta,wr.purple,wr.orange,wr.lightRed,wr.darkRed,wr.violet,wr.gold,wr.burgundy,wr.warmGray,wr.cyan,wr.rust,wr.coolGray],Zr=qr.length;function Xr(e){var t=e.primaryText,o=e.text,n=e.initialsColor;return"string"==typeof n?n:function(e){switch(e){case wr.lightBlue:return"#4F6BED";case wr.blue:return"#0078D4";case wr.darkBlue:return"#004E8C";case wr.teal:return"#038387";case wr.lightGreen:case wr.green:return"#498205";case wr.darkGreen:return"#0B6A0B";case wr.lightPink:return"#C239B3";case wr.pink:return"#E3008C";case wr.magenta:return"#881798";case wr.purple:return"#5C2E91";case wr.orange:return"#CA5010";case wr.red:return"#EE1111";case wr.lightRed:return"#D13438";case wr.darkRed:return"#A4262C";case wr.transparent:return"transparent";case wr.violet:return"#8764B8";case wr.gold:return"#986F0B";case wr.burgundy:return"#750B1C";case wr.warmGray:return"#7A7574";case wr.cyan:return"#005B70";case wr.rust:return"#8E562E";case wr.coolGray:return"#69797E";case wr.black:return"#1D1D1D";case wr.gray:return"#393939"}}(n=void 0!==n?n:function(e){var t=wr.blue;if(!e)return t;for(var o=0,n=e.length-1;n>=0;n--){var r=e.charCodeAt(n),i=n%8;o^=(r<<i)+(r>>8-i)}return t=qr[o%Zr]}(o||t))}var Qr=Mn({cacheSize:100}),Jr=No((function(e,t,o,n,r,i){return Q(e,!i&&{backgroundColor:Xr({text:n,initialsColor:t,primaryText:r}),color:o})})),$r=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderCoin=function(e){var t=o.props,n=t.coinSize,r=t.styles,i=t.imageUrl,s=t.imageAlt,a=t.imageShouldFadeIn,l=t.imageShouldStartVisible,c=t.theme,u=t.showUnknownPersonaCoin;if(!i)return null;var d=o.props.size,p=Qr(r,{theme:c,size:d,showUnknownPersonaCoin:u}),h=n||Lr[d];return b.createElement(yr,{className:p.image,imageFit:Wn.cover,src:i,width:h,height:h,alt:s,shouldFadeIn:a,shouldStartVisible:l,onLoadingStateChange:o._onPhotoLoadingStateChange})},o._onRenderInitials=function(e){var t=e.imageInitials,n=e.allowPhoneInitials;if(e.showUnknownPersonaCoin)return b.createElement(Fr,{iconName:"Help"});var r=In(o.props.theme);return""!==(t=t||On(o._getText(),r,n))?b.createElement("span",null,t):b.createElement(Fr,{iconName:"Contact"})},o._onPhotoLoadingStateChange=function(e){o.setState({isImageLoaded:e===Kn.loaded,isImageError:e===Kn.error}),o.props.onPhotoLoadingStateChange&&o.props.onPhotoLoadingStateChange(e)},o.state={isImageLoaded:!1,isImageError:!1},o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){e.imageUrl!==this.props.imageUrl&&this.setState({isImageLoaded:!1,isImageError:!1})},t.prototype.render=function(){var e=this.props,t=e.className,o=e.coinProps,n=e.showUnknownPersonaCoin,r=e.coinSize,i=e.styles,s=e.imageUrl,a=e.initialsColor,l=e.initialsTextColor,c=e.isOutOfOffice,u=e.onRenderCoin,d=void 0===u?this._onRenderCoin:u,p=e.onRenderPersonaCoin,m=void 0===p?d:p,g=e.onRenderInitials,f=void 0===g?this._onRenderInitials:g,v=e.presence,_=e.presenceTitle,y=e.presenceColors,C=e.primaryText,S=e.showInitialsUntilImageLoads,x=e.text,k=e.theme,w=this.props.size,I=fr(this.props,gr),D=fr(o||{},gr),P=r?{width:r,height:r}:void 0,T=n,E={coinSize:r,isOutOfOffice:c,presence:v,presenceTitle:_,presenceColors:y,size:w,theme:k},M=Qr(i,{theme:k,className:o&&o.className?o.className:t,size:w,coinSize:r,showUnknownPersonaCoin:n}),R=Boolean(!this.state.isImageLoaded&&(S&&s||!s||this.state.isImageError||T));return b.createElement("div",h({role:"presentation"},I,{className:M.coin}),w!==xr.size8&&w!==xr.size10&&w!==xr.tiny?b.createElement("div",h({role:"presentation"},D,{className:M.imageArea,style:P}),R&&b.createElement("div",{className:Jr(M.initials,a,l,x,C,n),style:P,"aria-hidden":"true"},f(this.props,this._onRenderInitials)),!T&&m(this.props,this._onRenderCoin),b.createElement(Yr,h({},E))):this.props.presence?b.createElement(Yr,h({},E)):b.createElement(Fr,{iconName:"Contact",className:M.size10WithoutPresenceIcon}),this.props.children)},t.prototype._getText=function(){return this.props.text||this.props.primaryText||""},t.defaultProps={size:xr.size48,presence:kr.none,imageAlt:""},t}(b.Component),ei={coin:"ms-Persona-coin",imageArea:"ms-Persona-imageArea",image:"ms-Persona-image",initials:"ms-Persona-initials",size8:"ms-Persona--size8",size10:"ms-Persona--size10",size16:"ms-Persona--size16",size24:"ms-Persona--size24",size28:"ms-Persona--size28",size32:"ms-Persona--size32",size40:"ms-Persona--size40",size48:"ms-Persona--size48",size56:"ms-Persona--size56",size72:"ms-Persona--size72",size100:"ms-Persona--size100",size120:"ms-Persona--size120"},ti=xn($r,(function(e){var t,o=e.className,n=e.theme,r=e.coinSize,i=n.palette,s=n.fonts,a=Ar(e.size),l=Oo(ei,n),c=r||e.size&&Lr[e.size]||48;return{coin:[l.coin,s.medium,a.isSize8&&l.size8,a.isSize10&&l.size10,a.isSize16&&l.size16,a.isSize24&&l.size24,a.isSize28&&l.size28,a.isSize32&&l.size32,a.isSize40&&l.size40,a.isSize48&&l.size48,a.isSize56&&l.size56,a.isSize72&&l.size72,a.isSize100&&l.size100,a.isSize120&&l.size120,o],size10WithoutPresenceIcon:{fontSize:s.xSmall.fontSize,position:"absolute",top:"5px",right:"auto",left:0},imageArea:[l.imageArea,{position:"relative",textAlign:"center",flex:"0 0 auto",height:c,width:c},c<=10&&{overflow:"visible",background:"transparent",height:0,width:0}],image:[l.image,{marginRight:"10px",position:"absolute",top:0,left:0,width:"100%",height:"100%",border:0,borderRadius:"50%",perspective:"1px"},c<=10&&{overflow:"visible",background:"transparent",height:0,width:0},c>10&&{height:c,width:c}],initials:[l.initials,{borderRadius:"50%",color:e.showUnknownPersonaCoin?"rgb(168, 0, 0)":i.white,fontSize:s.large.fontSize,fontWeight:Ge.semibold,lineHeight:48===c?46:c,height:c,selectors:(t={},t[jt]=h(h({border:"1px solid WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{color:"WindowText",boxSizing:"border-box",backgroundColor:"Window !important"}),t.i={fontWeight:Ge.semibold},t)},e.showUnknownPersonaCoin&&{backgroundColor:"rgb(234, 234, 234)"},c<32&&{fontSize:s.xSmall.fontSize},c>=32&&c<40&&{fontSize:s.medium.fontSize},c>=40&&c<56&&{fontSize:s.mediumPlus.fontSize},c>=56&&c<72&&{fontSize:s.xLarge.fontSize},c>=72&&c<100&&{fontSize:s.xxLarge.fontSize},c>=100&&{fontSize:s.superLarge.fontSize}]}}),void 0,{scope:"PersonaCoin"}),oi=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderIcon=function(e){return e.activityPersonas?o._onRenderPersonaArray(e):o.props.activityIcon},o._onRenderActivityDescription=function(e){var t=o._getClassNames(e),n=e.activityDescription||e.activityDescriptionText;return n?b.createElement("span",{className:t.activityText},n):null},o._onRenderComments=function(e){var t=o._getClassNames(e),n=e.comments||e.commentText;return!e.isCompact&&n?b.createElement("div",{className:t.commentText},n):null},o._onRenderTimeStamp=function(e){var t=o._getClassNames(e);return!e.isCompact&&e.timeStamp?b.createElement("div",{className:t.timeStamp},e.timeStamp):null},o._onRenderPersonaArray=function(e){var t=o._getClassNames(e),n=null,r=e.activityPersonas;if(r[0].imageUrl||r[0].imageInitials){var i=[],s=r.length>1||e.isCompact,a=e.isCompact?3:4,l=void 0;e.isCompact&&(l={display:"inline-block",width:"10px",minWidth:"10px",overflow:"visible"}),r.filter((function(e,t){return t<a})).forEach((function(e,o){i.push(b.createElement(ti,h({},e,{key:e.key||o,className:t.activityPersona,size:s?xr.size16:xr.size32,style:l})))})),n=b.createElement("div",{className:t.personaContainer},i)}return n},o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.onRenderIcon,o=void 0===t?this._onRenderIcon:t,n=e.onRenderActivityDescription,r=void 0===n?this._onRenderActivityDescription:n,i=e.onRenderComments,s=void 0===i?this._onRenderComments:i,a=e.onRenderTimeStamp,l=void 0===a?this._onRenderTimeStamp:a,c=e.animateBeaconSignal,u=e.isCompact,d=this._getClassNames(this.props);return b.createElement("div",{className:d.root,style:this.props.style},(this.props.activityPersonas||this.props.activityIcon||this.props.onRenderIcon)&&b.createElement("div",{className:d.activityTypeIcon},c&&u&&b.createElement("div",{className:d.pulsingBeacon}),o(this.props)),b.createElement("div",{className:d.activityContent},r(this.props,this._onRenderActivityDescription),s(this.props,this._onRenderComments),l(this.props,this._onRenderTimeStamp)))},t.prototype._getClassNames=function(e){return fn(_n(void 0,e.styles,e.animateBeaconSignal,e.beaconColorOne,e.beaconColorTwo,e.isCompact),e.className,e.activityPersonas,e.isCompact)},t}(b.Component),ni=function(){var e,t,o=rt();return!!(null===(t=null===(e=o)||void 0===e?void 0:e.navigator)||void 0===t?void 0:t.userAgent)&&o.navigator.userAgent.indexOf("rv:11.0")>-1};function ri(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return t.length<2?t[0]:function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];t.forEach((function(t){return t&&t.apply(e,o)}))}}function ii(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=ri(e,e[o],t[o]))}function si(e){ii(e,{componentDidMount:ai,componentDidUpdate:li,componentWillUnmount:ci})}function ai(){ui(this.props.componentRef,this)}function li(e){e.componentRef!==this.props.componentRef&&(ui(e.componentRef,null),ui(this.props.componentRef,this))}function ci(){ui(this.props.componentRef,null)}function ui(e,t){e&&("object"==typeof e?e.current=t:"function"==typeof e&&e(t))}var di=function(){function e(e,t){this._timeoutIds=null,this._immediateIds=null,this._intervalIds=null,this._animationFrameIds=null,this._isDisposed=!1,this._parent=e||null,this._onErrorHandler=t,this._noop=function(){}}return e.prototype.dispose=function(){var e;if(this._isDisposed=!0,this._parent=null,this._timeoutIds){for(e in this._timeoutIds)this._timeoutIds.hasOwnProperty(e)&&this.clearTimeout(parseInt(e,10));this._timeoutIds=null}if(this._immediateIds){for(e in this._immediateIds)this._immediateIds.hasOwnProperty(e)&&this.clearImmediate(parseInt(e,10));this._immediateIds=null}if(this._intervalIds){for(e in this._intervalIds)this._intervalIds.hasOwnProperty(e)&&this.clearInterval(parseInt(e,10));this._intervalIds=null}if(this._animationFrameIds){for(e in this._animationFrameIds)this._animationFrameIds.hasOwnProperty(e)&&this.cancelAnimationFrame(parseInt(e,10));this._animationFrameIds=null}},e.prototype.setTimeout=function(e,t){var o=this,n=0;return this._isDisposed||(this._timeoutIds||(this._timeoutIds={}),n=setTimeout((function(){try{o._timeoutIds&&delete o._timeoutIds[n],e.apply(o._parent)}catch(e){o._onErrorHandler&&o._onErrorHandler(e)}}),t),this._timeoutIds[n]=!0),n},e.prototype.clearTimeout=function(e){this._timeoutIds&&this._timeoutIds[e]&&(clearTimeout(e),delete this._timeoutIds[e])},e.prototype.setImmediate=function(e,t){var o=this,n=0,r=rt(t);if(!this._isDisposed){this._immediateIds||(this._immediateIds={});n=r.setTimeout((function(){try{o._immediateIds&&delete o._immediateIds[n],e.apply(o._parent)}catch(e){o._logError(e)}}),0),this._immediateIds[n]=!0}return n},e.prototype.clearImmediate=function(e,t){var o=rt(t);this._immediateIds&&this._immediateIds[e]&&(o.clearTimeout(e),delete this._immediateIds[e])},e.prototype.setInterval=function(e,t){var o=this,n=0;return this._isDisposed||(this._intervalIds||(this._intervalIds={}),n=setInterval((function(){try{e.apply(o._parent)}catch(e){o._logError(e)}}),t),this._intervalIds[n]=!0),n},e.prototype.clearInterval=function(e){this._intervalIds&&this._intervalIds[e]&&(clearInterval(e),delete this._intervalIds[e])},e.prototype.throttle=function(e,t,o){var n=this;if(this._isDisposed)return this._noop;var r,i,s=t||0,a=!0,l=!0,c=0,u=null;o&&"boolean"==typeof o.leading&&(a=o.leading),o&&"boolean"==typeof o.trailing&&(l=o.trailing);var d=function(t){var o=Date.now(),p=o-c,h=a?s-p:s;return p>=s&&(!t||a)?(c=o,u&&(n.clearTimeout(u),u=null),r=e.apply(n._parent,i)):null===u&&l&&(u=n.setTimeout(d,h)),r};return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i=e,d(!0)}},e.prototype.debounce=function(e,t,o){var n=this;if(this._isDisposed){var r=function(){};return r.cancel=function(){},r.flush=function(){return null},r.pending=function(){return!1},r}var i,s,a=t||0,l=!1,c=!0,u=null,d=0,p=Date.now(),h=null;o&&"boolean"==typeof o.leading&&(l=o.leading),o&&"boolean"==typeof o.trailing&&(c=o.trailing),o&&"number"==typeof o.maxWait&&!isNaN(o.maxWait)&&(u=o.maxWait);var m=function(e){h&&(n.clearTimeout(h),h=null),p=e},g=function(t){m(t),i=e.apply(n._parent,s)},f=function(e){var t=Date.now(),o=!1;e&&(l&&t-d>=a&&(o=!0),d=t);var r=t-d,s=a-r,m=t-p,v=!1;return null!==u&&(m>=u&&h?v=!0:s=Math.min(s,u-m)),r>=a||v||o?g(t):null!==h&&e||!c||(h=n.setTimeout(f,s)),i},v=function(){return!!h},b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s=e,f(!0)};return b.cancel=function(){v()&&m(Date.now())},b.flush=function(){return v()&&g(Date.now()),i},b.pending=v,b},e.prototype.requestAnimationFrame=function(e,t){var o=this,n=0,r=rt(t);if(!this._isDisposed){this._animationFrameIds||(this._animationFrameIds={});var i=function(){try{o._animationFrameIds&&delete o._animationFrameIds[n],e.apply(o._parent)}catch(e){o._logError(e)}};n=r.requestAnimationFrame?r.requestAnimationFrame(i):r.setTimeout(i,0),this._animationFrameIds[n]=!0}return n},e.prototype.cancelAnimationFrame=function(e,t){var o=rt(t);this._animationFrameIds&&this._animationFrameIds[e]&&(o.cancelAnimationFrame?o.cancelAnimationFrame(e):o.clearTimeout(e),delete this._animationFrameIds[e])},e.prototype._logError=function(e){this._onErrorHandler&&this._onErrorHandler(e)},e}(),pi=function(e){function t(t){var o=e.call(this,t)||this;return o._inputElement=b.createRef(),o._autoFillEnabled=!0,o._isComposing=!1,o._onCompositionStart=function(e){o._isComposing=!0,o._autoFillEnabled=!1},o._onCompositionUpdate=function(){ni()&&o._updateValue(o._getCurrentInputValue(),!0)},o._onCompositionEnd=function(e){var t=o._getCurrentInputValue();o._tryEnableAutofill(t,o.value,!1,!0),o._isComposing=!1,o._async.setTimeout((function(){o._updateValue(o._getCurrentInputValue(),!1)}),0)},o._onClick=function(){o._value&&""!==o._value&&o._autoFillEnabled&&(o._autoFillEnabled=!1)},o._onKeyDown=function(e){if(o.props.onKeyDown&&o.props.onKeyDown(e),!e.nativeEvent.isComposing)switch(e.which){case wn.backspace:o._autoFillEnabled=!1;break;case wn.left:case wn.right:o._autoFillEnabled&&(o._value=o.state.displayValue,o._autoFillEnabled=!1);break;default:o._autoFillEnabled||-1!==o.props.enableAutofillOnKeyPress.indexOf(e.which)&&(o._autoFillEnabled=!0)}},o._onInputChanged=function(e){var t=o._getCurrentInputValue(e);if(o._isComposing||o._tryEnableAutofill(t,o._value,e.nativeEvent.isComposing),!ni()||!o._isComposing){var n=e.nativeEvent.isComposing,r=void 0===n?o._isComposing:n;o._updateValue(t,r)}},o._onChanged=function(){},o._updateValue=function(e,t){(e||e!==o._value)&&(o._value=o.props.onInputChange?o.props.onInputChange(e,t):e,o.setState({displayValue:o._getDisplayValue(o._value,o.props.suggestedDisplayValue)},(function(){return o._notifyInputChange(o._value,t)})))},si(o),o._async=new di(o),o._value=t.defaultVisibleValue||"",o.state={displayValue:t.defaultVisibleValue||""},o}return p(t,e),Object.defineProperty(t.prototype,"cursorLocation",{get:function(){if(this._inputElement.current){var e=this._inputElement.current;return"forward"!==e.selectionDirection?e.selectionEnd:e.selectionStart}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValueSelected",{get:function(){return Boolean(this.inputElement&&this.inputElement.selectionStart!==this.inputElement.selectionEnd)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._inputElement.current?this._inputElement.current.selectionStart:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._inputElement.current?this._inputElement.current.selectionEnd:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputElement",{get:function(){return this._inputElement.current},enumerable:!0,configurable:!0}),t.prototype.UNSAFE_componentWillReceiveProps=function(e){if(this.props.updateValueInWillReceiveProps){var t=this.props.updateValueInWillReceiveProps();null!==t&&t!==this._value&&(this._value=t)}var o=this._getDisplayValue(this._value,e.suggestedDisplayValue);"string"==typeof o&&this.setState({displayValue:o})},t.prototype.componentDidUpdate=function(){var e=this._value,t=this.props,o=t.suggestedDisplayValue,n=t.shouldSelectFullInputValueInComponentDidUpdate,r=0;if(!t.preventValueSelection&&this._autoFillEnabled&&e&&o&&this._doesTextStartWith(o,e)){var i=!1;if(n&&(i=n()),i&&this._inputElement.current)this._inputElement.current.setSelectionRange(0,o.length,"backward");else{for(;r<e.length&&e[r].toLocaleLowerCase()===o[r].toLocaleLowerCase();)r++;r>0&&this._inputElement.current&&this._inputElement.current.setSelectionRange(r,o.length,"backward")}}},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.render=function(){var e=this.state.displayValue,t=fr(this.props,tr);return b.createElement("input",h({autoCapitalize:"off",autoComplete:"off","aria-autocomplete":"both"},t,{ref:this._inputElement,value:e,onCompositionStart:this._onCompositionStart,onCompositionUpdate:this._onCompositionUpdate,onCompositionEnd:this._onCompositionEnd,onChange:this._onChanged,onInput:this._onInputChanged,onKeyDown:this._onKeyDown,onClick:this.props.onClick?this.props.onClick:this._onClick,"data-lpignore":!0}))},t.prototype.focus=function(){this._inputElement.current&&this._inputElement.current.focus()},t.prototype.clear=function(){this._autoFillEnabled=!0,this._updateValue("",!1),this._inputElement.current&&this._inputElement.current.setSelectionRange(0,0)},t.prototype._getCurrentInputValue=function(e){return e&&e.target&&e.target.value?e.target.value:this.inputElement&&this.inputElement.value?this.inputElement.value:""},t.prototype._tryEnableAutofill=function(e,t,o,n){!o&&e&&this._inputElement.current&&this._inputElement.current.selectionStart===e.length&&!this._autoFillEnabled&&(e.length>t.length||n)&&(this._autoFillEnabled=!0)},t.prototype._notifyInputChange=function(e,t){this.props.onInputValueChange&&this.props.onInputValueChange(e,t)},t.prototype._getDisplayValue=function(e,t){var o=e;return t&&e&&this._doesTextStartWith(t,o)&&this._autoFillEnabled&&(o=t),o},t.prototype._doesTextStartWith=function(e,t){return!(!e||!t)&&0===e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())},t.defaultProps={enableAutofillOnKeyPress:[wn.down,wn.up]},t}(b.Component),hi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(pi),mi=function(e){function t(t){var o=e.call(this,t)||this;return o.state={isRendered:!1},o}return p(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.delay;this._timeoutId=window.setTimeout((function(){e.setState({isRendered:!0})}),t)},t.prototype.componentWillUnmount=function(){this._timeoutId&&clearTimeout(this._timeoutId)},t.prototype.render=function(){return this.state.isRendered?b.Children.only(this.props.children):null},t.defaultProps={delay:0},t}(b.Component),gi=Mn(),fi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.message,o=e.styles,n=e.as,r=void 0===n?"div":n,i=e.className,s=gi(o,{className:i});return b.createElement(r,h({role:"status",className:s.root},fr(this.props,gr,["className"])),b.createElement(mi,null,b.createElement("div",{className:s.screenReaderText},t)))},t.defaultProps={"aria-live":"polite"},t}(b.Component),vi=xn(fi,(function(e){return{root:e.className,screenReaderText:yo}}));function bi(e,t,o){void 0===o&&(o=0);for(var n=-1,r=o;e&&r<e.length;r++)if(t(e[r],r)){n=r;break}return n}function _i(e,t){var o=bi(e,t);if(!(o<0))return e[o]}function yi(e,t){for(var o=[],n=0;n<e;n++)o.push(t(n));return o}function Ci(e,t){return e.reduce((function(e,o,n){return n%t==0?e.push([o]):e[e.length-1].push(o),e}),[])}function Si(e,t){return e.filter((function(e,o){return t!==o}))}function xi(e,t,o){var n=e.slice();return n[o]=t,n}function ki(e,t,o){var n=e.slice();return n.splice(t,0,o),n}function wi(e){var t=[];return e.forEach((function(e){return t=t.concat(e)})),t}function Ii(e,t){if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var Di=function(e){return function(t){for(var o=0,n=e.refs;o<n.length;o++){var r=n[o];"function"==typeof r?r(t):r&&(r.current=t)}}},Pi=function(e){var t={refs:[]};return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return t.resolver&&Ii(t.refs,e)||(t.resolver=Di(t)),t.refs=e,t.resolver}};function Ti(e){return e&&!!e._virtual}function Ei(e){var t;return e&&Ti(e)&&(t=e._virtual.parent),t}function Mi(e,t){return void 0===t&&(t=!0),e&&(t&&Ei(e)||e.parentNode&&e.parentNode)}function Ri(e,t){return e&&e!==document.body?t(e)?e:Ri(Mi(e),t):null}function Bi(e,t){var o=Ri(e,(function(e){return e.hasAttribute(t)}));return o&&o.getAttribute(t)}function Ni(e,t,o){void 0===o&&(o=!0);var n=!1;if(e&&t)if(o)if(e===t)n=!0;else for(n=!1;t;){var r=Mi(t);if(r===e){n=!0;break}t=r}else e.contains&&(n=e.contains(t));return n}function Fi(e,t,o){return Wi(e,t,!0,!1,!1,o)}function Ai(e,t,o){return zi(e,t,!0,!1,!0,o)}function Li(e,t,o,n){return void 0===n&&(n=!0),Wi(e,t,n,!1,!1,o,!1,!0)}function Hi(e,t,o,n){return void 0===n&&(n=!0),zi(e,t,n,!1,!0,o,!1,!0)}function Oi(e){var t=Wi(e,e,!0,!1,!1,!0);return!!t&&(Zi(t),!0)}function zi(e,t,o,n,r,i,s,a){if(!t||!s&&t===e)return null;var l=Vi(t);if(r&&l&&(i||!Ui(t)&&!Gi(t))){var c=zi(e,t.lastElementChild,!0,!0,!0,i,s,a);if(c){if(a&&Ki(c,!0)||!a)return c;var u=zi(e,c.previousElementSibling,!0,!0,!0,i,s,a);if(u)return u;for(var d=c.parentElement;d&&d!==t;){var p=zi(e,d.previousElementSibling,!0,!0,!0,i,s,a);if(p)return p;d=d.parentElement}}}if(o&&l&&Ki(t,a))return t;var h=zi(e,t.previousElementSibling,!0,!0,!0,i,s,a);return h||(n?null:zi(e,t.parentElement,!0,!1,!1,i,s,a))}function Wi(e,t,o,n,r,i,s,a){if(!t||t===e&&r&&!s)return null;var l=Vi(t);if(o&&l&&Ki(t,a))return t;if(!r&&l&&(i||!Ui(t)&&!Gi(t))){var c=Wi(e,t.firstElementChild,!0,!0,!1,i,s,a);if(c)return c}if(t===e)return null;var u=Wi(e,t.nextElementSibling,!0,!0,!1,i,s,a);return u||(n?null:Wi(e,t.parentElement,!1,!1,!0,i,s,a))}function Vi(e){if(!e||!e.getAttribute)return!1;var t=e.getAttribute("data-is-visible");return null!=t?"true"===t:0!==e.offsetHeight||null!==e.offsetParent||!0===e.isVisible}function Ki(e,t){if(!e||e.disabled)return!1;var o=0,n=null;e&&e.getAttribute&&(n=e.getAttribute("tabIndex"))&&(o=parseInt(n,10));var r=e.getAttribute?e.getAttribute("data-is-focusable"):null,i=null!==n&&o>=0,s=!!e&&"false"!==r&&("A"===e.tagName||"BUTTON"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||"true"===r||i);return t?-1!==o&&s:s}function Ui(e){return!!(e&&e.getAttribute&&e.getAttribute("data-focuszone-id"))}function Gi(e){return!(!e||!e.getAttribute||"true"!==e.getAttribute("data-is-sub-focuszone"))}function ji(e){var t=tt(e),o=t&&t.activeElement;return!(!o||!Ni(e,o))}function Yi(e,t){return"true"!==Bi(e,t)}var qi=void 0;function Zi(e){if(e){if(qi)return void(qi=e);qi=e;var t=rt(e);t&&t.requestAnimationFrame((function(){var e=qi;qi=void 0,e&&(e.getAttribute&&"true"===e.getAttribute("data-is-focusable")&&(e.getAttribute("tabindex")||e.setAttribute("tabindex","0")),e.focus())}))}}function Xi(e,t){for(var o=e,n=0,r=t;n<r.length;n++){var i=r[n],s=o.children[Math.min(i,o.children.length-1)];if(!s)break;o=s}return o=Ki(o)&&Vi(o)?o:Wi(e,o,!0)||zi(e,o)}function Qi(e,t){for(var o=[];t&&e&&t!==e;){var n=Mi(t,!0);if(null===n)return[];o.unshift(Array.prototype.indexOf.call(n.children,t)),t=n}return o}var Ji=rt()||{};void 0===Ji.__currentId__&&(Ji.__currentId__=0);var $i,es=!1;function ts(e){if(!es){var t=x.getInstance();t&&t.onReset&&t.onReset(os),es=!0}return(void 0===e?"id__":e)+Ji.__currentId__++}function os(e){void 0===e&&(e=0),Ji.__currentId__=e}function ns(e){var t=function(e){var t;"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0);return t}("MouseEvents");t.initEvent("click",!0,!0),e.dispatchEvent(t)}var rs=0,is=Q({overflow:"hidden !important"}),ss="data-is-scrollable",as=function(e,t){if(e){var o=0,n=null;t.on(e,"touchstart",(function(e){1===e.targetTouches.length&&(o=e.targetTouches[0].clientY)}),{passive:!1}),t.on(e,"touchmove",(function(e){if(1===e.targetTouches.length&&(e.stopPropagation(),n)){var t=e.targetTouches[0].clientY-o,r=hs(e.target);r&&(n=r),0===n.scrollTop&&t>0&&e.preventDefault(),n.scrollHeight-Math.ceil(n.scrollTop)<=n.clientHeight&&t<0&&e.preventDefault()}}),{passive:!1}),n=e}},ls=function(e,t){if(e){t.on(e,"touchmove",(function(e){e.stopPropagation()}),{passive:!1})}},cs=function(e){e.preventDefault()};function us(){var e=tt();e&&e.body&&!rs&&(e.body.classList.add(is),e.body.addEventListener("touchmove",cs,{passive:!1,capture:!1})),rs++}function ds(){if(rs>0){var e=tt();e&&e.body&&1===rs&&(e.body.classList.remove(is),e.body.removeEventListener("touchmove",cs)),rs--}}function ps(){if(void 0===$i){var e=document.createElement("div");e.style.setProperty("width","100px"),e.style.setProperty("height","100px"),e.style.setProperty("overflow","scroll"),e.style.setProperty("position","absolute"),e.style.setProperty("top","-9999px"),document.body.appendChild(e),$i=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return $i}function hs(e){for(var t=e,o=tt(e);t&&t!==o.body;){if("true"===t.getAttribute(ss))return t;t=t.parentElement}for(t=e;t&&t!==o.body;){if("false"!==t.getAttribute(ss)){var n=getComputedStyle(t),r=n?n.getPropertyValue("overflow-y"):"";if(r&&("scroll"===r||"auto"===r))return t}t=t.parentElement}return t&&t!==o.body||(t=rt(e)),t}var ms="data-portal-element";function gs(e){e.setAttribute(ms,"true")}function fs(e,t){var o=Ri(e,(function(e){return t===e||e.hasAttribute(ms)}));return null!==o&&o.hasAttribute(ms)}var vs,bs={none:0,all:1,inputOnly:2};!function(e){e[e.vertical=0]="vertical",e[e.horizontal=1]="horizontal",e[e.bidirectional=2]="bidirectional",e[e.domOrder=3]="domOrder"}(vs||(vs={}));var _s;var ys,Cs={},Ss=new Set,xs=["text","number","password","email","tel","url","search"],ks=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._mergedRef=Pi(),o._onFocus=function(e){if(!o._portalContainsElement(e.target)){var t,n=o.props,r=n.onActiveElementChanged,i=n.doNotAllowFocusEventToPropagate,s=n.stopFocusPropagation,a=n.onFocusNotification,l=n.onFocus,c=n.shouldFocusInnerElementWhenReceivedFocus,u=n.defaultTabbableElement,d=o._isImmediateDescendantOfZone(e.target);if(d)t=e.target;else for(var p=e.target;p&&p!==o._root.current;){if(Ki(p)&&o._isImmediateDescendantOfZone(p)){t=p;break}p=Mi(p,!1)}if(c&&e.target===o._root.current){var h=u&&"function"==typeof u&&u(o._root.current);h&&Ki(h)?(t=h,h.focus()):(o.focus(!0),o._activeElement&&(t=null))}var m=!o._activeElement;t&&t!==o._activeElement&&((d||m)&&o._setFocusAlignment(t,!0,!0),o._activeElement=t,m&&o._updateTabIndexes()),r&&r(o._activeElement,e),(s||i)&&e.stopPropagation(),l?l(e):a&&a()}},o._onBlur=function(){o._setParkedFocus(!1)},o._onMouseDown=function(e){if(!o._portalContainsElement(e.target)&&!o.props.disabled){for(var t=e.target,n=[];t&&t!==o._root.current;)n.push(t),t=Mi(t,!1);for(;n.length&&((t=n.pop())&&Ki(t)&&o._setActiveElement(t,!0),!Ui(t)););}},o._onKeyDown=function(e,t){if(!o._portalContainsElement(e.target)){var n=o.props,r=n.direction,i=n.disabled,s=n.isInnerZoneKeystroke,a=n.pagingSupportDisabled,l=n.shouldEnterInnerZone;if(!(i||(o.props.onKeyDown&&o.props.onKeyDown(e),e.isDefaultPrevented()||o._getDocument().activeElement===o._root.current&&o._isInnerZone))){if((l&&l(e)||s&&s(e))&&o._isImmediateDescendantOfZone(e.target)){var c=o._getFirstInnerZone();if(c){if(!c.focus(!0))return}else{if(!Gi(e.target))return;if(!o.focusElement(Wi(e.target,e.target.firstChild,!0)))return}}else{if(e.altKey)return;switch(e.which){case wn.space:if(o._tryInvokeClickForFocusable(e.target))break;return;case wn.left:if(r!==vs.vertical&&(o._preventDefaultWhenHandled(e),o._moveFocusLeft(t)))break;return;case wn.right:if(r!==vs.vertical&&(o._preventDefaultWhenHandled(e),o._moveFocusRight(t)))break;return;case wn.up:if(r!==vs.horizontal&&(o._preventDefaultWhenHandled(e),o._moveFocusUp()))break;return;case wn.down:if(r!==vs.horizontal&&(o._preventDefaultWhenHandled(e),o._moveFocusDown()))break;return;case wn.pageDown:if(!a&&o._moveFocusPaging(!0))break;return;case wn.pageUp:if(!a&&o._moveFocusPaging(!1))break;return;case wn.tab:if(o.props.allowTabKey||o.props.handleTabKey===bs.all||o.props.handleTabKey===bs.inputOnly&&o._isElementInput(e.target)){var u=!1;if(o._processingTabKey=!0,r!==vs.vertical&&o._shouldWrapFocus(o._activeElement,"data-no-horizontal-wrap"))u=(In(t)?!e.shiftKey:e.shiftKey)?o._moveFocusLeft(t):o._moveFocusRight(t);else u=e.shiftKey?o._moveFocusUp():o._moveFocusDown();if(o._processingTabKey=!1,u)break;o.props.shouldResetActiveElementWhenTabFromZone&&(o._activeElement=null)}return;case wn.home:if(o._isContentEditableElement(e.target)||o._isElementInput(e.target)&&!o._shouldInputLoseFocus(e.target,!1))return!1;var d=o._root.current&&o._root.current.firstChild;if(o._root.current&&d&&o.focusElement(Wi(o._root.current,d,!0)))break;return;case wn.end:if(o._isContentEditableElement(e.target)||o._isElementInput(e.target)&&!o._shouldInputLoseFocus(e.target,!0))return!1;var p=o._root.current&&o._root.current.lastChild;if(o._root.current&&o.focusElement(zi(o._root.current,p,!0,!0,!0)))break;return;case wn.enter:if(o._tryInvokeClickForFocusable(e.target))break;return;default:return}}e.preventDefault(),e.stopPropagation()}}},o._getHorizontalDistanceFromCenter=function(e,t,n){var r=o._focusAlignment.left||o._focusAlignment.x||0,i=Math.floor(n.top),s=Math.floor(t.bottom),a=Math.floor(n.bottom),l=Math.floor(t.top);return e&&i>s||!e&&a<l?r>=n.left&&r<=n.left+n.width?0:Math.abs(n.left+n.width/2-r):o._shouldWrapFocus(o._activeElement,"data-no-vertical-wrap")?999999999:-999999999},si(o),o._id=ts("FocusZone"),o._focusAlignment={left:0,top:0},o._processingTabKey=!1,o}return p(t,e),t.getOuterZones=function(){return Ss.size},t._onKeyDownCapture=function(e){e.which===wn.tab&&Ss.forEach((function(e){return e._updateTabIndexes()}))},t.prototype.componentDidMount=function(){var e=this._root.current;if(Cs[this._id]=this,e){this._windowElement=rt(e);for(var o=Mi(e,!1);o&&o!==this._getDocument().body&&1===o.nodeType;){if(Ui(o)){this._isInnerZone=!0;break}o=Mi(o,!1)}this._isInnerZone||(Ss.add(this),this._windowElement&&1===Ss.size&&this._windowElement.addEventListener("keydown",t._onKeyDownCapture,!0)),this._root.current&&this._root.current.addEventListener("blur",this._onBlur,!0),this._updateTabIndexes(),this.props.defaultTabbableElement&&"string"==typeof this.props.defaultTabbableElement?this._activeElement=this._getDocument().querySelector(this.props.defaultTabbableElement):this.props.defaultActiveElement&&(this._activeElement=this._getDocument().querySelector(this.props.defaultActiveElement)),this.props.shouldFocusOnMount&&this.focus()}},t.prototype.componentDidUpdate=function(){var e=this._root.current,t=this._getDocument();if(t&&this._lastIndexPath&&(t.activeElement===t.body||null===t.activeElement||!this.props.preventFocusRestoration&&t.activeElement===e)){var o=Xi(e,this._lastIndexPath);o?(this._setActiveElement(o,!0),o.focus(),this._setParkedFocus(!1)):this._setParkedFocus(!0)}},t.prototype.componentWillUnmount=function(){delete Cs[this._id],this._isInnerZone||(Ss.delete(this),this._windowElement&&0===Ss.size&&this._windowElement.removeEventListener("keydown",t._onKeyDownCapture,!0)),this._root.current&&this._root.current.removeEventListener("blur",this._onBlur,!0),this._activeElement=null,this._defaultFocusElement=null},t.prototype.render=function(){var e=this,t=this.props,o=t.as,n=t.elementType,r=t.rootProps,i=t.ariaDescribedBy,s=t.ariaLabelledBy,a=t.className,l=fr(this.props,Yn),c=o||n||"div";this._evaluateFocusBeforeRender();var u=Ot();return b.createElement(c,h({"aria-labelledby":s,"aria-describedby":i},l,r,{className:Sr((_s||(_s=Q({selectors:{":focus":{outline:"none"}}},"ms-FocusZone")),_s),a),ref:this._mergedRef(this.props.elementRef,this._root),"data-focuszone-id":this._id,onKeyDown:function(t){return e._onKeyDown(t,u)},onFocus:this._onFocus,onMouseDownCapture:this._onMouseDown}),this.props.children)},t.prototype.focus=function(e){if(void 0===e&&(e=!1),this._root.current){if(!e&&"true"===this._root.current.getAttribute("data-is-focusable")&&this._isInnerZone){var t=this._getOwnerZone(this._root.current);if(t!==this._root.current){var o=Cs[t.getAttribute("data-focuszone-id")];return!!o&&o.focusElement(this._root.current)}return!1}if(!e&&this._activeElement&&Ni(this._root.current,this._activeElement)&&Ki(this._activeElement))return this._activeElement.focus(),!0;var n=this._root.current.firstChild;return this.focusElement(Wi(this._root.current,n,!0))}return!1},t.prototype.focusLast=function(){if(this._root.current){var e=this._root.current&&this._root.current.lastChild;return this.focusElement(zi(this._root.current,e,!0,!0,!0))}return!1},t.prototype.focusElement=function(e,t){var o=this.props,n=o.onBeforeFocus,r=o.shouldReceiveFocus;return!(r&&!r(e)||n&&!n(e))&&(!!e&&(this._setActiveElement(e,t),this._activeElement&&this._activeElement.focus(),!0))},t.prototype.setFocusAlignment=function(e){this._focusAlignment=e},t.prototype._evaluateFocusBeforeRender=function(){var e=this._root.current,t=this._getDocument();if(t){var o=t.activeElement;if(o!==e){var n=Ni(e,o,!1);this._lastIndexPath=n?Qi(e,o):void 0}}},t.prototype._setParkedFocus=function(e){var t=this._root.current;t&&this._isParked!==e&&(this._isParked=e,e?(this.props.allowFocusRoot||(this._parkedTabIndex=t.getAttribute("tabindex"),t.setAttribute("tabindex","-1")),t.focus()):this.props.allowFocusRoot||(this._parkedTabIndex?(t.setAttribute("tabindex",this._parkedTabIndex),this._parkedTabIndex=void 0):t.removeAttribute("tabindex")))},t.prototype._setActiveElement=function(e,t){var o=this._activeElement;this._activeElement=e,o&&(Ui(o)&&this._updateTabIndexes(o),o.tabIndex=-1),this._activeElement&&(this._focusAlignment&&!t||this._setFocusAlignment(e,!0,!0),this._activeElement.tabIndex=0)},t.prototype._preventDefaultWhenHandled=function(e){this.props.preventDefaultWhenHandled&&e.preventDefault()},t.prototype._tryInvokeClickForFocusable=function(e){if(e===this._root.current||!this.props.shouldRaiseClicks)return!1;do{if("BUTTON"===e.tagName||"A"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName)return!1;if(this._isImmediateDescendantOfZone(e)&&"true"===e.getAttribute("data-is-focusable")&&"true"!==e.getAttribute("data-disable-click-on-enter"))return ns(e),!0;e=Mi(e,!1)}while(e!==this._root.current);return!1},t.prototype._getFirstInnerZone=function(e){if(!(e=e||this._activeElement||this._root.current))return null;if(Ui(e))return Cs[e.getAttribute("data-focuszone-id")];for(var t=e.firstElementChild;t;){if(Ui(t))return Cs[t.getAttribute("data-focuszone-id")];var o=this._getFirstInnerZone(t);if(o)return o;t=t.nextElementSibling}return null},t.prototype._moveFocus=function(e,t,o,n){void 0===n&&(n=!0);var r=this._activeElement,i=-1,s=void 0,a=!1,l=this.props.direction===vs.bidirectional;if(!r||!this._root.current)return!1;if(this._isElementInput(r)&&!this._shouldInputLoseFocus(r,e))return!1;var c=l?r.getBoundingClientRect():null;do{if(r=e?Wi(this._root.current,r):zi(this._root.current,r),!l){s=r;break}if(r){var u=t(c,r.getBoundingClientRect());if(-1===u&&-1===i){s=r;break}if(u>-1&&(-1===i||u<i)&&(i=u,s=r),i>=0&&u<0)break}}while(r);if(s&&s!==this._activeElement)a=!0,this.focusElement(s);else if(this.props.isCircularNavigation&&n)return e?this.focusElement(Wi(this._root.current,this._root.current.firstElementChild,!0)):this.focusElement(zi(this._root.current,this._root.current.lastElementChild,!0,!0,!0));return a},t.prototype._moveFocusDown=function(){var e=this,t=-1,o=this._focusAlignment.left||this._focusAlignment.x||0;return!!this._moveFocus(!0,(function(n,r){var i=-1,s=Math.floor(r.top),a=Math.floor(n.bottom);return s<a?e._shouldWrapFocus(e._activeElement,"data-no-vertical-wrap")?999999999:-999999999:((-1===t&&s>=a||s===t)&&(t=s,i=o>=r.left&&o<=r.left+r.width?0:Math.abs(r.left+r.width/2-o)),i)}))&&(this._setFocusAlignment(this._activeElement,!1,!0),!0)},t.prototype._moveFocusUp=function(){var e=this,t=-1,o=this._focusAlignment.left||this._focusAlignment.x||0;return!!this._moveFocus(!1,(function(n,r){var i=-1,s=Math.floor(r.bottom),a=Math.floor(r.top),l=Math.floor(n.top);return s>l?e._shouldWrapFocus(e._activeElement,"data-no-vertical-wrap")?999999999:-999999999:((-1===t&&s<=l||a===t)&&(t=a,i=o>=r.left&&o<=r.left+r.width?0:Math.abs(r.left+r.width/2-o)),i)}))&&(this._setFocusAlignment(this._activeElement,!1,!0),!0)},t.prototype._moveFocusLeft=function(e){var t=this,o=this._shouldWrapFocus(this._activeElement,"data-no-horizontal-wrap");return!!this._moveFocus(In(e),(function(n,r){var i=-1;return(In(e)?parseFloat(r.top.toFixed(3))<parseFloat(n.bottom.toFixed(3)):parseFloat(r.bottom.toFixed(3))>parseFloat(n.top.toFixed(3)))&&r.right<=n.right&&t.props.direction!==vs.vertical?i=n.right-r.right:o||(i=-999999999),i}),void 0,o)&&(this._setFocusAlignment(this._activeElement,!0,!1),!0)},t.prototype._moveFocusRight=function(e){var t=this,o=this._shouldWrapFocus(this._activeElement,"data-no-horizontal-wrap");return!!this._moveFocus(!In(e),(function(n,r){var i=-1;return(In(e)?parseFloat(r.bottom.toFixed(3))>parseFloat(n.top.toFixed(3)):parseFloat(r.top.toFixed(3))<parseFloat(n.bottom.toFixed(3)))&&r.left>=n.left&&t.props.direction!==vs.vertical?i=r.left-n.left:o||(i=-999999999),i}),void 0,o)&&(this._setFocusAlignment(this._activeElement,!0,!1),!0)},t.prototype._moveFocusPaging=function(e,t){void 0===t&&(t=!0);var o=this._activeElement;if(!o||!this._root.current)return!1;if(this._isElementInput(o)&&!this._shouldInputLoseFocus(o,e))return!1;var n=hs(o);if(!n)return!1;var r=-1,i=void 0,s=-1,a=-1,l=n.clientHeight,c=o.getBoundingClientRect();do{if(o=e?Wi(this._root.current,o):zi(this._root.current,o)){var u=o.getBoundingClientRect(),d=Math.floor(u.top),p=Math.floor(c.bottom),h=Math.floor(u.bottom),m=Math.floor(c.top),g=this._getHorizontalDistanceFromCenter(e,c,u);if(e&&d>p+l||!e&&h<m-l)break;g>-1&&(e&&d>s?(s=d,r=g,i=o):!e&&h<a?(a=h,r=g,i=o):(-1===r||g<=r)&&(r=g,i=o))}}while(o);var f=!1;if(i&&i!==this._activeElement)f=!0,this.focusElement(i),this._setFocusAlignment(i,!1,!0);else if(this.props.isCircularNavigation&&t)return e?this.focusElement(Wi(this._root.current,this._root.current.firstElementChild,!0)):this.focusElement(zi(this._root.current,this._root.current.lastElementChild,!0,!0,!0));return f},t.prototype._setFocusAlignment=function(e,t,o){if(this.props.direction===vs.bidirectional&&(!this._focusAlignment||t||o)){var n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;this._focusAlignment||(this._focusAlignment={left:r,top:i}),t&&(this._focusAlignment.left=r),o&&(this._focusAlignment.top=i)}},t.prototype._isImmediateDescendantOfZone=function(e){return this._getOwnerZone(e)===this._root.current},t.prototype._getOwnerZone=function(e){for(var t=Mi(e,!1);t&&t!==this._root.current&&t!==this._getDocument().body;){if(Ui(t))return t;t=Mi(t,!1)}return t},t.prototype._updateTabIndexes=function(e){!this._activeElement&&this.props.defaultTabbableElement&&"function"==typeof this.props.defaultTabbableElement&&(this._activeElement=this.props.defaultTabbableElement(this._root.current)),!e&&this._root.current&&(this._defaultFocusElement=null,e=this._root.current,this._activeElement&&!Ni(e,this._activeElement)&&(this._activeElement=null)),this._activeElement&&!Ki(this._activeElement)&&(this._activeElement=null);for(var t=e&&e.children,o=0;t&&o<t.length;o++){var n=t[o];Ui(n)?"true"===n.getAttribute("data-is-focusable")&&(this._isInnerZone||(this._activeElement||this._defaultFocusElement)&&this._activeElement!==n?"-1"!==n.getAttribute("tabindex")&&n.setAttribute("tabindex","-1"):(this._defaultFocusElement=n,"0"!==n.getAttribute("tabindex")&&n.setAttribute("tabindex","0"))):(n.getAttribute&&"false"===n.getAttribute("data-is-focusable")&&n.setAttribute("tabindex","-1"),Ki(n)?this.props.disabled?n.setAttribute("tabindex","-1"):this._isInnerZone||(this._activeElement||this._defaultFocusElement)&&this._activeElement!==n?"-1"!==n.getAttribute("tabindex")&&n.setAttribute("tabindex","-1"):(this._defaultFocusElement=n,"0"!==n.getAttribute("tabindex")&&n.setAttribute("tabindex","0")):"svg"===n.tagName&&"false"!==n.getAttribute("focusable")&&n.setAttribute("focusable","false")),this._updateTabIndexes(n)}},t.prototype._isContentEditableElement=function(e){return e&&"true"===e.getAttribute("contenteditable")},t.prototype._isElementInput=function(e){return!(!e||!e.tagName||"input"!==e.tagName.toLowerCase()&&"textarea"!==e.tagName.toLowerCase())},t.prototype._shouldInputLoseFocus=function(e,t){if(!this._processingTabKey&&e&&e.type&&xs.indexOf(e.type.toLowerCase())>-1){var o=e.selectionStart,n=o!==e.selectionEnd,r=e.value,i=e.readOnly;if(n||o>0&&!t&&!i||o!==r.length&&t&&!i||this.props.handleTabKey&&(!this.props.shouldInputLoseFocusOnArrowKey||!this.props.shouldInputLoseFocusOnArrowKey(e)))return!1}return!0},t.prototype._shouldWrapFocus=function(e,t){return!this.props.checkForNoWrap||Yi(e,t)},t.prototype._portalContainsElement=function(e){return e&&!!this._root.current&&fs(e,this._root.current)},t.prototype._getDocument=function(){return tt(this._root.current)},t.defaultProps={isCircularNavigation:!1,direction:vs.bidirectional,shouldRaiseClicks:!0},t}(b.Component),ws="ktp",Is="-",Ds=ws+Is,Ps="data-ktp-target",Ts="data-ktp-execute-target",Es="data-ktp-aria-target",Ms="ktp-layer-id",Rs=", ";function Bs(e){var t=b.useRef();return void 0===t.current&&(t.current={value:"function"==typeof e?e():e}),t.current.value}function Ns(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=e.filter((function(e){return e})).join(" ").trim();return""===o?void 0:o}function Fs(e,t){for(var o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||t[o]!==e[o]))return!1;for(var o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}function As(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return Ls.apply(this,[null,e].concat(t))}function Ls(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];t=t||{};for(var r=0,i=o;r<i.length;r++){var s=i[r];if(s)for(var a in s)!s.hasOwnProperty(a)||e&&!e(a)||(t[a]=s[a])}return t}function Hs(e,t){return Object.keys(e).map((function(o){if(String(Number(o))!==o)return t(o,e[o])})).filter((function(e){return!!e}))}function Os(e){return Object.keys(e).reduce((function(t,o){return t.push(e[o]),t}),[])}function zs(e,t){var o={};for(var n in e)-1===t.indexOf(n)&&e.hasOwnProperty(n)&&(o[n]=e[n]);return o}!function(e){e.KEYTIP_ADDED="keytipAdded",e.KEYTIP_REMOVED="keytipRemoved",e.KEYTIP_UPDATED="keytipUpdated",e.PERSISTED_KEYTIP_ADDED="persistedKeytipAdded",e.PERSISTED_KEYTIP_REMOVED="persistedKeytipRemoved",e.PERSISTED_KEYTIP_EXECUTE="persistedKeytipExecute",e.ENTER_KEYTIP_MODE="enterKeytipMode",e.EXIT_KEYTIP_MODE="exitKeytipMode"}(ys||(ys={}));var Ws=function(){function e(t){this._id=e._uniqueId++,this._parent=t,this._eventRecords=[]}return e.raise=function(t,o,n,r){var i;if(e._isElement(t)){if("undefined"!=typeof document&&document.createEvent){var s=document.createEvent("HTMLEvents");s.initEvent(o,r||!1,!0),As(s,n),i=t.dispatchEvent(s)}else if("undefined"!=typeof document&&document.createEventObject){var a=document.createEventObject(n);t.fireEvent("on"+o,a)}}else for(;t&&!1!==i;){var l=t.__events__,c=l?l[o]:null;if(c)for(var u in c)if(c.hasOwnProperty(u))for(var d=c[u],p=0;!1!==i&&p<d.length;p++){var h=d[p];h.objectCallback&&(i=h.objectCallback.call(h.parent,n))}t=r?t.parent:null}return i},e.isObserved=function(e,t){var o=e&&e.__events__;return!!o&&!!o[t]},e.isDeclared=function(e,t){var o=e&&e.__declaredEvents;return!!o&&!!o[t]},e.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},e._isElement=function(e){return!!e&&(!!e.addEventListener||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement)},e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this.off(),this._parent=null)},e.prototype.onAll=function(e,t,o){for(var n in t)t.hasOwnProperty(n)&&this.on(e,n,t[n],o)},e.prototype.on=function(t,o,n,r){var i=this;if(o.indexOf(",")>-1)for(var s=o.split(/[ ,]+/),a=0;a<s.length;a++)this.on(t,s[a],n,r);else{var l=this._parent,c={target:t,eventName:o,parent:l,callback:n,options:r};if((s=t.__events__=t.__events__||{})[o]=s[o]||{count:0},s[o][this._id]=s[o][this._id]||[],s[o][this._id].push(c),s[o].count++,e._isElement(t)){var u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!i._isDisposed){var o;try{if(!1===(o=n.apply(l,e))&&e[0]){var r=e[0];r.preventDefault&&r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.cancelBubble=!0}}catch(r){}return o}};c.elementCallback=u,t.addEventListener?t.addEventListener(o,u,r):t.attachEvent&&t.attachEvent("on"+o,u)}else{c.objectCallback=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!i._isDisposed)return n.apply(l,e)}}this._eventRecords.push(c)}},e.prototype.off=function(e,t,o,n){for(var r=0;r<this._eventRecords.length;r++){var i=this._eventRecords[r];if(!(e&&e!==i.target||t&&t!==i.eventName||o&&o!==i.callback||"boolean"==typeof n&&n!==i.options)){var s=i.target.__events__,a=s[i.eventName],l=a?a[this._id]:null;l&&(1!==l.length&&o?(a.count--,l.splice(l.indexOf(i),1)):(a.count-=l.length,delete s[i.eventName][this._id]),a.count||delete s[i.eventName]),i.elementCallback&&(i.target.removeEventListener?i.target.removeEventListener(i.eventName,i.elementCallback,i.options):i.target.detachEvent&&i.target.detachEvent("on"+i.eventName,i.elementCallback)),this._eventRecords.splice(r--,1)}}},e.prototype.raise=function(t,o,n){return e.raise(this._parent,t,o,n)},e.prototype.declare=function(e){var t=this._parent.__declaredEvents=this._parent.__declaredEvents||{};if("string"==typeof e)t[e]=!0;else for(var o=0;o<e.length;o++)t[e[o]]=!0},e._uniqueId=0,e}(),Vs=function(){function e(){this.keytips={},this.persistedKeytips={},this.sequenceMapping={},this.inKeytipMode=!1,this.shouldEnterKeytipMode=!0,this.delayUpdatingKeytipChange=!1}return e.getInstance=function(){return this._instance},e.prototype.init=function(e){this.delayUpdatingKeytipChange=e},e.prototype.register=function(e,t){void 0===t&&(t=!1);var o=e;t||(o=this.addParentOverflow(e),this.sequenceMapping[o.keySequences.toString()]=o);var n=this._getUniqueKtp(o);if(t?this.persistedKeytips[n.uniqueID]=n:this.keytips[n.uniqueID]=n,this.inKeytipMode||!this.delayUpdatingKeytipChange){var r=t?ys.PERSISTED_KEYTIP_ADDED:ys.KEYTIP_ADDED;Ws.raise(this,r,{keytip:o,uniqueID:n.uniqueID})}return n.uniqueID},e.prototype.update=function(e,t){var o=this.addParentOverflow(e),n=this._getUniqueKtp(o,t),r=this.keytips[t];r&&(n.keytip.visible=r.keytip.visible,this.keytips[t]=n,delete this.sequenceMapping[r.keytip.keySequences.toString()],this.sequenceMapping[n.keytip.keySequences.toString()]=n.keytip,!this.inKeytipMode&&this.delayUpdatingKeytipChange||Ws.raise(this,ys.KEYTIP_UPDATED,{keytip:n.keytip,uniqueID:n.uniqueID}))},e.prototype.unregister=function(e,t,o){void 0===o&&(o=!1),o?delete this.persistedKeytips[t]:delete this.keytips[t],!o&&delete this.sequenceMapping[e.keySequences.toString()];var n=o?ys.PERSISTED_KEYTIP_REMOVED:ys.KEYTIP_REMOVED;!this.inKeytipMode&&this.delayUpdatingKeytipChange||Ws.raise(this,n,{keytip:e,uniqueID:t})},e.prototype.enterKeytipMode=function(){Ws.raise(this,ys.ENTER_KEYTIP_MODE)},e.prototype.exitKeytipMode=function(){Ws.raise(this,ys.EXIT_KEYTIP_MODE)},e.prototype.getKeytips=function(){var e=this;return Object.keys(this.keytips).map((function(t){return e.keytips[t].keytip}))},e.prototype.addParentOverflow=function(e){var t=f(e.keySequences);if(t.pop(),0!==t.length){var o=this.sequenceMapping[t.toString()];if(o&&o.overflowSetSequence)return h(h({},e),{overflowSetSequence:o.overflowSetSequence})}return e},e.prototype.menuExecute=function(e,t){Ws.raise(this,ys.PERSISTED_KEYTIP_EXECUTE,{overflowButtonSequences:e,keytipSequences:t})},e.prototype._getUniqueKtp=function(e,t){return void 0===t&&(t=ts()),{keytip:h({},e),uniqueID:t}},e._instance=new e,e}();function Ks(e){return e.reduce((function(e,t){return e+Is+t.split("").join(Is)}),ws)}function Us(e,t){var o=t.length,n=f(t).pop();return ki(f(e),o-1,n)}function Gs(e){return"["+Ps+'="'+Ks(e)+'"]'}function js(e){return"["+Ts+'="'+e+'"]'}function Ys(e){var t=" "+Ms;return e.length?t+" "+Ks(e):t}function qs(e){var t,o,n=b.useRef(),r=e.keytipProps?h({disabled:e.disabled},e.keytipProps):void 0,i=Bs(Vs.getInstance()),s=(t=e,o=Object(b.useRef)(),Object(b.useEffect)((function(){o.current=t})),o.current);b.useLayoutEffect((function(){var t,o;n.current&&r&&((null===(t=s)||void 0===t?void 0:t.keytipProps)!==e.keytipProps||(null===(o=s)||void 0===o?void 0:o.disabled)!==e.disabled)&&i.update(r,n.current)})),b.useLayoutEffect((function(){return r&&(n.current=i.register(r)),function(){r&&i.unregister(r,n.current)}}),[]);var a={ariaDescribedBy:void 0,keytipId:void 0};return r&&(a=function(e,t,o){var n=e.addParentOverflow(t),r=Ns(o,Ys(n.keySequences)),i=f(n.keySequences);n.overflowSetSequence&&(i=Us(i,n.overflowSetSequence));var s=Ks(i);return{ariaDescribedBy:r,keytipId:s}}(i,r,e.ariaDescribedBy)),a}var Zs=function(e){var t,o=e.children,n=qs(m(e,["children"])),r=n.keytipId,i=n.ariaDescribedBy;return o(((t={})[Ps]=r,t[Ts]=r,t["aria-describedby"]=i,t))},Xs=Mn(),Qs=function(e){function t(t){var o=e.call(this,t)||this;return o._link=b.createRef(),o._renderContent=function(e){void 0===e&&(e={});var t=o.props,n=t.disabled,r=t.children,i=t.className,s=t.href,a=t.underline,l=t.theme,c=t.styles,u=Xs(c,{className:i,isButton:!s,isDisabled:n,isUnderlined:a,theme:l}),d=o._getRootType(o.props);return b.createElement(d,h({},e,o._adjustPropsForRootType(d,o.props),{className:u.root,onClick:o._onClick,ref:o._link,"aria-disabled":n}),r)},o._onClick=function(e){var t=o.props,n=t.onClick;t.disabled?e.preventDefault():n&&n(e)},si(o),o}return p(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.disabled,n=t.keytipProps;return n?b.createElement(Zs,{keytipProps:n,ariaDescribedBy:this.props["aria-describedby"],disabled:o},(function(t){return e._renderContent(t)})):this._renderContent()},t.prototype.focus=function(){var e=this._link.current;e&&e.focus&&e.focus()},t.prototype._adjustPropsForRootType=function(e,t){t.children,t.as;var o=t.disabled,n=t.target,r=t.href,i=(t.theme,t.getStyles,t.styles,t.componentRef,t.keytipProps,t.underline,m(t,["children","as","disabled","target","href","theme","getStyles","styles","componentRef","keytipProps","underline"]));return"string"==typeof e?"a"===e?h({target:n,href:o?void 0:r},i):"button"===e?h({type:"button",disabled:o},i):h(h({},i),{disabled:o}):h({target:n,href:r,disabled:o},i)},t.prototype._getRootType=function(e){return e.as?e.as:e.href?"a":"button"},t}(b.Component),Js={root:"ms-Link"},$s=xn(Qs,(function(e){var t,o,n,r,i,s,a=e.className,l=e.isButton,c=e.isDisabled,u=e.isUnderlined,d=e.theme,p=d.semanticColors,h=p.link,m=p.linkHovered,g=p.disabledText,f=p.focusBorder,v=Oo(Js,d);return{root:[v.root,d.fonts.medium,{color:h,outline:"none",fontSize:"inherit",fontWeight:"inherit",textDecoration:u?"underline":"none",selectors:(t={".ms-Fabric--isFocusVisible &:focus":{boxShadow:"0 0 0 1px "+f+" inset",outline:"1px auto "+f,selectors:(o={},o[jt]={outline:"1px solid WindowText"},o)}},t[jt]={borderBottom:"none"},t)},l&&{background:"none",backgroundColor:"transparent",border:"none",cursor:"pointer",display:"inline",margin:0,overflow:"inherit",padding:0,textAlign:"left",textOverflow:"inherit",userSelect:"text",borderBottom:"1px solid transparent",selectors:(n={},n[jt]={color:"LinkText",forcedColorAdjust:"none"},n)},!l&&{selectors:(r={},r[jt]={MsHighContrastAdjust:"auto",forcedColorAdjust:"auto"},r)},c&&["is-disabled",{color:g,cursor:"default"},{selectors:{"&:link, &:visited":{pointerEvents:"none"}}}],!c&&{selectors:{"&:active, &:hover, &:active:hover":{color:m,textDecoration:"underline",selectors:(i={},i[jt]={color:"LinkText"},i)},"&:focus":{color:h,selectors:(s={},s[jt]={color:"LinkText"},s)}}},v.root,a]}}),void 0,{scope:"Link"});function ea(e,t,o,n,r){}function ta(e,t,o){}function oa(e,t,o){}var na,ra=function(e){function t(o,n){var r=e.call(this,o,n)||this;return function(e,t,o){for(var n=0,r=o.length;n<r;n++)ia(e,t,o[n])}(r,t.prototype,["componentDidMount","shouldComponentUpdate","getSnapshotBeforeUpdate","render","componentDidUpdate","componentWillUnmount"]),r}return p(t,e),t.prototype.componentDidUpdate=function(e,t){this._updateComponentRef(e,this.props)},t.prototype.componentDidMount=function(){this._setComponentRef(this.props.componentRef,this)},t.prototype.componentWillUnmount=function(){if(this._setComponentRef(this.props.componentRef,null),this.__disposables){for(var e=0,t=this._disposables.length;e<t;e++){var o=this.__disposables[e];o.dispose&&o.dispose()}this.__disposables=null}},Object.defineProperty(t.prototype,"className",{get:function(){if(!this.__className){var e=/function (.{1,})\(/.exec(this.constructor.toString());this.__className=e&&e.length>1?e[1]:""}return this.__className},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_disposables",{get:function(){return this.__disposables||(this.__disposables=[]),this.__disposables},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_async",{get:function(){return this.__async||(this.__async=new di(this),this._disposables.push(this.__async)),this.__async},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_events",{get:function(){return this.__events||(this.__events=new Ws(this),this._disposables.push(this.__events)),this.__events},enumerable:!0,configurable:!0}),t.prototype._resolveRef=function(e){var t=this;return this.__resolves||(this.__resolves={}),this.__resolves[e]||(this.__resolves[e]=function(o){return t[e]=o}),this.__resolves[e]},t.prototype._updateComponentRef=function(e,t){void 0===t&&(t={}),e&&t&&e.componentRef!==t.componentRef&&(this._setComponentRef(e.componentRef,null),this._setComponentRef(t.componentRef,this))},t.prototype._warnDeprecations=function(e){this.className,this.props},t.prototype._warnMutuallyExclusive=function(e){this.className,this.props},t.prototype._warnConditionallyRequiredProps=function(e,t,o){this.className,this.props},t.prototype._setComponentRef=function(e,t){!this._skipComponentRefResolution&&e&&("function"==typeof e&&e(t),"object"==typeof e&&(e.current=t))},t}(b.Component);function ia(e,t,o){var n=e[o],r=t[o];(n||r)&&(e[o]=function(){for(var e,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return r&&(e=r.apply(this,t)),n!==r&&(e=n.apply(this,t)),e})}function sa(){return null}var aa=((na={})[wn.up]=1,na[wn.down]=1,na[wn.left]=1,na[wn.right]=1,na[wn.home]=1,na[wn.end]=1,na[wn.tab]=1,na[wn.pageUp]=1,na[wn.pageDown]=1,na);function la(e){return!!aa[e]}function ca(e){aa[e]=1}var ua=new WeakMap;function da(e,t){var o,n=ua.get(e);return o=n?n+t:1,ua.set(e,o),o}function pa(e){b.useEffect((function(){var t,o,n=rt(null===(t=e)||void 0===t?void 0:t.current);if(n&&!0!==(null===(o=n.FabricConfig)||void 0===o?void 0:o.disableFocusRects)){var r=da(n,1);return r<=1&&(n.addEventListener("mousedown",ma,!0),n.addEventListener("pointerdown",ga,!0),n.addEventListener("keydown",fa,!0)),function(){var e;n&&!0!==(null===(e=n.FabricConfig)||void 0===e?void 0:e.disableFocusRects)&&0===(r=da(n,-1))&&(n.removeEventListener("mousedown",ma,!0),n.removeEventListener("pointerdown",ga,!0),n.removeEventListener("keydown",fa,!0))}}}),[e])}var ha=function(e){return pa(e.rootRef),null};function ma(e){mo(!1,e.target)}function ga(e){"mouse"!==e.pointerType&&mo(!1,e.target)}function fa(e){la(e.which)&&mo(!0,e.target)}var va,ba,_a=function(e){var t=e.className,o=e.imageProps,n=fr(e,Yn),r=e["aria-label"]?{}:{role:"presentation","aria-hidden":!o.alt&&!o["aria-labelledby"]};return b.createElement("div",h({},r,n,{className:Sr("ms-Icon",Cr.root,Cr.image,t)}),b.createElement(yr,h({},o)))},ya={topLeftEdge:0,topCenter:1,topRightEdge:2,topAutoEdge:3,bottomLeftEdge:4,bottomCenter:5,bottomRightEdge:6,bottomAutoEdge:7,leftTopEdge:8,leftCenter:9,leftBottomEdge:10,rightTopEdge:11,rightCenter:12,rightBottomEdge:13};function Ca(e){if(void 0===ba||e){var t=rt(),o=t&&t.navigator.userAgent;ba=!!o&&-1!==o.indexOf("Macintosh")}return!!ba}!function(e){e[e.Normal=0]="Normal",e[e.Divider=1]="Divider",e[e.Header=2]="Header",e[e.Section=3]="Section"}(va||(va={}));var Sa=function(){return!!(window&&window.navigator&&window.navigator.userAgent)&&/iPad|iPhone|iPod/i.test(window.navigator.userAgent)};function xa(e){return e.canCheck?!(!e.isChecked&&!e.checked):"boolean"==typeof e.isChecked?e.isChecked:"boolean"==typeof e.checked?e.checked:null}function ka(e){return!(!e.subMenuProps&&!e.items)}function wa(e){return!(!e.isDisabled&&!e.disabled)}function Ia(e){return null!==xa(e)?"menuitemcheckbox":"menuitem"}var Da=["setState","render","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","getSnapshotBeforeUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount"];function Pa(e,t,o){void 0===o&&(o=Da);var n=[],r=function(r){"function"!=typeof t[r]||void 0!==e[r]||o&&-1!==o.indexOf(r)||(n.push(r),e[r]=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t[r].apply(t,e)})};for(var i in t)r(i);return n}function Ta(e,t){t.forEach((function(t){return delete e[t]}))}var Ea=function(e){function t(t){var o=e.call(this,t)||this;return o._updateComposedComponentRef=o._updateComposedComponentRef.bind(o),o}return p(t,e),t.prototype._updateComposedComponentRef=function(e){this._composedComponentInstance=e,e?this._hoisted=Pa(this,e):this._hoisted&&Ta(this,this._hoisted)},t}(b.Component);function Ma(e,t){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}var Ra,Ba=b.createContext({window:"object"==typeof window?window:void 0}),Na=function(){return b.useContext(Ba).window},Fa=function(){var e;return null===(e=b.useContext(Ba).window)||void 0===e?void 0:e.document},Aa=function(e){return b.createElement(Ba.Provider,{value:e},e.children)};!function(e){e[e.small=0]="small",e[e.medium=1]="medium",e[e.large=2]="large",e[e.xLarge=3]="xLarge",e[e.xxLarge=4]="xxLarge",e[e.xxxLarge=5]="xxxLarge",e[e.unknown=999]="unknown"}(Ra||(Ra={}));var La,Ha,Oa,za,Wa=[479,639,1023,1365,1919,99999999];function Va(){return La||Ha||Ra.large}function Ka(e){var t,o=((t=function(t){function o(e){var o=t.call(this,e)||this;return o._onResize=function(){var e=Ua(o.context.window);e!==o.state.responsiveMode&&o.setState({responsiveMode:e})},o._events=new Ws(o),o._updateComposedComponentRef=o._updateComposedComponentRef.bind(o),o.state={responsiveMode:Va()},o}return p(o,t),o.prototype.componentDidMount=function(){this._events.on(this.context.window,"resize",this._onResize),this._onResize()},o.prototype.componentWillUnmount=function(){this._events.dispose()},o.prototype.render=function(){var t=this.state.responsiveMode;return t===Ra.unknown?null:b.createElement(e,h({ref:this._updateComposedComponentRef,responsiveMode:t},this.props))},o}(Ea)).contextType=Ba,t);return Ma(e,o)}function Ua(e){var t=Ra.small;if(e){try{for(;e.innerWidth>Wa[t];)t++}catch(e){t=Va()}Ha=t}else{if(void 0===La)throw new Error("Content was rendered in a server environment without providing a default responsive mode. Call setResponsiveMode to define what the responsive mode is.");t=La}return t}function Ga(e,t,o,n){return e.addEventListener(t,o,n),function(){return e.removeEventListener(t,o,n)}}!function(e){e[e.top=1]="top",e[e.bottom=-1]="bottom",e[e.left=2]="left",e[e.right=-2]="right"}(Oa||(Oa={})),function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.start=2]="start",e[e.end=3]="end"}(za||(za={}));var ja,Ya=function(){function e(e,t,o,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===o&&(o=0),void 0===n&&(n=0),this.top=o,this.bottom=n,this.left=e,this.right=t}return Object.defineProperty(e.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){return parseFloat(this.top.toFixed(4))===parseFloat(e.top.toFixed(4))&&parseFloat(this.bottom.toFixed(4))===parseFloat(e.bottom.toFixed(4))&&parseFloat(this.left.toFixed(4))===parseFloat(e.left.toFixed(4))&&parseFloat(this.right.toFixed(4))===parseFloat(e.right.toFixed(4))},e}();function qa(e,t,o){return{targetEdge:e,alignmentEdge:t,isAuto:o}}var Za=((ja={})[ya.topLeftEdge]=qa(Oa.top,Oa.left),ja[ya.topCenter]=qa(Oa.top),ja[ya.topRightEdge]=qa(Oa.top,Oa.right),ja[ya.topAutoEdge]=qa(Oa.top,void 0,!0),ja[ya.bottomLeftEdge]=qa(Oa.bottom,Oa.left),ja[ya.bottomCenter]=qa(Oa.bottom),ja[ya.bottomRightEdge]=qa(Oa.bottom,Oa.right),ja[ya.bottomAutoEdge]=qa(Oa.bottom,void 0,!0),ja[ya.leftTopEdge]=qa(Oa.left,Oa.top),ja[ya.leftCenter]=qa(Oa.left),ja[ya.leftBottomEdge]=qa(Oa.left,Oa.bottom),ja[ya.rightTopEdge]=qa(Oa.right,Oa.top),ja[ya.rightCenter]=qa(Oa.right),ja[ya.rightBottomEdge]=qa(Oa.right,Oa.bottom),ja);function Xa(e,t){return!(e.top<t.top)&&(!(e.bottom>t.bottom)&&(!(e.left<t.left)&&!(e.right>t.right)))}function Qa(e,t){var o=[];return e.top<t.top&&o.push(Oa.top),e.bottom>t.bottom&&o.push(Oa.bottom),e.left<t.left&&o.push(Oa.left),e.right>t.right&&o.push(Oa.right),o}function Ja(e,t){return e[Oa[t]]}function $a(e,t,o){return e[Oa[t]]=o,e}function el(e,t){var o=dl(t);return(Ja(e,o.positiveEdge)+Ja(e,o.negativeEdge))/2}function tl(e,t){return e>0?t:-1*t}function ol(e,t){return tl(e,Ja(t,e))}function nl(e,t,o){return tl(o,Ja(e,o)-Ja(t,o))}function rl(e,t,o){var n=Ja(e,t)-o;return e=$a(e,t,o),e=$a(e,-1*t,Ja(e,-1*t)-n)}function il(e,t,o,n){return void 0===n&&(n=0),rl(e,o,Ja(t,o)+tl(o,n))}function sl(e,t,o){return ol(o,e)>ol(o,t)}function al(e,t,o,n,r,i,s){void 0===r&&(r=0);var a=n.alignmentEdge,l=n.alignTargetEdge,c={elementRectangle:e,targetEdge:n.targetEdge,alignmentEdge:a};i||s||(c=function(e,t,o,n,r){void 0===r&&(r=0);var i=[Oa.left,Oa.right,Oa.bottom,Oa.top];In()&&(i[0]*=-1,i[1]*=-1);for(var s=e,a=n.targetEdge,l=n.alignmentEdge,c=0;c<4;c++){if(sl(s,o,a))return{elementRectangle:s,targetEdge:a,alignmentEdge:l};i.splice(i.indexOf(a),1),i.length>0&&(i.indexOf(-1*a)>-1?a*=-1:(l=a,a=i.slice(-1)[0]),s=ul(e,t,{targetEdge:a,alignmentEdge:l},r))}return{elementRectangle:e,targetEdge:n.targetEdge,alignmentEdge:n.alignmentEdge}}(e,t,o,n,r));var u=Qa(e,o);if(l){if(c.alignmentEdge&&u.indexOf(-1*c.alignmentEdge)>-1){var d=function(e,t,o,n){var r=e.alignmentEdge,i=e.targetEdge,s=-1*r;return{elementRectangle:ul(e.elementRectangle,t,{targetEdge:i,alignmentEdge:s},o,n),targetEdge:i,alignmentEdge:s}}(c,t,r,s);if(Xa(d.elementRectangle,o))return d;c=ll(Qa(d.elementRectangle,o),c,o)}}else c=ll(u,c,o);return c}function ll(e,t,o){for(var n=0,r=e;n<r.length;n++){var i=r[n];t.elementRectangle=il(t.elementRectangle,o,i)}return t}function cl(e,t,o){var n=dl(t).positiveEdge;return rl(e,n,o-(el(e,t)-Ja(e,n)))}function ul(e,t,o,n,r){var i;void 0===n&&(n=0);var s=o.alignmentEdge,a=o.targetEdge,l=r?a:-1*a;(i=r?il(e,t,a,n):function(e,t,o,n){void 0===n&&(n=0);var r=tl(-1*o,n);return rl(e,-1*o,Ja(t,o)+r)}(e,t,a,n),s)?i=il(i,t,s):i=cl(i,l,el(t,a));return i}function dl(e){return e===Oa.top||e===Oa.bottom?{positiveEdge:Oa.left,negativeEdge:Oa.right}:{positiveEdge:Oa.top,negativeEdge:Oa.bottom}}function pl(e,t,o){return o&&Math.abs(nl(e,o,t))>Math.abs(nl(e,o,-1*t))?-1*t:t}function hl(e){return Math.sqrt(e*e*2)}function ml(e,t,o){if(void 0===e&&(e=ya.bottomAutoEdge),o)return{alignmentEdge:o.alignmentEdge,isAuto:o.isAuto,targetEdge:o.targetEdge};var n=h({},Za[e]);return In()?(n.alignmentEdge&&n.alignmentEdge%2==0&&(n.alignmentEdge=-1*n.alignmentEdge),void 0!==t?Za[t]:n):n}function gl(e,t,o){var n=el(t,e),r=el(o,e),i=dl(e),s=i.positiveEdge,a=i.negativeEdge;return n<=r?s:a}function fl(e,t,o,n,r,i,s){var a=ul(e,t,n,r,s);return Xa(a,o)?{elementRectangle:a,targetEdge:n.targetEdge,alignmentEdge:n.alignmentEdge}:al(e,t,o,n,r,i,s)}function vl(e,t,o){var n=-1*e.targetEdge,r=new Ya(0,e.elementRectangle.width,0,e.elementRectangle.height),i={},s=pl(e.elementRectangle,e.alignmentEdge?e.alignmentEdge:dl(n).positiveEdge,o);return i[Oa[n]]=Ja(t,n),i[Oa[s]]=nl(t,r,s),{elementPosition:h({},i),closestEdge:gl(e.targetEdge,t,r),targetEdge:n}}function bl(e,t){var o=t.targetRectangle,n=dl(t.targetEdge),r=n.positiveEdge,i=n.negativeEdge,s=el(o,t.targetEdge),a=new Ya(e/2,t.elementRectangle.width-e/2,e/2,t.elementRectangle.height-e/2),l=new Ya(0,e,0,e);return sl(l=cl(l=rl(l,-1*t.targetEdge,-e/2),-1*t.targetEdge,s-ol(r,t.elementRectangle)),a,r)?sl(l,a,i)||(l=il(l,a,i)):l=il(l,a,r),l}function _l(e){var t=e.getBoundingClientRect();return new Ya(t.left,t.right,t.top,t.bottom)}function yl(e){return new Ya(e.left,e.right,e.top,e.bottom)}function Cl(e,t,o,n,r){var i=0,s=Za[t],a=r?-1*s.targetEdge:s.targetEdge;return(i=a===Oa.top?Ja(e,s.targetEdge)-n.top-o:a===Oa.bottom?n.bottom-Ja(e,s.targetEdge)-o:n.bottom-e.top-o)>0?i:n.height}function Sl(e,t,o,n){var r=e.gapSpace?e.gapSpace:0,i=function(e,t){var o;if(t){if(t.preventDefault){var n=t;o=new Ya(n.clientX,n.clientX,n.clientY,n.clientY)}else if(t.getBoundingClientRect)o=_l(t);else{var r=t,i=r.left||r.x,s=r.top||r.y;o=new Ya(i,i,s,s)}if(!Xa(o,e))for(var a=0,l=Qa(o,e);a<l.length;a++){var c=l[a];o[Oa[c]]=e[Oa[c]]}}else o=new Ya(0,0,0,0);return o}(o,e.target),s=function(e,t,o,n,r){return e.isAuto&&(e.alignmentEdge=gl(e.targetEdge,t,o)),e.alignTargetEdge=r,e}(ml(e.directionalHint,e.directionalHintForRTL,n),i,o,e.coverTarget,e.alignTargetEdge),a=fl(_l(t),i,o,s,r,e.directionalHintFixed,e.coverTarget);return h(h({},a),{targetRectangle:i})}function xl(e,t,o,n,r){return{elementPosition:function(e,t,o,n,r,i,s){var a={},l=_l(t),c=i?o:-1*o,u=Oa[c],d=r||dl(o).positiveEdge;return s||(d=pl(e,d,n)),a[u]=nl(e,l,c),a[Oa[d]]=nl(e,l,d),a}(e.elementRectangle,t,e.targetEdge,o,e.alignmentEdge,n,r),targetEdge:e.targetEdge,alignmentEdge:e.alignmentEdge}}function kl(e,t,o,n,r){var i=e.isBeakVisible&&e.beakWidth||0,s=hl(i)/2+(e.gapSpace?e.gapSpace:0),a=e;a.gapSpace=s;var l=e.bounds?yl(e.bounds):new Ya(0,window.innerWidth-ps(),0,window.innerHeight),c=Sl(a,o,l,n),u=vl(c,bl(i,c),l);return h(h({},xl(c,t,l,e.coverTarget,r)),{beakPosition:u})}function wl(e,t,o,n){return function(e,t,o,n){var r=e.bounds?yl(e.bounds):new Ya(0,window.innerWidth-ps(),0,window.innerHeight);return xl(Sl(e,o,r,n),t,r,e.coverTarget)}(e,t,o,n)}function Il(e,t,o,n){return kl(e,t,o,n)}function Dl(e,t,o,n){return function(e,t,o,n){return kl(e,t,o,n,!0)}(e,t,o,n)}function Pl(e,t,o,n,r){void 0===o&&(o=0);var i=e,s=e,a=e,l=n?yl(n):new Ya(0,window.innerWidth-ps(),0,window.innerHeight),c=a.left||a.x,u=a.top||a.y;return Cl(i.stopPropagation?new Ya(i.clientX,i.clientX,i.clientY,i.clientY):void 0!==c&&void 0!==u?new Ya(c,c,u,u):_l(s),t,o,l,r)}function Tl(e){return-1*e}function El(e,t){return function(e,t){var o=void 0;if(t.getWindowSegments&&(o=t.getWindowSegments()),void 0===o||o.length<=1)return{top:0,left:0,right:t.innerWidth,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight};var n=0,r=0;if(null!==e&&e.getBoundingClientRect){var i=e.getBoundingClientRect();n=(i.left+i.right)/2,r=(i.top+i.bottom)/2}else null!==e&&(n=e.left||e.x,r=e.top||e.y);for(var s={top:0,left:0,right:0,bottom:0,width:0,height:0},a=0,l=o;a<l.length;a++){var c=l[a];n&&c.left<=n&&c.right>=n&&r&&c.top<=r&&c.bottom>=r&&(s={top:c.top,left:c.left,right:c.right,bottom:c.bottom,width:c.width,height:c.height})}return s}(e,t)}var Ml,Rl=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._disposables=[],o._onKeyDown=function(e){switch(e.which){case wn.escape:o.props.onDismiss&&(o.props.onDismiss(e),e.preventDefault(),e.stopPropagation())}},o._onFocus=function(){o._containsFocus=!0},o._onBlur=function(e){o._root.current&&e.relatedTarget&&!Ni(o._root.current,e.relatedTarget)&&(o._containsFocus=!1)},o._async=new di(o),o.state={needsVerticalScrollBar:!1},o}return p(t,e),t.prototype.UNSAFE_componentWillMount=function(){this._originalFocusedElement=tt().activeElement},t.prototype.componentDidMount=function(){if(this._root.current){this._disposables.push(Ga(this._root.current,"focus",this._onFocus,!0),Ga(this._root.current,"blur",this._onBlur,!0));var e=rt(this._root.current);e&&this._disposables.push(Ga(e,"keydown",this._onKeyDown)),ji(this._root.current)&&(this._containsFocus=!0)}this._updateScrollBarAsync()},t.prototype.componentDidUpdate=function(){this._updateScrollBarAsync(),this._async.dispose()},t.prototype.componentWillUnmount=function(){var e;if(this._disposables.forEach((function(e){return e()})),this.props.shouldRestoreFocus){var t=this.props.onRestoreFocus;(void 0===t?Bl:t)({originalElement:this._originalFocusedElement,containsFocus:this._containsFocus,documentContainsFocus:(null===(e=tt())||void 0===e?void 0:e.hasFocus())||!1})}delete this._originalFocusedElement},t.prototype.render=function(){var e=this.props,t=e.role,o=e.className,n=e.ariaLabel,r=e.ariaLabelledBy,i=e.ariaDescribedBy,s=e.style;return b.createElement("div",h({ref:this._root},fr(this.props,gr),{className:o,role:t,"aria-label":n,"aria-labelledby":r,"aria-describedby":i,onKeyDown:this._onKeyDown,style:h({overflowY:this.state.needsVerticalScrollBar?"scroll":void 0,outline:"none"},s)}),this.props.children)},t.prototype._updateScrollBarAsync=function(){var e=this;this._async.requestAnimationFrame((function(){e._getScrollBar()}))},t.prototype._getScrollBar=function(){if(!this.props.style||!this.props.style.overflowY){var e=!1;if(this._root&&this._root.current&&this._root.current.firstElementChild){var t=this._root.current.clientHeight,o=this._root.current.firstElementChild.clientHeight;t>0&&o>t&&(e=o-t>1)}this.state.needsVerticalScrollBar!==e&&this.setState({needsVerticalScrollBar:e})}},t.defaultProps={shouldRestoreFocus:!0},t}(b.Component);function Bl(e){var t=e.originalElement,o=e.containsFocus;t&&o&&t!==window&&t.focus&&t.focus()}var Nl=((Ml={})[Oa.top]=Ye.slideUpIn10,Ml[Oa.bottom]=Ye.slideDownIn10,Ml[Oa.left]=Ye.slideLeftIn10,Ml[Oa.right]=Ye.slideRightIn10,Ml),Fl=Mn({disableCaching:!0}),Al=0,Ll=0,Hl={opacity:0,filter:"opacity(0)",pointerEvents:"none"},Ol=["role","aria-roledescription"],zl=function(e){function t(t){var o=e.call(this,t)||this;return o._hostElement=b.createRef(),o._calloutElement=b.createRef(),o._hasListeners=!1,o._disposables=[],o.dismiss=function(e){var t=o.props.onDismiss;t&&t(e)},o._dismissOnScroll=function(e){var t=o.props,n=t.preventDismissOnEvent,r=t.preventDismissOnScroll;o.state.positions&&(n&&!n(e)||!n&&!r)&&o._dismissOnClickOrScroll(e)},o._dismissOnResize=function(e){var t=o.props,n=t.preventDismissOnEvent,r=t.preventDismissOnResize;(n&&!n(e)||!n&&!r)&&o.dismiss(e)},o._dismissOnLostFocus=function(e){var t=o.props,n=t.preventDismissOnEvent,r=t.preventDismissOnLostFocus;(n&&!n(e)||!n&&!r)&&o._dismissOnClickOrScroll(e)},o._setInitialFocus=function(){o.props.setInitialFocus&&!o._didSetInitialFocus&&o.state.positions&&o._calloutElement.current&&(o._didSetInitialFocus=!0,o._async.requestAnimationFrame((function(){return Oi(o._calloutElement.current)}),o._calloutElement.current))},o._onComponentDidMount=function(){o._addListeners(),o.props.onLayerMounted&&o.props.onLayerMounted(),o._updateAsyncPosition(),o._setHeightOffsetEveryFrame()},o._dismissOnTargetWindowBlur=function(e){var t=o.props,n=t.preventDismissOnEvent,r=t.preventDismissOnLostFocus;t.shouldDismissOnWindowFocus&&((!n||n(e))&&(n||r)||o._targetWindow.document.hasFocus()||null!==e.relatedTarget||o.dismiss(e))},o._mouseDownOnPopup=function(){o._isMouseDownOnPopup=!0},o._mouseUpOnPopup=function(){o._isMouseDownOnPopup=!1},o._async=new di(o),o._didSetInitialFocus=!1,o.state={positions:void 0,slideDirectionalClassName:void 0,calloutElementRect:void 0,heightOffset:0},o._positionAttempts=0,o}return p(t,e),t.prototype.componentDidUpdate=function(){this.props.hidden?this._hasListeners&&this._removeListeners():(this._setInitialFocus(),this._hasListeners||this._addListeners(),this._updateAsyncPosition())},t.prototype.shouldComponentUpdate=function(e,t){return!(!e.shouldUpdateWhenHidden&&this.props.hidden&&e.hidden)&&(!Fs(this.props,e)||!Fs(this.state,t))},t.prototype.UNSAFE_componentWillMount=function(){this._setTargetWindowAndElement(this._getTarget())},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._disposables.forEach((function(e){return e()}))},t.prototype.UNSAFE_componentWillUpdate=function(e){var t=this._getTarget(e);(t!==this._getTarget()||"string"==typeof t||t instanceof String)&&!this._blockResetHeight&&(this._maxHeight=void 0,this._setTargetWindowAndElement(t)),e.gapSpace===this.props.gapSpace&&this.props.beakWidth===e.beakWidth||(this._maxHeight=void 0),e.finalHeight!==this.props.finalHeight&&this._setHeightOffsetEveryFrame(),this._didPositionPropsChange(e,this.props)&&(this._maxHeight=void 0,this._setTargetWindowAndElement(t),this.setState({positions:void 0}),this._didSetInitialFocus=!1,this._bounds=void 0),this._blockResetHeight=!1},t.prototype.componentDidMount=function(){this.props.hidden||this._onComponentDidMount()},t.prototype.render=function(){if(!this._targetWindow)return null;var e=this.props.target,t=this.props,o=t.styles,n=t.style,r=t.ariaLabel,i=t.ariaDescribedBy,s=t.ariaLabelledBy,a=t.className,l=t.isBeakVisible,c=t.children,u=t.beakWidth,d=t.calloutWidth,p=t.calloutMaxWidth,m=t.finalHeight,g=t.hideOverflow,f=void 0===g?!!m:g,v=t.backgroundColor,_=t.calloutMaxHeight,y=t.onScroll,C=t.shouldRestoreFocus,S=void 0===C||C;e=this._getTarget();var x=this.state.positions,k=this._getMaxHeight()?this._getMaxHeight()+this.state.heightOffset:void 0,w=_&&k&&_<k?_:k,I=f,D=l&&!!e;this._classNames=Fl(o,{theme:this.props.theme,className:a,overflowYHidden:I,calloutWidth:d,positions:x,beakWidth:u,backgroundColor:v,calloutMaxWidth:p});var P=h(h(h({},n),{maxHeight:w}),I&&{overflowY:"hidden"}),T=this.props.hidden?{visibility:"hidden"}:void 0;return b.createElement("div",{ref:this._hostElement,className:this._classNames.container,style:T},b.createElement("div",h({},fr(this.props,gr,Ol),{className:Sr(this._classNames.root,x&&x.targetEdge&&Nl[x.targetEdge]),style:x?x.elementPosition:Hl,tabIndex:-1,ref:this._calloutElement}),D&&b.createElement("div",{className:this._classNames.beak,style:this._getBeakPosition()}),D&&b.createElement("div",{className:this._classNames.beakCurtain}),b.createElement(Rl,h({},fr(this.props,Ol),{ariaLabel:r,onRestoreFocus:this.props.onRestoreFocus,ariaDescribedBy:i,ariaLabelledBy:s,className:this._classNames.calloutMain,onDismiss:this.dismiss,onScroll:y,shouldRestoreFocus:S,style:P,onMouseDown:this._mouseDownOnPopup,onMouseUp:this._mouseUpOnPopup}),c)))},t.prototype._dismissOnClickOrScroll=function(e){var t=e.target,o=this._hostElement.current&&!Ni(this._hostElement.current,t);o&&this._isMouseDownOnPopup?this._isMouseDownOnPopup=!1:(!this._target&&o||e.target!==this._targetWindow&&o&&(this._target.stopPropagation||!this._target||this.props.dismissOnTargetClick||t!==this._target&&!Ni(this._target,t)))&&this.dismiss(e)},t.prototype._addListeners=function(){var e=this;this._async.setTimeout((function(){e._disposables.push(Ga(e._targetWindow,"scroll",e._dismissOnScroll,!0),Ga(e._targetWindow,"resize",e._dismissOnResize,!0),Ga(e._targetWindow.document.documentElement,"focus",e._dismissOnLostFocus,!0),Ga(e._targetWindow.document.documentElement,"click",e._dismissOnLostFocus,!0),Ga(e._targetWindow,"blur",e._dismissOnTargetWindowBlur,!0)),e._hasListeners=!0}),0)},t.prototype._removeListeners=function(){this._disposables.forEach((function(e){return e()})),this._disposables=[],this._hasListeners=!1},t.prototype._updateAsyncPosition=function(){var e=this;this._async.requestAnimationFrame((function(){return e._updatePosition()}),this._calloutElement.current)},t.prototype._getBeakPosition=function(){var e=this.state.positions,t=h({},e&&e.beakPosition?e.beakPosition.elementPosition:null);return t.top||t.bottom||t.left||t.right||(t.left=Ll,t.top=Al),t},t.prototype._updatePosition=function(){this._setTargetWindowAndElement(this._getTarget());var e=this.state.positions,t=this._hostElement.current,o=this._calloutElement.current,n=!!this.props.target;if(t&&o&&(!n||this._target)){var r=h({},this.props);r.bounds=this._getBounds(),r.target=this._target;var i=this.props.finalHeight?Dl(r,t,o,e):Il(r,t,o,e);!e&&i||e&&i&&!this._arePositionsEqual(e,i)&&this._positionAttempts<5?(this._positionAttempts++,this.setState({positions:i})):this._positionAttempts>0&&(this._positionAttempts=0,this.props.onPositioned&&this.props.onPositioned(this.state.positions))}},t.prototype._getBounds=function(){if(!this._bounds){var e=this.props.bounds,t="function"==typeof e?e(this.props.target,this._targetWindow):e;t||(t={top:(t=El(this._target,this._targetWindow)).top+this.props.minPagePadding,left:t.left+this.props.minPagePadding,right:t.right-this.props.minPagePadding,bottom:t.bottom-this.props.minPagePadding,width:t.width-2*this.props.minPagePadding,height:t.height-2*this.props.minPagePadding}),this._bounds=t}return this._bounds},t.prototype._getMaxHeight=function(){var e=this;if(!this._maxHeight)if(this.props.directionalHintFixed&&this._target){var t=this.props.isBeakVisible?this.props.beakWidth:0,o=(this.props.gapSpace?this.props.gapSpace:0)+t;this._async.requestAnimationFrame((function(){e._target&&(e._maxHeight=Pl(e._target,e.props.directionalHint,o,e._getBounds(),e.props.coverTarget),e._blockResetHeight=!0,e.forceUpdate())}),this._target)}else this._maxHeight=this._getBounds().height;return this._maxHeight},t.prototype._arePositionsEqual=function(e,t){return this._comparePositions(e.elementPosition,t.elementPosition)&&this._comparePositions(e.beakPosition.elementPosition,t.beakPosition.elementPosition)},t.prototype._comparePositions=function(e,t){for(var o in t)if(t.hasOwnProperty(o)){var n=e[o],r=t[o];if(void 0===n||void 0===r)return!1;if(n.toFixed(2)!==r.toFixed(2))return!1}return!0},t.prototype._setTargetWindowAndElement=function(e){var t=this._calloutElement.current;if(e)if("string"==typeof e){var o=tt(t);this._target=o?o.querySelector(e):null,this._targetWindow=rt(t)}else if(e.stopPropagation)this._targetWindow=rt(e.target),this._target=e;else if(e.getBoundingClientRect){var n=e;this._targetWindow=rt(n),this._target=n}else void 0!==e.current?(this._target=e.current,this._targetWindow=rt(this._target)):(this._targetWindow=rt(t),this._target=e);else this._targetWindow=rt(t)},t.prototype._setHeightOffsetEveryFrame=function(){var e=this;this._calloutElement.current&&this.props.finalHeight&&(this._setHeightOffsetTimer=this._async.requestAnimationFrame((function(){var t=e._calloutElement.current&&e._calloutElement.current.lastChild;if(t){var o=t.scrollHeight-t.offsetHeight;e.setState({heightOffset:e.state.heightOffset+o}),t.offsetHeight<e.props.finalHeight?e._setHeightOffsetEveryFrame():e._async.cancelAnimationFrame(e._setHeightOffsetTimer,e._calloutElement.current)}}),this._calloutElement.current))},t.prototype._didPositionPropsChange=function(e,t){return!e.hidden&&e.hidden!==t.hidden||e.directionalHint!==t.directionalHint},t.prototype._getTarget=function(e){return void 0===e&&(e=this.props),e.target},t.defaultProps={preventDismissOnLostFocus:!1,preventDismissOnScroll:!1,preventDismissOnResize:!1,isBeakVisible:!0,beakWidth:16,gapSpace:0,minPagePadding:8,directionalHint:ya.bottomAutoEdge},t}(b.Component);function Wl(e){return{height:e,width:e}}var Vl={container:"ms-Callout-container",root:"ms-Callout",beak:"ms-Callout-beak",beakCurtain:"ms-Callout-beakCurtain",calloutMain:"ms-Callout-main"},Kl=xn(zl,(function(e){var t,o=e.theme,n=e.className,r=e.overflowYHidden,i=e.calloutWidth,s=e.beakWidth,a=e.backgroundColor,l=e.calloutMaxWidth,c=Oo(Vl,o),u=o.semanticColors,d=o.effects;return{container:[c.container,{position:"relative"}],root:[c.root,o.fonts.medium,{position:"absolute",boxSizing:"border-box",borderRadius:d.roundedCorner2,boxShadow:d.elevation16,selectors:(t={},t[jt]={borderWidth:1,borderStyle:"solid",borderColor:"WindowText"},t)},{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}},n,!!i&&{width:i},!!l&&{maxWidth:l}],beak:[c.beak,{position:"absolute",backgroundColor:u.menuBackground,boxShadow:"inherit",border:"inherit",boxSizing:"border-box",transform:"rotate(45deg)"},Wl(s),a&&{backgroundColor:a}],beakCurtain:[c.beakCurtain,{position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:u.menuBackground,borderRadius:d.roundedCorner2}],calloutMain:[c.calloutMain,{backgroundColor:u.menuBackground,overflowX:"hidden",overflowY:"auto",position:"relative",borderRadius:d.roundedCorner2},r&&{overflowY:"hidden"},a&&{backgroundColor:a}]}}),void 0,{scope:"CalloutContent"}),Ul=o(14);function Gl(e,t){var o=(t||{}).customizations,n=void 0===o?{settings:{},scopedSettings:{}}:o;return{customizations:{settings:zo(n.settings,e.settings),scopedSettings:Wo(n.scopedSettings,e.scopedSettings),inCustomizerContext:!0}}}var jl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onCustomizationChange=function(){return t.forceUpdate()},t}return p(t,e),t.prototype.componentDidMount=function(){It.observe(this._onCustomizationChange)},t.prototype.componentWillUnmount=function(){It.unobserve(this._onCustomizationChange)},t.prototype.render=function(){var e=this,t=this.props.contextTransform;return b.createElement(yn.Consumer,null,(function(o){var n=Gl(e.props,o);return t&&(n=t(n)),b.createElement(yn.Provider,{value:n},e.props.children)}))},t}(b.Component),Yl=Mn(),ql=No((function(e,t){return Nt(h(h({},e),{rtl:t}))})),Zl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._rootElement=b.createRef(),t._removeClassNameFromBody=void 0,t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.as,o=void 0===t?"div":t,n=e.theme,r=e.dir,i=this._getClassNames(),s=fr(this.props,gr,["dir"]),a=function(e,t){var o=In(e)?"rtl":"ltr",n=In()?"rtl":"ltr",r=t||o;return{rootDir:r!==o||r!==n?r:t,needsTheme:r!==o}}(n,r),l=a.rootDir,c=a.needsTheme,u=b.createElement(o,h({dir:l},s,{className:i.root,ref:this._rootElement}));return c&&(u=b.createElement(jl,{settings:{theme:ql(n,"rtl"===r)}},u)),b.createElement(b.Fragment,null,u,b.createElement(ha,{rootRef:this._rootElement}))},t.prototype.componentDidMount=function(){this._addClassNameToBody()},t.prototype.componentWillUnmount=function(){this._removeClassNameFromBody&&this._removeClassNameFromBody()},t.prototype._getClassNames=function(){var e=this.props,t=e.className,o=e.theme,n=e.applyTheme,r=e.styles;return Yl(r,{theme:o,applyTheme:n,className:t})},t.prototype._addClassNameToBody=function(){if(this.props.applyThemeToBody){var e=this._getClassNames(),t=tt(this._rootElement.current);t&&(t.body.classList.add(e.bodyThemed),this._removeClassNameFromBody=function(){t.body.classList.remove(e.bodyThemed)})}},t}(b.Component),Xl={fontFamily:"inherit"},Ql={root:"ms-Fabric",bodyThemed:"ms-Fabric-bodyThemed"},Jl=xn(Zl,(function(e){var t=e.theme,o=e.className,n=e.applyTheme;return{root:[Oo(Ql,t).root,t.fonts.medium,{color:t.palette.neutralPrimary,selectors:{"& button":Xl,"& input":Xl,"& textarea":Xl}},n&&{color:t.semanticColors.bodyText,backgroundColor:t.semanticColors.bodyBackground},o],bodyThemed:[{backgroundColor:t.semanticColors.bodyBackground}]}}),void 0,{scope:"Fabric"});function $l(e,t){var o=e,n=t;o._virtual||(o._virtual={children:[]});var r=o._virtual.parent;if(r&&r!==t){var i=r._virtual.children.indexOf(o);i>-1&&r._virtual.children.splice(i,1)}o._virtual.parent=n||void 0,n&&(n._virtual||(n._virtual={children:[]}),n._virtual.children.push(o))}function ec(e,t,o){return function(n){var r,i=((r=function(r){function i(e){var t=r.call(this,e)||this;return t._styleCache={},t._onSettingChanged=t._onSettingChanged.bind(t),t}return p(i,r),i.prototype.componentDidMount=function(){It.observe(this._onSettingChanged)},i.prototype.componentWillUnmount=function(){It.unobserve(this._onSettingChanged)},i.prototype.render=function(){var r=this;return b.createElement(yn.Consumer,null,(function(i){var s=It.getSettings(t,e,i.customizations),a=r.props;if(s.styles&&"function"==typeof s.styles&&(s.styles=s.styles(h(h({},s),a))),o&&s.styles){if(r._styleCache.default!==s.styles||r._styleCache.component!==a.styles){var l=dn(s.styles,a.styles);r._styleCache.default=s.styles,r._styleCache.component=a.styles,r._styleCache.merged=l}return b.createElement(n,h({},s,a,{styles:r._styleCache.merged}))}return b.createElement(n,h({},s,a))}))},i.prototype._onSettingChanged=function(){this.forceUpdate()},i}(b.Component)).displayName="Customized"+e,r);return Ma(n,i)}}var tc,oc={};function nc(e){oc[e]&&oc[e].forEach((function(e){return e()}))}var rc,ic=Mn(),sc=function(e){function t(t){var o=e.call(this,t)||this;return o._rootRef=b.createRef(),o._createLayerElement=function(){var e=o.props.hostId,t=tt(o._rootRef.current),n=o._getHost();if(t&&n){o._removeLayerElement();var r=t.createElement("div"),i=o._getClassNames();r.className=i.root,gs(r),$l(r,o._rootRef.current),o.props.insertFirst?n.insertBefore(r,n.firstChild):n.appendChild(r),o.setState({hostId:e,layerElement:r},(function(){var e=o.props,t=e.onLayerDidMount,n=e.onLayerMounted;n&&n(),t&&t()}))}},o.state={},o}return p(t,e),t.prototype.componentDidMount=function(){var e=this.props.hostId;this._createLayerElement(),e&&function(e,t){oc[e]||(oc[e]=[]),oc[e].push(t)}(e,this._createLayerElement)},t.prototype.render=function(){var e=this.state.layerElement,t=this._getClassNames(),o=this.props.eventBubblingEnabled;return b.createElement("span",{className:"ms-layer",ref:this._rootRef},e&&Ul.createPortal(b.createElement(Jl,h({},!o&&function(){rc||(rc={},["onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOver","onMouseOut","onMouseUp","onTouchMove","onTouchStart","onTouchCancel","onTouchEnd","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onInvalid","onSubmit"].forEach((function(e){return rc[e]=ac})));return rc}(),{className:t.content}),this.props.children),e))},t.prototype.componentDidUpdate=function(){this.props.hostId!==this.state.hostId&&this._createLayerElement()},t.prototype.componentWillUnmount=function(){var e=this.props.hostId;this._removeLayerElement(),e&&function(e,t){if(oc[e]){var o=oc[e].indexOf(t);o>=0&&(oc[e].splice(o,1),0===oc[e].length&&delete oc[e])}}(e,this._createLayerElement)},t.prototype._removeLayerElement=function(){var e=this.props.onLayerWillUnmount,t=this.state.layerElement;if(t&&$l(t,null),e&&e(),t&&t.parentNode){var o=t.parentNode;o&&o.removeChild(t)}},t.prototype._getClassNames=function(){var e=this.props,t=e.className,o=e.styles,n=e.theme;return ic(o,{theme:n,className:t,isNotHost:!this.props.hostId})},t.prototype._getHost=function(){var e=this.props.hostId,t=tt(this._rootRef.current);if(t){if(e)return t.getElementById(e);var o=tc;return o?t.querySelector(o):t.body}},t.defaultProps={onLayerDidMount:function(){},onLayerWillUnmount:function(){}},t=g([ec("Layer",["theme","hostId"])],t)}(b.Component),ac=function(e){e.eventPhase===Event.BUBBLING_PHASE&&"mouseenter"!==e.type&&"mouseleave"!==e.type&&"touchstart"!==e.type&&"touchend"!==e.type&&e.stopPropagation()};var lc={root:"ms-Layer",rootNoHost:"ms-Layer--fixed",content:"ms-Layer-content"},cc=xn(sc,(function(e){var t=e.className,o=e.isNotHost,n=e.theme,r=Oo(lc,n);return{root:[r.root,n.fonts.medium,o&&[r.rootNoHost,{position:"fixed",zIndex:po.Layer,top:0,left:0,bottom:0,right:0,visibility:"hidden"}],t],content:[r.content,{visibility:"visible"}]}}),void 0,{scope:"Layer",fields:["hostId","theme","styles"]}),uc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.layerProps,o=m(e,["layerProps"]),n=b.createElement(Kl,h({},o));return this.props.doNotLayer?n:b.createElement(cc,h({},t),n)},t}(b.Component),dc=function(e){var t=e.item,o=e.hasIcons,n=e.classNames,r=t.iconProps;return o?t.onRenderIcon?t.onRenderIcon(e):b.createElement(Fr,h({},r,{className:n.icon})):null},pc=function(e){var t=e.onCheckmarkClick,o=e.item,n=e.classNames,r=xa(o);if(t){return b.createElement(Fr,{iconName:!1!==o.canCheck&&r?"CheckMark":"",className:n.checkmarkIcon,onClick:function(e){return t(o,e)}})}return null},hc=function(e){var t=e.item,o=e.classNames;return t.text||t.name?b.createElement("span",{className:o.label},t.text||t.name):null},mc=function(e){var t=e.item,o=e.classNames;return t.secondaryText?b.createElement("span",{className:o.secondaryText},t.secondaryText):null},gc=function(e){var t=e.item,o=e.classNames,n=e.theme;return ka(t)?b.createElement(Fr,h({iconName:In(n)?"ChevronLeft":"ChevronRight"},t.submenuIconProps,{className:o.subMenuIcon})):null},fc=function(e){function t(t){var o=e.call(this,t)||this;return o.openSubMenu=function(){var e=o.props,t=e.item,n=e.openSubMenu,r=e.getSubmenuTarget;if(r){var i=r();ka(t)&&n&&i&&n(t,i)}},o.dismissSubMenu=function(){var e=o.props,t=e.item,n=e.dismissSubMenu;ka(t)&&n&&n()},o.dismissMenu=function(e){var t=o.props.dismissMenu;t&&t(void 0,e)},si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.item,o=e.classNames,n=t.onRenderContent||this._renderLayout;return b.createElement("div",{className:t.split?o.linkContentMenu:o.linkContent},n(this.props,{renderCheckMarkIcon:pc,renderItemIcon:dc,renderItemName:hc,renderSecondaryText:mc,renderSubMenuIcon:gc}))},t.prototype._renderLayout=function(e,t){return b.createElement(b.Fragment,null,t.renderCheckMarkIcon(e),t.renderItemIcon(e),t.renderItemName(e),t.renderSecondaryText(e),t.renderSubMenuIcon(e))},t}(b.Component),vc=No((function(e){return hn({wrapper:{display:"inline-flex",height:"100%",alignItems:"center"},divider:{width:1,height:"100%",backgroundColor:e.palette.neutralTertiaryAlt}})})),bc=lo(0,no),_c=No((function(){var e;return{selectors:(e={},e[jt]=h({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),e)}})),yc=No((function(e){var t,o,n,r,i,s,a,l=e.semanticColors,c=e.fonts,u=e.palette,d=l.menuItemBackgroundHovered,p=l.menuItemTextHovered,m=l.menuItemBackgroundPressed,g=l.bodyDivider;return dn({item:[c.medium,{color:l.bodyText,position:"relative",boxSizing:"border-box"}],divider:{display:"block",height:"1px",backgroundColor:g,position:"relative"},root:[go(e),c.medium,{color:l.bodyText,backgroundColor:"transparent",border:"none",width:"100%",height:36,lineHeight:36,display:"block",cursor:"pointer",padding:"0px 8px 0 4px",textAlign:"left"}],rootDisabled:{color:l.disabledBodyText,cursor:"default",pointerEvents:"none",selectors:(t={},t[jt]=h({color:"GrayText",opacity:1},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},rootHovered:h({backgroundColor:d,color:p,selectors:{".ms-ContextualMenu-icon":{color:u.themeDarkAlt},".ms-ContextualMenu-submenuIcon":{color:u.neutralPrimary}}},_c()),rootFocused:h({backgroundColor:u.white},_c()),rootChecked:h({selectors:{".ms-ContextualMenu-checkmarkIcon":{color:u.neutralPrimary}}},_c()),rootPressed:h({backgroundColor:m,selectors:{".ms-ContextualMenu-icon":{color:u.themeDark},".ms-ContextualMenu-submenuIcon":{color:u.neutralPrimary}}},_c()),rootExpanded:h({backgroundColor:m,color:l.bodyTextChecked},_c()),linkContent:{whiteSpace:"nowrap",height:"inherit",display:"flex",alignItems:"center",maxWidth:"100%"},anchorLink:{padding:"0px 8px 0 4px",textRendering:"auto",color:"inherit",letterSpacing:"normal",wordSpacing:"normal",textTransform:"none",textIndent:"0px",textShadow:"none",textDecoration:"none",boxSizing:"border-box"},label:{margin:"0 4px",verticalAlign:"middle",display:"inline-block",flexGrow:"1",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},secondaryText:{color:e.palette.neutralSecondary,paddingLeft:"20px",textAlign:"right"},icon:{display:"inline-block",minHeight:"1px",maxHeight:36,fontSize:je.medium,width:je.medium,margin:"0 4px",verticalAlign:"middle",flexShrink:"0",selectors:(o={},o[bc]={fontSize:je.large,width:je.large},o)},iconColor:{color:l.menuIcon,selectors:(n={},n[jt]={color:"inherit"},n["$root:hover &"]={selectors:(r={},r[jt]={color:"HighlightText"},r)},n["$root:focus &"]={selectors:(i={},i[jt]={color:"HighlightText"},i)},n)},iconDisabled:{color:l.disabledBodyText},checkmarkIcon:{color:l.bodySubtext,selectors:(s={},s[jt]={color:"HighlightText"},s)},subMenuIcon:{height:36,lineHeight:36,color:u.neutralSecondary,textAlign:"center",display:"inline-block",verticalAlign:"middle",flexShrink:"0",fontSize:je.small,selectors:(a={":hover":{color:u.neutralPrimary},":active":{color:u.neutralPrimary}},a[bc]={fontSize:je.medium},a[jt]={color:"HighlightText"},a)},splitButtonFlexContainer:[go(e),{display:"flex",height:36,flexWrap:"nowrap",justifyContent:"center",alignItems:"flex-start"}]})})),Cc=lo(0,no),Sc=No((function(e){var t;return hn(vc(e),{wrapper:{position:"absolute",right:28,selectors:(t={},t[Cc]={right:32},t)},divider:{height:16,width:1}})})),xc={item:"ms-ContextualMenu-item",divider:"ms-ContextualMenu-divider",root:"ms-ContextualMenu-link",isChecked:"is-checked",isExpanded:"is-expanded",isDisabled:"is-disabled",linkContent:"ms-ContextualMenu-linkContent",linkContentMenu:"ms-ContextualMenu-linkContent",icon:"ms-ContextualMenu-icon",iconColor:"ms-ContextualMenu-iconColor",checkmarkIcon:"ms-ContextualMenu-checkmarkIcon",subMenuIcon:"ms-ContextualMenu-submenuIcon",label:"ms-ContextualMenu-itemText",secondaryText:"ms-ContextualMenu-secondaryText",splitMenu:"ms-ContextualMenu-splitMenu",screenReaderText:"ms-ContextualMenu-screenReaderText"},kc=No((function(e,t,o,n,r,i,s,a,l,c,u,d){var p,h,m,g,f=yc(e),v=Oo(xc,e);return hn({item:[v.item,f.item,s],divider:[v.divider,f.divider,a],root:[v.root,f.root,n&&[v.isChecked,f.rootChecked],r&&f.anchorLink,o&&[v.isExpanded,f.rootExpanded],t&&[v.isDisabled,f.rootDisabled],!t&&!o&&[{selectors:(p={":hover":f.rootHovered,":active":f.rootPressed},p["."+ho+" &:focus, ."+ho+" &:focus:hover"]=f.rootFocused,p["."+ho+" &:hover"]={background:"inherit;"},p)}],d],splitPrimary:[f.root,{width:"calc(100% - 28px)"},n&&["is-checked",f.rootChecked],(t||u)&&["is-disabled",f.rootDisabled],!(t||u)&&!n&&[{selectors:(h={":hover":f.rootHovered},h[":hover ~ ."+v.splitMenu]=f.rootHovered,h[":active"]=f.rootPressed,h["."+ho+" &:focus, ."+ho+" &:focus:hover"]=f.rootFocused,h["."+ho+" &:hover"]={background:"inherit;"},h)}]],splitMenu:[v.splitMenu,f.root,{flexBasis:"0",padding:"0 8px",minWidth:"28px"},o&&["is-expanded",f.rootExpanded],t&&["is-disabled",f.rootDisabled],!t&&!o&&[{selectors:(m={":hover":f.rootHovered,":active":f.rootPressed},m["."+ho+" &:focus, ."+ho+" &:focus:hover"]=f.rootFocused,m["."+ho+" &:hover"]={background:"inherit;"},m)}]],anchorLink:f.anchorLink,linkContent:[v.linkContent,f.linkContent],linkContentMenu:[v.linkContentMenu,f.linkContent,{justifyContent:"center"}],icon:[v.icon,i&&f.iconColor,f.icon,l,t&&[v.isDisabled,f.iconDisabled]],iconColor:f.iconColor,checkmarkIcon:[v.checkmarkIcon,i&&f.checkmarkIcon,f.icon,l],subMenuIcon:[v.subMenuIcon,f.subMenuIcon,c,o&&{color:e.palette.neutralPrimary},t&&[f.iconDisabled]],label:[v.label,f.label],secondaryText:[v.secondaryText,f.secondaryText],splitContainer:[f.splitButtonFlexContainer,!t&&!n&&[{selectors:(g={},g["."+ho+" &:focus, ."+ho+" &:focus:hover"]=f.rootFocused,g)}]],screenReaderText:[v.screenReaderText,f.screenReaderText,yo,{visibility:"hidden"}]})})),wc=function(e){var t=e.theme,o=e.disabled,n=e.expanded,r=e.checked,i=e.isAnchorLink,s=e.knownIcon,a=e.itemClassName,l=e.dividerClassName,c=e.iconClassName,u=e.subMenuClassName,d=e.primaryDisabled,p=e.className;return kc(t,o,n,r,i,s,a,l,c,u,d,p)},Ic=xn(fc,wc,void 0,{scope:"ContextualMenuItem"}),Dc=function(e){function t(t){var o=e.call(this,t)||this;return o._onItemMouseEnter=function(e){var t=o.props,n=t.item,r=t.onItemMouseEnter;r&&r(n,e,e.currentTarget)},o._onItemClick=function(e){var t=o.props,n=t.item,r=t.onItemClickBase;r&&r(n,e,e.currentTarget)},o._onItemMouseLeave=function(e){var t=o.props,n=t.item,r=t.onItemMouseLeave;r&&r(n,e)},o._onItemKeyDown=function(e){var t=o.props,n=t.item,r=t.onItemKeyDown;r&&r(n,e)},o._onItemMouseMove=function(e){var t=o.props,n=t.item,r=t.onItemMouseMove;r&&r(n,e,e.currentTarget)},o._getSubMenuId=function(e){var t=o.props.getSubMenuId;if(t)return t(e)},o._getSubmenuTarget=function(){},si(o),o}return p(t,e),t.prototype.shouldComponentUpdate=function(e){return!Fs(e,this.props)},t}(b.Component),Pc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._anchor=b.createRef(),t._getMemoizedMenuButtonKeytipProps=No((function(e){return h(h({},e),{hasMenu:!0})})),t._getSubmenuTarget=function(){return t._anchor.current?t._anchor.current:void 0},t._onItemClick=function(e){var o=t.props,n=o.item,r=o.onItemClick;r&&r(n,e)},t._renderAriaDescription=function(e,o){return e?b.createElement("span",{id:t._ariaDescriptionId,className:o},e):null},t}return p(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.item,n=t.classNames,r=t.index,i=t.focusableElementIndex,s=t.totalItemCount,a=t.hasCheckmarks,l=t.hasIcons,c=t.contextualMenuItemAs,u=void 0===c?Ic:c,d=t.expandedMenuItemKey,p=t.onItemClick,m=t.openSubMenu,g=t.dismissSubMenu,f=t.dismissMenu,v=o.rel;o.target&&"_blank"===o.target.toLowerCase()&&(v=v||"nofollow noopener noreferrer");var _=this._getSubMenuId(o),y=ka(o),C=fr(o,$n),S=wa(o),x=o.itemProps,k=o.ariaDescription,w=o.keytipProps;return w&&y&&(w=this._getMemoizedMenuButtonKeytipProps(w)),k&&(this._ariaDescriptionId=ts()),b.createElement("div",null,b.createElement(Zs,{keytipProps:o.keytipProps,ariaDescribedBy:C["aria-describedby"],disabled:S},(function(t){return b.createElement("a",h({},C,t,{ref:e._anchor,href:o.href,target:o.target,rel:v,className:n.root,role:"menuitem","aria-owns":o.key===d?_:void 0,"aria-haspopup":y||void 0,"aria-expanded":y?o.key===d:void 0,"aria-posinset":i+1,"aria-setsize":s,"aria-disabled":wa(o),"aria-describedby":Ns(k?e._ariaDescriptionId:void 0,t?t["aria-describedby"]:void 0),style:o.style,onClick:e._onItemClick,onMouseEnter:e._onItemMouseEnter,onMouseLeave:e._onItemMouseLeave,onMouseMove:e._onItemMouseMove,onKeyDown:y?e._onItemKeyDown:void 0}),b.createElement(u,h({componentRef:o.componentRef,item:o,classNames:n,index:r,onCheckmarkClick:a&&p?p:void 0,hasIcons:l,openSubMenu:m,dismissSubMenu:g,dismissMenu:f,getSubmenuTarget:e._getSubmenuTarget},x)),e._renderAriaDescription(k,n.screenReaderText))})))},t}(Dc),Tc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._btn=b.createRef(),t._getMemoizedMenuButtonKeytipProps=No((function(e){return h(h({},e),{hasMenu:!0})})),t._renderAriaDescription=function(e,o){return e?b.createElement("span",{id:t._ariaDescriptionId,className:o},e):null},t._getSubmenuTarget=function(){return t._btn.current?t._btn.current:void 0},t}return p(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.item,n=t.classNames,r=t.index,i=t.focusableElementIndex,s=t.totalItemCount,a=t.hasCheckmarks,l=t.hasIcons,c=t.contextualMenuItemAs,u=void 0===c?Ic:c,d=t.expandedMenuItemKey,p=t.onItemMouseDown,m=t.onItemClick,g=t.openSubMenu,f=t.dismissSubMenu,v=t.dismissMenu,_=this._getSubMenuId(o),y=xa(o),C=null!==y,S=Ia(o),x=ka(o),k=o.itemProps,w=o.ariaLabel,I=o.ariaDescription,D=fr(o,er);delete D.disabled;var P=o.role||S;I&&(this._ariaDescriptionId=ts());var T=I?this._ariaDescriptionId:void 0,E={className:n.root,onClick:this._onItemClick,onKeyDown:x?this._onItemKeyDown:void 0,onMouseEnter:this._onItemMouseEnter,onMouseLeave:this._onItemMouseLeave,onMouseDown:function(e){return p?p(o,e):void 0},onMouseMove:this._onItemMouseMove,href:o.href,title:o.title,"aria-label":w,"aria-describedby":T,"aria-haspopup":x||void 0,"aria-owns":o.key===d?_:void 0,"aria-expanded":x?o.key===d:void 0,"aria-posinset":i+1,"aria-setsize":s,"aria-disabled":wa(o),"aria-checked":"menuitemcheckbox"!==P&&"menuitemradio"!==P||!C?void 0:!!y,"aria-selected":"menuitem"===P&&C?!!y:void 0,role:P,style:o.style},M=o.keytipProps;return M&&x&&(M=this._getMemoizedMenuButtonKeytipProps(M)),b.createElement(Zs,{keytipProps:M,ariaDescribedBy:D["aria-describedby"],disabled:wa(o)},(function(t){return b.createElement("button",h({ref:e._btn},D,E,t,{"aria-describedby":Ns(E["aria-describedby"],t?t["aria-describedby"]:void 0)}),b.createElement(u,h({componentRef:o.componentRef,item:o,classNames:n,index:r,onCheckmarkClick:a&&m?m:void 0,hasIcons:l,openSubMenu:g,dismissSubMenu:f,dismissMenu:v,getSubmenuTarget:e._getSubmenuTarget},k)),e._renderAriaDescription(I,n.screenReaderText))}))},t}(Dc),Ec=Mn(),Mc=function(e){var t=e.styles,o=e.theme,n=e.getClassNames,r=e.className,i=Ec(t,{theme:o,getClassNames:n,className:r});return b.createElement("span",{className:i.wrapper},b.createElement("span",{className:i.divider}))};Mc.displayName="VerticalDividerBase";var Rc=xn(Mc,(function(e){var t=e.theme,o=e.getClassNames,n=e.className;if(!t)throw new Error("Theme is undefined or null.");if(o){var r=o(t);return{wrapper:[r.wrapper],divider:[r.divider]}}return{wrapper:[{display:"inline-flex",height:"100%",alignItems:"center"},n],divider:[{width:1,height:"100%",backgroundColor:t.palette.neutralTertiaryAlt}]}}),void 0,{scope:"VerticalDivider"}),Bc=function(e){function t(t){var o=e.call(this,t)||this;return o._getMemoizedMenuButtonKeytipProps=No((function(e){return h(h({},e),{hasMenu:!0})})),o._renderAriaDescription=function(e,t){return e?b.createElement("span",{id:o._ariaDescriptionId,className:t},e):null},o._onItemKeyDown=function(e){var t=o.props,n=t.item,r=t.onItemKeyDown;e.which===wn.enter?(o._executeItemClick(e),e.preventDefault(),e.stopPropagation()):r&&r(n,e)},o._getSubmenuTarget=function(){return o._splitButton},o._onItemMouseEnterPrimary=function(e){var t=o.props,n=t.item,r=t.onItemMouseEnter;r&&r(h(h({},n),{subMenuProps:void 0,items:void 0}),e,o._splitButton)},o._onItemMouseEnterIcon=function(e){var t=o.props,n=t.item,r=t.onItemMouseEnter;r&&r(n,e,o._splitButton)},o._onItemMouseMovePrimary=function(e){var t=o.props,n=t.item,r=t.onItemMouseMove;r&&r(h(h({},n),{subMenuProps:void 0,items:void 0}),e,o._splitButton)},o._onItemMouseMoveIcon=function(e){var t=o.props,n=t.item,r=t.onItemMouseMove;r&&r(n,e,o._splitButton)},o._onIconItemClick=function(e){var t=o.props,n=t.item,r=t.onItemClickBase;r&&r(n,e,o._splitButton?o._splitButton:e.currentTarget)},o._executeItemClick=function(e){var t=o.props,n=t.item,r=t.executeItemClick,i=t.onItemClick;if(!n.disabled&&!n.isDisabled)return o._processingTouch&&i?i(n,e):void(r&&r(n,e))},o._onTouchStart=function(e){o._splitButton&&!("onpointerdown"in o._splitButton)&&o._handleTouchAndPointerEvent(e)},o._onPointerDown=function(e){"touch"===e.pointerType&&(o._handleTouchAndPointerEvent(e),e.preventDefault(),e.stopImmediatePropagation())},o._async=new di(o),o._events=new Ws(o),o}return p(t,e),t.prototype.componentDidMount=function(){this._splitButton&&"onpointerdown"in this._splitButton&&this._events.on(this._splitButton,"pointerdown",this._onPointerDown,!0)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this,t=this.props,o=t.item,n=t.classNames,r=t.index,i=t.focusableElementIndex,s=t.totalItemCount,a=t.hasCheckmarks,l=t.hasIcons,c=t.onItemMouseLeave,u=t.expandedMenuItemKey,d=ka(o),p=o.keytipProps;p&&(p=this._getMemoizedMenuButtonKeytipProps(p));var m=o.ariaDescription;return m&&(this._ariaDescriptionId=ts()),b.createElement(Zs,{keytipProps:p,disabled:wa(o)},(function(t){return b.createElement("div",{"data-ktp-target":t["data-ktp-target"],ref:function(t){return e._splitButton=t},role:Ia(o),"aria-label":o.ariaLabel,className:n.splitContainer,"aria-disabled":wa(o),"aria-expanded":d?o.key===u:void 0,"aria-haspopup":!0,"aria-describedby":Ns(m?e._ariaDescriptionId:void 0,t["aria-describedby"]),"aria-checked":o.isChecked||o.checked,"aria-posinset":i+1,"aria-setsize":s,onMouseEnter:e._onItemMouseEnterPrimary,onMouseLeave:c?c.bind(e,h(h({},o),{subMenuProps:null,items:null})):void 0,onMouseMove:e._onItemMouseMovePrimary,onKeyDown:e._onItemKeyDown,onClick:e._executeItemClick,onTouchStart:e._onTouchStart,tabIndex:0,"data-is-focusable":!0,"aria-roledescription":o["aria-roledescription"]},e._renderSplitPrimaryButton(o,n,r,a,l),e._renderSplitDivider(o),e._renderSplitIconButton(o,n,r,t),e._renderAriaDescription(m,n.screenReaderText))}))},t.prototype._renderSplitPrimaryButton=function(e,t,o,n,r){var i=this.props,s=i.contextualMenuItemAs,a=void 0===s?Ic:s,l=i.onItemClick,c={key:e.key,disabled:wa(e)||e.primaryDisabled,name:e.name,text:e.text||e.name,secondaryText:e.secondaryText,className:t.splitPrimary,canCheck:e.canCheck,isChecked:e.isChecked,checked:e.checked,iconProps:e.iconProps,onRenderIcon:e.onRenderIcon,data:e.data,"data-is-focusable":!1},u=e.itemProps;return b.createElement("button",h({},fr(c,er)),b.createElement(a,h({"data-is-focusable":!1,item:c,classNames:t,index:o,onCheckmarkClick:n&&l?l:void 0,hasIcons:r},u)))},t.prototype._renderSplitDivider=function(e){var t=e.getSplitButtonVerticalDividerClassNames||Sc;return b.createElement(Rc,{getClassNames:t})},t.prototype._renderSplitIconButton=function(e,t,o,n){var r=this.props,i=r.contextualMenuItemAs,s=void 0===i?Ic:i,a=r.onItemMouseLeave,l=r.onItemMouseDown,c=r.openSubMenu,u=r.dismissSubMenu,d=r.dismissMenu,p={onClick:this._onIconItemClick,disabled:wa(e),className:t.splitMenu,subMenuProps:e.subMenuProps,submenuIconProps:e.submenuIconProps,split:!0,key:e.key},m=h(h({},fr(p,er)),{onMouseEnter:this._onItemMouseEnterIcon,onMouseLeave:a?a.bind(this,e):void 0,onMouseDown:function(t){return l?l(e,t):void 0},onMouseMove:this._onItemMouseMoveIcon,"data-is-focusable":!1,"data-ktp-execute-target":n["data-ktp-execute-target"],"aria-hidden":!0}),g=e.itemProps;return b.createElement("button",h({},m),b.createElement(s,h({componentRef:e.componentRef,item:p,classNames:t,index:o,hasIcons:!1,openSubMenu:c,dismissSubMenu:u,dismissMenu:d,getSubmenuTarget:this._getSubmenuTarget},g)))},t.prototype._handleTouchAndPointerEvent=function(e){var t=this,o=this.props.onTap;o&&o(e),this._lastTouchTimeoutId&&(this._async.clearTimeout(this._lastTouchTimeoutId),this._lastTouchTimeoutId=void 0),this._processingTouch=!0,this._lastTouchTimeoutId=this._async.setTimeout((function(){t._processingTouch=!1,t._lastTouchTimeoutId=void 0}),500)},t}(Dc),Nc=Mn(),Fc=Mn();function Ac(e){return e.subMenuProps?e.subMenuProps.items:e.items}function Lc(e){return e.some((function(e){return!!e.canCheck||!(!e.sectionProps||!e.sectionProps.items.some((function(e){return!0===e.canCheck})))}))}var Hc=No((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return pn.apply(void 0,f([t,wc],e))}})),Oc=function(e){function t(t){var o=e.call(this,t)||this;return o._mounted=!1,o.dismiss=function(e,t){var n=o.props.onDismiss;n&&n(e,t)},o._tryFocusPreviousActiveElement=function(e){o.props.onRestoreFocus?o.props.onRestoreFocus(e):e&&e.containsFocus&&o._previousActiveElement&&o._previousActiveElement.focus&&o._previousActiveElement.focus()},o._onRenderMenuList=function(e,t){var n=0,r=e.items,i=e.totalItemCount,s=e.hasCheckmarks,a=e.hasIcons,l=e.role;return b.createElement("ul",{className:o._classNames.list,onKeyDown:o._onKeyDown,onKeyUp:o._onKeyUp,role:null!=l?l:"menu"},r.map((function(e,t){var r=o._renderMenuItem(e,t,n,i,s,a);if(e.itemType!==va.Divider&&e.itemType!==va.Header){var l=e.customOnRenderListLength?e.customOnRenderListLength:1;n+=l}return r})))},o._renderMenuItem=function(e,t,n,r,i,s){var a,l,c=[],u=e.iconProps||{iconName:"None"},d=e.getItemClassNames,p=e.itemProps,h=p?p.styles:void 0,m=e.itemType===va.Divider?e.className:void 0,g=e.submenuIconProps?e.submenuIconProps.className:"";if(d)l=d(o.props.theme,wa(e),o.state.expandedMenuItemKey===e.key,!!xa(e),!!e.href,"None"!==u.iconName,e.className,m,u.className,g,e.primaryDisabled);else{var f={theme:o.props.theme,disabled:wa(e),expanded:o.state.expandedMenuItemKey===e.key,checked:!!xa(e),isAnchorLink:!!e.href,knownIcon:"None"!==u.iconName,itemClassName:e.className,dividerClassName:m,iconClassName:u.className,subMenuClassName:g,primaryDisabled:e.primaryDisabled};l=Fc(Hc(null===(a=o._classNames.subComponentStyles)||void 0===a?void 0:a.menuItem,h),f)}switch("-"!==e.text&&"-"!==e.name||(e.itemType=va.Divider),e.itemType){case va.Divider:c.push(o._renderSeparator(t,l));break;case va.Header:c.push(o._renderSeparator(t,l));var v=o._renderHeaderMenuItem(e,l,t,i,s);c.push(o._renderListItem(v,e.key||t,l,e.title));break;case va.Section:c.push(o._renderSectionItem(e,l,t,i,s));break;default:var _=o._renderNormalItem(e,l,t,n,r,i,s);c.push(o._renderListItem(_,e.key||t,l,e.title))}return b.createElement(b.Fragment,{key:e.key},c)},o._defaultMenuItemRenderer=function(e){var t=e.index,n=e.focusableElementIndex,r=e.totalItemCount,i=e.hasCheckmarks,s=e.hasIcons;return o._renderMenuItem(e,t,n,r,i,s)},o._onKeyDown=function(e){o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e);var t=e.which===wn.escape&&(Ca()||Sa());return o._keyHandler(e,o._shouldHandleKeyDown,t)},o._shouldHandleKeyDown=function(e){return e.which===wn.escape||o._shouldCloseSubMenu(e)||e.which===wn.up&&(e.altKey||e.metaKey)},o._onMenuFocusCapture=function(e){o.props.delayUpdateFocusOnHover&&(o._shouldUpdateFocusOnMouseEvent=!0)},o._onKeyUp=function(e){return o._keyHandler(e,o._shouldHandleKeyUp,!0)},o._shouldHandleKeyUp=function(e){var t=o._lastKeyDownWasAltOrMeta&&o._isAltOrMeta(e);return o._lastKeyDownWasAltOrMeta=!1,!!t&&!(Sa()||Ca())},o._keyHandler=function(e,t,n){var r=!1;return t(e)&&(o._focusingPreviousElement=!0,o.dismiss(e,n),e.preventDefault(),e.stopPropagation(),r=!0),r},o._shouldCloseSubMenu=function(e){var t=In(o.props.theme)?wn.right:wn.left;return!(e.which!==t||!o.props.isSubMenu)&&(o._adjustedFocusZoneProps.direction===vs.vertical||!!o._adjustedFocusZoneProps.checkForNoWrap&&!Yi(e.target,"data-no-horizontal-wrap"))},o._onMenuKeyDown=function(e){if(!o._onKeyDown(e)&&o._host){var t=!(!e.altKey&&!e.metaKey),n=e.which===wn.up,r=e.which===wn.down;if(!t&&(n||r)){var i=n?Ai(o._host,o._host.lastChild,!0):Fi(o._host,o._host.firstChild,!0);i&&(i.focus(),e.preventDefault(),e.stopPropagation())}}},o._onScroll=function(){o._isScrollIdle||void 0===o._scrollIdleTimeoutId?o._isScrollIdle=!1:(o._async.clearTimeout(o._scrollIdleTimeoutId),o._scrollIdleTimeoutId=void 0),o._scrollIdleTimeoutId=o._async.setTimeout((function(){o._isScrollIdle=!0}),250)},o._onItemMouseEnterBase=function(e,t,n){o._shouldIgnoreMouseEvent()||o._updateFocusOnMouseEvent(e,t,n)},o._onItemMouseMoveBase=function(e,t,n){var r=t.currentTarget;o._shouldUpdateFocusOnMouseEvent&&(o._gotMouseMove=!0,o._isScrollIdle&&void 0===o._enterTimerId&&r!==o._targetWindow.document.activeElement&&o._updateFocusOnMouseEvent(e,t,n))},o._onMouseItemLeave=function(e,t){if(!o._shouldIgnoreMouseEvent()&&(void 0!==o._enterTimerId&&(o._async.clearTimeout(o._enterTimerId),o._enterTimerId=void 0),void 0===o.state.expandedMenuItemKey))if(o._host.setActive)try{o._host.setActive()}catch(e){}else o._host.focus()},o._onItemMouseDown=function(e,t){e.onMouseDown&&e.onMouseDown(e,t)},o._onItemClick=function(e,t){o._onItemClickBase(e,t,t.currentTarget)},o._onItemClickBase=function(e,t,n){var r=Ac(e);o._cancelSubMenuTimer(),ka(e)||r&&r.length?e.key!==o.state.expandedMenuItemKey&&(o.setState({expandedByMouseClick:0!==t.nativeEvent.detail||"mouse"===t.nativeEvent.pointerType}),o._onItemSubMenuExpand(e,n)):o._executeItemClick(e,t),t.stopPropagation(),t.preventDefault()},o._onAnchorClick=function(e,t){o._executeItemClick(e,t),t.stopPropagation()},o._executeItemClick=function(e,t){if(!e.disabled&&!e.isDisabled){var n=!1;e.onClick?n=!!e.onClick(t,e):o.props.onItemClick&&(n=!!o.props.onItemClick(t,e)),!n&&t.defaultPrevented||(o.dismiss(t,!0),o._focusingPreviousElement=!0)}},o._onItemKeyDown=function(e,t){var n=In(o.props.theme)?wn.left:wn.right;e.disabled||t.which!==n&&t.which!==wn.enter&&(t.which!==wn.down||!t.altKey&&!t.metaKey)||(o.setState({expandedByMouseClick:!1}),o._onItemSubMenuExpand(e,t.currentTarget),t.preventDefault())},o._cancelSubMenuTimer=function(){void 0!==o._enterTimerId&&(o._async.clearTimeout(o._enterTimerId),o._enterTimerId=void 0)},o._onItemSubMenuExpand=function(e,t){o.state.expandedMenuItemKey!==e.key&&(o.state.expandedMenuItemKey&&o._onSubMenuDismiss(),t.focus(),o.setState({expandedMenuItemKey:e.key,submenuTarget:t}))},o._onSubMenuDismiss=function(e,t){t?o.dismiss(e,t):o._mounted&&o.setState({dismissedMenuItemKey:o.state.expandedMenuItemKey,expandedMenuItemKey:void 0,submenuTarget:void 0})},o._getSubMenuId=function(e){var t=o.state.subMenuId;return e.subMenuProps&&e.subMenuProps.id&&(t=e.subMenuProps.id),t},o._onPointerAndTouchEvent=function(e){o._cancelSubMenuTimer()},o._async=new di(o),o._events=new Ws(o),si(o),o.state={contextualMenuItems:void 0,subMenuId:ts("ContextualMenu")},o._id=t.id||ts("ContextualMenu"),o._focusingPreviousElement=!1,o._isScrollIdle=!0,o._shouldUpdateFocusOnMouseEvent=!o.props.delayUpdateFocusOnHover,o._gotMouseMove=!1,o}return p(t,e),t.prototype.shouldComponentUpdate=function(e,t){return!(!e.shouldUpdateWhenHidden&&this.props.hidden&&e.hidden)&&(!Fs(this.props,e)||!Fs(this.state,t))},t.prototype.UNSAFE_componentWillUpdate=function(e){if(e.target!==this.props.target){var t=e.target;this._setTargetWindowAndElement(t)}this._isHidden(e)!==this._isHidden(this.props)&&(this._isHidden(e)?this._onMenuClosed():(this._onMenuOpened(),this._previousActiveElement=this._targetWindow?this._targetWindow.document.activeElement:void 0)),e.delayUpdateFocusOnHover!==this.props.delayUpdateFocusOnHover&&(this._shouldUpdateFocusOnMouseEvent=!e.delayUpdateFocusOnHover,this._gotMouseMove=this._shouldUpdateFocusOnMouseEvent&&this._gotMouseMove)},t.prototype.UNSAFE_componentWillMount=function(){var e=this.props.target;this._setTargetWindowAndElement(e),this.props.hidden||(this._previousActiveElement=this._targetWindow?this._targetWindow.document.activeElement:void 0)},t.prototype.componentDidMount=function(){this.props.hidden||this._onMenuOpened(),this._mounted=!0},t.prototype.componentWillUnmount=function(){this.props.onMenuDismissed&&this.props.onMenuDismissed(this.props),this._events.dispose(),this._async.dispose(),this._mounted=!1},t.prototype.render=function(){var e=this,t=this.props.isBeakVisible,o=this.props,n=o.items,r=o.labelElementId,i=o.id,s=o.className,a=o.beakWidth,l=o.directionalHint,c=o.directionalHintForRTL,u=o.alignTargetEdge,d=o.gapSpace,p=o.coverTarget,m=o.ariaLabel,g=o.doNotLayer,f=o.target,v=o.bounds,_=o.useTargetWidth,y=o.useTargetAsMinWidth,C=o.directionalHintFixed,S=o.shouldFocusOnMount,x=o.shouldFocusOnContainer,k=o.title,w=o.styles,I=o.theme,D=o.calloutProps,P=o.onRenderSubMenu,T=void 0===P?this._onRenderSubMenu:P,E=o.onRenderMenuList,M=void 0===E?this._onRenderMenuList:E,R=o.focusZoneProps,B=o.getMenuClassNames;this._classNames=B?B(I,s):Nc(w,{theme:I,className:s});var N=function e(t){for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.iconProps)return!0;if(r.itemType===va.Section&&r.sectionProps&&e(r.sectionProps.items))return!0}return!1}(n);this._adjustedFocusZoneProps=h(h({},R),{direction:this._getFocusZoneDirection()});var F,A=Lc(n),L=this.state.expandedMenuItemKey&&!0!==this.props.hidden?this._getSubmenuProps():null;t=void 0===t?this.props.responsiveMode<=Ra.medium:t;var H=this._target;if((_||y)&&H&&H.offsetWidth){var O=H.getBoundingClientRect().width-2;_?F={width:O}:y&&(F={minWidth:O})}if(n&&n.length>0){for(var z=0,W=0,V=n;W<V.length;W++){var K=V[W];if(K.itemType!==va.Divider&&K.itemType!==va.Header)z+=K.customOnRenderListLength?K.customOnRenderListLength:1}var U=this._classNames.subComponentStyles?this._classNames.subComponentStyles.callout:void 0;return b.createElement(uc,h({styles:U,onRestoreFocus:this._tryFocusPreviousActiveElement},D,{target:f,isBeakVisible:t,beakWidth:a,directionalHint:l,directionalHintForRTL:c,gapSpace:d,coverTarget:p,doNotLayer:g,className:Sr("ms-ContextualMenu-Callout",D&&D.className),setInitialFocus:S,onDismiss:this.props.onDismiss,onScroll:this._onScroll,bounds:v,directionalHintFixed:C,alignTargetEdge:u,hidden:this.props.hidden}),b.createElement("div",{"aria-label":m,"aria-labelledby":r,style:F,ref:function(t){return e._host=t},id:i,className:this._classNames.container,tabIndex:x?0:-1,onKeyDown:this._onMenuKeyDown,onKeyUp:this._onKeyUp,onFocusCapture:this._onMenuFocusCapture},k&&b.createElement("div",{className:this._classNames.title}," ",k," "),n&&n.length?b.createElement(ks,h({className:this._classNames.root,isCircularNavigation:!0,handleTabKey:bs.all},this._adjustedFocusZoneProps),M({items:n,totalItemCount:z,hasCheckmarks:A,hasIcons:N,defaultMenuItemRenderer:this._defaultMenuItemRenderer},this._onRenderMenuList)):null,L&&T(L,this._onRenderSubMenu)))}return null},t.prototype._isHidden=function(e){return!!e.hidden},t.prototype._onMenuOpened=function(){this._events.on(this._targetWindow,"resize",this.dismiss),this._shouldUpdateFocusOnMouseEvent=!this.props.delayUpdateFocusOnHover,this._gotMouseMove=!1,this.props.onMenuOpened&&this.props.onMenuOpened(this.props)},t.prototype._onMenuClosed=function(){this._events.off(this._targetWindow,"resize",this.dismiss),this._tryFocusPreviousActiveElement({containsFocus:this._focusingPreviousElement,documentContainsFocus:this._targetWindow.document.hasFocus(),originalElement:this._previousActiveElement}),this._focusingPreviousElement=!1,this.props.onMenuDismissed&&this.props.onMenuDismissed(this.props),this._shouldUpdateFocusOnMouseEvent=!this.props.delayUpdateFocusOnHover,this.setState({expandedByMouseClick:void 0,dismissedMenuItemKey:void 0,expandedMenuItemKey:void 0,submenuTarget:void 0})},t.prototype._getFocusZoneDirection=function(){var e=this.props.focusZoneProps;return e&&void 0!==e.direction?e.direction:vs.vertical},t.prototype._onRenderSubMenu=function(e,t){throw Error("ContextualMenuBase: onRenderSubMenu callback is null or undefined. Please ensure to set `onRenderSubMenu` property either manually or with `styled` helper.")},t.prototype._renderSectionItem=function(e,t,o,n,r){var i,s=this,a=e.sectionProps;if(a){var l,c;if(a.title){var u=void 0,d="";if("string"==typeof a.title){var p=this._id+a.title.replace(/\s/g,"");u={key:"section-"+a.title+"-title",itemType:va.Header,text:a.title,id:p},d=p}else u=a.title,d=this._id+(null===(i=a.title.text)||void 0===i?void 0:i.replace(/\s/g,""));u&&(c={role:"group","aria-labelledby":d},l=this._renderHeaderMenuItem(u,t,o,n,r))}return a.items&&a.items.length>0?b.createElement("li",{role:"presentation",key:a.key||e.key||"section-"+o},b.createElement("div",h({},c),b.createElement("ul",{className:this._classNames.list,role:"menu"},a.topDivider&&this._renderSeparator(o,t,!0,!0),l&&this._renderListItem(l,e.key||o,t,e.title),a.items.map((function(e,t){return s._renderMenuItem(e,t,t,a.items.length,n,r)})),a.bottomDivider&&this._renderSeparator(o,t,!1,!0)))):void 0}},t.prototype._renderListItem=function(e,t,o,n){return b.createElement("li",{role:"presentation",title:n,key:t,className:o.item},e)},t.prototype._renderSeparator=function(e,t,o,n){return n||e>0?b.createElement("li",{role:"separator",key:"separator-"+e+(void 0===o?"":o?"-top":"-bottom"),className:t.divider,"aria-hidden":"true"}):null},t.prototype._renderNormalItem=function(e,t,o,n,r,i,s){return e.onRender?e.onRender(h({"aria-posinset":n+1,"aria-setsize":r},e),this.dismiss):e.href?this._renderAnchorMenuItem(e,t,o,n,r,i,s):e.split&&ka(e)?this._renderSplitButton(e,t,o,n,r,i,s):this._renderButtonItem(e,t,o,n,r,i,s)},t.prototype._renderHeaderMenuItem=function(e,t,o,n,r){var i=this.props.contextualMenuItemAs,s=void 0===i?Ic:i,a=e.itemProps,l=e.id,c=a&&fr(a,gr);return b.createElement("div",h({id:l,className:this._classNames.header},c,{style:e.style}),b.createElement(s,h({item:e,classNames:t,index:o,onCheckmarkClick:n?this._onItemClick:void 0,hasIcons:r},a)))},t.prototype._renderAnchorMenuItem=function(e,t,o,n,r,i,s){var a=this.props.contextualMenuItemAs,l=this.state.expandedMenuItemKey;return b.createElement(Pc,{item:e,classNames:t,index:o,focusableElementIndex:n,totalItemCount:r,hasCheckmarks:i,hasIcons:s,contextualMenuItemAs:a,onItemMouseEnter:this._onItemMouseEnterBase,onItemMouseLeave:this._onMouseItemLeave,onItemMouseMove:this._onItemMouseMoveBase,onItemMouseDown:this._onItemMouseDown,executeItemClick:this._executeItemClick,onItemClick:this._onAnchorClick,onItemKeyDown:this._onItemKeyDown,getSubMenuId:this._getSubMenuId,expandedMenuItemKey:l,openSubMenu:this._onItemSubMenuExpand,dismissSubMenu:this._onSubMenuDismiss,dismissMenu:this.dismiss})},t.prototype._renderButtonItem=function(e,t,o,n,r,i,s){var a=this.props.contextualMenuItemAs,l=this.state.expandedMenuItemKey;return b.createElement(Tc,{item:e,classNames:t,index:o,focusableElementIndex:n,totalItemCount:r,hasCheckmarks:i,hasIcons:s,contextualMenuItemAs:a,onItemMouseEnter:this._onItemMouseEnterBase,onItemMouseLeave:this._onMouseItemLeave,onItemMouseMove:this._onItemMouseMoveBase,onItemMouseDown:this._onItemMouseDown,executeItemClick:this._executeItemClick,onItemClick:this._onItemClick,onItemClickBase:this._onItemClickBase,onItemKeyDown:this._onItemKeyDown,getSubMenuId:this._getSubMenuId,expandedMenuItemKey:l,openSubMenu:this._onItemSubMenuExpand,dismissSubMenu:this._onSubMenuDismiss,dismissMenu:this.dismiss})},t.prototype._renderSplitButton=function(e,t,o,n,r,i,s){var a=this.props.contextualMenuItemAs,l=this.state.expandedMenuItemKey;return b.createElement(Bc,{item:e,classNames:t,index:o,focusableElementIndex:n,totalItemCount:r,hasCheckmarks:i,hasIcons:s,contextualMenuItemAs:a,onItemMouseEnter:this._onItemMouseEnterBase,onItemMouseLeave:this._onMouseItemLeave,onItemMouseMove:this._onItemMouseMoveBase,onItemMouseDown:this._onItemMouseDown,executeItemClick:this._executeItemClick,onItemClick:this._onItemClick,onItemClickBase:this._onItemClickBase,onItemKeyDown:this._onItemKeyDown,openSubMenu:this._onItemSubMenuExpand,dismissSubMenu:this._onSubMenuDismiss,dismissMenu:this.dismiss,expandedMenuItemKey:l,onTap:this._onPointerAndTouchEvent})},t.prototype._isAltOrMeta=function(e){return e.which===wn.alt||"Meta"===e.key},t.prototype._shouldIgnoreMouseEvent=function(){return!this._isScrollIdle||!this._gotMouseMove},t.prototype._updateFocusOnMouseEvent=function(e,t,o){var n=this,r=o||t.currentTarget,i=this.props.subMenuHoverDelay,s=void 0===i?250:i;e.key!==this.state.expandedMenuItemKey&&(void 0!==this._enterTimerId&&(this._async.clearTimeout(this._enterTimerId),this._enterTimerId=void 0),void 0===this.state.expandedMenuItemKey&&r.focus(),ka(e)?(t.stopPropagation(),this._enterTimerId=this._async.setTimeout((function(){r.focus(),n.setState({expandedByMouseClick:!0}),n._onItemSubMenuExpand(e,r),n._enterTimerId=void 0}),s)):this._enterTimerId=this._async.setTimeout((function(){n._onSubMenuDismiss(t),r.focus(),n._enterTimerId=void 0}),s))},t.prototype._getSubmenuProps=function(){var e=this.state,t=e.submenuTarget,o=e.expandedMenuItemKey,n=this._findItemByKey(o),r=null;return n&&(r={items:Ac(n),target:t,onDismiss:this._onSubMenuDismiss,isSubMenu:!0,id:this.state.subMenuId,shouldFocusOnMount:!0,shouldFocusOnContainer:this.state.expandedByMouseClick,directionalHint:In(this.props.theme)?ya.leftTopEdge:ya.rightTopEdge,className:this.props.className,gapSpace:0,isBeakVisible:!1},n.subMenuProps&&As(r,n.subMenuProps)),r},t.prototype._findItemByKey=function(e){var t=this.props.items;return this._findItemByKeyFromItems(e,t)},t.prototype._findItemByKeyFromItems=function(e,t){for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.itemType===va.Section&&r.sectionProps){var i=this._findItemByKeyFromItems(e,r.sectionProps.items);if(i)return i}else if(r.key&&r.key===e)return r}},t.prototype._setTargetWindowAndElement=function(e){var t=this._host;if(e)if("string"==typeof e){var o=tt(t);this._target=o?o.querySelector(e):null,this._targetWindow=rt(t)}else if(e.stopPropagation)this._targetWindow=rt(e.target),this._target=e;else if(void 0===e.left&&void 0===e.x||void 0===e.top&&void 0===e.y)if(void 0!==e.current)this._target=e.current,this._targetWindow=rt(this._target);else{var n=e;this._targetWindow=rt(n),this._target=e}else this._targetWindow=rt(t),this._target=e;else this._targetWindow=rt(t)},t.defaultProps={items:[],shouldFocusOnMount:!0,gapSpace:0,directionalHint:ya.bottomAutoEdge,beakWidth:16},t=g([Ka],t)}(b.Component),zc={root:"ms-ContextualMenu",container:"ms-ContextualMenu-container",list:"ms-ContextualMenu-list",header:"ms-ContextualMenu-header",title:"ms-ContextualMenu-title",isopen:"is-open"};function Wc(e){return b.createElement(Kc,h({},e))}var Vc,Kc=xn(Oc,(function(e){var t=e.className,o=e.theme,n=Oo(zc,o),r=o.fonts,i=o.semanticColors,s=o.effects;return{root:[o.fonts.medium,n.root,n.isopen,{backgroundColor:i.menuBackground,minWidth:"180px"},t],container:[n.container,{selectors:{":focus":{outline:0}}}],list:[n.list,n.isopen,{listStyleType:"none",margin:"0",padding:"0"}],header:[n.header,r.small,{fontWeight:Ge.semibold,color:i.menuHeader,background:"none",backgroundColor:"transparent",border:"none",height:36,lineHeight:36,cursor:"default",padding:"0px 6px",userSelect:"none",textAlign:"left"}],title:[n.title,{fontSize:r.mediumPlus.fontSize,paddingRight:"14px",paddingLeft:"14px",paddingBottom:"5px",paddingTop:"5px",backgroundColor:i.menuItemBackgroundPressed}],subComponentStyles:{callout:{root:{boxShadow:s.elevation8}},menuItem:{}}}}),(function(){return{onRenderSubMenu:Wc}}),{scope:"ContextualMenu"}),Uc=Kc,Gc={msButton:"ms-Button",msButtonHasMenu:"ms-Button--hasMenu",msButtonIcon:"ms-Button-icon",msButtonMenuIcon:"ms-Button-menuIcon",msButtonLabel:"ms-Button-label",msButtonDescription:"ms-Button-description",msButtonScreenReaderText:"ms-Button-screenReaderText",msButtonFlexContainer:"ms-Button-flexContainer",msButtonTextContainer:"ms-Button-textContainer"},jc=No((function(e,t,o,n,r,i,s,a,l,c,u){var d,p,h=Oo(Gc,e||{}),m=c&&!u;return hn({root:[h.msButton,t.root,n,l&&["is-checked",t.rootChecked],m&&["is-expanded",t.rootExpanded,{selectors:(d={},d[":hover ."+h.msButtonIcon]=t.iconExpandedHovered,d[":hover ."+h.msButtonMenuIcon]=t.menuIconExpandedHovered||t.rootExpandedHovered,d[":hover"]=t.rootExpandedHovered,d)}],a&&[Gc.msButtonHasMenu,t.rootHasMenu],s&&["is-disabled",t.rootDisabled],!s&&!m&&!l&&{selectors:(p={":hover":t.rootHovered},p[":hover ."+h.msButtonLabel]=t.labelHovered,p[":hover ."+h.msButtonIcon]=t.iconHovered,p[":hover ."+h.msButtonDescription]=t.descriptionHovered,p[":hover ."+h.msButtonMenuIcon]=t.menuIconHovered,p[":focus"]=t.rootFocused,p[":active"]=t.rootPressed,p[":active ."+h.msButtonIcon]=t.iconPressed,p[":active ."+h.msButtonDescription]=t.descriptionPressed,p[":active ."+h.msButtonMenuIcon]=t.menuIconPressed,p)},s&&l&&[t.rootCheckedDisabled],!s&&l&&{selectors:{":hover":t.rootCheckedHovered,":active":t.rootCheckedPressed}},o],flexContainer:[h.msButtonFlexContainer,t.flexContainer],textContainer:[h.msButtonTextContainer,t.textContainer],icon:[h.msButtonIcon,r,t.icon,m&&t.iconExpanded,l&&t.iconChecked,s&&t.iconDisabled],label:[h.msButtonLabel,t.label,l&&t.labelChecked,s&&t.labelDisabled],menuIcon:[h.msButtonMenuIcon,i,t.menuIcon,l&&t.menuIconChecked,s&&!u&&t.menuIconDisabled,!s&&!m&&!l&&{selectors:{":hover":t.menuIconHovered,":active":t.menuIconPressed}},m&&["is-expanded",t.menuIconExpanded]],description:[h.msButtonDescription,t.description,l&&t.descriptionChecked,s&&t.descriptionDisabled],screenReaderText:[h.msButtonScreenReaderText,t.screenReaderText]})})),Yc=No((function(e,t,o,n,r){return{root:Q(e.splitButtonMenuButton,o&&[e.splitButtonMenuButtonExpanded],t&&[e.splitButtonMenuButtonDisabled],n&&!t&&[e.splitButtonMenuButtonChecked]),splitButtonContainer:Q(e.splitButtonContainer,!t&&n&&[e.splitButtonContainerChecked,{selectors:{":hover":e.splitButtonContainerCheckedHovered}}],!t&&!n&&[{selectors:{":hover":e.splitButtonContainerHovered,":focus":e.splitButtonContainerFocused}}],t&&e.splitButtonContainerDisabled),icon:Q(e.splitButtonMenuIcon,t&&e.splitButtonMenuIconDisabled,!t&&r&&e.splitButtonMenuIcon),flexContainer:Q(e.splitButtonFlexContainer),divider:Q(e.splitButtonDivider,(r||t)&&e.splitButtonDividerDisabled)}})),qc=function(e){function t(t){var o=e.call(this,t)||this;return o._buttonElement=b.createRef(),o._splitButtonContainer=b.createRef(),o._mergedRef=Pi(),o._renderedVisibleMenu=!1,o._getMemoizedMenuButtonKeytipProps=No((function(e){return h(h({},e),{hasMenu:!0})})),o._onRenderIcon=function(e,t){var n=o.props.iconProps;if(n&&(void 0!==n.iconName||n.imageProps)){var r=n.className,i=n.imageProps,s=m(n,["className","imageProps"]);if(n.styles)return b.createElement(Fr,h({className:Sr(o._classNames.icon,r),imageProps:i},s));if(n.iconName)return b.createElement(Mr,h({className:Sr(o._classNames.icon,r)},s));if(i)return b.createElement(_a,h({className:Sr(o._classNames.icon,r),imageProps:i},s))}return null},o._onRenderTextContents=function(){var e=o.props,t=e.text,n=e.children,r=e.secondaryText,i=void 0===r?o.props.description:r,s=e.onRenderText,a=void 0===s?o._onRenderText:s,l=e.onRenderDescription,c=void 0===l?o._onRenderDescription:l;return t||"string"==typeof n||i?b.createElement("span",{className:o._classNames.textContainer},a(o.props,o._onRenderText),c(o.props,o._onRenderDescription)):[a(o.props,o._onRenderText),c(o.props,o._onRenderDescription)]},o._onRenderText=function(){var e=o.props.text,t=o.props.children;return void 0===e&&"string"==typeof t&&(e=t),o._hasText()?b.createElement("span",{key:o._labelId,className:o._classNames.label,id:o._labelId},e):null},o._onRenderChildren=function(){var e=o.props.children;return"string"==typeof e?null:e},o._onRenderDescription=function(e){var t=e.secondaryText,n=void 0===t?o.props.description:t;return n?b.createElement("span",{key:o._descriptionId,className:o._classNames.description,id:o._descriptionId},n):null},o._onRenderAriaDescription=function(){var e=o.props.ariaDescription;return e?b.createElement("span",{className:o._classNames.screenReaderText,id:o._ariaDescriptionId},e):null},o._onRenderMenuIcon=function(e){var t=o.props.menuIconProps;return b.createElement(Mr,h({iconName:"ChevronDown"},t,{className:o._classNames.menuIcon}))},o._onRenderMenu=function(e){var t=o.props.persistMenu,n=o.state.menuHidden,r=o.props.menuAs||Uc;return e.ariaLabel||e.labelElementId||!o._hasText()||(e=h(h({},e),{labelElementId:o._labelId})),b.createElement(r,h({id:o._labelId+"-menu",directionalHint:ya.bottomLeftEdge},e,{shouldFocusOnContainer:o._menuShouldFocusOnContainer,shouldFocusOnMount:o._menuShouldFocusOnMount,hidden:t?n:void 0,className:Sr("ms-BaseButton-menuhost",e.className),target:o._isSplitButton?o._splitButtonContainer.current:o._buttonElement.current,onDismiss:o._onDismissMenu}))},o._onDismissMenu=function(e){var t=o.props.menuProps;t&&t.onDismiss&&t.onDismiss(e),e&&e.defaultPrevented||o._dismissMenu()},o._dismissMenu=function(){o._menuShouldFocusOnMount=void 0,o._menuShouldFocusOnContainer=void 0,o.setState({menuHidden:!0})},o._openMenu=function(e,t){void 0===t&&(t=!0),o.props.menuProps&&(o._menuShouldFocusOnContainer=e,o._menuShouldFocusOnMount=t,o._renderedVisibleMenu=!0,o.setState({menuHidden:!1}))},o._onToggleMenu=function(e){var t=!0;o.props.menuProps&&!1===o.props.menuProps.shouldFocusOnMount&&(t=!1),o.state.menuHidden?o._openMenu(e,t):o._dismissMenu()},o._onSplitContainerFocusCapture=function(e){var t=o._splitButtonContainer.current;!t||e.target&&fs(e.target,t)||t.focus()},o._onSplitButtonPrimaryClick=function(e){o.state.menuHidden||o._dismissMenu(),!o._processingTouch&&o.props.onClick?o.props.onClick(e):o._processingTouch&&o._onMenuClick(e)},o._onKeyDown=function(e){!o.props.disabled||e.which!==wn.enter&&e.which!==wn.space?o.props.disabled||(o.props.menuProps?o._onMenuKeyDown(e):void 0!==o.props.onKeyDown&&o.props.onKeyDown(e)):(e.preventDefault(),e.stopPropagation())},o._onKeyUp=function(e){o.props.disabled||void 0===o.props.onKeyUp||o.props.onKeyUp(e)},o._onKeyPress=function(e){o.props.disabled||void 0===o.props.onKeyPress||o.props.onKeyPress(e)},o._onMouseUp=function(e){o.props.disabled||void 0===o.props.onMouseUp||o.props.onMouseUp(e)},o._onMouseDown=function(e){o.props.disabled||void 0===o.props.onMouseDown||o.props.onMouseDown(e)},o._onClick=function(e){o.props.disabled||(o.props.menuProps?o._onMenuClick(e):void 0!==o.props.onClick&&o.props.onClick(e))},o._onSplitButtonContainerKeyDown=function(e){e.which===wn.enter||e.which===wn.space?o._buttonElement.current&&(o._buttonElement.current.click(),e.preventDefault(),e.stopPropagation()):o._onMenuKeyDown(e)},o._onMenuKeyDown=function(e){if(!o.props.disabled){o.props.onKeyDown&&o.props.onKeyDown(e);var t=e.which===wn.up,n=e.which===wn.down;if(!e.defaultPrevented&&o._isValidMenuOpenKey(e)){var r=o.props.onMenuClick;r&&r(e,o.props),o._onToggleMenu(!1),e.preventDefault(),e.stopPropagation()}if(!e.altKey&&!e.metaKey&&(t||n))if(!o.state.menuHidden&&o.props.menuProps)(void 0!==o._menuShouldFocusOnMount?o._menuShouldFocusOnMount:o.props.menuProps.shouldFocusOnMount)||(e.preventDefault(),e.stopPropagation(),o._menuShouldFocusOnMount=!0,o.forceUpdate())}},o._onTouchStart=function(){o._isSplitButton&&o._splitButtonContainer.current&&!("onpointerdown"in o._splitButtonContainer.current)&&o._handleTouchAndPointerEvent()},o._onMenuClick=function(e){var t=o.props.onMenuClick;if(t&&t(e,o.props),!e.defaultPrevented){var n=0!==e.nativeEvent.detail||"mouse"===e.nativeEvent.pointerType;o._onToggleMenu(n),e.preventDefault(),e.stopPropagation()}},si(o),o._async=new di(o),o._events=new Ws(o),o.props.split,o._labelId=ts(),o._descriptionId=ts(),o._ariaDescriptionId=ts(),o.state={menuHidden:!0},o}return p(t,e),Object.defineProperty(t.prototype,"_isSplitButton",{get:function(){return!!this.props.menuProps&&!!this.props.onClick&&!0===this.props.split},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e,t=this.props,o=t.ariaDescription,n=t.ariaLabel,r=t.ariaHidden,i=t.className,s=t.disabled,a=t.allowDisabledFocus,l=t.primaryDisabled,c=t.secondaryText,u=void 0===c?this.props.description:c,d=t.href,p=t.iconProps,h=t.menuIconProps,m=t.styles,g=t.checked,f=t.variantClassName,v=t.theme,b=t.toggle,_=t.getClassNames,y=t.role,C=this.state.menuHidden,S=s||l;this._classNames=_?_(v,i,f,p&&p.className,h&&h.className,S,g,!C,!!this.props.menuProps,this.props.split,!!a):jc(v,m,i,f,p&&p.className,h&&h.className,S,!!this.props.menuProps,g,!C,this.props.split);var x=this._ariaDescriptionId,k=this._labelId,w=this._descriptionId,I=!S&&!!d,D=I?"a":"button",P=fr(As(I?{}:{type:"button"},this.props.rootProps,this.props),I?$n:er,["disabled"]),T=n||P["aria-label"],E=void 0;o?E=x:u&&this.props.onRenderDescription!==sa?E=w:P["aria-describedby"]&&(E=P["aria-describedby"]);var M=void 0;T||(P["aria-labelledby"]?M=P["aria-labelledby"]:E&&(M=this._hasText()?k:void 0));var R=!(!1===this.props["data-is-focusable"]||s&&!a||this._isSplitButton),B="menuitemcheckbox"===y||"checkbox"===y,N=B||!0===b?!!g:void 0,F=As(P,((e={className:this._classNames.root,ref:this._mergedRef(this.props.elementRef,this._buttonElement),disabled:S&&!a,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseDown:this._onMouseDown,onMouseUp:this._onMouseUp,onClick:this._onClick,"aria-label":T,"aria-labelledby":M,"aria-describedby":E,"aria-disabled":S,"data-is-focusable":R})[B?"aria-checked":"aria-pressed"]=N,e));return r&&(F["aria-hidden"]=!0),this._isSplitButton?this._onRenderSplitButtonContent(D,F):(this.props.menuProps&&As(F,{"aria-expanded":!C,"aria-owns":C?null:this._labelId+"-menu","aria-haspopup":!0}),this._onRenderContent(D,F))},t.prototype.componentDidMount=function(){this._isSplitButton&&this._splitButtonContainer.current&&("onpointerdown"in this._splitButtonContainer.current&&this._events.on(this._splitButtonContainer.current,"pointerdown",this._onPointerDown,!0),"onpointerup"in this._splitButtonContainer.current&&this.props.onPointerUp&&this._events.on(this._splitButtonContainer.current,"pointerup",this.props.onPointerUp,!0))},t.prototype.componentDidUpdate=function(e,t){this.props.onAfterMenuDismiss&&!t.menuHidden&&this.state.menuHidden&&this.props.onAfterMenuDismiss()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.focus=function(){this._isSplitButton&&this._splitButtonContainer.current?this._splitButtonContainer.current.focus():this._buttonElement.current&&this._buttonElement.current.focus()},t.prototype.dismissMenu=function(){this._dismissMenu()},t.prototype.openMenu=function(e,t){this._openMenu(e,t)},t.prototype._onRenderContent=function(e,t){var o=this,n=this.props,r=e,i=n.menuIconProps,s=n.menuProps,a=n.onRenderIcon,l=void 0===a?this._onRenderIcon:a,c=n.onRenderAriaDescription,u=void 0===c?this._onRenderAriaDescription:c,d=n.onRenderChildren,p=void 0===d?this._onRenderChildren:d,m=n.onRenderMenu,g=void 0===m?this._onRenderMenu:m,f=n.onRenderMenuIcon,v=void 0===f?this._onRenderMenuIcon:f,_=n.disabled,y=n.keytipProps;y&&s&&(y=this._getMemoizedMenuButtonKeytipProps(y));var C=function(e){return b.createElement(r,h({},t,e),b.createElement("span",{className:o._classNames.flexContainer,"data-automationid":"splitbuttonprimary"},l(n,o._onRenderIcon),o._onRenderTextContents(),u(n,o._onRenderAriaDescription),p(n,o._onRenderChildren),!o._isSplitButton&&(s||i||o.props.onRenderMenuIcon)&&v(o.props,o._onRenderMenuIcon),s&&!s.doNotLayer&&o._shouldRenderMenu()&&g(s,o._onRenderMenu)))},S=y?b.createElement(Zs,{keytipProps:this._isSplitButton?void 0:y,ariaDescribedBy:t["aria-describedby"],disabled:_},(function(e){return C(e)})):C();return s&&s.doNotLayer?b.createElement("span",{style:{display:"inline-block"}},S,this._shouldRenderMenu()&&g(s,this._onRenderMenu)):b.createElement(b.Fragment,null,S,b.createElement(ha,null))},t.prototype._shouldRenderMenu=function(){var e=this.state.menuHidden,t=this.props,o=t.persistMenu,n=t.renderPersistedMenuHiddenOnMount;return!e||!(!o||!this._renderedVisibleMenu&&!n)},t.prototype._hasText=function(){return null!==this.props.text&&(void 0!==this.props.text||"string"==typeof this.props.children)},t.prototype._onRenderSplitButtonContent=function(e,t){var o=this,n=this.props,r=n.styles,i=void 0===r?{}:r,s=n.disabled,a=n.allowDisabledFocus,l=n.checked,c=n.getSplitButtonClassNames,u=n.primaryDisabled,d=n.menuProps,p=n.toggle,m=n.role,g=n.primaryActionButtonProps,f=this.props.keytipProps,v=this.state.menuHidden,_=c?c(!!s,!v,!!l,!!a):i&&Yc(i,!!s,!v,!!l,!!u);As(t,{onClick:void 0,onPointerDown:void 0,onPointerUp:void 0,tabIndex:-1,"data-is-focusable":!1}),f&&d&&(f=this._getMemoizedMenuButtonKeytipProps(f));var y=fr(t,[],["disabled"]);g&&As(t,g);var C=function(n){return b.createElement("div",h({},y,{"data-ktp-target":n?n["data-ktp-target"]:void 0,role:m||"button","aria-disabled":s,"aria-haspopup":!0,"aria-expanded":!v,"aria-pressed":p?!!l:void 0,"aria-describedby":Ns(t["aria-describedby"],n?n["aria-describedby"]:void 0),className:_&&_.splitButtonContainer,onKeyDown:o._onSplitButtonContainerKeyDown,onTouchStart:o._onTouchStart,ref:o._splitButtonContainer,"data-is-focusable":!0,onClick:s||u?void 0:o._onSplitButtonPrimaryClick,tabIndex:!s||a?0:void 0,"aria-roledescription":t["aria-roledescription"],onFocusCapture:o._onSplitContainerFocusCapture}),b.createElement("span",{style:{display:"flex"}},o._onRenderContent(e,t),o._onRenderSplitButtonMenuButton(_,n),o._onRenderSplitButtonDivider(_)))};return f?b.createElement(Zs,{keytipProps:f,disabled:s},(function(e){return C(e)})):C()},t.prototype._onRenderSplitButtonDivider=function(e){if(e&&e.divider){return b.createElement("span",{className:e.divider,"aria-hidden":!0,onClick:function(e){e.stopPropagation()}})}return null},t.prototype._onRenderSplitButtonMenuButton=function(e,o){var n=this.props,r=n.allowDisabledFocus,i=n.checked,s=n.disabled,a=n.splitButtonMenuProps,l=n.splitButtonAriaLabel,c=this.state.menuHidden,u=this.props.menuIconProps;void 0===u&&(u={iconName:"ChevronDown"});var d=h(h({},a),{styles:e,checked:i,disabled:s,allowDisabledFocus:r,onClick:this._onMenuClick,menuProps:void 0,iconProps:h(h({},u),{className:this._classNames.menuIcon}),ariaLabel:l,"aria-haspopup":!0,"aria-expanded":!c,"data-is-focusable":!1});return b.createElement(t,h({},d,{"data-ktp-execute-target":o?o["data-ktp-execute-target"]:o,onMouseDown:this._onMouseDown,tabIndex:-1}))},t.prototype._onPointerDown=function(e){var t=this.props.onPointerDown;t&&t(e),"touch"===e.pointerType&&(this._handleTouchAndPointerEvent(),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._handleTouchAndPointerEvent=function(){var e=this;void 0!==this._lastTouchTimeoutId&&(this._async.clearTimeout(this._lastTouchTimeoutId),this._lastTouchTimeoutId=void 0),this._processingTouch=!0,this._lastTouchTimeoutId=this._async.setTimeout((function(){e._processingTouch=!1,e._lastTouchTimeoutId=void 0,e.focus()}),500)},t.prototype._isValidMenuOpenKey=function(e){return this.props.menuTriggerKeyCode?e.which===this.props.menuTriggerKeyCode:!!this.props.menuProps&&(e.which===wn.down&&(e.altKey||e.metaKey))},t.defaultProps={baseClassName:"ms-Button",styles:{},split:!1},t}(b.Component),Zc={outline:0},Xc=function(e){return{fontSize:e,margin:"0 4px",height:"16px",lineHeight:"16px",textAlign:"center",flexShrink:0}},Qc=No((function(e){var t,o,n=e.semanticColors,r=e.effects,i=e.fonts,s=n.buttonBorder,a=n.disabledBackground,l=n.disabledText,c={left:-2,top:-2,bottom:-2,right:-2,outlineColor:"ButtonText"};return{root:[go(e,{inset:1,highContrastStyle:c,borderColor:"transparent"}),e.fonts.medium,{boxSizing:"border-box",border:"1px solid "+s,userSelect:"none",display:"inline-block",textDecoration:"none",textAlign:"center",cursor:"pointer",padding:"0 16px",borderRadius:r.roundedCorner2,selectors:{":active > *":{position:"relative",left:0,top:0}}}],rootDisabled:[go(e,{inset:1,highContrastStyle:c,borderColor:"transparent"}),{backgroundColor:a,borderColor:a,color:l,cursor:"default",pointerEvents:"none",selectors:{":hover":Zc,":focus":Zc}}],iconDisabled:{color:l,selectors:(t={},t[jt]={color:"GrayText"},t)},menuIconDisabled:{color:l,selectors:(o={},o[jt]={color:"GrayText"},o)},flexContainer:{display:"flex",height:"100%",flexWrap:"nowrap",justifyContent:"center",alignItems:"center"},description:{display:"block"},textContainer:{flexGrow:1,display:"block"},icon:Xc(i.mediumPlus.fontSize),menuIcon:Xc(i.small.fontSize),label:{margin:"0 4px",lineHeight:"100%",display:"block"},screenReaderText:yo}})),Jc=No((function(e,t){var o,n,r,i,s,a,l,c,u,d,p,m,g,f=e.effects,v=e.palette,b=e.semanticColors,_={position:"absolute",width:1,right:31,top:8,bottom:8};return dn({splitButtonContainer:[go(e,{highContrastStyle:{left:-2,top:-2,bottom:-2,right:-2,border:"none"},inset:2}),{display:"inline-flex",selectors:{".ms-Button--default":{borderTopRightRadius:"0",borderBottomRightRadius:"0",borderRight:"none"},".ms-Button--primary":{borderTopRightRadius:"0",borderBottomRightRadius:"0",border:"none",selectors:(o={},o[jt]=h({color:"WindowText",backgroundColor:"Window",border:"1px solid WindowText",borderRightWidth:"0"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)},".ms-Button--primary + .ms-Button":{border:"none",selectors:(n={},n[jt]={border:"1px solid WindowText",borderLeftWidth:"0"},n)}}}],splitButtonContainerHovered:{selectors:{".ms-Button--primary":{selectors:(r={},r[jt]={color:"Window",backgroundColor:"Highlight"},r)},".ms-Button.is-disabled":{color:b.buttonTextDisabled,selectors:(i={},i[jt]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},i)}}},splitButtonContainerChecked:{selectors:{".ms-Button--primary":{selectors:(s={},s[jt]=h({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s)}}},splitButtonContainerCheckedHovered:{selectors:{".ms-Button--primary":{selectors:(a={},a[jt]=h({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a)}}},splitButtonContainerFocused:{outline:"none!important"},splitButtonMenuButton:(l={padding:6,height:"auto",boxSizing:"border-box",borderRadius:0,borderTopRightRadius:f.roundedCorner2,borderBottomRightRadius:f.roundedCorner2,border:"1px solid "+v.neutralSecondaryAlt,borderLeft:"none",outline:"transparent",userSelect:"none",display:"inline-block",textDecoration:"none",textAlign:"center",cursor:"pointer",verticalAlign:"top",width:32,marginLeft:-1,marginTop:0,marginRight:0,marginBottom:0},l[jt]={".ms-Button-menuIcon":{color:"WindowText"}},l),splitButtonDivider:h(h({},_),{selectors:(c={},c[jt]={backgroundColor:"WindowText"},c)}),splitButtonDividerDisabled:h(h({},_),{selectors:(u={},u[jt]={backgroundColor:"GrayText"},u)}),splitButtonMenuButtonDisabled:{pointerEvents:"none",border:"none",selectors:(d={":hover":{cursor:"default"},".ms-Button--primary":{selectors:(p={},p[jt]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},p)},".ms-Button-menuIcon":{selectors:(m={},m[jt]={color:"GrayText"},m)}},d[jt]={color:"GrayText",border:"1px solid GrayText",backgroundColor:"Window"},d)},splitButtonFlexContainer:{display:"flex",height:"100%",flexWrap:"nowrap",justifyContent:"center",alignItems:"center"},splitButtonContainerDisabled:{outline:"none",border:"none",selectors:(g={},g[jt]=h({color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),g)}},t)})),$c=No((function(e,t){var o,n=Qc(e),r=Jc(e),i=e.palette;return dn(n,{root:{padding:"0 4px",width:"32px",height:"32px",backgroundColor:"transparent",border:"none",color:e.semanticColors.link},rootHovered:{color:i.themeDarkAlt,backgroundColor:i.neutralLighter,selectors:(o={},o[jt]={borderColor:"Highlight",color:"Highlight"},o)},rootHasMenu:{width:"auto"},rootPressed:{color:i.themeDark,backgroundColor:i.neutralLight},rootExpanded:{color:i.themeDark,backgroundColor:i.neutralLight},rootChecked:{color:i.themeDark,backgroundColor:i.neutralLight},rootCheckedHovered:{color:i.themeDark,backgroundColor:i.neutralQuaternaryAlt},rootDisabled:{color:i.neutralTertiaryAlt}},r,t)})),eu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return b.createElement(qc,h({},this.props,{variantClassName:"ms-Button--icon",styles:$c(o,t),onRenderText:sa,onRenderDescription:sa}))},t=g([ec("IconButton",["theme","styles"],!0)],t)}(b.Component);!function(e){e[e.horizontal=0]="horizontal",e[e.vertical=1]="vertical"}(Vc||(Vc={}));var tu,ou=function(){var e={};return{getCachedMeasurement:function(t){if(t&&t.cacheKey&&e.hasOwnProperty(t.cacheKey))return e[t.cacheKey]},addMeasurementToCache:function(t,o){t.cacheKey&&(e[t.cacheKey]=o)}}},nu=function(e){void 0===e&&(e=ou());var t,o=e;function n(e,t){var n=o.getCachedMeasurement(e);if(void 0!==n)return n;var r=t();return o.addMeasurementToCache(e,r),r}function r(e,r,i){for(var s=e,a=n(e,i);a>t;){var l=r(s);if(void 0===l)return{renderedData:s,resizeDirection:void 0,dataToMeasure:void 0};if(void 0===(a=o.getCachedMeasurement(l)))return{dataToMeasure:l,resizeDirection:"shrink"};s=l}return{renderedData:s,resizeDirection:void 0,dataToMeasure:void 0}}return{getNextState:function(e,i,s,a){if(void 0!==a||void 0!==i.dataToMeasure){if(a){if(t&&i.renderedData&&!i.dataToMeasure)return h(h({},i),function(e,o,n,r){var i;return i=e>t?r?{resizeDirection:"grow",dataToMeasure:r(n)}:{resizeDirection:"shrink",dataToMeasure:o}:{resizeDirection:"shrink",dataToMeasure:n},t=e,h(h({},i),{measureContainer:!1})}(a,e.data,i.renderedData,e.onGrowData));t=a}var l=h(h({},i),{measureContainer:!1});return i.dataToMeasure&&(l="grow"===i.resizeDirection&&e.onGrowData?h(h({},l),function(e,i,s,a){for(var l=e,c=n(e,s);c<t;){var u=i(l);if(void 0===u)return{renderedData:l,resizeDirection:void 0,dataToMeasure:void 0};if(void 0===(c=o.getCachedMeasurement(u)))return{dataToMeasure:u};l=u}return h({resizeDirection:"shrink"},r(l,a,s))}(i.dataToMeasure,e.onGrowData,s,e.onReduceData)):h(h({},l),r(i.dataToMeasure,e.onReduceData,s))),l}},shouldRenderDataForMeasurement:function(e){return!(!e||void 0!==o.getCachedMeasurement(e))},getInitialResizeGroupState:function(e){return{dataToMeasure:h({},e),resizeDirection:"grow",measureContainer:!0}}}},ru=b.createContext({isMeasured:!1}),iu={position:"fixed",visibility:"hidden"},su={position:"relative"},au=function(e){function t(t){var o=e.call(this,t)||this;return o._nextResizeGroupStateProvider=nu(),o._root=b.createRef(),o._initialHiddenDiv=b.createRef(),o._updateHiddenDiv=b.createRef(),o._hasRenderedContent=!1,o.state=o._nextResizeGroupStateProvider.getInitialResizeGroupState(o.props.data),si(o),o._async=new di(o),o._events=new Ws(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.onRenderData,n=this.state,r=n.dataToMeasure,i=n.renderedData,s=fr(this.props,gr,["data"]),a=this._nextResizeGroupStateProvider.shouldRenderDataForMeasurement(r),l=!this._hasRenderedContent&&a;return b.createElement("div",h({},s,{className:t,ref:this._root}),b.createElement("div",{style:su},a&&!l&&b.createElement("div",{style:iu,ref:this._updateHiddenDiv},b.createElement(ru.Provider,{value:{isMeasured:!0}},o(r))),b.createElement("div",{ref:this._initialHiddenDiv,style:l?iu:void 0,"data-automation-id":"visibleContent"},l?o(r):i&&o(i))))},t.prototype.componentDidMount=function(){this._afterComponentRendered(this.props.direction),this._events.on(window,"resize",this._async.debounce(this._onResize,16,{leading:!0}))},t.prototype.UNSAFE_componentWillReceiveProps=function(e){this.setState({dataToMeasure:h({},e.data),resizeDirection:"grow",measureContainer:!0})},t.prototype.componentDidUpdate=function(e){this.state.renderedData&&(this._hasRenderedContent=!0,this.props.dataDidRender&&this.props.dataDidRender(this.state.renderedData)),this._afterComponentRendered(this.props.direction)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.remeasure=function(){this._root.current&&this.setState({measureContainer:!0})},t.prototype._afterComponentRendered=function(e){var t=this;this._async.requestAnimationFrame((function(){var o=void 0;if(t.state.measureContainer&&t._root.current){var n=t._root.current.getBoundingClientRect();o=e&&e===Vc.vertical?n.height:n.width}var r=t._nextResizeGroupStateProvider.getNextState(t.props,t.state,(function(){var o=t._hasRenderedContent?t._updateHiddenDiv:t._initialHiddenDiv;return o.current?e&&e===Vc.vertical?o.current.scrollHeight:o.current.scrollWidth:0}),o);r&&t.setState(r)}),this._root.current)},t.prototype._onResize=function(){this._root.current&&this.setState({measureContainer:!0})},t}(b.Component),lu=au;function cu(e){return e.clientWidth<e.scrollWidth}function uu(e){return e.clientHeight<e.scrollHeight}function du(e){return cu(e)||uu(e)}!function(e){e[e.Parent=0]="Parent",e[e.Self=1]="Self"}(tu||(tu={}));var pu,hu=Mn(),mu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onRenderContent=function(e){return b.createElement("p",{className:t._classNames.subText},e.content)},t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.calloutProps,n=e.directionalHint,r=e.directionalHintForRTL,i=e.styles,s=e.id,a=e.maxWidth,l=e.onRenderContent,c=void 0===l?this._onRenderContent:l,u=e.targetElement,d=e.theme;return this._classNames=hu(i,{theme:d,className:t||o&&o.className,beakWidth:o&&o.beakWidth,gapSpace:o&&o.gapSpace,maxWidth:a}),b.createElement(uc,h({target:u,directionalHint:n,directionalHintForRTL:r},o,fr(this.props,gr,["id"]),{className:this._classNames.root}),b.createElement("div",{className:this._classNames.content,id:s,role:"tooltip",onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},c(this.props,this._onRenderContent)))},t.defaultProps={directionalHint:ya.topCenter,maxWidth:"364px",calloutProps:{isBeakVisible:!0,beakWidth:16,gapSpace:0,setInitialFocus:!0,doNotLayer:!1}},t}(b.Component),gu=xn(mu,(function(e){var t=e.className,o=e.beakWidth,n=void 0===o?16:o,r=e.gapSpace,i=void 0===r?0:r,s=e.maxWidth,a=e.theme,l=a.semanticColors,c=a.fonts,u=a.effects,d=-(Math.sqrt(n*n/2)+i)+1/window.devicePixelRatio;return{root:["ms-Tooltip",a.fonts.medium,Ye.fadeIn200,{background:l.menuBackground,boxShadow:u.elevation8,padding:"8px",maxWidth:s,selectors:{":after":{content:"''",position:"absolute",bottom:d,left:d,right:d,top:d,zIndex:0}}},t],content:["ms-Tooltip-content",c.small,{position:"relative",zIndex:1,color:l.menuItemText,wordWrap:"break-word",overflowWrap:"break-word",overflow:"hidden"}],subText:["ms-Tooltip-subtext",{fontSize:"inherit",fontWeight:"inherit",color:"inherit",margin:0}]}}),void 0,{scope:"Tooltip"});!function(e){e[e.zero=0]="zero",e[e.medium=1]="medium",e[e.long=2]="long"}(pu||(pu={}));var fu,vu,bu=Mn(),_u=function(e){function t(o){var n=e.call(this,o)||this;return n._tooltipHost=b.createRef(),n._defaultTooltipId=ts("tooltip"),n.show=function(){n._toggleTooltip(!0)},n.dismiss=function(){n._hideTooltip()},n._getTargetElement=function(){if(n._tooltipHost.current){var e=n.props.overflowMode;if(void 0!==e)switch(e){case tu.Parent:return n._tooltipHost.current.parentElement;case tu.Self:return n._tooltipHost.current}return n._tooltipHost.current}},n._onTooltipMouseEnter=function(e){var o=n.props,r=o.overflowMode,i=o.delay;if(t._currentVisibleTooltip&&t._currentVisibleTooltip!==n&&t._currentVisibleTooltip.dismiss(),t._currentVisibleTooltip=n,void 0!==r){var s=n._getTargetElement();if(s&&!du(s))return}if(!e.target||!fs(e.target,n._getTargetElement()))if(n._clearDismissTimer(),n._clearOpenTimer(),i!==pu.zero){n.setState({isAriaPlaceholderRendered:!0});var a=n._getDelayTime(i);n._openTimerId=n._async.setTimeout((function(){n._toggleTooltip(!0)}),a)}else n._toggleTooltip(!0)},n._onTooltipMouseLeave=function(e){var o=n.props.closeDelay;n._clearDismissTimer(),n._clearOpenTimer(),o?n._dismissTimerId=n._async.setTimeout((function(){n._toggleTooltip(!1)}),o):n._toggleTooltip(!1),t._currentVisibleTooltip===n&&(t._currentVisibleTooltip=void 0)},n._onTooltipKeyDown=function(e){(e.which===wn.escape||e.ctrlKey)&&n.state.isTooltipVisible&&(n._hideTooltip(),e.stopPropagation())},n._clearDismissTimer=function(){n._async.clearTimeout(n._dismissTimerId)},n._clearOpenTimer=function(){n._async.clearTimeout(n._openTimerId)},n._hideTooltip=function(){n._clearOpenTimer(),n._clearDismissTimer(),n._toggleTooltip(!1)},n._toggleTooltip=function(e){n.state.isTooltipVisible!==e&&n.setState({isAriaPlaceholderRendered:!1,isTooltipVisible:e},(function(){return n.props.onTooltipToggle&&n.props.onTooltipToggle(e)}))},n._getDelayTime=function(e){switch(e){case pu.medium:return 300;case pu.long:return 500;default:return 0}},si(n),n.state={isAriaPlaceholderRendered:!1,isTooltipVisible:!1},n._async=new di(n),n}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.calloutProps,o=e.children,n=e.content,r=e.directionalHint,i=e.directionalHintForRTL,s=e.hostClassName,a=e.id,l=e.setAriaDescribedBy,c=void 0===l||l,u=e.tooltipProps,d=e.styles,p=e.theme;this._classNames=bu(d,{theme:p,className:s});var m=this.state,g=m.isAriaPlaceholderRendered,f=m.isTooltipVisible,v=a||this._defaultTooltipId,_=!!(n||u&&u.onRenderContent&&u.onRenderContent()),y=f&&_,C=c&&f&&_?v:void 0;return b.createElement("div",h({className:this._classNames.root,ref:this._tooltipHost},{onFocusCapture:this._onTooltipMouseEnter},{onBlurCapture:this._hideTooltip},{onMouseEnter:this._onTooltipMouseEnter,onMouseLeave:this._onTooltipMouseLeave,onKeyDown:this._onTooltipKeyDown,"aria-describedby":C}),o,y&&b.createElement(gu,h({id:v,content:n,targetElement:this._getTargetElement(),directionalHint:r,directionalHintForRTL:i,calloutProps:As({},t,{onDismiss:this._hideTooltip,onMouseEnter:this._onTooltipMouseEnter,onMouseLeave:this._onTooltipMouseLeave}),onMouseEnter:this._onTooltipMouseEnter,onMouseLeave:this._onTooltipMouseLeave},fr(this.props,gr),u)),g&&b.createElement("div",{id:v,style:yo},n))},t.prototype.componentWillUnmount=function(){t._currentVisibleTooltip&&t._currentVisibleTooltip===this&&(t._currentVisibleTooltip=void 0),this._async.dispose()},t.defaultProps={delay:pu.medium},t}(b.Component),yu={root:"ms-TooltipHost",ariaPlaceholder:"ms-TooltipHost-aria-placeholder"},Cu=xn(_u,(function(e){var t=e.className,o=e.theme;return{root:[Oo(yu,o).root,{display:"inline"},t]}}),void 0,{scope:"TooltipHost"}),Su=Mn(),xu=function(){return null},ku={styles:function(e){return{root:{selectors:{"&.is-disabled":{color:e.theme.semanticColors.bodyText}}}}}},wu=function(e){function t(t){var o=e.call(this,t)||this;return o._focusZone=b.createRef(),o._onReduceData=function(e){var t=e.renderedItems,o=e.renderedOverflowItems,n=e.props.overflowIndex,r=t[n];if(r)return(t=f(t)).splice(n,1),o=f(o,[r]),h(h({},e),{renderedItems:t,renderedOverflowItems:o})},o._onGrowData=function(e){var t=e.renderedItems,o=e.renderedOverflowItems,n=e.props,r=n.overflowIndex,i=n.maxDisplayedItems,s=(o=f(o)).pop();if(s&&!(t.length>=i))return(t=f(t)).splice(r,0,s),h(h({},e),{renderedItems:t,renderedOverflowItems:o})},o._onRenderBreadcrumb=function(e){var t=e.props,n=t.ariaLabel,r=t.dividerAs,i=void 0===r?Fr:r,s=t.onRenderItem,a=void 0===s?o._onRenderItem:s,l=t.overflowAriaLabel,c=t.overflowIndex,u=t.onRenderOverflowIcon,d=t.overflowButtonAs,p=e.renderedOverflowItems,m=e.renderedItems,g=p.map((function(e){var t=!(!e.onClick&&!e.href);return{text:e.text,name:e.text,key:e.key,onClick:e.onClick?o._onBreadcrumbClicked.bind(o,e):null,href:e.href,disabled:!t,itemProps:t?void 0:ku}})),f=m.length-1,v=p&&0!==p.length,_=m.map((function(e,t){return b.createElement("li",{className:o._classNames.listItem,key:e.key||String(t)},a(e,o._onRenderItem),(t!==f||v&&t===c-1)&&b.createElement(i,{className:o._classNames.chevron,iconName:In(o.props.theme)?"ChevronLeft":"ChevronRight",item:e}))}));if(v){var y=u?{}:{iconName:"More"},C=u||xu,S=d||eu;_.splice(c,0,b.createElement("li",{className:o._classNames.overflow,key:"overflow"},b.createElement(S,{className:o._classNames.overflowButton,iconProps:y,role:"button","aria-haspopup":"true",ariaLabel:l,onRenderMenuIcon:C,menuProps:{items:g,directionalHint:ya.bottomLeftEdge}}),c!==f+1&&b.createElement(i,{className:o._classNames.chevron,iconName:In(o.props.theme)?"ChevronLeft":"ChevronRight",item:p[p.length-1]})))}var x=fr(o.props,Yn,["className"]);return b.createElement("div",h({className:o._classNames.root,role:"navigation","aria-label":n},x),b.createElement(ks,h({componentRef:o._focusZone,direction:vs.horizontal},o.props.focusZoneProps),b.createElement("ol",{className:o._classNames.list},_)))},o._onRenderItem=function(e){var t=e.as,n=e.href,r=e.onClick,i=e.isCurrentItem,s=e.text,a=m(e,["as","href","onClick","isCurrentItem","text"]);if(r||n)return b.createElement($s,h({},a,{as:t,className:o._classNames.itemLink,href:n,"aria-current":i?"page":void 0,onClick:o._onBreadcrumbClicked.bind(o,e)}),b.createElement(Cu,h({content:s,overflowMode:tu.Parent},o.props.tooltipHostProps),s));var l=t||"span";return b.createElement(l,h({},a,{className:o._classNames.item}),b.createElement(Cu,h({content:s,overflowMode:tu.Parent},o.props.tooltipHostProps),s))},o._onBreadcrumbClicked=function(e,t){e.onClick&&e.onClick(t,e)},si(o),o._validateProps(t),o}return p(t,e),t.prototype.focus=function(){this._focusZone.current&&this._focusZone.current.focus()},t.prototype.render=function(){this._validateProps(this.props);var e=this.props,t=e.onReduceData,o=void 0===t?this._onReduceData:t,n=e.onGrowData,r=void 0===n?this._onGrowData:n,i=e.overflowIndex,s=e.maxDisplayedItems,a=e.items,l=e.className,c=e.theme,u=e.styles,d=f(a),p=d.splice(i,d.length-s),h={props:this.props,renderedItems:d,renderedOverflowItems:p};return this._classNames=Su(u,{className:l,theme:c}),b.createElement(lu,{onRenderData:this._onRenderBreadcrumb,onReduceData:o,onGrowData:r,data:h})},t.prototype._validateProps=function(e){var t=e.maxDisplayedItems,o=e.overflowIndex,n=e.items;if(o<0||t>1&&o>t-1||n.length>0&&o>n.length-1)throw new Error("Breadcrumb: overflowIndex out of range")},t.defaultProps={items:[],maxDisplayedItems:999,overflowIndex:0},t}(b.Component),Iu={root:"ms-Breadcrumb",list:"ms-Breadcrumb-list",listItem:"ms-Breadcrumb-listItem",chevron:"ms-Breadcrumb-chevron",overflow:"ms-Breadcrumb-overflow",overflowButton:"ms-Breadcrumb-overflowButton",itemLink:"ms-Breadcrumb-itemLink",item:"ms-Breadcrumb-item"},Du={whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},Pu=lo(0,oo),Tu=lo(Qt,no),Eu=xn(wu,(function(e){var t,o,n,r,i=e.className,s=e.theme,a=s.palette,l=s.semanticColors,c=s.fonts,u=Oo(Iu,s),d=l.menuItemBackgroundHovered,p=l.menuItemBackgroundPressed,m=a.neutralSecondary,g=Ge.regular,f=a.neutralPrimary,v=a.neutralPrimary,b=Ge.semibold,_=a.neutralSecondary,y=a.neutralSecondary,C={fontWeight:b,color:v},S={":hover":{color:f,backgroundColor:d,cursor:"pointer",selectors:(t={},t[jt]={color:"Highlight"},t)},":active":{backgroundColor:p,color:f},"&:active:hover":{color:f,backgroundColor:p},"&:active, &:hover, &:active:hover":{textDecoration:"none"}},x={color:m,padding:"0 8px",lineHeight:36,fontSize:18,fontWeight:g};return{root:[u.root,c.medium,{margin:"11px 0 1px"},i],list:[u.list,{whiteSpace:"nowrap",padding:0,margin:0,display:"flex",alignItems:"stretch"}],listItem:[u.listItem,{listStyleType:"none",margin:"0",padding:"0",display:"flex",position:"relative",alignItems:"center",selectors:{"&:last-child .ms-Breadcrumb-itemLink":C,"&:last-child .ms-Breadcrumb-item":C}}],chevron:[u.chevron,{color:_,fontSize:c.small.fontSize,selectors:(o={},o[jt]=h({color:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o[Tu]={fontSize:8},o[Pu]={fontSize:8},o)}],overflow:[u.overflow,{position:"relative",display:"flex",alignItems:"center"}],overflowButton:[u.overflowButton,go(s),Du,{fontSize:16,color:y,height:"100%",cursor:"pointer",selectors:h(h({},S),(n={},n[Pu]={padding:"4px 6px"},n[Tu]={fontSize:c.mediumPlus.fontSize},n))}],itemLink:[u.itemLink,go(s),Du,h(h({},x),{selectors:h((r={":focus":{color:a.neutralDark}},r["."+ho+" &:focus"]={outline:"none"},r),S)})],item:[u.item,h(h({},x),{selectors:{":hover":{cursor:"default"}}})]}}),void 0,{scope:"Breadcrumb"});!function(e){e[e.button=0]="button",e[e.anchor=1]="anchor"}(fu||(fu={})),function(e){e[e.normal=0]="normal",e[e.primary=1]="primary",e[e.hero=2]="hero",e[e.compound=3]="compound",e[e.command=4]="command",e[e.icon=5]="icon",e[e.default=6]="default"}(vu||(vu={}));function Mu(e){var t,o,n,r,i,s=e.semanticColors,a=e.palette,l=s.buttonBackground,c=s.buttonBackgroundPressed,u=s.buttonBackgroundHovered,d=s.buttonBackgroundDisabled,p=s.buttonText,m=s.buttonTextHovered,g=s.buttonTextDisabled,f=s.buttonTextChecked,v=s.buttonTextCheckedHovered;return{root:{backgroundColor:l,color:p},rootHovered:{backgroundColor:u,color:m,selectors:(t={},t[jt]={borderColor:"Highlight",color:"Highlight"},t)},rootPressed:{backgroundColor:c,color:f},rootExpanded:{backgroundColor:c,color:f},rootChecked:{backgroundColor:c,color:f},rootCheckedHovered:{backgroundColor:c,color:v},rootDisabled:{color:g,backgroundColor:d,selectors:(o={},o[jt]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},o)},splitButtonContainer:{selectors:(n={},n[jt]={border:"none"},n)},splitButtonMenuButton:{color:a.white,backgroundColor:"transparent",selectors:{":hover":{backgroundColor:a.neutralLight,selectors:(r={},r[jt]={color:"Highlight"},r)}}},splitButtonMenuButtonDisabled:{backgroundColor:s.buttonBackgroundDisabled,selectors:{":hover":{backgroundColor:s.buttonBackgroundDisabled}}},splitButtonDivider:h(h({},{position:"absolute",width:1,right:31,top:8,bottom:8}),{backgroundColor:a.neutralTertiaryAlt,selectors:(i={},i[jt]={backgroundColor:"WindowText"},i)}),splitButtonDividerDisabled:{backgroundColor:e.palette.neutralTertiaryAlt},splitButtonMenuButtonChecked:{backgroundColor:a.neutralQuaternaryAlt,selectors:{":hover":{backgroundColor:a.neutralQuaternaryAlt}}},splitButtonMenuButtonExpanded:{backgroundColor:a.neutralQuaternaryAlt,selectors:{":hover":{backgroundColor:a.neutralQuaternaryAlt}}},splitButtonMenuIcon:{color:s.buttonText},splitButtonMenuIconDisabled:{color:s.buttonTextDisabled}}}function Ru(e){var t,o,n,r,i,s,a,l,c,u=e.palette,d=e.semanticColors;return{root:{backgroundColor:d.primaryButtonBackground,border:"1px solid "+d.primaryButtonBackground,color:d.primaryButtonText,selectors:(t={},t[jt]=h({color:"Window",backgroundColor:"WindowText",borderColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t["."+ho+" &:focus"]={selectors:{":after":{border:"none",outlineColor:u.white}}},t)},rootHovered:{backgroundColor:d.primaryButtonBackgroundHovered,border:"1px solid "+d.primaryButtonBackgroundHovered,color:d.primaryButtonTextHovered,selectors:(o={},o[jt]={color:"Window",backgroundColor:"Highlight",borderColor:"Highlight"},o)},rootPressed:{backgroundColor:d.primaryButtonBackgroundPressed,border:"1px solid "+d.primaryButtonBackgroundPressed,color:d.primaryButtonTextPressed,selectors:(n={},n[jt]=h({color:"Window",backgroundColor:"WindowText",borderColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)},rootExpanded:{backgroundColor:d.primaryButtonBackgroundPressed,color:d.primaryButtonTextPressed},rootChecked:{backgroundColor:d.primaryButtonBackgroundPressed,color:d.primaryButtonTextPressed},rootCheckedHovered:{backgroundColor:d.primaryButtonBackgroundPressed,color:d.primaryButtonTextPressed},rootDisabled:{color:d.primaryButtonTextDisabled,backgroundColor:d.primaryButtonBackgroundDisabled,selectors:(r={},r[jt]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},r)},splitButtonContainer:{selectors:(i={},i[jt]={border:"none"},i)},splitButtonDivider:h(h({},{position:"absolute",width:1,right:31,top:8,bottom:8}),{backgroundColor:u.white,selectors:(s={},s[jt]={backgroundColor:"Window"},s)}),splitButtonMenuButton:{backgroundColor:d.primaryButtonBackground,color:d.primaryButtonText,selectors:(a={},a[jt]={backgroundColor:"WindowText"},a[":hover"]={backgroundColor:d.primaryButtonBackgroundHovered,selectors:(l={},l[jt]={color:"Highlight"},l)},a)},splitButtonMenuButtonDisabled:{backgroundColor:d.primaryButtonBackgroundDisabled,selectors:{":hover":{backgroundColor:d.primaryButtonBackgroundDisabled}}},splitButtonMenuButtonChecked:{backgroundColor:d.primaryButtonBackgroundPressed,selectors:{":hover":{backgroundColor:d.primaryButtonBackgroundPressed}}},splitButtonMenuButtonExpanded:{backgroundColor:d.primaryButtonBackgroundPressed,selectors:{":hover":{backgroundColor:d.primaryButtonBackgroundPressed}}},splitButtonMenuIcon:{color:d.primaryButtonText},splitButtonMenuIconDisabled:{color:u.neutralTertiary,selectors:(c={},c[jt]={color:"GrayText"},c)}}}var Bu,Nu,Fu,Au,Lu=No((function(e,t,o){var n=Qc(e),r=Jc(e);return dn(n,{root:{minWidth:"80px",height:"32px"},label:{fontWeight:Ge.semibold}},o?Ru(e):Mu(e),r,t)})),Hu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.primary,o=void 0!==t&&t,n=e.styles,r=e.theme;return b.createElement(qc,h({},this.props,{variantClassName:o?"ms-Button--primary":"ms-Button--default",styles:Lu(r,n,o),onRenderDescription:sa}))},t=g([ec("DefaultButton",["theme","styles"],!0)],t)}(b.Component),Ou=No((function(e,t){var o;return dn(Qc(e),{root:{padding:"0 4px",height:"40px",color:e.palette.neutralPrimary,backgroundColor:"transparent",border:"1px solid transparent"},rootHovered:{color:e.palette.themePrimary,selectors:(o={},o[jt]={borderColor:"Highlight",color:"Highlight"},o)},iconHovered:{color:e.palette.themePrimary},rootPressed:{color:e.palette.black},rootExpanded:{color:e.palette.themePrimary},iconPressed:{color:e.palette.themeDarker},rootDisabled:{color:e.palette.neutralTertiary,backgroundColor:"transparent",borderColor:"transparent"},rootChecked:{color:e.palette.black},iconChecked:{color:e.palette.themeDarker},flexContainer:{justifyContent:"flex-start"},icon:{color:e.palette.themeDarkAlt},iconDisabled:{color:"inherit"},menuIcon:{color:e.palette.neutralSecondary},textContainer:{flexGrow:0}},t)})),zu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return b.createElement(qc,h({},this.props,{variantClassName:"ms-Button--action ms-Button--command",styles:Ou(o,t),onRenderDescription:sa}))},t=g([ec("ActionButton",["theme","styles"],!0)],t)}(b.Component),Wu=No((function(e,t,o){var n,r,i,s,a,l=e.fonts,c=e.palette,u=Qc(e),d=Jc(e),p={root:{maxWidth:"280px",minHeight:"72px",height:"auto",padding:"16px 12px"},flexContainer:{flexDirection:"row",alignItems:"flex-start",minWidth:"100%",margin:""},textContainer:{textAlign:"left"},icon:{fontSize:"2em",lineHeight:"1em",height:"1em",margin:"0px 8px 0px 0px",flexBasis:"1em",flexShrink:"0"},label:{margin:"0 0 5px",lineHeight:"100%",fontWeight:Ge.semibold},description:[l.small,{lineHeight:"100%"}]},m={description:{color:c.neutralSecondary},descriptionHovered:{color:c.neutralDark},descriptionPressed:{color:"inherit"},descriptionChecked:{color:"inherit"},descriptionDisabled:{color:"inherit"}},g={description:{color:c.white,selectors:(n={},n[jt]=h({backgroundColor:"WindowText",color:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)},descriptionHovered:{color:c.white,selectors:(r={},r[jt]={backgroundColor:"Highlight",color:"Window"},r)},descriptionPressed:{color:"inherit",selectors:(i={},i[jt]=h({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)},descriptionChecked:{color:"inherit",selectors:(s={},s[jt]=h({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s)},descriptionDisabled:{color:"inherit",selectors:(a={},a[jt]={color:"inherit"},a)}};return dn(u,p,o?Ru(e):Mu(e),o?g:m,d,t)})),Vu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.primary,o=void 0!==t&&t,n=e.styles,r=e.theme;return b.createElement(qc,h({},this.props,{variantClassName:o?"ms-Button--compoundPrimary":"ms-Button--compound",styles:Wu(r,n,o)}))},t=g([ec("CompoundButton",["theme","styles"],!0)],t)}(b.Component),Ku=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){return b.createElement(Hu,h({},this.props,{primary:!0,onRenderDescription:sa}))},t=g([ec("PrimaryButton",["theme","styles"],!0)],t)}(b.Component),Uu=function(e){function t(t){var o=e.call(this,t)||this;return Zo("The Button component has been deprecated. Use specific variants instead. (PrimaryButton, DefaultButton, IconButton, ActionButton, etc.)"),o}return p(t,e),t.prototype.render=function(){var e=this.props;switch(e.buttonType){case vu.command:return b.createElement(zu,h({},e));case vu.compound:return b.createElement(Vu,h({},e));case vu.icon:return b.createElement(eu,h({},e));case vu.primary:return b.createElement(Ku,h({},e));default:return b.createElement(Hu,h({},e))}},t}(b.Component),Gu=No((function(e,t,o,n){var r,i,s,a,l,c,u,d,p,m,g,f,v,b,_=Qc(e),y=Jc(e),C=e.palette,S=e.semanticColors;return dn(_,y,{root:[go(e,{inset:2,highContrastStyle:{left:4,top:4,bottom:4,right:4,border:"none"},borderColor:"transparent"}),e.fonts.medium,{minWidth:"40px",backgroundColor:C.white,color:C.neutralPrimary,padding:"0 4px",border:"none",borderRadius:0,selectors:(r={},r[jt]={border:"none"},r)}],rootHovered:{backgroundColor:C.neutralLighter,color:C.neutralDark,selectors:(i={},i[jt]={color:"Highlight"},i["."+Gc.msButtonIcon]={color:C.themeDarkAlt},i["."+Gc.msButtonMenuIcon]={color:C.neutralPrimary},i)},rootPressed:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:(s={},s["."+Gc.msButtonIcon]={color:C.themeDark},s["."+Gc.msButtonMenuIcon]={color:C.neutralPrimary},s)},rootChecked:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:(a={},a["."+Gc.msButtonIcon]={color:C.themeDark},a["."+Gc.msButtonMenuIcon]={color:C.neutralPrimary},a)},rootCheckedHovered:{backgroundColor:C.neutralQuaternaryAlt,selectors:(l={},l["."+Gc.msButtonIcon]={color:C.themeDark},l["."+Gc.msButtonMenuIcon]={color:C.neutralPrimary},l)},rootExpanded:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:(c={},c["."+Gc.msButtonIcon]={color:C.themeDark},c["."+Gc.msButtonMenuIcon]={color:C.neutralPrimary},c)},rootExpandedHovered:{backgroundColor:C.neutralQuaternaryAlt},rootDisabled:{backgroundColor:C.white,selectors:(u={},u["."+Gc.msButtonIcon]={color:S.disabledBodySubtext,selectors:(d={},d[jt]=h({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),d)},u[jt]=h({color:"GrayText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),u)},splitButtonContainer:{height:"100%",selectors:(p={},p[jt]={border:"none"},p)},splitButtonDividerDisabled:{selectors:(m={},m[jt]={backgroundColor:"Window"},m)},splitButtonDivider:{backgroundColor:C.neutralTertiaryAlt},splitButtonMenuButton:{backgroundColor:C.white,border:"none",borderTopRightRadius:"0",borderBottomRightRadius:"0",color:C.neutralSecondary,selectors:{":hover":{backgroundColor:C.neutralLighter,color:C.neutralDark,selectors:(g={},g[jt]={color:"Highlight"},g["."+Gc.msButtonIcon]={color:C.neutralPrimary},g)},":active":{backgroundColor:C.neutralLight,selectors:(f={},f["."+Gc.msButtonIcon]={color:C.neutralPrimary},f)}}},splitButtonMenuButtonDisabled:{backgroundColor:C.white,selectors:(v={},v[jt]=h({color:"GrayText",border:"none",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),v)},splitButtonMenuButtonChecked:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:{":hover":{backgroundColor:C.neutralQuaternaryAlt}}},splitButtonMenuButtonExpanded:{backgroundColor:C.neutralLight,color:C.black,selectors:{":hover":{backgroundColor:C.neutralQuaternaryAlt}}},splitButtonMenuIcon:{color:C.neutralPrimary},splitButtonMenuIconDisabled:{color:C.neutralTertiary},label:{fontWeight:"normal"},icon:{color:C.themePrimary},menuIcon:(b={color:C.neutralSecondary},b[jt]={color:"GrayText"},b)},t)})),ju=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return b.createElement(qc,h({},this.props,{variantClassName:"ms-Button--commandBar",styles:Gu(o,t),onRenderDescription:sa}))},t=g([ec("CommandBarButton",["theme","styles"],!0)],t)}(b.Component),Yu=zu,qu=No((function(e,t){return dn({root:[go(e,{inset:1,highContrastStyle:{outlineOffset:"-4px",outline:"1px solid Window"},borderColor:"transparent"}),{height:24}]},t)})),Zu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return b.createElement(Hu,h({},this.props,{styles:qu(o,t),onRenderDescription:sa}))},t=g([ec("MessageBarButton",["theme","styles"],!0)],t)}(b.Component),Xu=Mn(),Qu=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o._id=t.id||ts(),o}return p(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.items,n=t.columnCount,r=t.onRenderItem,i=t.ariaPosInSet,s=void 0===i?t.positionInSet:i,a=t.ariaSetSize,l=void 0===a?t.setSize:a,c=t.styles,u=t.doNotContainWithinFocusZone,d=fr(this.props,Yn,u?[]:["onBlur"]),p=Xu(c,{theme:this.props.theme}),m=Ci(o,n),g=b.createElement("table",h({"aria-posinset":s,"aria-setsize":l,id:this._id,role:"grid"},d,{className:p.root}),b.createElement("tbody",null,m.map((function(t,o){return b.createElement("tr",{role:"row",key:e._id+"-"+o+"-row"},t.map((function(t,o){return b.createElement("td",{role:"presentation",key:e._id+"-"+o+"-cell",className:p.tableCell},r(t,o))})))}))));return u?g:b.createElement(ks,{isCircularNavigation:this.props.shouldFocusCircularNavigate,className:p.focusedContainer,onBlur:this.props.onBlur},g)},t}(b.Component),Ju=xn(Qu,(function(e){return{root:{padding:2,outline:"none"},tableCell:{padding:0}}})),$u=Ju,ed=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onClick=function(){var e=t.props,o=e.onClick,n=e.disabled,r=e.item;o&&!n&&o(r)},t._onMouseEnter=function(e){var o=t.props,n=o.onHover,r=o.disabled,i=o.item,s=o.onMouseEnter;s&&s(e)||!n||r||n(i)},t._onMouseMove=function(e){var o=t.props,n=o.onHover,r=o.disabled,i=o.item,s=o.onMouseMove;s&&s(e)||!n||r||n(i)},t._onMouseLeave=function(e){var o=t.props,n=o.onHover,r=o.disabled,i=o.onMouseLeave;i&&i(e)||!n||r||n()},t._onFocus=function(){var e=t.props,o=e.onFocus,n=e.disabled,r=e.item;o&&!n&&o(r)},t}return p(t,e),t.prototype.render=function(){var e,t=this.props,o=t.item,n=t.id,r=t.className,i=t.role,s=t.selected,a=t.disabled,l=t.onRenderItem,c=t.cellDisabledStyle,u=t.cellIsSelectedStyle,d=t.index,p=t.label,h=t.getClassNames;return b.createElement(Yu,{id:n,"data-index":d,"data-is-focusable":!0,disabled:a,className:Sr(r,(e={},e[""+u]=s,e[""+c]=a,e)),onClick:this._onClick,onMouseEnter:this._onMouseEnter,onMouseMove:this._onMouseMove,onMouseLeave:this._onMouseLeave,onFocus:this._onFocus,role:i,"aria-selected":s,ariaLabel:p,title:p,getClassNames:h},l(o))},t.defaultProps={disabled:!1},t}(b.Component),td=ed;!function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(Bu||(Bu={})),function(e){e[e.January=0]="January",e[e.February=1]="February",e[e.March=2]="March",e[e.April=3]="April",e[e.May=4]="May",e[e.June=5]="June",e[e.July=6]="July",e[e.August=7]="August",e[e.September=8]="September",e[e.October=9]="October",e[e.November=10]="November",e[e.December=11]="December"}(Nu||(Nu={})),function(e){e[e.FirstDay=0]="FirstDay",e[e.FirstFullWeek=1]="FirstFullWeek",e[e.FirstFourDayWeek=2]="FirstFourDayWeek"}(Fu||(Fu={})),function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.WorkWeek=3]="WorkWeek"}(Au||(Au={}));var od=7,nd=/[\{\}]/g,rd=/\{\d+\}/g;function id(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var n=t;function r(e){var t=n[e.replace(nd,"")];return null==t&&(t=""),t}return e.replace(rd,r)}var sd={MillisecondsInOneDay:864e5,MillisecondsIn1Sec:1e3,MillisecondsIn1Min:6e4,MillisecondsIn30Mins:18e5,MillisecondsIn1Hour:36e5,MinutesInOneDay:1440,MinutesInOneHour:60,DaysInOneWeek:7,MonthInOneYear:12};function ad(e,t){var o=new Date(e.getTime());return o.setDate(o.getDate()+t),o}function ld(e,t){return ad(e,t*sd.DaysInOneWeek)}function cd(e,t){var o=new Date(e.getTime()),n=o.getMonth()+t;return o.setMonth(n),o.getMonth()!==(n%sd.MonthInOneYear+sd.MonthInOneYear)%sd.MonthInOneYear&&(o=ad(o,-o.getDate())),o}function ud(e,t){var o=new Date(e.getTime());return o.setFullYear(e.getFullYear()+t),o.getMonth()!==(e.getMonth()%sd.MonthInOneYear+sd.MonthInOneYear)%sd.MonthInOneYear&&(o=ad(o,-o.getDate())),o}function dd(e){return new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0)}function pd(e){return new Date(e.getFullYear(),e.getMonth()+1,0,0,0,0,0)}function hd(e){return new Date(e.getFullYear(),0,1,0,0,0,0)}function md(e){return new Date(e.getFullYear()+1,0,0,0,0,0,0)}function gd(e,t){return cd(e,t-e.getMonth())}function fd(e,t){return!e&&!t||!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())}function vd(e,t){return wd(e)-wd(t)}function bd(e,t,o,n,r){void 0===r&&(r=1);var i,s=new Array,a=null;switch(n||(n=[Bu.Monday,Bu.Tuesday,Bu.Wednesday,Bu.Thursday,Bu.Friday]),r=Math.max(r,1),t){case Au.Day:a=ad(i=kd(e),r);break;case Au.Week:case Au.WorkWeek:a=ad(i=Sd(kd(e),o),sd.DaysInOneWeek);break;case Au.Month:a=cd(i=new Date(e.getFullYear(),e.getMonth(),1),1);break;default:throw new Error("Unexpected object: "+t)}var l=i;do{(t!==Au.WorkWeek||-1!==n.indexOf(l.getDay()))&&s.push(l),l=ad(l,1)}while(!fd(l,a));return s}function _d(e,t){for(var o=0,n=t;o<n.length;o++){if(fd(e,n[o]))return!0}return!1}function yd(e,t,o,n){var r=n.getFullYear(),i=n.getMonth(),s=1,a=new Date(r,i,s),l=s+(t+sd.DaysInOneWeek-1)-function(e,t){return e!==Bu.Sunday&&t<e?t+sd.DaysInOneWeek:t}(t,a.getDay()),c=new Date(r,i,l);s=c.getDate();for(var u=[],d=0;d<e;d++)u.push(Cd(c,t,o)),s+=sd.DaysInOneWeek,c=new Date(r,i,s);return u}function Cd(e,t,o){switch(o){case Fu.FirstFullWeek:return Id(e,t,sd.DaysInOneWeek);case Fu.FirstFourDayWeek:return Id(e,t,4);default:return function(e,t){var o=Dd(e)-1,n=(e.getDay()-o%sd.DaysInOneWeek-t+2*sd.DaysInOneWeek)%sd.DaysInOneWeek;return Math.floor((o+n)/sd.DaysInOneWeek+1)}(e,t)}}function Sd(e,t){var o=t-e.getDay();return o>0&&(o-=sd.DaysInOneWeek),ad(e,o)}function xd(e,t){var o=(t-1>=0?t-1:sd.DaysInOneWeek-1)-e.getDay();return o<0&&(o+=sd.DaysInOneWeek),ad(e,o)}function kd(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wd(e){return e.getDate()+(e.getMonth()<<5)+(e.getFullYear()<<9)}function Id(e,t,o){var n=Dd(e)-1,r=e.getDay()-n%sd.DaysInOneWeek,i=Dd(new Date(e.getFullYear()-1,Nu.December,31))-1,s=(t-r+2*sd.DaysInOneWeek)%sd.DaysInOneWeek;0!==s&&s>=o&&(s-=sd.DaysInOneWeek);var a=n-s;return a<0&&(0!==(s=(t-(r-=i%sd.DaysInOneWeek)+2*sd.DaysInOneWeek)%sd.DaysInOneWeek)&&s+1>=o&&(s-=sd.DaysInOneWeek),a=i-s),Math.floor(a/sd.DaysInOneWeek+1)}function Dd(e){for(var t=e.getMonth(),o=e.getFullYear(),n=0,r=0;r<t;r++)n+=Pd(r+1,o);return n+=e.getDate()}function Pd(e,t){return new Date(t,e,0).getDate()}Object(Dt.a)([{rawString:".root_fa5856b3{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:none;box-shadow:none;margin:0;padding:0}.root_fa5856b3 *{overflow:visible}.root_fa5856b3 ::-moz-focus-inner{border:0}.root_fa5856b3 *{outline:transparent}.root_fa5856b3 *{position:relative}.ms-Fabric--isFocusVisible .root_fa5856b3 :focus:after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:1px solid "},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:"}.picker_fa5856b3{color:"},{theme:"black",defaultValue:"#000000"},{rawString:";font-size:14px;position:relative}html[dir=ltr] .picker_fa5856b3{text-align:left}html[dir=rtl] .picker_fa5856b3{text-align:right}.holder_fa5856b3{-webkit-overflow-scrolling:touch;-webkit-box-sizing:border-box;box-sizing:border-box;display:none}.picker_fa5856b3.pickerIsOpened_fa5856b3 .holder_fa5856b3{-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block}.pickerIsOpened_fa5856b3{position:relative}.frame_fa5856b3{position:relative}.wrap_fa5856b3{min-height:212px;padding:12px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:content-box;box-sizing:content-box}.wrap_fa5856b3.goTodaySpacing_fa5856b3{min-height:228px}.dayPicker_fa5856b3{display:block}.header_fa5856b3{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:28px;line-height:44px;width:100%}.divider_fa5856b3{top:0;margin-top:-12px;margin-bottom:-12px}html[dir=ltr] .divider_fa5856b3{border-right:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}html[dir=rtl] .divider_fa5856b3{border-left:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.decade_fa5856b3,.monthAndYear_fa5856b3,.year_fa5856b3{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;font-size:14px;font-weight:400;font-weight:600;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:";padding:0 5px}.currentDecade_fa5856b3:hover,.currentYear_fa5856b3:hover,.monthAndYear_fa5856b3:hover{cursor:default}.table_fa5856b3{text-align:center;border-collapse:collapse;border-spacing:0;table-layout:fixed;font-size:inherit;margin-top:4px;width:197px}.table_fa5856b3 td{margin:0;padding:0}.dayWrapper_fa5856b3,.weekday_fa5856b3{width:28px;height:28px;padding:0;line-height:28px;font-size:12px;font-size:15px;font-weight:400;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:";-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:default}.dayWrapper_fa5856b3 ::-moz-focus-inner,.weekday_fa5856b3 ::-moz-focus-inner{border:0}.dayWrapper_fa5856b3 *,.weekday_fa5856b3 *{outline:transparent}.dayWrapper_fa5856b3 *,.weekday_fa5856b3 *{position:relative}.ms-Fabric--isFocusVisible .dayWrapper_fa5856b3 :focus:after,.ms-Fabric--isFocusVisible .weekday_fa5856b3 :focus:after{content:'';position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;pointer-events:none;border:1px solid "},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:"}.day_fa5856b3{width:24px;height:24px;border-radius:2px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border:none;padding:0;background-color:transparent;line-height:100%;color:inherit;font-size:inherit;font-weight:inherit;font-family:inherit}@media screen and (-ms-high-contrast:active){.daySelection_fa5856b3 .day_fa5856b3:active,.daySelection_fa5856b3 .day_fa5856b3:hover{outline:1px solid Highlight;-ms-high-contrast-adjust:none}}@media screen and (-ms-high-contrast:active){.daySelection_fa5856b3 .day_fa5856b3:active{color:Highlight;-ms-high-contrast-adjust:none}}.dayIsToday_fa5856b3{border-radius:100%}.dayIsToday_fa5856b3,.dayIsToday_fa5856b3:hover{position:relative;background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:"}@media screen and (-ms-high-contrast:active){.dayIsToday_fa5856b3,.dayIsToday_fa5856b3:hover{background-color:Highlight;-ms-high-contrast-adjust:none}}.dayIsToday_fa5856b3:hover,.dayIsToday_fa5856b3:hover:hover{border-radius:100%}.dayIsDisabled_fa5856b3:before{border-top-color:"},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:"}.dayIsUnfocused_fa5856b3{color:"},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:";font-weight:400}.dayIsFocused_fa5856b3:hover,.dayIsUnfocused_fa5856b3:hover{cursor:pointer;background:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.daySelection_fa5856b3.dayIsHighlighted_fa5856b3:hover,.pickerIsFocused_fa5856b3 .dayIsHighlighted_fa5856b3.daySelection_fa5856b3{cursor:pointer;background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";border-radius:2px}@media screen and (-ms-high-contrast:active){.daySelection_fa5856b3.dayIsHighlighted_fa5856b3:hover,.pickerIsFocused_fa5856b3 .dayIsHighlighted_fa5856b3.daySelection_fa5856b3{outline:2px solid Highlight}.daySelection_fa5856b3.dayIsHighlighted_fa5856b3:hover :not(.dayIsToday_fa5856b3) span,.pickerIsFocused_fa5856b3 .dayIsHighlighted_fa5856b3.daySelection_fa5856b3 :not(.dayIsToday_fa5856b3) span{color:Highlight;-ms-high-contrast-adjust:none}}@media screen and (-ms-high-contrast:active){.dayIsHighlighted_fa5856b3 button.dayIsToday_fa5856b3{border-radius:100%}}@media screen and (-ms-high-contrast:active){.dayIsHighlighted_fa5856b3 button.dayIsToday_fa5856b3 span{color:Window;-ms-high-contrast-adjust:none}}.dayIsFocused_fa5856b3:active,.dayIsHighlighted_fa5856b3{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.dayIsFocused_fa5856b3:active.day_fa5856b3,.dayIsHighlighted_fa5856b3.day_fa5856b3{color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:";background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.dayIsHighlighted_fa5856b3.dayDisabled_fa5856b3,.dayIsHighlighted_fa5856b3.dayDisabled_fa5856b3:hover{background:"},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:"}.dayBackground_fa5856b3,.dayBackground_fa5856b3:active,.dayBackground_fa5856b3:hover{border-radius:2px}.dayHover_fa5856b3,.dayHover_fa5856b3:hover{cursor:pointer;background:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.dayPress_fa5856b3,.dayPress_fa5856b3:hover{cursor:pointer;color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:";background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.dayPress_fa5856b3 .dayIsToday_fa5856b3,.dayPress_fa5856b3:hover .dayIsToday_fa5856b3{background:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:";border-radius:100%}.dayIsFocused_fa5856b3:active,.dayIsHighlighted_fa5856b3,.dayIsHighlighted_fa5856b3:active,.dayIsHighlighted_fa5856b3:hover,.dayIsUnfocused_fa5856b3:active,.weekBackground_fa5856b3,.weekBackground_fa5856b3:active,.weekBackground_fa5856b3:hover{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.dayIsToday_fa5856b3,.dayIsToday_fa5856b3.day_fa5856b3:active,.pickerIsFocused_fa5856b3 .dayIsToday_fa5856b3{position:relative;color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:";font-weight:600;background:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:";border-radius:100%}@media screen and (-ms-high-contrast:active){.dayIsToday_fa5856b3,.dayIsToday_fa5856b3.day_fa5856b3:active,.pickerIsFocused_fa5856b3 .dayIsToday_fa5856b3{background-color:Highlight;color:HighlightText;-ms-high-contrast-adjust:none}}.showWeekNumbers_fa5856b3 .weekNumbers_fa5856b3{border-right:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";-webkit-box-sizing:border-box;box-sizing:border-box;width:28px;padding:0}.showWeekNumbers_fa5856b3 .weekNumbers_fa5856b3 .dayWrapper_fa5856b3{color:"},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:"}.showWeekNumbers_fa5856b3 .weekNumbers_fa5856b3 .dayWrapper_fa5856b3.weekIsHighlighted_fa5856b3{color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:"}.showWeekNumbers_fa5856b3 .table_fa5856b3{width:225px}.showWeekNumbers_fa5856b3 .table_fa5856b3 .dayWrapper_fa5856b3,.showWeekNumbers_fa5856b3 .table_fa5856b3 .weekday_fa5856b3{width:30px}.showWeekNumbersRTL_fa5856b3 .weekNumbers_fa5856b3{border-left:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";-webkit-box-sizing:border-box;box-sizing:border-box}.showWeekNumbersRTL_fa5856b3 .weekNumbers_fa5856b3 .dayWrapper_fa5856b3{color:"},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:"}.showWeekNumbersRTL_fa5856b3 .weekNumbers_fa5856b3 .dayWrapper_fa5856b3.weekIsHighlighted_fa5856b3{color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:"}.showWeekNumbersRTL_fa5856b3 .table_fa5856b3{width:225px}.showWeekNumbersRTL_fa5856b3 .table_fa5856b3 .dayWrapper_fa5856b3,.showWeekNumbersRTL_fa5856b3 .table_fa5856b3 .weekday_fa5856b3{width:30px}.decadeComponents_fa5856b3,.monthComponents_fa5856b3,.yearComponents_fa5856b3{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-item-align:end;align-self:flex-end}.closeButton_fa5856b3,.nextDecade_fa5856b3,.nextMonth_fa5856b3,.nextYear_fa5856b3,.prevDecade_fa5856b3,.prevMonth_fa5856b3,.prevYear_fa5856b3{font-family:inherit;width:28px;height:28px;display:block;text-align:center;line-height:28px;text-align:center;font-size:12px;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:";border-radius:2px;position:relative;background-color:transparent;border:none;padding:0}.closeButton_fa5856b3:hover,.nextDecade_fa5856b3:hover,.nextMonth_fa5856b3:hover,.nextYear_fa5856b3:hover,.prevDecade_fa5856b3:hover,.prevMonth_fa5856b3:hover,.prevYear_fa5856b3:hover{color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:";cursor:pointer;outline:1px solid transparent}.nextDecadeIsDisabled_fa5856b3,.nextMonthIsDisabled_fa5856b3,.nextYearIsDisabled_fa5856b3,.prevDecadeIsDisabled_fa5856b3,.prevMonthIsDisabled_fa5856b3,.prevYearIsDisabled_fa5856b3{color:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:";pointer-events:none}.headerToggleView_fa5856b3{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:4px 8px}.headerToggleView_fa5856b3:hover{color:"},{theme:"black",defaultValue:"#000000"},{rawString:";cursor:pointer}@media screen and (-ms-high-contrast:active){.headerToggleView_fa5856b3:hover{outline:1px solid highlight}}@media screen and (-ms-high-contrast:active){.headerToggleView_fa5856b3:hover:active{color:highlight}}.currentDecade_fa5856b3,.currentYear_fa5856b3{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;padding:0 5px;font-size:14px;font-weight:400;font-weight:600;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:";height:28px;line-height:28px}html[dir=ltr] .currentDecade_fa5856b3,html[dir=ltr] .currentYear_fa5856b3{margin-left:5px}html[dir=rtl] .currentDecade_fa5856b3,html[dir=rtl] .currentYear_fa5856b3{margin-right:5px}.optionGrid_fa5856b3{position:relative;height:210px;width:196px;margin:4px 0 0 0}html[dir=rtl] .optionGrid_fa5856b3{margin:4px 0 0 0}.monthOption_fa5856b3,.yearOption_fa5856b3{width:60px;height:60px;line-height:100%;cursor:pointer;margin:0 10px 10px 0;font-size:13px;font-weight:400;font-family:inherit;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:";text-align:center;border:none;padding:0;background-color:transparent;border-radius:2px}html[dir=ltr] .monthOption_fa5856b3,html[dir=ltr] .yearOption_fa5856b3{float:left}html[dir=rtl] .monthOption_fa5856b3,html[dir=rtl] .yearOption_fa5856b3{float:right}html[dir=rtl] .monthOption_fa5856b3,html[dir=rtl] .yearOption_fa5856b3{margin:0 0 10px 10px}.monthOption_fa5856b3:hover,.yearOption_fa5856b3:hover{color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:";background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";outline:1px solid transparent}@media screen and (-ms-high-contrast:active){.monthOption_fa5856b3:hover,.yearOption_fa5856b3:hover{outline-color:highlight}}@media screen and (-ms-high-contrast:active){.monthOption_fa5856b3:active,.yearOption_fa5856b3:active{color:highlight}}.monthOption_fa5856b3.isHighlighted_fa5856b3,.yearOption_fa5856b3.isHighlighted_fa5856b3{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.dayIsDisabled_fa5856b3,.monthOptionIsDisabled_fa5856b3,.yearOptionIsDisabled_fa5856b3{color:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:";pointer-events:none}.goToday_fa5856b3{bottom:0;color:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:";cursor:pointer;font-size:12px;font-weight:400;font-family:inherit;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:";height:30px;line-height:30px;padding:0 10px;background-color:transparent;border:none;position:absolute!important;-webkit-box-sizing:content-box;box-sizing:content-box}[dir=ltr] .goToday_fa5856b3{right:13px}[dir=rtl] .goToday_fa5856b3{left:13px}.goToday_fa5856b3:hover{color:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:";outline:1px solid transparent}@media screen and (-ms-high-contrast:active){.goToday_fa5856b3:hover{outline-color:highlight}}.goToday_fa5856b3:active{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.goToday_fa5856b3:active{color:highlight}}.goToTodayIsDisabled_fa5856b3{color:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:";pointer-events:none}.goTodayInlineMonth_fa5856b3{top:212px}.wrap_fa5856b3.goTodaySpacing_fa5856b3{padding-bottom:28px}.root_fa5856b3.isPickingYears_fa5856b3 .dayPicker_fa5856b3,.root_fa5856b3.isPickingYears_fa5856b3 .monthComponents_fa5856b3{display:none}.root_fa5856b3.isPickingYears_fa5856b3 .monthPicker_fa5856b3{display:none}.root_fa5856b3.isPickingYears_fa5856b3 .yearPicker_fa5856b3{display:block}@media (min-device-width:460px){.wrap_fa5856b3{padding:12px}.dayPicker_fa5856b3,.monthPicker_fa5856b3{min-height:200px}.header_fa5856b3{height:28px;line-height:28px;width:100%}.dayWrapper_fa5856b3,.weekday_fa5856b3{width:28px;height:28px;line-height:28px;font-size:12px}.closeButton_fa5856b3,.nextDecade_fa5856b3,.nextMonth_fa5856b3,.nextYear_fa5856b3,.prevDecade_fa5856b3,.prevMonth_fa5856b3,.prevYear_fa5856b3{font-size:12px;width:28px;height:28px;line-height:28px}.holder_fa5856b3{display:inline-block;height:auto;overflow:hidden}.decade_fa5856b3,.monthAndYear_fa5856b3,.year_fa5856b3{font-size:14px;color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:"}.yearComponents_fa5856b3{margin-left:1px}.goToday_fa5856b3{padding:0 3px}[dir=ltr] .goToday_fa5856b3{right:20px}[dir=rtl] .goToday_fa5856b3{left:20px}.showWeekNumbers_fa5856b3 .table_fa5856b3 .dayWrapper_fa5856b3,.showWeekNumbers_fa5856b3 .table_fa5856b3 .weekday_fa5856b3{width:28px}.showWeekNumbersRTL_fa5856b3 .table_fa5856b3 .dayWrapper_fa5856b3,.showWeekNumbersRTL_fa5856b3 .table_fa5856b3 .weekday_fa5856b3{width:28px}.monthPickerVisible_fa5856b3 .wrap_fa5856b3{padding:12px}.monthPickerVisible_fa5856b3 .dayPicker_fa5856b3{margin:-10px 0;padding:10px 0}.monthPickerVisible_fa5856b3 .dayPicker_fa5856b3{-webkit-box-sizing:border-box;box-sizing:border-box;width:212px;min-height:200px}.monthPickerVisible_fa5856b3 .monthPicker_fa5856b3{display:block}.monthPickerVisible_fa5856b3 .optionGrid_fa5856b3{height:150px;width:196px}.monthPickerVisible_fa5856b3 .toggleMonthView_fa5856b3{display:none}.monthPickerVisible_fa5856b3 .currentDecade_fa5856b3,.monthPickerVisible_fa5856b3 .currentYear_fa5856b3{font-size:14px;margin:0;height:28px;line-height:28px;display:inline-block}.monthPickerVisible_fa5856b3 .monthOption_fa5856b3,.monthPickerVisible_fa5856b3 .yearOption_fa5856b3{width:40px;height:40px;line-height:100%;font-size:12px;margin:0 12px 16px 0}html[dir=rtl] .monthPickerVisible_fa5856b3 .monthOption_fa5856b3,html[dir=rtl] .monthPickerVisible_fa5856b3 .yearOption_fa5856b3{margin:0 0 16px 12px}.monthPickerVisible_fa5856b3 .monthOption_fa5856b3:hover,.monthPickerVisible_fa5856b3 .yearOption_fa5856b3:hover{outline:1px solid transparent}.monthPickerVisible_fa5856b3 .monthOption_fa5856b3:nth-child(4n+4),.monthPickerVisible_fa5856b3 .yearOption_fa5856b3:nth-child(4n+4){margin:0 0 16px 0}html[dir=rtl] .monthPickerVisible_fa5856b3 .monthOption_fa5856b3:nth-child(4n+4),html[dir=rtl] .monthPickerVisible_fa5856b3 .yearOption_fa5856b3:nth-child(4n+4){margin:0 0 16px 0}.monthPickerVisible_fa5856b3 .goToday_fa5856b3{font-size:12px;height:28px;line-height:28px;padding:0 10px}[dir=ltr] .monthPickerVisible_fa5856b3 .goToday_fa5856b3{right:8px}[dir=rtl] .monthPickerVisible_fa5856b3 .goToday_fa5856b3{left:8px}html[dir=ltr] .monthPickerVisible_fa5856b3 .goToday_fa5856b3{text-align:right}html[dir=rtl] .monthPickerVisible_fa5856b3 .goToday_fa5856b3{text-align:left}.monthPickerVisible_fa5856b3 .root_fa5856b3.isPickingYears_fa5856b3 .dayPicker_fa5856b3,.monthPickerVisible_fa5856b3 .root_fa5856b3.isPickingYears_fa5856b3 .monthComponents_fa5856b3{display:block}.monthPickerVisible_fa5856b3 .root_fa5856b3.isPickingYears_fa5856b3 .monthPicker_fa5856b3{display:none}.monthPickerVisible_fa5856b3 .root_fa5856b3.isPickingYears_fa5856b3 .yearPicker_fa5856b3{display:block}.calendarsInline_fa5856b3 .wrap_fa5856b3{padding:12px}.calendarsInline_fa5856b3 .holder_fa5856b3{height:auto}html[dir=ltr] .calendarsInline_fa5856b3 .table_fa5856b3{margin-right:12px}html[dir=rtl] .calendarsInline_fa5856b3 .table_fa5856b3{margin-left:12px}.calendarsInline_fa5856b3 .dayPicker_fa5856b3{width:auto}html[dir=ltr] .calendarsInline_fa5856b3 .monthPicker_fa5856b3{margin-left:12px}html[dir=rtl] .calendarsInline_fa5856b3 .monthPicker_fa5856b3{margin-right:12px}html[dir=ltr] .calendarsInline_fa5856b3 .yearPicker_fa5856b3{margin-left:12px}html[dir=rtl] .calendarsInline_fa5856b3 .yearPicker_fa5856b3{margin-right:12px}.calendarsInline_fa5856b3 .goToday_fa5856b3{padding:0 10px}[dir=ltr] .calendarsInline_fa5856b3 .goToday_fa5856b3{right:14px}[dir=rtl] .calendarsInline_fa5856b3 .goToday_fa5856b3{left:14px}html[dir=ltr] .calendarsInline_fa5856b3 .monthComponents_fa5856b3{margin-right:12px}html[dir=rtl] .calendarsInline_fa5856b3 .monthComponents_fa5856b3{margin-left:12px}.monthPickerOnly_fa5856b3 .wrap_fa5856b3{padding:12px}.monthPickerAsOverlay_fa5856b3 .wrap_fa5856b3{padding-bottom:28px;margin-bottom:6px}.monthPickerAsOverlay_fa5856b3 .holder_fa5856b3{height:240px;min-height:240px}.monthPickerAsOverlay_fa5856b3 .holderWithButton_fa5856b3{padding-top:6px;height:auto}}@media (max-device-width:459px){.calendarsInline_fa5856b3 .monthPicker_fa5856b3,.calendarsInline_fa5856b3 .yearPicker_fa5856b3{display:none}.yearComponents_fa5856b3{margin-top:2px}}.goToday_fa5856b3{width:auto}.closeButton_fa5856b3,.nextDecade_fa5856b3,.nextMonth_fa5856b3,.nextYear_fa5856b3,.prevDecade_fa5856b3,.prevMonth_fa5856b3,.prevYear_fa5856b3{display:inline-block}.closeButton_fa5856b3:hover,.nextDecade_fa5856b3:hover,.nextMonth_fa5856b3:hover,.nextYear_fa5856b3:hover,.prevDecade_fa5856b3:hover,.prevMonth_fa5856b3:hover,.prevYear_fa5856b3:hover{background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}@media screen and (-ms-high-contrast:active){.closeButton_fa5856b3:hover,.nextDecade_fa5856b3:hover,.nextMonth_fa5856b3:hover,.nextYear_fa5856b3:hover,.prevDecade_fa5856b3:hover,.prevMonth_fa5856b3:hover,.prevYear_fa5856b3:hover{outline:1px solid Highlight}}.closeButton_fa5856b3:active,.nextDecade_fa5856b3:active,.nextMonth_fa5856b3:active,.nextYear_fa5856b3:active,.prevDecade_fa5856b3:active,.prevMonth_fa5856b3:active,.prevYear_fa5856b3:active{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}@media screen and (-ms-high-contrast:active){.closeButton_fa5856b3:active,.nextDecade_fa5856b3:active,.nextMonth_fa5856b3:active,.nextYear_fa5856b3:active,.prevDecade_fa5856b3:active,.prevMonth_fa5856b3:active,.prevYear_fa5856b3:active{color:highlight}}.monthIsHighlighted_fa5856b3{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.monthIsHighlighted_fa5856b3.monthOption_fa5856b3:hover{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}@media screen and (-ms-high-contrast:active){.monthIsHighlighted_fa5856b3{color:highlight;border:2px solid highlight;border-radius:2px}.monthIsHighlighted_fa5856b3:hover{outline:0!important}}.monthIsCurrentMonth_fa5856b3{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:";background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.monthIsCurrentMonth_fa5856b3.monthOption_fa5856b3:hover{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:";background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:"}.monthOption_fa5856b3:active{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.yearIsHighlighted_fa5856b3{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.yearIsHighlighted_fa5856b3.yearOption_fa5856b3:hover{background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:"}.yearIsCurrentYear_fa5856b3{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:";background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.yearIsCurrentYear_fa5856b3.yearOption_fa5856b3:hover{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:";background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:"}.yearOption_fa5856b3:active{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.topLeftCornerDate_fa5856b3{border-top-left-radius:2px}.topRightCornerDate_fa5856b3{border-top-right-radius:2px}.bottomLeftCornerDate_fa5856b3{border-bottom-left-radius:2px}.bottomRightCornerDate_fa5856b3{border-bottom-right-radius:2px}@media screen and (-ms-high-contrast:active){.weekBackground_fa5856b3{border-top:1px solid highlight;border-bottom:1px solid highlight}.weekBackground_fa5856b3.bottomRightCornerDate_fa5856b3.topRightCornerDate_fa5856b3{border-right:1px solid highlight;border-left:none;padding-left:1px}.weekBackground_fa5856b3.bottomLeftCornerDate_fa5856b3.topLeftCornerDate_fa5856b3{border-left:1px solid highlight;border-right:none;padding-right:1px}.weekBackground_fa5856b3 :not(.dayIsToday_fa5856b3) span{color:highlight}.weekSelection_fa5856b3.dayHover_fa5856b3{border-top:1px solid highlight;border-bottom:1px solid highlight}.weekSelection_fa5856b3.dayHover_fa5856b3.bottomLeftCornerDate_fa5856b3.topLeftCornerDate_fa5856b3{border-left:1px solid highlight;padding-right:1px}.weekSelection_fa5856b3.dayHover_fa5856b3.bottomRightCornerDate_fa5856b3.topRightCornerDate_fa5856b3{border-right:1px solid highlight;padding-left:1px}.weekSelection_fa5856b3.dayHover_fa5856b3.dayPress_fa5856b3 :not(.dayIsToday_fa5856b3) span{color:highlight}.monthSelection_fa5856b3.dayHover_fa5856b3.bottomLeftCornerDate_fa5856b3,.monthSelection_fa5856b3.dayHover_fa5856b3.topLeftCornerDate_fa5856b3{border-left:1px solid highlight;padding-right:1px}.monthSelection_fa5856b3.dayHover_fa5856b3.bottomRightCornerDate_fa5856b3,.monthSelection_fa5856b3.dayHover_fa5856b3.topRightCornerDate_fa5856b3{border-right:1px solid highlight;padding-left:1px}.monthSelection_fa5856b3.dayIsFocused_fa5856b3.dayHover_fa5856b3.topDate_fa5856b3,.monthSelection_fa5856b3.dayIsUnfocused_fa5856b3.dayHover_fa5856b3.topDate_fa5856b3{border-top:1px solid highlight;padding-bottom:1px}.monthSelection_fa5856b3.dayIsFocused_fa5856b3.dayHover_fa5856b3.rightDate_fa5856b3,.monthSelection_fa5856b3.dayIsUnfocused_fa5856b3.dayHover_fa5856b3.rightDate_fa5856b3{border-right:1px solid highlight;padding-left:1px}.monthSelection_fa5856b3.dayIsFocused_fa5856b3.dayHover_fa5856b3.bottomDate_fa5856b3,.monthSelection_fa5856b3.dayIsUnfocused_fa5856b3.dayHover_fa5856b3.bottomDate_fa5856b3{border-bottom:1px solid highlight;padding-top:1px}.monthSelection_fa5856b3.dayIsFocused_fa5856b3.dayHover_fa5856b3.leftdate_fa5856b3,.monthSelection_fa5856b3.dayIsUnfocused_fa5856b3.dayHover_fa5856b3.leftdate_fa5856b3{border-left:1px solid highlight;padding-right:1px}.monthSelection_fa5856b3.dayIsFocused_fa5856b3.dayHover_fa5856b3.dayPress_fa5856b3 :not(.dayIsToday_fa5856b3) span,.monthSelection_fa5856b3.dayIsUnfocused_fa5856b3.dayHover_fa5856b3.dayPress_fa5856b3 :not(.dayIsToday_fa5856b3) span{color:highlight}}"}]);var Td="root_fa5856b3",Ed="picker_fa5856b3",Md="holder_fa5856b3",Rd="pickerIsOpened_fa5856b3",Bd="frame_fa5856b3",Nd="wrap_fa5856b3",Fd="goTodaySpacing_fa5856b3",Ad="dayPicker_fa5856b3",Ld="header_fa5856b3",Hd="divider_fa5856b3",Od="monthAndYear_fa5856b3",zd="year_fa5856b3",Wd="decade_fa5856b3",Vd="currentYear_fa5856b3",Kd="currentDecade_fa5856b3",Ud="table_fa5856b3",Gd="dayWrapper_fa5856b3",jd="weekday_fa5856b3",Yd="day_fa5856b3",qd="daySelection_fa5856b3",Zd="dayIsToday_fa5856b3",Xd="dayIsDisabled_fa5856b3",Qd="dayIsUnfocused_fa5856b3",Jd="dayIsFocused_fa5856b3",$d="dayIsHighlighted_fa5856b3",ep="pickerIsFocused_fa5856b3",tp="dayDisabled_fa5856b3",op="dayBackground_fa5856b3",np="dayHover_fa5856b3",rp="dayPress_fa5856b3",ip="weekBackground_fa5856b3",sp="showWeekNumbers_fa5856b3",ap="weekNumbers_fa5856b3",lp="weekIsHighlighted_fa5856b3",cp="showWeekNumbersRTL_fa5856b3",up="monthComponents_fa5856b3",dp="yearComponents_fa5856b3",pp="decadeComponents_fa5856b3",hp="closeButton_fa5856b3",mp="prevMonth_fa5856b3",gp="nextMonth_fa5856b3",fp="prevYear_fa5856b3",vp="nextYear_fa5856b3",bp="prevDecade_fa5856b3",_p="nextDecade_fa5856b3",yp="prevMonthIsDisabled_fa5856b3",Cp="nextMonthIsDisabled_fa5856b3",Sp="prevYearIsDisabled_fa5856b3",xp="nextYearIsDisabled_fa5856b3",kp="prevDecadeIsDisabled_fa5856b3",wp="nextDecadeIsDisabled_fa5856b3",Ip="headerToggleView_fa5856b3",Dp="optionGrid_fa5856b3",Pp="monthOption_fa5856b3",Tp="yearOption_fa5856b3",Ep="isHighlighted_fa5856b3",Mp="monthOptionIsDisabled_fa5856b3",Rp="yearOptionIsDisabled_fa5856b3",Bp="goToday_fa5856b3",Np="goToTodayIsDisabled_fa5856b3",Fp="goTodayInlineMonth_fa5856b3",Ap="isPickingYears_fa5856b3",Lp="monthPicker_fa5856b3",Hp="yearPicker_fa5856b3",Op="monthPickerVisible_fa5856b3",zp="toggleMonthView_fa5856b3",Wp="calendarsInline_fa5856b3",Vp="monthPickerOnly_fa5856b3",Kp="monthPickerAsOverlay_fa5856b3",Up="holderWithButton_fa5856b3",Gp="monthIsHighlighted_fa5856b3",jp="monthIsCurrentMonth_fa5856b3",Yp="yearIsHighlighted_fa5856b3",qp="yearIsCurrentYear_fa5856b3",Zp="topLeftCornerDate_fa5856b3",Xp="topRightCornerDate_fa5856b3",Qp="bottomLeftCornerDate_fa5856b3",Jp="bottomRightCornerDate_fa5856b3",$p="weekSelection_fa5856b3",eh="monthSelection_fa5856b3",th="topDate_fa5856b3",oh="rightDate_fa5856b3",nh="bottomDate_fa5856b3",rh="leftdate_fa5856b3",ih=n,sh=function(e){function t(t){var o=e.call(this,t)||this;return o.days={},o._onKeyDown=function(e,t){t.which!==wn.enter&&t.which!==wn.space||e()},o._onDayKeyDown=function(e,t,n){return function(r){r.which===wn.enter?(o._onSelectDate(e,r),r.preventDefault()):o._navigateMonthEdge(r,e,t,n)}},o._onDayMouseDown=function(e,t,n,r){return function(n){r===Au.Month?o._applyFunctionToDayRefs((function(t,o){t&&o.originalDate.getMonth()===e.getMonth()&&o.isInBounds&&t.classList.add(ih.dayPress)})):o._applyFunctionToDayRefs((function(e,o,n){e&&n===t&&o.isInBounds?(e.classList.add(ih.dayPress),e.classList.add(ih.dayIsHighlighted)):e&&e.classList.remove(ih.dayIsHighlighted)}))}},o._onDayMouseUp=function(e,t,n,r){return function(n){r===Au.Month?o._applyFunctionToDayRefs((function(t,o){t&&o.originalDate.getMonth()===e.getMonth()&&o.isInBounds&&t.classList.remove(ih.dayPress)})):o._applyFunctionToDayRefs((function(e,o,n){e&&n===t&&o.isInBounds&&e.classList.remove(ih.dayPress)}))}},o._onDayMouseOver=function(e,t,n,r){return function(n){r===Au.Month?o._applyFunctionToDayRefs((function(t,o){t&&o.originalDate.getMonth()===e.getMonth()&&o.isInBounds&&t.classList.add(ih.dayHover)})):o._applyFunctionToDayRefs((function(e,o,n){e&&n===t&&o.isInBounds&&e.classList.add(ih.dayHover)}))}},o._onDayMouseLeave=function(e,t,n,r){return function(n){r===Au.Month?o._applyFunctionToDayRefs((function(t,o){t&&o.originalDate.getMonth()===e.getMonth()&&o.isInBounds&&t.classList.remove(ih.dayHover)})):o._applyFunctionToDayRefs((function(e,o,n){e&&n===t&&o.isInBounds&&e.classList.remove(ih.dayHover)}))}},o._onTableMouseLeave=function(e){e.target.contains&&e.relatedTarget&&e.relatedTarget.contains&&e.target.contains(e.relatedTarget)||o._applyFunctionToDayRefs((function(e,t){e&&(e.classList.remove(ih.dayHover),e.classList.remove(ih.dayPress))}))},o._onTableMouseUp=function(e){e.target.contains&&e.relatedTarget&&e.relatedTarget.contains&&e.target.contains(e.relatedTarget)||o._applyFunctionToDayRefs((function(e,t){e&&e.classList.remove(ih.dayPress)}))},o._onSelectDate=function(e,t){var n=o.props,r=n.onSelectDate,i=n.dateRangeType,s=n.firstDayOfWeek,a=n.navigatedDate,l=n.autoNavigateOnSelection,c=n.minDate,u=n.maxDate,d=n.workWeekDays;t&&t.stopPropagation();var p=bd(e,i,s,d);if(i!==Au.Day&&(p=o._getBoundedDateRange(p,c,u)),p=p.filter((function(e){return!o._getIsRestrictedDate(e)})),r&&r(e,p),l&&e.getMonth()!==a.getMonth()){var h=vd(e,a);h<0?o._onSelectPrevMonth():h>0&&o._onSelectNextMonth()}},o._onSelectNextMonth=function(){o.props.onNavigateDate(cd(o.props.navigatedDate,1),!1)},o._onSelectPrevMonth=function(){o.props.onNavigateDate(cd(o.props.navigatedDate,-1),!1)},o._onClose=function(){o.props.onDismiss&&o.props.onDismiss()},o._onHeaderSelect=function(){var e=o.props.onHeaderSelect;e&&e(!0)},o._onHeaderKeyDown=function(e){var t=o.props.onHeaderSelect;!t||e.which!==wn.enter&&e.which!==wn.space||t(!0)},o._onPrevMonthKeyDown=function(e){e.which===wn.enter&&o._onKeyDown(o._onSelectPrevMonth,e)},o._onNextMonthKeyDown=function(e){e.which===wn.enter&&o._onKeyDown(o._onSelectNextMonth,e)},o._onCloseButtonKeyDown=function(e){e.which===wn.enter&&o._onKeyDown(o._onClose,e)},si(o),o.state={activeDescendantId:ts("DatePickerDay-active"),weeks:o._getWeeks(t)},o._onSelectNextMonth=o._onSelectNextMonth.bind(o),o._onSelectPrevMonth=o._onSelectPrevMonth.bind(o),o._onClose=o._onClose.bind(o),o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){this.setState({weeks:this._getWeeks(e)})},t.prototype.render=function(){var e,t,o=this,n=this.state,r=n.activeDescendantId,i=n.weeks,s=this.props,a=s.firstDayOfWeek,l=s.strings,c=s.navigatedDate,u=s.selectedDate,d=s.dateRangeType,p=s.navigationIcons,h=s.showWeekNumbers,m=s.firstWeekOfYear,g=s.dateTimeFormatter,f=s.minDate,v=s.maxDate,_=s.showCloseButton,y=s.allFocusable,C=ts("DatePickerDay-dayPicker"),S=ts("DatePickerDay-monthAndYear"),x=p.leftNavigation,k=p.rightNavigation,w=p.closeIcon,I=h?yd(i.length,a,m,c):null,D=h?Cd(u,a,m):void 0,P=this._getWeekCornerStyles(i,d),T=!f||vd(f,dd(c))<0,E=!v||vd(pd(c),v)<0;return b.createElement("div",{className:Sr("ms-DatePicker-dayPicker",ih.dayPicker,h&&(In()?ih.showWeekNumbersRTL:ih.showWeekNumbers)),id:C},b.createElement("div",{className:Sr("ms-DatePicker-header",ih.header)},b.createElement("div",{"aria-live":"polite","aria-relevant":"text","aria-atomic":"true",id:S,className:ih.monthAndYear},this.props.onHeaderSelect?b.createElement("div",{className:Sr("ms-DatePicker-monthAndYear js-showMonthPicker",ih.headerToggleView),onClick:this._onHeaderSelect,onKeyDown:this._onHeaderKeyDown,"aria-label":g.formatMonthYear(c,l),role:"button",tabIndex:0},g.formatMonthYear(c,l)):b.createElement("div",{className:Sr("ms-DatePicker-monthAndYear",ih.monthAndYear)},g.formatMonthYear(c,l))),b.createElement("div",{className:Sr("ms-DatePicker-monthComponents",ih.monthComponents)},b.createElement("div",{className:Sr("ms-DatePicker-navContainer",ih.navContainer)},b.createElement("button",{className:Sr("ms-DatePicker-prevMonth js-prevMonth",ih.prevMonth,(e={},e["ms-DatePicker-prevMonth--disabled "+ih.prevMonthIsDisabled]=!T,e)),disabled:!y&&!T,"aria-disabled":!T,onClick:T?this._onSelectPrevMonth:void 0,onKeyDown:T?this._onPrevMonthKeyDown:void 0,"aria-controls":C,title:l.prevMonthAriaLabel?l.prevMonthAriaLabel+" "+l.months[cd(c,-1).getMonth()]:void 0,role:"button",type:"button"},b.createElement(Fr,{iconName:x})),b.createElement("button",{className:Sr("ms-DatePicker-nextMonth js-nextMonth",ih.nextMonth,(t={},t["ms-DatePicker-nextMonth--disabled "+ih.nextMonthIsDisabled]=!E,t)),disabled:!y&&!E,"aria-disabled":!E,onClick:E?this._onSelectNextMonth:void 0,onKeyDown:E?this._onNextMonthKeyDown:void 0,"aria-controls":C,title:l.nextMonthAriaLabel?l.nextMonthAriaLabel+" "+l.months[cd(c,1).getMonth()]:void 0,role:"button",type:"button"},b.createElement(Fr,{iconName:k})),_&&b.createElement("button",{className:Sr("ms-DatePicker-closeButton js-closeButton",ih.closeButton),onClick:this._onClose,onKeyDown:this._onCloseButtonKeyDown,title:l.closeButtonAriaLabel,role:"button",type:"button"},b.createElement(Fr,{iconName:w}))))),b.createElement(ks,null,b.createElement("table",{className:Sr("ms-DatePicker-table",ih.table),"aria-readonly":"true","aria-multiselectable":"false","aria-labelledby":S,"aria-activedescendant":r,role:"grid"},b.createElement("thead",null,b.createElement("tr",null,h&&b.createElement("th",{className:Sr("ms-DatePicker-weekday",ih.weekday)}),l.shortDays.map((function(e,t){return b.createElement("th",{className:Sr("ms-DatePicker-weekday",ih.weekday),role:"columnheader",scope:"col",key:t,title:l.days[(t+a)%7],"aria-label":l.days[(t+a)%7],"data-is-focusable":!!y||void 0},l.shortDays[(t+a)%7])})))),b.createElement("tbody",{onMouseLeave:d!==Au.Day?this._onTableMouseLeave:void 0,onMouseUp:d!==Au.Day?this._onTableMouseUp:void 0},i.map((function(e,t){var n;return b.createElement("tr",{key:I?I[t]:t},h&&I&&b.createElement("th",{className:Sr("ms-DatePicker-weekNumbers","ms-DatePicker-weekday",ih.weekday,ih.weekNumbers),key:t,title:I&&l.weekNumberFormatString&&id(l.weekNumberFormatString,I[t]),"aria-label":I&&l.weekNumberFormatString&&id(l.weekNumberFormatString,I[t]),scope:"row"},b.createElement("div",{className:Sr("ms-DatePicker-day",ih.day,(n={},n["ms-DatePicker-week--highlighted "+ih.weekIsHighlighted]=D===I[t],n))},b.createElement("span",null,I[t]))),e.map((function(e,n){var i,s,a=fd(c,e.originalDate);return b.createElement("td",{key:e.key,onClick:e.isInBounds?e.onSelected:void 0,className:Sr(ih.dayWrapper,"ms-DatePicker-day",o._getHighlightedCornerStyle(P,n,t),(i={},i["ms-DatePicker-weekBackground "+ih.weekBackground]=e.isSelected&&(d===Au.Week||d===Au.WorkWeek),i["ms-DatePicker-dayBackground "+ih.dayBackground]=d===Au.Day,i["ms-DatePicker-day--highlighted "+ih.dayIsHighlighted]=e.isSelected&&d===Au.Day,i["ms-DatePicker-day--infocus "+ih.dayIsFocused]=e.isInBounds&&e.isInMonth,i["ms-DatePicker-day--outfocus "+ih.dayIsUnfocused]=e.isInBounds&&!e.isInMonth,i[ih.daySelection]=d===Au.Day,i[ih.weekSelection]=d===Au.Week||d===Au.WorkWeek,i[ih.monthSelection]=d===Au.Month,i)),ref:function(t){return o._setDayCellRef(t,e,a)},onMouseOver:d!==Au.Day&&e.isInBounds?o._onDayMouseOver(e.originalDate,t,n,d):void 0,onMouseLeave:d!==Au.Day&&e.isInBounds?o._onDayMouseLeave(e.originalDate,t,n,d):void 0,onMouseDown:d!==Au.Day&&e.isInBounds?o._onDayMouseDown(e.originalDate,t,n,d):void 0,onMouseUp:d!==Au.Day&&e.isInBounds?o._onDayMouseUp(e.originalDate,t,n,d):void 0,role:"gridcell"},b.createElement("button",{key:e.key+"button",onClick:e.isInBounds?e.onSelected:void 0,className:Sr(ih.day,"ms-DatePicker-day-button",(s={},s["ms-DatePicker-day--disabled "+ih.dayIsDisabled]=!e.isInBounds,s["ms-DatePicker-day--today "+ih.dayIsToday]=e.isToday,s)),onKeyDown:o._onDayKeyDown(e.originalDate,t,n),"aria-label":g.formatMonthDayYear(e.originalDate,l),id:a?r:void 0,"aria-readonly":!0,"aria-current":e.isToday?"date":void 0,"aria-selected":e.isInBounds?e.isSelected:void 0,"data-is-focusable":y||!!e.isInBounds||void 0,ref:function(t){return o._setDayRef(t,e,a)},disabled:!y&&!e.isInBounds,"aria-disabled":!e.isInBounds,type:"button"},b.createElement("span",{"aria-hidden":"true"},g.formatDay(e.originalDate))))})))}))))))},t.prototype.focus=function(){this.navigatedDay&&(this.navigatedDay.tabIndex=0,this.navigatedDay.focus())},t.prototype._setDayRef=function(e,t,o){o&&(this.navigatedDay=e)},t.prototype._setDayCellRef=function(e,t,o){this.days[t.key]=e},t.prototype._getWeekCornerStyles=function(e,t){var o=this,n={};switch(t){case Au.Month:e.forEach((function(t,o){t.forEach((function(t,r){var i=e[o-1]&&e[o-1][r]&&e[o-1][r].originalDate.getMonth()===e[o][r].originalDate.getMonth(),s=e[o+1]&&e[o+1][r]&&e[o+1][r].originalDate.getMonth()===e[o][r].originalDate.getMonth(),a=e[o][r-1]&&e[o][r-1].originalDate.getMonth()===e[o][r].originalDate.getMonth(),l=e[o][r+1]&&e[o][r+1].originalDate.getMonth()===e[o][r].originalDate.getMonth(),c=!i&&!l,u=!s&&!a,d=!s&&!l,p="";!i&&!a&&(p=In()?p.concat(ih.topRightCornerDate+" "):p.concat(ih.topLeftCornerDate+" ")),c&&(p=In()?p.concat(ih.topLeftCornerDate+" "):p.concat(ih.topRightCornerDate+" ")),u&&(p=In()?p.concat(ih.bottomRightCornerDate+" "):p.concat(ih.bottomLeftCornerDate+" ")),d&&(p=In()?p.concat(ih.bottomLeftCornerDate+" "):p.concat(ih.bottomRightCornerDate+" ")),i||(p=p.concat(ih.topDate+" ")),s||(p=p.concat(ih.bottomDate+" ")),l||(p=p.concat(ih.rightDate+" ")),a||(p=p.concat(ih.leftdate+" ")),n[o+"_"+r]=p}))}));break;case Au.Week:case Au.WorkWeek:e.forEach((function(e,t){var r=bi(e,(function(e){return e.isInBounds})),i=o._findLastIndex(e,(function(e){return e.isInBounds})),s=ih.topLeftCornerDate+" "+ih.bottomLeftCornerDate,a=ih.topRightCornerDate+" "+ih.bottomRightCornerDate;n[t+"_"+r]=In()?a:s,n[t+"_"+i]=In()?s:a}))}return n},t.prototype._getHighlightedCornerStyle=function(e,t,o){return e[o+"_"+t]?e[o+"_"+t]:""},t.prototype._navigateMonthEdge=function(e,t,o,n){var r=this.props,i=r.minDate,s=r.maxDate,a=void 0;0===o&&e.which===wn.up?a=ld(t,-1):o===this.state.weeks.length-1&&e.which===wn.down?a=ld(t,1):0===n&&e.which===Pn(wn.left)?a=ad(t,-1):6===n&&e.which===Pn(wn.right)&&(a=ad(t,1)),a&&(!i||vd(i,a)<1)&&(!s||vd(a,s)<1)&&(this.props.onNavigateDate(a,!0),e.preventDefault())},t.prototype._applyFunctionToDayRefs=function(e){var t=this;this.state.weeks&&this.state.weeks.forEach((function(o,n){o.forEach((function(o){var r=t.days[o.key];e(r,o,n)}))}))},t.prototype._getWeeks=function(e){for(var t=e.navigatedDate,o=e.selectedDate,n=e.dateRangeType,r=e.firstDayOfWeek,i=e.today,s=e.minDate,a=e.maxDate,l=e.showSixWeeksByDefault,c=e.workWeekDays,u=new Date(t.getFullYear(),t.getMonth(),1),d=i||new Date,p=[];u.getDay()!==r;)u.setDate(u.getDate()-1);var h=!1,m=bd(o,n===Au.WorkWeek?Au.Week:n,r,c);n!==Au.Day&&(m=this._getBoundedDateRange(m,s,a));for(var g=!0,f=0;g;f++){var v=[];h=!0;for(var b=0;b<7;b++){var _=new Date(u),y={key:u.toString(),date:u.getDate().toString(),originalDate:_,isInMonth:u.getMonth()===t.getMonth(),isToday:fd(d,u),isSelected:_d(u,m),onSelected:this._onSelectDate.bind(this,_),isInBounds:(!s||vd(s,u)<1)&&(!a||vd(u,a)<1)&&!this._getIsRestrictedDate(u)};v.push(y),y.isInMonth&&(h=!1),u.setDate(u.getDate()+1)}(g=l?!h||f<=5:!h)&&p.push(v)}return p},t.prototype._getIsRestrictedDate=function(e){var t=this.props.restrictedDates;return!!t&&!!_i(t,(function(t){return fd(t,e)}))},t.prototype._getBoundedDateRange=function(e,t,o){var n=f(e);return t&&(n=n.filter((function(e){return vd(e,t)>=0}))),o&&(n=n.filter((function(e){return vd(e,o)<=0}))),n},t.prototype._findLastIndex=function(e,t){for(var o=e.length-1;o>=0;o--){if(t(e[o]))return o}return-1},t}(b.Component),ah=n,lh={prevRangeAriaLabel:void 0,nextRangeAriaLabel:void 0},ch={leftNavigation:"Up",rightNavigation:"Down",closeIcon:"CalculatorMultiply"},uh=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._buttonRef=b.createRef(),t._onRenderYear=function(){var e=t.props,o=e.year,n=e.onRenderYear;return n?n(o):o},t._onClick=function(){t.props.onSelectYear&&t.props.onSelectYear(t.props.year)},t._onKeyDown=function(e){t.props.onSelectYear&&e.which===wn.enter&&t.props.onSelectYear(t.props.year)},t}return p(t,e),t.prototype.focus=function(){this._buttonRef.current&&this._buttonRef.current.focus()},t.prototype.render=function(){var e,t=this.props,o=t.year,n=t.selected,r=t.disabled,i=t.onSelectYear;return b.createElement("button",{className:Sr("ms-DatePicker-yearOption",ah.yearOption,(e={},e["ms-DatePicker-day--highlighted "+ah.yearIsHighlighted]=n,e["ms-DatePicker-yearOption--disabled "+ah.yearOptionIsDisabled]=r,e)),type:"button",role:"gridcell",onClick:!r&&i?this._onClick:void 0,onKeyDown:!r&&i?this._onKeyDown:void 0,disabled:r,"aria-label":String(o),"aria-selected":n,ref:this._buttonRef},this._onRenderYear())},t}(b.Component),dh=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedCellRef=b.createRef(),t._currentCellRef=b.createRef(),t._renderCell=function(e){var o=e===t.props.selectedYear,n=t.props,r=n.minYear,i=n.maxYear,s=n.onSelectYear,a=void 0!==r&&e<r||void 0!==i&&e>i,l=e===(new Date).getFullYear();return b.createElement(uh,{key:e,year:e,selected:o,current:l,disabled:a,onSelectYear:s,ref:o?t._selectedCellRef:l?t._currentCellRef:void 0})},t}return p(t,e),t.prototype.focus=function(){this._selectedCellRef.current?this._selectedCellRef.current.focus():this._currentCellRef.current&&this._currentCellRef.current.focus()},t.prototype.render=function(){for(var e=this.props,t=e.fromYear,o=e.toYear,n=t,r=[];n<=o;)r.push(this._renderCell(n)),n++;return b.createElement(ks,null,b.createElement("div",{className:Sr("ms-DatePicker-optionGrid",ah.optionGrid),role:"grid"},b.createElement("div",{role:"row"},r)))},t}(b.Component),ph=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onSelectPrev=function(){!t.isDisabled&&t.props.onSelectPrev&&t.props.onSelectPrev()},t._onKeyDown=function(e){e.which===wn.enter&&t._onSelectPrev()},t}return p(t,e),t.prototype.render=function(){var e,t=this.props.navigationIcons||ch,o=(this.props.strings||lh).prevRangeAriaLabel,n={fromYear:this.props.fromYear-12,toYear:this.props.toYear-12},r=o?"string"==typeof o?o:o(n):void 0,i=this.isDisabled,s=this.props.onSelectPrev;return b.createElement("button",{className:Sr("ms-DatePicker-prevDecade",ah.prevDecade,(e={},e["ms-DatePicker-prevDecade--disabled "+ah.prevDecadeIsDisabled]=i,e)),onClick:!i&&s?this._onSelectPrev:void 0,onKeyDown:!i&&s?this._onKeyDown:void 0,type:"button",tabIndex:0,title:r,disabled:i},b.createElement(Fr,{iconName:In()?t.rightNavigation:t.leftNavigation}))},Object.defineProperty(t.prototype,"isDisabled",{get:function(){var e=this.props.minYear;return void 0!==e&&this.props.fromYear<e},enumerable:!0,configurable:!0}),t}(b.Component),hh=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onSelectNext=function(){!t.isDisabled&&t.props.onSelectNext&&t.props.onSelectNext()},t._onKeyDown=function(e){e.which===wn.enter&&t._onSelectNext()},t}return p(t,e),t.prototype.render=function(){var e,t=this.props.navigationIcons||ch,o=(this.props.strings||lh).nextRangeAriaLabel,n={fromYear:this.props.fromYear+12,toYear:this.props.toYear+12},r=o?"string"==typeof o?o:o(n):void 0,i=this.props.onSelectNext,s=this.isDisabled;return b.createElement("button",{className:Sr("ms-DatePicker-nextDecade",ah.nextDecade,(e={},e["ms-DatePicker-nextDecade--disabled "+ah.nextDecadeIsDisabled]=s,e)),onClick:!s&&i?this._onSelectNext:void 0,onKeyDown:!s&&i?this._onKeyDown:void 0,type:"button",tabIndex:0,title:r,disabled:this.isDisabled},b.createElement(Fr,{iconName:In()?t.leftNavigation:t.rightNavigation}))},Object.defineProperty(t.prototype,"isDisabled",{get:function(){var e=this.props.maxYear;return void 0!==e&&this.props.fromYear+12>e},enumerable:!0,configurable:!0}),t}(b.Component),mh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){return b.createElement("div",{className:Sr("ms-DatePicker-decadeComponents",ah.decadeComponents)},b.createElement("div",{className:Sr("ms-DatePicker-navContainer",ah.navContainer)},b.createElement(ph,h({},this.props)),b.createElement(hh,h({},this.props))))},t}(b.Component),gh=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onHeaderSelect=function(){t.props.onHeaderSelect&&t.props.onHeaderSelect(!0)},t._onHeaderKeyDown=function(e){!t.props.onHeaderSelect||e.which!==wn.enter&&e.which!==wn.space||t.props.onHeaderSelect(!0)},t._onRenderYear=function(e){return t.props.onRenderYear?t.props.onRenderYear(e):e},t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.fromYear,o=e.toYear;if(e.onHeaderSelect){var n=this.props.strings||lh,r=n.rangeAriaLabel,i=r?"string"==typeof r?r:r(this.props):void 0,s=n.headerAriaLabelFormatString?id(n.headerAriaLabelFormatString,i):i;return b.createElement("div",{className:Sr("ms-DatePicker-currentDecade js-showYearPicker",ah.currentDecade,ah.headerToggleView),onClick:this._onHeaderSelect,onKeyDown:this._onHeaderKeyDown,"aria-label":s,role:"button","aria-atomic":!0,"aria-live":"polite",tabIndex:0},this._onRenderYear(t)," - ",this._onRenderYear(o))}return b.createElement("div",{className:Sr("ms-DatePicker-currentDecade js-showYearPicker",ah.currentDecade)},this._onRenderYear(t)," - ",this._onRenderYear(o))},t}(b.Component),fh=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onRenderTitle=function(){return t.props.onRenderTitle?t.props.onRenderTitle(t.props):b.createElement(gh,h({},t.props))},t._onRenderNav=function(){return b.createElement(mh,h({},t.props))},t}return p(t,e),t.prototype.render=function(){return b.createElement("div",{className:Sr("ms-DatePicker-header",ah.header)},this._onRenderTitle(),this._onRenderNav())},t}(b.Component),vh=function(e){function t(t){var o=e.call(this,t)||this;return o._gridRef=b.createRef(),o._onNavNext=function(){o.setState({fromYear:o.state.fromYear+12})},o._onNavPrev=function(){o.setState({fromYear:o.state.fromYear-12})},o._renderHeader=function(){return b.createElement(fh,h({},o.props,{fromYear:o.state.fromYear,toYear:o.state.fromYear+12-1,onSelectPrev:o._onNavPrev,onSelectNext:o._onNavNext}))},o._renderGrid=function(){return b.createElement(dh,h({},o.props,{fromYear:o.state.fromYear,toYear:o.state.fromYear+12-1,ref:o._gridRef}))},o.state=o._calculateInitialStateFromProps(t),o}return p(t,e),t.prototype.focus=function(){this._gridRef.current&&this._gridRef.current.focus()},t.prototype.render=function(){return b.createElement("div",{className:Sr("ms-DatePicker-yearPicker",ah.yearPicker)},this._renderHeader(),this._renderGrid())},t.prototype._calculateInitialStateFromProps=function(e){var t=e.selectedYear,o=e.navigatedYear,n=t||o||(new Date).getFullYear();return{fromYear:10*Math.floor(n/10),navigatedYear:o,selectedYear:t}},t}(b.Component),bh=n,_h=function(e){function t(t){var o=e.call(this,t)||this;return o._navigatedMonthRef=b.createRef(),o._onCalendarYearRef=function(e){o._calendarYearRef=e},o._onKeyDown=function(e,t){t.which===wn.enter&&e()},o._onSelectYear=function(e){o._focusOnUpdate=!0;var t=o.props,n=t.navigatedDate,r=t.onNavigateDate,i=t.maxDate,s=t.minDate;if(n.getFullYear()!==e){var a=new Date(n.getTime());a.setFullYear(e),i&&a>i?a=gd(a,i.getMonth()):s&&a<s&&(a=gd(a,s.getMonth())),r(a,!0)}o.setState({isYearPickerVisible:!1})},o._yearToString=function(e){var t=o.props,n=t.navigatedDate,r=t.dateTimeFormatter;if(r){var i=new Date(n.getTime());return i.setFullYear(e),r.formatYear(i)}return String(e)},o._yearRangeToString=function(e){return o._yearToString(e.fromYear)+" - "+o._yearToString(e.toYear)},o._yearRangeToNextDecadeLabel=function(e){var t=o.props.strings;return t.nextYearRangeAriaLabel?t.nextYearRangeAriaLabel+" "+o._yearRangeToString(e):""},o._yearRangeToPrevDecadeLabel=function(e){var t=o.props.strings;return t.prevYearRangeAriaLabel?t.prevYearRangeAriaLabel+" "+o._yearRangeToString(e):""},o._onRenderYear=function(e){return o._yearToString(e)},o._onSelectNextYear=function(){var e=o.props,t=e.navigatedDate;(0,e.onNavigateDate)(ud(t,1),!1)},o._onSelectNextYearKeyDown=function(e){e.which===wn.enter&&o._onKeyDown(o._onSelectNextYear,e)},o._onSelectPrevYear=function(){var e=o.props,t=e.navigatedDate;(0,e.onNavigateDate)(ud(t,-1),!1)},o._onSelectPrevYearKeyDown=function(e){e.which===wn.enter&&o._onKeyDown(o._onSelectPrevYear,e)},o._onSelectMonthKeyDown=function(e){return function(t){return o._onKeyDown((function(){return o._onSelectMonth(e)}),t)}},o._onSelectMonth=function(e){var t=o.props,n=t.navigatedDate,r=t.onNavigateDate,i=t.onHeaderSelect;i&&i(!0),r(gd(n,e),!0)},o._onHeaderSelect=function(){var e=o.props,t=e.onHeaderSelect;e.yearPickerHidden?t&&t(!0):(o._focusOnUpdate=!0,o.setState({isYearPickerVisible:!0}))},o._onYearPickerHeaderSelect=function(e){o._focusOnUpdate=e,o.setState({isYearPickerVisible:!1})},o._onHeaderKeyDown=function(e){!o._onHeaderSelect||e.which!==wn.enter&&e.which!==wn.space||o._onHeaderSelect()},si(o),o._selectMonthCallbacks=[],t.strings.shortMonths.forEach((function(e,t){o._selectMonthCallbacks[t]=o._onSelectMonth.bind(o,t)})),o._isCurrentMonth=o._isCurrentMonth.bind(o),o._onSelectNextYear=o._onSelectNextYear.bind(o),o._onSelectPrevYear=o._onSelectPrevYear.bind(o),o._onSelectMonth=o._onSelectMonth.bind(o),o.state={isYearPickerVisible:!1},o}return p(t,e),t.prototype.componentDidUpdate=function(){this._focusOnUpdate&&(this.focus(),this._focusOnUpdate=!1)},t.prototype.render=function(){var e,t,o=this,n=this.props,r=n.navigatedDate,i=n.selectedDate,s=n.strings,a=n.today,l=n.highlightCurrentMonth,c=n.highlightSelectedMonth,u=n.navigationIcons,d=n.dateTimeFormatter,p=n.minDate,h=n.maxDate,m=n.yearPickerHidden;if(this.state.isYearPickerVisible){var g=r?r.getFullYear():void 0;return b.createElement(vh,{key:"calendarYear_"+(g&&g.toString()),minYear:p?p.getFullYear():void 0,maxYear:h?h.getFullYear():void 0,onSelectYear:this._onSelectYear,navigationIcons:u,onHeaderSelect:this._onYearPickerHeaderSelect,selectedYear:g,onRenderYear:this._onRenderYear,strings:{rangeAriaLabel:this._yearRangeToString,prevRangeAriaLabel:this._yearRangeToPrevDecadeLabel,nextRangeAriaLabel:this._yearRangeToNextDecadeLabel,headerAriaLabelFormatString:s.yearPickerHeaderAriaLabel},ref:this._onCalendarYearRef})}for(var f=[],v=0;v<s.shortMonths.length/4;v++)f.push(v);var _=u.leftNavigation,y=u.rightNavigation,C=!p||vd(p,hd(r))<0,S=!h||vd(md(r),h)<0,x=d.formatYear(r),k=s.monthPickerHeaderAriaLabel?id(s.monthPickerHeaderAriaLabel,x):x;return b.createElement("div",{className:Sr("ms-DatePicker-monthPicker",bh.monthPicker)},b.createElement("div",{className:Sr("ms-DatePicker-header",bh.header)},this.props.onHeaderSelect||!m?b.createElement("div",{className:Sr("ms-DatePicker-currentYear js-showYearPicker",bh.currentYear,bh.headerToggleView),onClick:this._onHeaderSelect,onKeyDown:this._onHeaderKeyDown,"aria-label":k,role:"button","aria-atomic":!0,"aria-live":"polite",tabIndex:0},d.formatYear(r)):b.createElement("div",{className:Sr("ms-DatePicker-currentYear js-showYearPicker",bh.currentYear)},d.formatYear(r)),b.createElement("div",{className:Sr("ms-DatePicker-yearComponents",bh.yearComponents)},b.createElement("div",{className:Sr("ms-DatePicker-navContainer",bh.navContainer)},b.createElement("button",{className:Sr("ms-DatePicker-prevYear js-prevYear",bh.prevYear,(e={},e["ms-DatePicker-prevYear--disabled "+bh.prevYearIsDisabled]=!C,e)),disabled:!C,onClick:C?this._onSelectPrevYear:void 0,onKeyDown:C?this._onSelectPrevYearKeyDown:void 0,title:s.prevYearAriaLabel?s.prevYearAriaLabel+" "+d.formatYear(ud(r,-1)):void 0,role:"button",type:"button"},b.createElement(Fr,{iconName:In()?y:_})),b.createElement("button",{className:Sr("ms-DatePicker-nextYear js-nextYear",bh.nextYear,(t={},t["ms-DatePicker-nextYear--disabled "+bh.nextYearIsDisabled]=!S,t)),disabled:!S,onClick:S?this._onSelectNextYear:void 0,onKeyDown:S?this._onSelectNextYearKeyDown:void 0,title:s.nextYearAriaLabel?s.nextYearAriaLabel+" "+d.formatYear(ud(r,1)):void 0,role:"button",type:"button"},b.createElement(Fr,{iconName:In()?_:y}))))),b.createElement(ks,null,b.createElement("div",{className:Sr("ms-DatePicker-optionGrid",bh.optionGrid),role:"grid","aria-readonly":"true"},f.map((function(e){var t=s.shortMonths.slice(4*e,4*(e+1));return b.createElement("div",{key:"monthRow_"+e,role:"row"},t.map((function(t,n){var u,m=4*e+n,g=gd(r,m),f=o._isCurrentMonth(m,r.getFullYear(),a),v=r.getMonth()===m,_=i.getMonth()===m,y=i.getFullYear()===r.getFullYear(),C=(!p||vd(p,pd(g))<1)&&(!h||vd(dd(g),h)<1);return b.createElement("button",{role:"gridcell",className:Sr("ms-DatePicker-monthOption",bh.monthOption,(u={},u["ms-DatePicker-day--today "+bh.monthIsCurrentMonth]=l&&f,u["ms-DatePicker-day--highlighted "+bh.monthIsHighlighted]=(l||c)&&_&&y,u["ms-DatePicker-monthOption--disabled "+bh.monthOptionIsDisabled]=!C,u)),disabled:!C,key:m,onClick:C?o._selectMonthCallbacks[m]:void 0,onKeyDown:C?o._onSelectMonthKeyDown(m):void 0,"aria-label":d.formatMonthYear(g,s),"aria-selected":v,"data-is-focusable":!!C||void 0,ref:v?o._navigatedMonthRef:void 0,type:"button"},t)})))})))))},t.prototype.focus=function(){this._calendarYearRef?this._calendarYearRef.focus():this._navigatedMonthRef.current&&(this._navigatedMonthRef.current.tabIndex=0,this._navigatedMonthRef.current.focus())},t.prototype._isCurrentMonth=function(e,t,o){return o.getFullYear()===t&&o.getMonth()===e},t}(b.Component),yh=n,Ch={leftNavigation:"Up",rightNavigation:"Down",closeIcon:"CalculatorMultiply"},Sh=[Bu.Monday,Bu.Tuesday,Bu.Wednesday,Bu.Thursday,Bu.Friday],xh={formatMonthDayYear:function(e,t){return t.months[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()},formatMonthYear:function(e,t){return t.months[e.getMonth()]+" "+e.getFullYear()},formatDay:function(e){return e.getDate().toString()},formatYear:function(e){return e.getFullYear().toString()}},kh=function(e){function t(t){var o=e.call(this,t)||this;o._dayPicker=b.createRef(),o._monthPicker=b.createRef(),o._hasFocus=!1,o._onBlur=function(e){Ni(e.currentTarget,e.relatedTarget)||(o._hasFocus=!1,o.props.onBlur&&o.props.onBlur(e))},o._onFocus=function(e){o._hasFocus||(o._hasFocus=!0,o.props.onFocus&&o.props.onFocus(e))},o._navigateDayPickerDay=function(e){o.setState({navigatedDayDate:e,navigatedMonthDate:e})},o._navigateMonthPickerDay=function(e){o.setState({navigatedMonthDate:e})},o._onNavigateDayDate=function(e,t){o._navigateDayPickerDay(e),o._focusOnUpdate=t},o._onNavigateMonthDate=function(e,t){if(!t)return o._navigateMonthPickerDay(e),void(o._focusOnUpdate=t);!o.props.showMonthPickerAsOverlay&&!o.props.isDayPickerVisible&&o._onSelectDate(e),o._navigateDayPickerDay(e)},o._onSelectDate=function(e,t){var n=o.props.onSelectDate;o.setState({selectedDate:e}),n&&n(e,t)},o._onHeaderSelect=function(e){o.setState({isDayPickerVisible:!o.state.isDayPickerVisible,isMonthPickerVisible:!o.state.isMonthPickerVisible}),e&&(o._focusOnUpdate=!0)},o._onGotoToday=function(){var e=o.props,t=e.dateRangeType,n=e.firstDayOfWeek,r=e.today,i=e.workWeekDays;if(e.selectDateOnClick){var s=bd(r,t,n,i);o._onSelectDate(r,s)}o._navigateDayPickerDay(r),o._focusOnUpdate=!0},o._onGotoTodayClick=function(e){o._onGotoToday()},o._onGotoTodayKeyDown=function(e){e.which===wn.enter&&(e.preventDefault(),o._onGotoToday())},o._onDatePickerPopupKeyDown=function(e){switch(e.which){case wn.enter:case wn.backspace:e.preventDefault();break;case wn.escape:o._handleEscKey(e)}},o._handleEscKey=function(e){o.props.onDismiss&&o.props.onDismiss()},si(o);var n=t.value&&!isNaN(t.value.getTime())?t.value:t.today||new Date;return o.state={selectedDate:n,navigatedDayDate:n,navigatedMonthDate:n,isMonthPickerVisible:!o.props.showMonthPickerAsOverlay&&o.props.isMonthPickerVisible,isDayPickerVisible:!!o.props.showMonthPickerAsOverlay||o.props.isDayPickerVisible},o._focusOnUpdate=!1,o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=e.autoNavigateOnSelection,o=e.value,n=e.today,r=void 0===n?new Date:n;t&&!fd(o,this.props.value)&&this.setState({navigatedMonthDate:o,navigatedDayDate:o}),this.setState({selectedDate:o||r})},t.prototype.componentDidUpdate=function(){this._focusOnUpdate&&(this.focus(),this._focusOnUpdate=!1)},t.prototype.render=function(){var e,t=this.props,o=t.firstDayOfWeek,n=t.dateRangeType,r=t.strings,i=t.showMonthPickerAsOverlay,s=t.autoNavigateOnSelection,a=t.showGoToToday,l=t.highlightCurrentMonth,c=t.highlightSelectedMonth,u=t.navigationIcons,d=t.minDate,p=t.maxDate,m=t.restrictedDates,g=t.className,f=t.showCloseButton,v=t.allFocusable,_=t.yearPickerHidden,y=t.today,C=fr(this.props,gr,["value"]),S=this.state,x=S.selectedDate,k=S.navigatedDayDate,w=S.navigatedMonthDate,I=S.isMonthPickerVisible,D=S.isDayPickerVisible,P=i?this._onHeaderSelect:void 0,T=!i&&!D,E=i&&a,M=a;return M&&k&&w&&y&&(M=k.getFullYear()!==y.getFullYear()||k.getMonth()!==y.getMonth()||w.getFullYear()!==y.getFullYear()||w.getMonth()!==y.getMonth()),b.createElement("div",{className:Sr("ms-DatePicker",yh.root,g),role:"application"},b.createElement("div",h({},C,{onBlur:this._onBlur,onFocus:this._onFocus,className:Sr("ms-DatePicker-picker ms-DatePicker-picker--opened ms-DatePicker-picker--focused",yh.picker,yh.pickerIsOpened,yh.pickerIsFocused,I&&"ms-DatePicker-monthPickerVisible "+yh.monthPickerVisible,I&&D&&"ms-DatePicker-calendarsInline "+yh.calendarsInline,T&&"ms-DatePicker-monthPickerOnly "+yh.monthPickerOnly,i&&"ms-DatePicker-monthPickerAsOverlay "+yh.monthPickerAsOverlay)}),b.createElement("div",{className:Sr("ms-DatePicker-holder ms-slideDownIn10",yh.holder,E&&yh.holderWithButton),onKeyDown:this._onDatePickerPopupKeyDown},b.createElement("div",{className:Sr("ms-DatePicker-frame",yh.frame)},b.createElement("div",{className:Sr("ms-DatePicker-wrap",yh.wrap,a&&yh.goTodaySpacing)},D&&b.createElement(sh,{selectedDate:x,navigatedDate:k,today:this.props.today,onSelectDate:this._onSelectDate,onNavigateDate:this._onNavigateDayDate,onDismiss:this.props.onDismiss,firstDayOfWeek:o,dateRangeType:n,autoNavigateOnSelection:s,strings:r,onHeaderSelect:P,navigationIcons:u,showWeekNumbers:this.props.showWeekNumbers,firstWeekOfYear:this.props.firstWeekOfYear,dateTimeFormatter:this.props.dateTimeFormatter,showSixWeeksByDefault:this.props.showSixWeeksByDefault,minDate:d,maxDate:p,restrictedDates:m,workWeekDays:this.props.workWeekDays,componentRef:this._dayPicker,showCloseButton:f,allFocusable:v}),D&&I&&b.createElement("div",{className:yh.divider}),I&&b.createElement(_h,{navigatedDate:w,selectedDate:k,strings:r,onNavigateDate:this._onNavigateMonthDate,today:this.props.today,highlightCurrentMonth:l,highlightSelectedMonth:c,onHeaderSelect:P,navigationIcons:u,dateTimeFormatter:this.props.dateTimeFormatter,minDate:d,maxDate:p,componentRef:this._monthPicker,yearPickerHidden:_||i}),a&&b.createElement("button",{role:"button",className:Sr("ms-DatePicker-goToday js-goToday",yh.goToday,(e={},e[yh.goTodayInlineMonth]=I,e[yh.goToTodayIsDisabled]=!M,e)),onClick:this._onGotoTodayClick,onKeyDown:this._onGotoTodayKeyDown,tabIndex:0,disabled:!M,type:"button"},r.goToToday))))),b.createElement(ha,null))},t.prototype.focus=function(){this.state.isDayPickerVisible&&this._dayPicker.current?this._dayPicker.current.focus():this.state.isMonthPickerVisible&&this._monthPicker.current&&this._monthPicker.current.focus()},t.defaultProps={onSelectDate:void 0,onDismiss:void 0,isMonthPickerVisible:!0,isDayPickerVisible:!0,showMonthPickerAsOverlay:!1,value:void 0,today:new Date,firstDayOfWeek:Bu.Sunday,dateRangeType:Au.Day,autoNavigateOnSelection:!1,showGoToToday:!0,strings:null,highlightCurrentMonth:!1,highlightSelectedMonth:!1,navigationIcons:Ch,showWeekNumbers:!1,firstWeekOfYear:Fu.FirstDay,dateTimeFormatter:xh,showSixWeeksByDefault:!1,workWeekDays:Sh,showCloseButton:!1,allFocusable:!1},t}(b.Component);function wh(e){for(var t,o=[],n=tt(e)||document;e!==n.body;){for(var r=0,i=e.parentElement.children;r<i.length;r++){var s=i[r];s!==e&&"true"!==(null===(t=s.getAttribute("aria-hidden"))||void 0===t?void 0:t.toLowerCase())&&o.push(s)}if(!e.parentElement)break;e=e.parentElement}return o.forEach((function(e){e.setAttribute("aria-hidden","true")})),function(){!function(e){e.forEach((function(e){e.setAttribute("aria-hidden","false")}))}(o),o=[]}}var Ih=function(e){function t(o){var n=e.call(this,o)||this;return n._root=b.createRef(),n._firstBumper=b.createRef(),n._lastBumper=b.createRef(),n._hasFocus=!1,n._onRootFocus=function(e){n.props.onFocus&&n.props.onFocus(e),n._hasFocus=!0},n._onRootBlur=function(e){n.props.onBlur&&n.props.onBlur(e);var t=e.relatedTarget;null===e.relatedTarget&&(t=n._getDocument().activeElement),Ni(n._root.current,t)||(n._hasFocus=!1)},n._onFirstBumperFocus=function(){n._onBumperFocus(!0)},n._onLastBumperFocus=function(){n._onBumperFocus(!1)},n._onBumperFocus=function(e){if(!n.props.disabled){var t=e===n._hasFocus?n._lastBumper.current:n._firstBumper.current;if(n._root.current){var o=e===n._hasFocus?Hi(n._root.current,t,!0,!1):Li(n._root.current,t,!0,!1);o&&(n._isBumper(o)?n.focus():o.focus())}}},n._onFocusCapture=function(e){n.props.onFocusCapture&&n.props.onFocusCapture(e),e.target===e.currentTarget||n._isBumper(e.target)||(n._previouslyFocusedElementInTrapZone=e.target)},n._forceFocusInTrap=function(e){if(!n.props.disabled&&t._focusStack.length&&n===t._focusStack[t._focusStack.length-1]){var o=n._getDocument().activeElement;Ni(n._root.current,o)||(n.focus(),n._hasFocus=!0,e.preventDefault(),e.stopPropagation())}},n._forceClickInTrap=function(e){if(!n.props.disabled&&t._focusStack.length&&n===t._focusStack[t._focusStack.length-1]){var o=e.target;o&&!Ni(n._root.current,o)&&(n.focus(),n._hasFocus=!0,e.preventDefault(),e.stopPropagation())}},si(n),n}return p(t,e),t.prototype.componentDidMount=function(){this._bringFocusIntoZone(),this._updateEventHandlers(this.props),!this.props.disabled&&this._root.current&&this.props.enableAriaHiddenSiblings&&(this._unmodalize=wh(this._root.current))},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=e.elementToFocusOnDismiss;t&&this._previouslyFocusedElementOutsideTrapZone!==t&&(this._previouslyFocusedElementOutsideTrapZone=t),this._updateEventHandlers(e)},t.prototype.componentDidUpdate=function(e){var t=void 0===e.forceFocusInsideTrap||e.forceFocusInsideTrap,o=void 0===this.props.forceFocusInsideTrap||this.props.forceFocusInsideTrap,n=void 0!==e.disabled&&e.disabled,r=void 0!==this.props.disabled&&this.props.disabled;!t&&o||n&&!r?(this._bringFocusIntoZone(),!this._unmodalize&&this._root.current&&this.props.enableAriaHiddenSiblings&&(this._unmodalize=wh(this._root.current))):(t&&!o||!n&&r)&&(this._returnFocusToInitiator(),this._unmodalize&&this._unmodalize())},t.prototype.componentWillUnmount=function(){this.props.disabled&&!this.props.forceFocusInsideTrap&&Ni(this._root.current,this._getDocument().activeElement)||this._returnFocusToInitiator(),this._disposeClickHandler&&(this._disposeClickHandler(),this._disposeClickHandler=void 0),this._disposeFocusHandler&&(this._disposeFocusHandler(),this._disposeFocusHandler=void 0),this._unmodalize&&this._unmodalize(),delete this._previouslyFocusedElementInTrapZone,delete this._previouslyFocusedElementOutsideTrapZone},t.prototype.render=function(){var e=this.props,t=e.className,o=e.disabled,n=void 0!==o&&o,r=e.ariaLabelledBy,i=fr(this.props,gr),s={"aria-hidden":!0,style:{pointerEvents:"none",position:"fixed"},tabIndex:n?-1:0,"data-is-visible":!0};return b.createElement("div",h({},i,{className:t,ref:this._root,"aria-labelledby":r,onFocusCapture:this._onFocusCapture,onFocus:this._onRootFocus,onBlur:this._onRootBlur}),b.createElement("div",h({},s,{ref:this._firstBumper,onFocus:this._onFirstBumperFocus})),this.props.children,b.createElement("div",h({},s,{ref:this._lastBumper,onFocus:this._onLastBumperFocus})))},t.prototype.focus=function(){var e=this.props,t=e.focusPreviouslyFocusedInnerElement,o=e.firstFocusableSelector,n=e.firstFocusableTarget;if(t&&this._previouslyFocusedElementInTrapZone&&Ni(this._root.current,this._previouslyFocusedElementInTrapZone))this._focusAsync(this._previouslyFocusedElementInTrapZone);else{var r="string"==typeof o?o:o&&o(),i=null;this._root.current&&("string"==typeof n?i=this._root.current.querySelector(n):n?i=n(this._root.current):r&&(i=this._root.current.querySelector("."+r)),i||(i=Wi(this._root.current,this._root.current.firstChild,!1,!1,!1,!0))),i&&this._focusAsync(i)}},t.prototype._focusAsync=function(e){this._isBumper(e)||Zi(e)},t.prototype._bringFocusIntoZone=function(){var e=this.props,o=e.elementToFocusOnDismiss,n=e.disabled,r=void 0!==n&&n,i=e.disableFirstFocus,s=void 0!==i&&i;r||(t._focusStack.push(this),this._previouslyFocusedElementOutsideTrapZone=o||this._getDocument().activeElement,s||Ni(this._root.current,this._previouslyFocusedElementOutsideTrapZone)||this.focus())},t.prototype._returnFocusToInitiator=function(){var e=this,o=this.props.ignoreExternalFocusing;t._focusStack=t._focusStack.filter((function(t){return e!==t}));var n=this._getDocument(),r=n.activeElement;o||!this._previouslyFocusedElementOutsideTrapZone||"function"!=typeof this._previouslyFocusedElementOutsideTrapZone.focus||!Ni(this._root.current,r)&&r!==n.body||this._focusAsync(this._previouslyFocusedElementOutsideTrapZone)},t.prototype._updateEventHandlers=function(e){var t=e.isClickableOutsideFocusTrap,o=void 0!==t&&t,n=e.forceFocusInsideTrap,r=void 0===n||n;r&&!this._disposeFocusHandler?this._disposeFocusHandler=Ga(window,"focus",this._forceFocusInTrap,!0):!r&&this._disposeFocusHandler&&(this._disposeFocusHandler(),this._disposeFocusHandler=void 0),o||this._disposeClickHandler?o&&this._disposeClickHandler&&(this._disposeClickHandler(),this._disposeClickHandler=void 0):this._disposeClickHandler=Ga(window,"click",this._forceClickInTrap,!0)},t.prototype._isBumper=function(e){return e===this._firstBumper.current||e===this._lastBumper.current},t.prototype._getDocument=function(){return tt(this._root.current)},t._focusStack=[],t}(b.Component),Dh=function(e){return b.createElement(uc,h({},e),b.createElement(Ih,h({disabled:e.hidden},e.focusTrapProps),e.children))},Ph=Mn(),Th=function(e){var t=e.checked,o=void 0!==t&&t,n=e.className,r=e.theme,i=e.styles,s=e.useFastIcons,a=void 0===s||s,l=Ph(i,{theme:r,className:n,checked:o}),c=a?Mr:Fr;return b.createElement("div",{className:l.root},b.createElement(c,{iconName:"CircleRing",className:l.circle}),b.createElement(c,{iconName:"StatusCircleCheckmark",className:l.check}))};Th.displayName="CheckBase";var Eh={root:"ms-Check",circle:"ms-Check-circle",check:"ms-Check-check",checkHost:"ms-Check-checkHost"},Mh=xn(Th,(function(e){var t,o,n,r,i,s=e.height,a=void 0===s?e.checkBoxHeight||"18px":s,l=e.checked,c=e.className,u=e.theme,d=u.palette,p=u.semanticColors,m=u.fonts,g=In(u),f=Oo(Eh,u),v={fontSize:a,position:"absolute",left:0,top:0,width:a,height:a,textAlign:"center",verticalAlign:"middle"};return{root:[f.root,m.medium,{lineHeight:"1",width:a,height:a,verticalAlign:"top",position:"relative",userSelect:"none",selectors:(t={":before":{content:'""',position:"absolute",top:"1px",right:"1px",bottom:"1px",left:"1px",borderRadius:"50%",opacity:1,background:p.bodyBackground}},t["."+f.checkHost+":hover &, ."+f.checkHost+":focus &, &:hover, &:focus"]={opacity:1},t)},l&&["is-checked",{selectors:{":before":{background:d.themePrimary,opacity:1,selectors:(o={},o[jt]={background:"Window"},o)}}}],c],circle:[f.circle,v,{color:d.neutralSecondary,selectors:(n={},n[jt]={color:"WindowText"},n)},l&&{color:d.white}],check:[f.check,v,{opacity:0,color:d.neutralSecondary,fontSize:je.medium,left:g?"-0.5px":".5px",selectors:(r={":hover":{opacity:1}},r[jt]=h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)},l&&{opacity:1,color:d.white,fontWeight:900,selectors:(i={},i[jt]={border:"none",color:"WindowText"},i)}],checkHost:f.checkHost}}),void 0,{scope:"Check"},!0),Rh=Mn(),Bh=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n._checkBox=b.createRef(),n._renderContent=function(e,t,o){void 0===o&&(o={});var r=n.props,i=r.disabled,s=r.inputProps,a=r.name,l=r.ariaLabel,c=r.ariaLabelledBy,u=r.ariaDescribedBy,d=r.onRenderLabel,p=void 0===d?n._onRenderLabel:d,m=r.checkmarkIconProps,g=r.ariaPositionInSet,f=r.ariaSetSize,v=r.title,_=r.label;return b.createElement("div",{className:n._classNames.root,title:v},b.createElement(ha,null),b.createElement("input",h({type:"checkbox"},s,{"data-ktp-execute-target":o["data-ktp-execute-target"],checked:e,disabled:i,className:n._classNames.input,ref:n._checkBox,name:a,id:n._id,title:v,onChange:n._onChange,onFocus:n._onFocus,onBlur:n._onBlur,"aria-disabled":i,"aria-label":l||_,"aria-labelledby":c,"aria-describedby":Ns(u,o["aria-describedby"]),"aria-posinset":g,"aria-setsize":f,"aria-checked":t?"mixed":e?"true":"false"})),b.createElement("label",{className:n._classNames.label,htmlFor:n._id},b.createElement("div",{className:n._classNames.checkbox,"data-ktp-target":o["data-ktp-target"]},b.createElement(Fr,h({iconName:"CheckMark"},m,{className:n._classNames.checkmark}))),p(n.props,n._onRenderLabel)))},n._onFocus=function(e){var t=n.props.inputProps;t&&t.onFocus&&t.onFocus(e)},n._onBlur=function(e){var t=n.props.inputProps;t&&t.onBlur&&t.onBlur(e)},n._onChange=function(e){var t=n.props.onChange,o=n.state,r=o.isChecked;o.isIndeterminate?(t&&t(e,r),void 0===n.props.indeterminate&&n.setState({isIndeterminate:!1})):(t&&t(e,!r),void 0===n.props.checked&&n.setState({isChecked:!r}))},n._onRenderLabel=function(e){var t=e.label,o=e.title;return t?b.createElement("span",{"aria-hidden":"true",className:n._classNames.text,title:o},t):null},si(n),n._id=n.props.id||ts("checkbox-"),n.state={isChecked:!!(void 0!==t.checked?t.checked:t.defaultChecked),isIndeterminate:!!(void 0!==t.indeterminate?t.indeterminate:t.defaultIndeterminate)},n}return p(t,e),t.getDerivedStateFromProps=function(e,t){var o={};return void 0!==e.indeterminate&&(o.isIndeterminate=!!e.indeterminate),void 0!==e.checked&&(o.isChecked=!!e.checked),Object.keys(o).length?o:null},t.prototype.render=function(){var e=this,t=this.props,o=t.className,n=t.disabled,r=t.boxSide,i=t.theme,s=t.styles,a=t.onRenderLabel,l=void 0===a?this._onRenderLabel:a,c=t.keytipProps,u=this.state,d=u.isChecked,p=u.isIndeterminate;return this._classNames=Rh(s,{theme:i,className:o,disabled:n,indeterminate:p,checked:d,reversed:"start"!==r,isUsingCustomLabelRender:l!==this._onRenderLabel}),c?b.createElement(Zs,{keytipProps:c,disabled:n},(function(t){return e._renderContent(d,p,t)})):this._renderContent(d,p)},Object.defineProperty(t.prototype,"indeterminate",{get:function(){return!!this.state.isIndeterminate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return!!this.state.isChecked},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this._checkBox.current&&this._checkBox.current.focus()},t.defaultProps={boxSide:"start"},t}(b.Component),Nh={root:"ms-Checkbox",label:"ms-Checkbox-label",checkbox:"ms-Checkbox-checkbox",checkmark:"ms-Checkbox-checkmark",text:"ms-Checkbox-text"},Fh=xn(Bh,(function(e){var t,o,n,r,i,s,a,l,c,u,d,p,m,g,f,v,b,_,y=e.className,C=e.theme,S=e.reversed,x=e.checked,k=e.disabled,w=e.isUsingCustomLabelRender,I=e.indeterminate,D=C.semanticColors,P=C.effects,T=C.palette,E=C.fonts,M=Oo(Nh,C),R=D.inputForegroundChecked,B=T.neutralSecondary,N=T.neutralPrimary,F=D.inputBackgroundChecked,A=D.inputBackgroundChecked,L=D.disabledBodySubtext,H=D.inputBorderHovered,O=D.inputBackgroundCheckedHovered,z=D.inputBackgroundChecked,W=D.inputBackgroundCheckedHovered,V=D.inputBackgroundCheckedHovered,K=D.inputTextHovered,U=D.disabledBodySubtext,G=D.bodyText,j=D.disabledText,Y=[(t={content:'""',borderRadius:P.roundedCorner2,position:"absolute",width:10,height:10,top:4,left:4,boxSizing:"border-box",borderWidth:5,borderStyle:"solid",borderColor:k?L:F,transitionProperty:"border-width, border, border-color",transitionDuration:"200ms",transitionTimingFunction:"cubic-bezier(.4, 0, .23, 1)"},t[jt]={borderColor:"WindowText"},t)];return{root:[M.root,{position:"relative",display:"flex"},S&&"reversed",x&&"is-checked",!k&&"is-enabled",k&&"is-disabled",!k&&[!x&&(o={},o[":hover ."+M.checkbox]=(n={borderColor:H},n[jt]={borderColor:"Highlight"},n),o[":focus ."+M.checkbox]={borderColor:H},o[":hover ."+M.checkmark]=(r={color:B,opacity:"1"},r[jt]={color:"Highlight"},r),o),x&&!I&&(i={},i[":hover ."+M.checkbox]={background:W,borderColor:V},i[":focus ."+M.checkbox]={background:W,borderColor:V},i[jt]=(s={},s[":hover ."+M.checkbox]={background:"Highlight",borderColor:"Highlight"},s[":focus ."+M.checkbox]={background:"Highlight"},s[":focus:hover ."+M.checkbox]={background:"Highlight"},s[":focus:hover ."+M.checkmark]={color:"Window"},s[":hover ."+M.checkmark]={color:"Window"},s),i),I&&(a={},a[":hover ."+M.checkbox+", :hover ."+M.checkbox+":after"]=(l={borderColor:O},l[jt]={borderColor:"WindowText"},l),a[":focus ."+M.checkbox]={borderColor:O},a[":hover ."+M.checkmark]={opacity:"0"},a),(c={},c[":hover ."+M.text+", :focus ."+M.text]=(u={color:K},u[jt]={color:k?"GrayText":"WindowText"},u),c)],y],input:(d={position:"absolute",background:"none",opacity:0},d["."+ho+" &:focus + label::before"]=(p={outline:"1px solid "+C.palette.neutralSecondary,outlineOffset:"2px"},p[jt]={outline:"1px solid WindowText"},p),d),label:[M.label,C.fonts.medium,{display:"flex",alignItems:w?"center":"flex-start",cursor:k?"default":"pointer",position:"relative",userSelect:"none"},S&&{flexDirection:"row-reverse",justifyContent:"flex-end"},{"&::before":{position:"absolute",left:0,right:0,top:0,bottom:0,content:'""',pointerEvents:"none"}}],checkbox:[M.checkbox,(m={position:"relative",display:"flex",flexShrink:0,alignItems:"center",justifyContent:"center",height:"20px",width:"20px",border:"1px solid "+N,borderRadius:P.roundedCorner2,boxSizing:"border-box",transitionProperty:"background, border, border-color",transitionDuration:"200ms",transitionTimingFunction:"cubic-bezier(.4, 0, .23, 1)",overflow:"hidden",":after":I?Y:null},m[jt]=h({borderColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),m),I&&{borderColor:F},S?{marginLeft:4}:{marginRight:4},!k&&!I&&x&&(g={background:z,borderColor:A},g[jt]={background:"Highlight",borderColor:"Highlight"},g),k&&(f={borderColor:L},f[jt]={borderColor:"GrayText"},f),x&&k&&(v={background:U,borderColor:L},v[jt]={background:"Window"},v)],checkmark:[M.checkmark,(b={opacity:x?"1":"0",color:R},b[jt]=h({color:k?"GrayText":"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),b)],text:[M.text,(_={color:k?j:G,fontSize:E.medium.fontSize,lineHeight:"20px"},_[jt]=h({color:k?"GrayText":"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),_),S?{marginRight:4}:{marginLeft:4}]}}),void 0,{scope:"Checkbox"}),Ah=Mn({cacheSize:100}),Lh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.as,o=void 0===t?"label":t,n=e.children,r=e.className,i=e.disabled,s=e.styles,a=e.required,l=e.theme,c=Ah(s,{className:r,disabled:i,required:a,theme:l});return b.createElement(o,h({},fr(this.props,gr),{className:c.root}),n)},t}(b.Component),Hh=xn(Lh,(function(e){var t,o=e.theme,n=e.className,r=e.disabled,i=e.required,s=o.semanticColors,a=Ge.semibold,l=s.bodyText,c=s.disabledBodyText,u=s.errorText;return{root:["ms-Label",o.fonts.medium,{fontWeight:a,color:l,boxSizing:"border-box",boxShadow:"none",margin:0,display:"block",padding:"5px 0",wordWrap:"break-word",overflowWrap:"break-word"},r&&{color:c,selectors:(t={},t[jt]=h({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},i&&{selectors:{"::after":{content:"' *'",color:u,paddingRight:12}}},n]}}),void 0,{scope:"Label"});function Oh(e,t){return void 0!==e[t]&&null!==e[t]}var zh=Fo((function(e){return Fo((function(t){var o=Fo((function(e){return function(o){return t(o,e)}}));return function(n,r){return e(n,r?o(r):t)}}))}));function Wh(e,t){return zh(e)(t)}var Vh=Mn(),Kh=function(e){function t(t){var o=e.call(this,t)||this;return o._onChange=function(e){var t=o.props.onChange;t&&t(e,o.props)},o._onBlur=function(e){var t=o.props.onBlur;t&&t(e,o.props)},o._onFocus=function(e){var t=o.props.onFocus;t&&t(e,o.props)},o._onRenderField=function(e){var t=e.id,n=e.imageSrc,r=e.imageAlt,i=void 0===r?"":r,s=e.selectedImageSrc,a=e.iconProps,l=e.imageSize?e.imageSize:{width:32,height:32},c=(e.onRenderLabel?Wh(e.onRenderLabel,o._onRenderLabel):o._onRenderLabel)(e);return b.createElement("label",{htmlFor:t,className:o._classNames.field},n&&b.createElement("div",{className:o._classNames.innerField},b.createElement("div",{className:o._classNames.imageWrapper},b.createElement(yr,{src:n,alt:i,width:l.width,height:l.height})),b.createElement("div",{className:o._classNames.selectedImageWrapper},b.createElement(yr,{src:s,alt:i,width:l.width,height:l.height}))),a&&b.createElement("div",{className:o._classNames.innerField},b.createElement("div",{className:o._classNames.iconWrapper},b.createElement(Fr,h({},a)))),n||a?b.createElement("div",{className:o._classNames.labelWrapper},c):c)},o._onRenderLabel=function(e){return b.createElement("span",{id:e.labelId,className:"ms-ChoiceFieldLabel"},e.text)},si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.ariaLabel,o=e.focused,n=e.required,r=e.theme,i=e.iconProps,s=e.imageSrc,a=e.imageSize,l=e.disabled,c=e.checked,u=e.id,d=e.styles,p=e.name,g=e.onRenderField,f=void 0===g?this._onRenderField:g,v=m(e,["ariaLabel","focused","required","theme","iconProps","imageSrc","imageSize","disabled","checked","id","styles","name","onRenderField"]);this._classNames=Vh(d,{theme:r,hasIcon:!!i,hasImage:!!s,checked:c,disabled:l,imageIsLarge:!!s&&(a.width>71||a.height>71),imageSize:a,focused:o});var _=fr(v,tr),y=_.className,C=m(_,["className"]);return b.createElement("div",{className:this._classNames.root},b.createElement("div",{className:this._classNames.choiceFieldWrapper},b.createElement("input",h({"aria-label":t,id:u,className:Sr(this._classNames.input,y),type:"radio",name:p,disabled:l,checked:c,required:n},C,{onChange:this._onChange,onFocus:this._onFocus,onBlur:this._onBlur})),f(this.props,this._onRenderField)))},t.defaultProps={imageSize:{width:32,height:32}},t}(b.Component),Uh={root:"ms-ChoiceField",choiceFieldWrapper:"ms-ChoiceField-wrapper",input:"ms-ChoiceField-input",field:"ms-ChoiceField-field",innerField:"ms-ChoiceField-innerField",imageWrapper:"ms-ChoiceField-imageWrapper",iconWrapper:"ms-ChoiceField-iconWrapper",labelWrapper:"ms-ChoiceField-labelWrapper",checked:"is-checked"};function Gh(e,t){var o,n;return["is-inFocus",{selectors:(o={},o["."+ho+" &"]={position:"relative",outline:"transparent",selectors:{"::-moz-focus-inner":{border:0},":after":{content:'""',top:-2,right:-2,bottom:-2,left:-2,pointerEvents:"none",border:"1px solid "+e,position:"absolute",selectors:(n={},n[jt]={borderColor:"WindowText",borderWidth:t?1:2},n)}}},o)}]}function jh(e,t,o){return[t,{paddingBottom:2,transitionProperty:"opacity",transitionDuration:"200ms",transitionTimingFunction:"ease",selectors:{".ms-Image":{display:"inline-block",borderStyle:"none"}}},(o?!e:e)&&["is-hidden",{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"hidden",opacity:0}]]}var Yh=xn(Kh,(function(e){var t,o,n,r,i,s=e.theme,a=e.hasIcon,l=e.hasImage,c=e.checked,u=e.disabled,d=e.imageIsLarge,p=e.focused,m=e.imageSize,g=s.palette,f=s.semanticColors,v=s.fonts,b=Oo(Uh,s),_=g.neutralPrimary,y=f.inputBorderHovered,C=f.inputBackgroundChecked,S=g.themeDark,x=f.disabledBodySubtext,k=f.bodyBackground,w=g.neutralSecondary,I=f.inputBackgroundChecked,D=g.themeDark,P=f.disabledBodySubtext,T=g.neutralDark,E=f.focusBorder,M=f.inputBorderHovered,R=f.inputBackgroundChecked,B=g.themeDark,N=g.neutralLighter,F={selectors:{".ms-ChoiceFieldLabel":{color:T},":before":{borderColor:c?S:y},":after":[!a&&!l&&!c&&{content:'""',transitionProperty:"background-color",left:5,top:5,width:10,height:10,backgroundColor:w},c&&{borderColor:D}]}},A={borderColor:c?B:M,selectors:{":before":{opacity:1,borderColor:c?S:y}}},L=[{content:'""',display:"inline-block",backgroundColor:k,borderWidth:1,borderStyle:"solid",borderColor:_,width:20,height:20,fontWeight:"normal",position:"absolute",top:0,left:0,boxSizing:"border-box",transitionProperty:"border-color",transitionDuration:"200ms",transitionTimingFunction:"cubic-bezier(.4, 0, .23, 1)",borderRadius:"50%"},u&&{borderColor:x,selectors:(t={},t[jt]=h({borderColor:"GrayText",background:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},c&&{borderColor:u?x:C,selectors:(o={},o[jt]={borderColor:"Highlight",background:"Window",forcedColorAdjust:"none"},o)},(a||l)&&{top:3,right:3,left:"auto",opacity:c?1:0}],H=[{content:'""',width:0,height:0,borderRadius:"50%",position:"absolute",left:10,right:0,transitionProperty:"border-width",transitionDuration:"200ms",transitionTimingFunction:"cubic-bezier(.4, 0, .23, 1)",boxSizing:"border-box"},c&&{borderWidth:5,borderStyle:"solid",borderColor:u?P:I,left:5,top:5,width:10,height:10,selectors:(n={},n[jt]={borderColor:"Highlight",forcedColorAdjust:"none"},n)},c&&(a||l)&&{top:8,right:8,left:"auto"}];return{root:[b.root,s.fonts.medium,{display:"flex",alignItems:"center",boxSizing:"border-box",color:f.bodyText,minHeight:26,border:"none",position:"relative",marginTop:8,selectors:{".ms-ChoiceFieldLabel":{display:"inline-block"}}},!a&&!l&&{selectors:{".ms-ChoiceFieldLabel":{paddingLeft:"26px"}}},l&&"ms-ChoiceField--image",a&&"ms-ChoiceField--icon",(a||l)&&{display:"inline-flex",fontSize:0,margin:"0 4px 4px 0",paddingLeft:0,backgroundColor:N,height:"100%"}],choiceFieldWrapper:[b.choiceFieldWrapper,p&&Gh(E,a||l)],input:[b.input,{position:"absolute",opacity:0,top:0,right:0,width:"100%",height:"100%",margin:0},u&&"is-disabled"],field:[b.field,c&&b.checked,{display:"inline-block",cursor:"pointer",marginTop:0,position:"relative",verticalAlign:"top",userSelect:"none",minHeight:20,selectors:{":hover":!u&&F,":focus":!u&&F,":before":L,":after":H}},a&&"ms-ChoiceField--icon",l&&"ms-ChoiceField-field--image",(a||l)&&{boxSizing:"content-box",cursor:"pointer",paddingTop:22,margin:0,textAlign:"center",transitionProperty:"all",transitionDuration:"200ms",transitionTimingFunction:"ease",border:"1px solid transparent",justifyContent:"center",alignItems:"center",display:"flex",flexDirection:"column"},c&&{borderColor:R},(a||l)&&!u&&{selectors:{":hover":A,":focus":A}},u&&{cursor:"default",selectors:{".ms-ChoiceFieldLabel":{color:f.disabledBodyText,selectors:(r={},r[jt]=h({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)}}},c&&u&&{borderColor:N}],innerField:[b.innerField,l&&{height:m.height,width:m.width},(a||l)&&{position:"relative",display:"inline-block",paddingLeft:30,paddingRight:30},(a||l)&&d&&{paddingLeft:24,paddingRight:24},(a||l)&&u&&{opacity:.25,selectors:(i={},i[jt]={color:"GrayText",opacity:1},i)}],imageWrapper:jh(!1,b.imageWrapper,c),selectedImageWrapper:jh(!0,b.imageWrapper,c),iconWrapper:[b.iconWrapper,{fontSize:32,lineHeight:32,height:32}],labelWrapper:[b.labelWrapper,v.medium,(a||l)&&{display:"block",position:"relative",margin:"4px 8px 2px 8px",height:32,lineHeight:15,maxWidth:2*m.width,overflow:"hidden",whiteSpace:"pre-wrap"}]}}),void 0,{scope:"ChoiceGroupOption"}),qh=Mn(),Zh=function(e){function t(t){var o=e.call(this,t)||this;o._focusCallbacks={},o._changeCallbacks={},o._onBlur=function(e,t){o.setState({keyFocused:void 0})},si(o);var n=t.defaultSelectedKey,r=t.options,i=void 0===r?[]:r,s=!Xh(t)&&void 0!==n&&i.some((function(e){return e.key===n}));return o.state={keyChecked:s?n:o._getKeyChecked(t)},o._id=ts("ChoiceGroup"),o._labelId=ts("ChoiceGroupLabel"),o}return p(t,e),Object.defineProperty(t.prototype,"checkedOption",{get:function(){var e=this,t=this.props.options;return _i(void 0===t?[]:t,(function(t){return t.key===e.state.keyChecked}))},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){if(e!==this.props){var o=this._getKeyChecked(this.props);o!==this._getKeyChecked(e)&&this.setState({keyChecked:o})}},t.prototype.render=function(){var e=this,t=this.props,o=t.className,n=t.theme,r=t.styles,i=t.options,s=void 0===i?[]:i,a=t.label,l=t.required,c=t.disabled,u=t.name,d=this.state,p=d.keyChecked,m=d.keyFocused,g=fr(this.props,gr,["onChange","className","required"]),f=qh(r,{theme:n,className:o,optionsContainIconOrImage:s.some((function(e){return!(!e.iconProps&&!e.imageSrc)}))}),v=this._id+"-label",_=this.props.ariaLabelledBy||(a?v:this.props["aria-labelledby"]);return b.createElement("div",h({className:f.applicationRole},g),b.createElement("div",h({className:f.root,role:"radiogroup"},_&&{"aria-labelledby":_}),a&&b.createElement(Hh,{className:f.label,required:l,id:v,disabled:c},a),b.createElement("div",{className:f.flexContainer},s.map((function(t){var o=h(h({},t),{focused:t.key===m,checked:t.key===p,disabled:t.disabled||c,id:e._getOptionId(t),labelId:e._getOptionLabelId(t),name:u||e._id,required:l});return b.createElement(Yh,h({key:t.key,onBlur:e._onBlur,onFocus:e._onFocus(t.key),onChange:e._onChange(t.key)},o))})))))},t.prototype.focus=function(){var e=this.props.options,t=void 0===e?[]:e,o=this.checkedOption||t.filter((function(e){return!e.disabled}))[0],n=o&&document.getElementById(this._getOptionId(o));n&&(n.focus(),mo(!0,n))},t.prototype._onFocus=function(e){var t=this;return this._focusCallbacks[e]||(this._focusCallbacks[e]=function(o,n){t.setState({keyFocused:e})}),this._focusCallbacks[e]},t.prototype._onChange=function(e){var t=this;return this._changeCallbacks[e]||(this._changeCallbacks[e]=function(o,n){var r=t.props,i=r.onChanged,s=r.onChange;Xh(t.props)||t.setState({keyChecked:e});var a=_i(t.props.options||[],(function(t){return t.key===e}));s?s(o,a):i&&i(a,o)}),this._changeCallbacks[e]},t.prototype._getKeyChecked=function(e){if(void 0!==e.selectedKey)return e.selectedKey;var t=e.options,o=(void 0===t?[]:t).filter((function(e){return e.checked}));return o[0]&&o[0].key},t.prototype._getOptionId=function(e){return e.id||this._id+"-"+e.key},t.prototype._getOptionLabelId=function(e){return e.labelId||this._labelId+"-"+e.key},t}(b.Component);function Xh(e){return Oh(e,"selectedKey")}var Qh={root:"ms-ChoiceFieldGroup",flexContainer:"ms-ChoiceFieldGroup-flexContainer"},Jh=xn(Zh,(function(e){var t=e.className,o=e.optionsContainIconOrImage,n=e.theme,r=Oo(Qh,n);return{applicationRole:t,root:[r.root,n.fonts.medium,{display:"block"}],flexContainer:[r.flexContainer,o&&{display:"flex",flexDirection:"row",flexWrap:"wrap"}]}}),void 0,{scope:"ChoiceGroup"}),$h=No((function(){return ee({"0%":{transform:"translate(0, 0)",animationTimingFunction:"linear"},"78.57%":{transform:"translate(0, 0)",animationTimingFunction:"cubic-bezier(0.62, 0, 0.56, 1)"},"82.14%":{transform:"translate(0, -5px)",animationTimingFunction:"cubic-bezier(0.58, 0, 0, 1)"},"84.88%":{transform:"translate(0, 9px)",animationTimingFunction:"cubic-bezier(1, 0, 0.56, 1)"},"88.1%":{transform:"translate(0, -2px)",animationTimingFunction:"cubic-bezier(0.58, 0, 0.67, 1)"},"90.12%":{transform:"translate(0, 0)",animationTimingFunction:"linear"},"100%":{transform:"translate(0, 0)"}})})),em=No((function(){return ee({"0%":{transform:" scale(0)",animationTimingFunction:"linear"},"14.29%":{transform:"scale(0)",animationTimingFunction:"cubic-bezier(0.84, 0, 0.52, 0.99)"},"16.67%":{transform:"scale(1.15)",animationTimingFunction:"cubic-bezier(0.48, -0.01, 0.52, 1.01)"},"19.05%":{transform:"scale(0.95)",animationTimingFunction:"cubic-bezier(0.48, 0.02, 0.52, 0.98)"},"21.43%":{transform:"scale(1)",animationTimingFunction:"linear"},"42.86%":{transform:"scale(1)",animationTimingFunction:"cubic-bezier(0.48, -0.02, 0.52, 1.02)"},"45.71%":{transform:"scale(0.8)",animationTimingFunction:"cubic-bezier(0.48, 0.01, 0.52, 0.99)"},"50%":{transform:"scale(1)",animationTimingFunction:"linear"},"90.12%":{transform:"scale(1)",animationTimingFunction:"cubic-bezier(0.48, -0.02, 0.52, 1.02)"},"92.98%":{transform:"scale(0.8)",animationTimingFunction:"cubic-bezier(0.48, 0.01, 0.52, 0.99)"},"97.26%":{transform:"scale(1)",animationTimingFunction:"linear"},"100%":{transform:"scale(1)"}})})),tm=No((function(){return ee({"0%":{transform:"rotate(0deg)",animationTimingFunction:"linear"},"83.33%":{transform:" rotate(0deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"83.93%":{transform:"rotate(15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"84.52%":{transform:"rotate(-15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"85.12%":{transform:"rotate(15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"85.71%":{transform:"rotate(-15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"86.31%":{transform:"rotate(0deg)",animationTimingFunction:"linear"},"100%":{transform:"rotate(0deg)"}})}));var om,nm=No((function(){var e;return hn({root:[{position:"absolute",boxSizing:"border-box",border:"1px solid ${}",selectors:(e={},e[jt]={border:"1px solid WindowText"},e)},{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}}],container:{position:"relative"},main:{backgroundColor:"#ffffff",overflowX:"hidden",overflowY:"hidden",position:"relative"},overFlowYHidden:{overflowY:"hidden"}})})),rm={opacity:0},im=((om={})[Oa.top]="slideUpIn20",om[Oa.bottom]="slideDownIn20",om[Oa.left]="slideLeftIn20",om[Oa.right]="slideRightIn20",om),sm=function(e){function t(t){var o=e.call(this,t)||this;return o._positionedHost=b.createRef(),o._contentHost=b.createRef(),o.dismiss=function(e){o.onResize(e)},o.onResize=function(e){var t=o.props.onDismiss;t?t(e):o._updateAsyncPosition()},o._setInitialFocus=function(){o._contentHost.current&&o.props.setInitialFocus&&!o._didSetInitialFocus&&o.state.positions&&(o._didSetInitialFocus=!0,Oi(o._contentHost.current))},o._onComponentDidMount=function(){o._async.setTimeout((function(){o._events.on(o._targetWindow,"scroll",o._async.throttle(o._dismissOnScroll,10),!0),o._events.on(o._targetWindow,"resize",o._async.throttle(o.onResize,10),!0),o._events.on(o._targetWindow.document.body,"focus",o._dismissOnLostFocus,!0),o._events.on(o._targetWindow.document.body,"click",o._dismissOnLostFocus,!0)}),0),o.props.onLayerMounted&&o.props.onLayerMounted(),o._updateAsyncPosition(),o._setHeightOffsetEveryFrame()},si(o),o._async=new di(o),o._events=new Ws(o),o._didSetInitialFocus=!1,o.state={positions:void 0,heightOffset:0},o._positionAttempts=0,o}return p(t,e),t.prototype.UNSAFE_componentWillMount=function(){this._setTargetWindowAndElement(this._getTarget())},t.prototype.componentDidMount=function(){this._onComponentDidMount()},t.prototype.componentDidUpdate=function(){this._setInitialFocus(),this._updateAsyncPosition()},t.prototype.UNSAFE_componentWillUpdate=function(e){var t=this._getTarget(e);(t!==this._getTarget()||"string"==typeof t||t instanceof String)&&(this._maxHeight=void 0,this._setTargetWindowAndElement(t)),e.offsetFromTarget!==this.props.offsetFromTarget&&(this._maxHeight=void 0),e.finalHeight!==this.props.finalHeight&&this._setHeightOffsetEveryFrame()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){if(!this._targetWindow)return null;var e=this.props,t=e.className,o=e.positioningContainerWidth,n=e.positioningContainerMaxHeight,r=e.children,i=this.state.positions,s=nm(),a=i&&i.targetEdge?Ye[im[i.targetEdge]]:"",l=this._getMaxHeight()+this.state.heightOffset,c=n&&n>l?l:n,u=b.createElement("div",{ref:this._positionedHost,className:Sr("ms-PositioningContainer",s.container)},b.createElement("div",{className:Q("ms-PositioningContainer-layerHost",s.root,t,a,!!o&&{width:o}),style:i?i.elementPosition:rm,tabIndex:-1,ref:this._contentHost},r,c));return this.props.doNotLayer?u:b.createElement(cc,null,u)},t.prototype._dismissOnScroll=function(e){var t=this.props.preventDismissOnScroll;this.state.positions&&!t&&this._dismissOnLostFocus(e)},t.prototype._dismissOnLostFocus=function(e){var t=e.target,o=this._positionedHost.current&&!Ni(this._positionedHost.current,t);(!this._target&&o||e.target!==this._targetWindow&&o&&(this._target.stopPropagation||!this._target||t!==this._target&&!Ni(this._target,t)))&&this.onResize(e)},t.prototype._updateAsyncPosition=function(){var e=this;this._async.requestAnimationFrame((function(){return e._updatePosition()}))},t.prototype._updatePosition=function(){var e=this.state.positions,t=this.props,o=t.offsetFromTarget,n=t.onPositioned,r=this._positionedHost.current,i=this._contentHost.current;if(r&&i){var s=h({},this.props);if(s.bounds=this._getBounds(),s.target=this._target,document.body.contains(s.target)){s.gapSpace=o;var a=wl(s,r,i);!e&&a||e&&a&&!this._arePositionsEqual(e,a)&&this._positionAttempts<5?(this._positionAttempts++,this.setState({positions:a},(function(){n&&n(a)}))):(this._positionAttempts=0,n&&n(a))}else void 0!==e&&this.setState({positions:void 0})}},t.prototype._getBounds=function(){if(!this._positioningBounds){var e=this.props.bounds;e||(e={top:0+this.props.minPagePadding,left:0+this.props.minPagePadding,right:this._targetWindow.innerWidth-this.props.minPagePadding,bottom:this._targetWindow.innerHeight-this.props.minPagePadding,width:this._targetWindow.innerWidth-2*this.props.minPagePadding,height:this._targetWindow.innerHeight-2*this.props.minPagePadding}),this._positioningBounds=e}return this._positioningBounds},t.prototype._getMaxHeight=function(){var e=this.props,t=e.directionalHintFixed,o=e.offsetFromTarget,n=e.directionalHint;if(!this._maxHeight)if(t&&this._target){var r=o||0;this._maxHeight=Pl(this._target,n,r,this._getBounds())}else this._maxHeight=this._getBounds().height-2;return this._maxHeight},t.prototype._arePositionsEqual=function(e,t){return this._comparePositions(e.elementPosition,t.elementPosition)},t.prototype._comparePositions=function(e,t){for(var o in t)if(t.hasOwnProperty(o)){var n=e[o],r=t[o];if(n&&r&&n.toFixed(2)!==r.toFixed(2))return!1}return!0},t.prototype._setTargetWindowAndElement=function(e){var t=this._positionedHost.current;if(e)if("string"==typeof e){var o=tt();this._target=o?o.querySelector(e):null,this._targetWindow=rt(t)}else if(e.stopPropagation)this._targetWindow=rt(e.target),this._target=e;else if(void 0===e.left&&void 0===e.x||void 0===e.top&&void 0===e.y){var n=e;this._targetWindow=rt(n),this._target=e}else this._targetWindow=rt(t),this._target=e;else this._targetWindow=rt(t)},t.prototype._setHeightOffsetEveryFrame=function(){var e=this;this._contentHost&&this.props.finalHeight&&(this._setHeightOffsetTimer=this._async.requestAnimationFrame((function(){if(e._contentHost.current){var t=e._contentHost.current.lastChild,o=t.scrollHeight-t.offsetHeight;e.setState({heightOffset:e.state.heightOffset+o}),t.offsetHeight<e.props.finalHeight?e._setHeightOffsetEveryFrame():e._async.cancelAnimationFrame(e._setHeightOffsetTimer)}})))},t.prototype._getTarget=function(e){return void 0===e&&(e=this.props),e.target},t.defaultProps={preventDismissOnScroll:!1,offsetFromTarget:0,minPagePadding:8,directionalHint:ya.bottomAutoEdge},t}(b.Component);function am(e){return{root:[{position:"absolute",boxShadow:"inherit",border:"none",boxSizing:"border-box",transform:e.transform,width:e.width,height:e.height,left:e.left,top:e.top,right:e.right,bottom:e.bottom}],beak:{fill:e.color,display:"block"}}}var lm=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e,t,o,n,r,i,s=this.props,a=s.left,l=s.top,c=s.bottom,u=s.right,d=s.color,p=s.direction,h=void 0===p?Oa.top:p;switch(h===Oa.top||h===Oa.bottom?(e=10,t=18):(e=18,t=10),h){case Oa.top:default:o="9, 0",n="18, 10",r="0, 10",i="translateY(-100%)";break;case Oa.right:o="0, 0",n="10, 10",r="0, 18",i="translateX(100%)";break;case Oa.bottom:o="0, 0",n="18, 0",r="9, 10",i="translateY(100%)";break;case Oa.left:o="10, 0",n="0, 10",r="10, 18",i="translateX(-100%)"}var m=Mn()(am,{left:a,top:l,bottom:c,right:u,height:e+"px",width:t+"px",transform:i,color:d});return b.createElement("div",{className:m.root,role:"presentation"},b.createElement("svg",{height:e,width:t,className:m.beak},b.createElement("polygon",{points:o+" "+n+" "+r})))},t}(b.Component),cm=Mn(),um="data-coachmarkid",dm=function(e){function t(t){var o=e.call(this,t)||this;return o._entityHost=b.createRef(),o._entityInnerHostElement=b.createRef(),o._translateAnimationContainer=b.createRef(),o._ariaAlertContainer=b.createRef(),o._childrenContainer=b.createRef(),o._positioningContainer=b.createRef(),o.dismiss=function(e){var t=o.props.onDismiss;t&&t(e)},o._onKeyDown=function(e){(e.altKey&&e.which===wn.c||e.which===wn.enter&&o._translateAnimationContainer.current&&o._translateAnimationContainer.current.contains(e.target))&&o._onFocusHandler()},o._onFocusHandler=function(){o.state.isCollapsed&&o._openCoachmark()},o._onPositioned=function(e){o._async.requestAnimationFrame((function(){o.setState({targetAlignment:e.alignmentEdge,targetPosition:e.targetEdge})}))},o._setBeakPosition=function(){var e,t,n,r,i,s,a=o.state.targetAlignment;switch(o._beakDirection){case Oa.top:case Oa.bottom:a?a===Oa.left?(e="7px",i="left"):(n="7px",i="right"):(e="calc(50% - 9px)",i="center"),o._beakDirection===Oa.top?(t="3px",s="top"):(r="3px",s="bottom");break;case Oa.left:case Oa.right:a?a===Oa.top?(t="7px",s="top"):(r="7px",s="bottom"):(t="calc(50% - 9px)",s="center"),o._beakDirection===Oa.left?(In(o.props.theme)?n="3px":e="3px",i="left"):(In(o.props.theme)?e="3px":n="3px",i="right")}o.setState({beakLeft:e,beakRight:n,beakBottom:r,beakTop:t,transformOrigin:i+" "+s})},o._openCoachmark=function(){o.setState({isCollapsed:!1}),o.props.onAnimationOpenStart&&o.props.onAnimationOpenStart(),o._entityInnerHostElement.current&&o._entityInnerHostElement.current.addEventListener("transitionend",(function(){o._async.setTimeout((function(){o._entityInnerHostElement.current&&Oi(o._entityInnerHostElement.current)}),1e3),o.props.onAnimationOpenEnd&&o.props.onAnimationOpenEnd()}))},o._async=new di(o),o._events=new Ws(o),si(o),o.state={isCollapsed:t.isCollapsed,isBeaconAnimating:!0,isMeasuring:!0,entityInnerHostRect:{width:0,height:0},isMouseInProximity:!1,isMeasured:!1},o}return p(t,e),Object.defineProperty(t.prototype,"_beakDirection",{get:function(){var e=this.state.targetPosition;return void 0===e?Oa.bottom:Tl(e)},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.beaconColorOne,o=e.beaconColorTwo,n=e.children,r=e.target,i=e.color,s=e.positioningContainerProps,a=e.ariaDescribedBy,l=e.ariaDescribedByText,c=e.ariaLabelledBy,u=e.ariaLabelledByText,d=e.ariaAlertText,p=e.delayBeforeCoachmarkAnimation,m=e.styles,g=e.theme,f=e.className,v=e.persistentBeak,_=this.state,y=_.beakLeft,C=_.beakTop,S=_.beakRight,x=_.beakBottom,k=_.isCollapsed,w=_.isBeaconAnimating,I=_.isMeasuring,D=_.entityInnerHostRect,P=_.transformOrigin,T=_.alertText,E=_.isMeasured,M=i;!M&&g&&(M=g.semanticColors.primaryButtonBackground);var R=cm(m,{theme:g,beaconColorOne:t,beaconColorTwo:o,className:f,isCollapsed:k,isBeaconAnimating:w,isMeasuring:I,color:M,transformOrigin:P,isMeasured:E,entityHostHeight:D.height+"px",entityHostWidth:D.width+"px",width:"32px",height:"32px",delayBeforeCoachmarkAnimation:p+"ms"}),B=k?32:D.height;return b.createElement(sm,h({target:r,offsetFromTarget:10,componentRef:this._positioningContainer,finalHeight:B,onPositioned:this._onPositioned,bounds:this._getBounds()},s),b.createElement("div",{className:R.root},d&&b.createElement("div",{className:R.ariaContainer,role:"alert",ref:this._ariaAlertContainer,"aria-hidden":!k},T),b.createElement("div",{className:R.pulsingBeacon}),b.createElement("div",{className:R.translateAnimationContainer,ref:this._translateAnimationContainer},b.createElement("div",{className:R.scaleAnimationLayer},b.createElement("div",{className:R.rotateAnimationLayer},this._positioningContainer.current&&(k||v)&&b.createElement(lm,{left:y,top:C,right:S,bottom:x,direction:this._beakDirection,color:M}),b.createElement("div",{className:R.entityHost,ref:this._entityHost,tabIndex:-1,"data-is-focusable":!0,role:"dialog","aria-labelledby":c,"aria-describedby":a},k&&[c&&b.createElement("p",{id:c,key:0,className:R.ariaContainer},u),a&&b.createElement("p",{id:a,key:1,className:R.ariaContainer},l)],b.createElement(Ih,{isClickableOutsideFocusTrap:!0,forceFocusInsideTrap:!1},b.createElement("div",{className:R.entityInnerHost,ref:this._entityInnerHostElement},b.createElement("div",{className:R.childrenContainer,ref:this._childrenContainer,"aria-hidden":k},n)))))))))},t.prototype.UNSAFE_componentWillReceiveProps=function(e){this.props.isCollapsed&&!e.isCollapsed&&this._openCoachmark()},t.prototype.shouldComponentUpdate=function(e,t){return!Fs(e,this.props)||!Fs(t,this.state)},t.prototype.componentDidUpdate=function(e,t){t.targetAlignment===this.state.targetAlignment&&t.targetPosition===this.state.targetPosition||this._setBeakPosition(),e.preventDismissOnLostFocus!==this.props.preventDismissOnLostFocus&&this._addListeners()},t.prototype.componentDidMount=function(){var e=this;this._async.requestAnimationFrame((function(){e._entityInnerHostElement.current&&e.state.entityInnerHostRect.width+e.state.entityInnerHostRect.width===0&&(e.setState({isMeasuring:!1,entityInnerHostRect:{width:e._entityInnerHostElement.current.offsetWidth,height:e._entityInnerHostElement.current.offsetHeight},isMeasured:!0}),e._setBeakPosition(),e.forceUpdate()),e._addListeners(),e._async.setTimeout((function(){e._addProximityHandler(e.props.mouseProximityOffset)}),e.props.delayBeforeMouseOpen),e.props.ariaAlertText&&e._async.setTimeout((function(){e.props.ariaAlertText&&e._ariaAlertContainer.current&&e.setState({alertText:e.props.ariaAlertText})}),0),e.props.preventFocusOnMount||e._async.setTimeout((function(){e._entityHost.current&&e._entityHost.current.focus()}),1e3)}))},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype._addListeners=function(){var e=this.props.preventDismissOnLostFocus,t=tt();this._events.off(),t&&(this._events.on(t,"keydown",this._onKeyDown,!0),e||(this._events.on(t,"click",this._dismissOnLostFocus,!0),this._events.on(t,"focus",this._dismissOnLostFocus,!0)))},t.prototype._dismissOnLostFocus=function(e){var t=e.target,o=this._translateAnimationContainer.current&&!Ni(this._translateAnimationContainer.current,t),n=this.props.target;o&&t!==n&&!Ni(n,t)&&this.dismiss(e)},t.prototype._getBounds=function(){var e=this.props,t=e.isPositionForced,o=e.positioningContainerProps;return t?!o||o.directionalHint!==ya.topAutoEdge&&o.directionalHint!==ya.bottomAutoEdge?{left:-1/0,top:-1/0,bottom:1/0,right:1/0,width:1/0,height:1/0}:{left:0,top:-1/0,bottom:1/0,right:window.innerWidth,width:window.innerWidth,height:1/0}:void 0},t.prototype._addProximityHandler=function(e){var t=this;void 0===e&&(e=0);var o=[];this._async.setTimeout((function(){t._setTargetElementRect(),t._events.on(window,"resize",(function(){o.forEach((function(e){clearInterval(e)})),o.push(t._async.setTimeout((function(){t._setTargetElementRect()}),100))}))}),10),this._events.on(document,"mousemove",(function(o){if(t.state.isCollapsed){var n=o.clientY,r=o.clientX;t._setTargetElementRect(),t._isInsideElement(r,n,e)!==t.state.isMouseInProximity&&t._openCoachmark()}t.props.onMouseMove&&t.props.onMouseMove(o)}))},t.prototype._setTargetElementRect=function(){this._translateAnimationContainer&&this._translateAnimationContainer.current&&(this._targetElementRect=this._translateAnimationContainer.current.getBoundingClientRect())},t.prototype._isInsideElement=function(e,t,o){return void 0===o&&(o=0),e>this._targetElementRect.left-o&&e<this._targetElementRect.left+this._targetElementRect.width+o&&t>this._targetElementRect.top-o&&t<this._targetElementRect.top+this._targetElementRect.height+o},t.defaultProps={isCollapsed:!0,mouseProximityOffset:10,delayBeforeMouseOpen:3600,delayBeforeCoachmarkAnimation:0,isPositionForced:!0,positioningContainerProps:{directionalHint:ya.bottomAutoEdge}},t}(b.Component),pm=xn(dm,(function(e){var t,o=e.theme,n=e.className,r=e.color,i=e.beaconColorOne,s=e.beaconColorTwo,a=e.delayBeforeCoachmarkAnimation,l=e.isCollapsed,c=e.isBeaconAnimating,u=e.isMeasuring,d=e.isMeasured,p=e.entityHostHeight,h=e.entityHostWidth,m=e.transformOrigin;if(!o)throw new Error("theme is undefined or null in base Dropdown getStyles function.");var g=wo.continuousPulseAnimationDouble(i||o.palette.themePrimary,s||o.palette.themeTertiary,"35px","150px","10px"),f=wo.createDefaultAnimation(g,a);return{root:[o.fonts.medium,{position:"relative"},n],pulsingBeacon:[{position:"absolute",top:"50%",left:"50%",transform:In(o)?"translate(50%, -50%)":"translate(-50%, -50%)",width:"0px",height:"0px",borderRadius:"225px",borderStyle:"solid",opacity:"0"},l&&c&&f],translateAnimationContainer:[{width:"100%",height:"100%"},l&&{animationDuration:"14s",animationTimingFunction:"linear",animationDirection:"normal",animationIterationCount:"1",animationDelay:"0s",animationFillMode:"forwards",animationName:$h(),transition:"opacity 0.5s ease-in-out"},!l&&{opacity:"1"}],scaleAnimationLayer:[{width:"100%",height:"100%"},l&&{animationDuration:"14s",animationTimingFunction:"linear",animationDirection:"normal",animationIterationCount:"1",animationDelay:"0s",animationFillMode:"forwards",animationName:em()}],rotateAnimationLayer:[{width:"100%",height:"100%"},l&&{animationDuration:"14s",animationTimingFunction:"linear",animationDirection:"normal",animationIterationCount:"1",animationDelay:"0s",animationFillMode:"forwards",animationName:tm()},!l&&{opacity:"1"}],entityHost:[{position:"relative",outline:"none",overflow:"hidden",backgroundColor:r,borderRadius:32,transition:"border-radius 250ms, width 500ms, height 500ms cubic-bezier(0.5, 0, 0, 1)",visibility:"hidden",selectors:(t={},t[jt]={backgroundColor:"Window",border:"2px solid WindowText"},t["."+ho+" &:focus"]={outline:"1px solid "+o.palette.themeTertiary},t)},!u&&{width:32,height:32,visibility:"visible"},!l&&{borderRadius:"1px",opacity:"1",width:h,height:p}],entityInnerHost:[{transition:"transform 500ms cubic-bezier(0.5, 0, 0, 1)",transformOrigin:m,transform:"scale(0)"},!l&&{width:h,height:p,transform:"scale(1)"},!u&&{visibility:"visible"}],childrenContainer:[{display:d&&l?"none":"block"}],ariaContainer:{position:"fixed",opacity:0,height:0,width:0,pointerEvents:"none"}}}),void 0,{scope:"Coachmark"}),hm=100,mm=359,gm=100,fm=255,vm=fm,bm=100,_m=3,ym=6,Cm=1,Sm=3,xm=/^[\da-f]{0,6}$/i,km=/^\d{0,3}$/;function wm(e,t,o){var n=o+(t*=(o<50?o:100-o)/100);return{h:e,s:0===n?0:2*t/n*100,v:n}}function Im(e,t,o){var n=[],r=(o/=100)*(t/=100),i=e/60,s=r*(1-Math.abs(i%2-1)),a=o-r;switch(Math.floor(i)){case 0:n=[r,s,0];break;case 1:n=[s,r,0];break;case 2:n=[0,r,s];break;case 3:n=[0,s,r];break;case 4:n=[s,0,r];break;case 5:n=[r,0,s]}return{r:Math.round(fm*(n[0]+a)),g:Math.round(fm*(n[1]+a)),b:Math.round(fm*(n[2]+a))}}function Dm(e,t,o){var n=wm(e,t,o);return Im(n.h,n.s,n.v)}function Pm(e){if(e){var t=Tm(e)||function(e){if("#"===e[0]&&7===e.length&&/^#[\da-fA-F]{6}$/.test(e))return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:bm}}(e)||function(e){if("#"===e[0]&&4===e.length&&/^#[\da-fA-F]{3}$/.test(e))return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:bm}}(e)||function(e){var t=e.match(/^hsl(a?)\(([\d., ]+)\)$/);if(t){var o=!!t[1],n=o?4:3,r=t[2].split(/ *, */).map(Number);if(r.length===n){var i=Dm(r[0],r[1],r[2]);return i.a=o?100*r[3]:bm,i}}}(e);return t||function(e){if("undefined"==typeof document)return;var t=document.createElement("div");t.style.backgroundColor=e,t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.height="1px",t.style.width="1px",document.body.appendChild(t);var o=getComputedStyle(t),n=o&&o.backgroundColor;if(document.body.removeChild(t),"rgba(0, 0, 0, 0)"===n||"transparent"===n){switch(e.trim()){case"transparent":case"#0000":case"#00000000":return{r:0,g:0,b:0,a:0}}return}return Tm(n)}(e)}}function Tm(e){if(e){var t=e.match(/^rgb(a?)\(([\d., ]+)\)$/);if(t){var o=!!t[1],n=o?4:3,r=t[2].split(/ *, */).map(Number);if(r.length===n)return{r:r[0],g:r[1],b:r[2],a:o?100*r[3]:bm}}}}function Em(e,t,o){return void 0===o&&(o=0),e<o?o:e>t?t:e}function Mm(e,t,o){return[Rm(e),Rm(t),Rm(o)].join("")}function Rm(e){var t=(e=Em(e,fm)).toString(16);return 1===t.length?"0"+t:t}function Bm(e,t,o){var n=Im(e,t,o);return Mm(n.r,n.g,n.b)}function Nm(e,t,o){var n=NaN,r=Math.max(e,t,o),i=r-Math.min(e,t,o);return 0===i?n=0:e===r?n=(t-o)/i%6:t===r?n=(o-e)/i+2:o===r&&(n=(e-t)/i+4),(n=Math.round(60*n))<0&&(n+=360),{h:n,s:Math.round(100*(0===r?0:i/r)),v:Math.round(r/fm*100)}}function Fm(e,t,o){var n=(2-(t/=hm))*(o/=gm),r=t*o;return{h:e,s:100*(r=(r/=n<=1?n:2-n)||0),l:100*(n/=2)}}function Am(e,t,o,n,r){return n===bm||"number"!=typeof n?"#"+r:"rgba("+e+", "+t+", "+o+", "+n/bm+")"}function Lm(e){var t=e.a,o=void 0===t?bm:t,n=e.b,r=e.g,i=e.r,s=Nm(i,r,n),a=s.h,l=s.s,c=s.v,u=Mm(i,r,n);return{a:o,b:n,g:r,h:a,hex:u,r:i,s:l,str:Am(i,r,n,o,u),v:c,t:bm-o}}function Hm(e){var t=Pm(e);if(t)return h(h({},Lm(t)),{str:e})}function Om(e,t){var o=e.h,n=e.s,r=e.v;t="number"==typeof t?t:bm;var i=Im(o,n,r),s=i.r,a=i.g,l=i.b,c=Bm(o,n,r);return{a:t,b:l,g:a,h:o,hex:c,r:s,s:n,str:Am(s,a,l,t,c),v:r,t:bm-t}}function zm(e){return"#"+Bm(e.h,hm,gm)}function Wm(e,t,o){var n=Im(e.h,t,o),r=n.r,i=n.g,s=n.b,a=Mm(r,i,s);return h(h({},e),{s:t,v:o,r:r,g:i,b:s,hex:a,str:Am(r,i,s,e.a,a)})}function Vm(e,t){var o=Im(t,e.s,e.v),n=o.r,r=o.g,i=o.b,s=Mm(n,r,i);return h(h({},e),{h:t,r:n,g:r,b:i,hex:s,str:Am(n,r,i,e.a,s)})}function Km(e,t,o){var n;return Lm(((n={r:e.r,g:e.g,b:e.b,a:e.a})[t]=o,n))}function Um(e,t){return h(h({},e),{a:t,t:bm-t,str:Am(e.r,e.g,e.b,t,e.hex)})}function Gm(e){return{r:Em(e.r,fm),g:Em(e.g,fm),b:Em(e.b,fm),a:"number"==typeof e.a?Em(e.a,bm):e.a}}function jm(e){return{h:Em(e.h,mm),s:Em(e.s,hm),v:Em(e.v,gm)}}function Ym(e){return!e||e.length<_m?"ffffff":e.length>=ym?e.substring(0,ym):e.substring(0,_m)}var qm,Zm=[.027,.043,.082,.145,.184,.216,.349,.537],Xm=[.537,.45,.349,.216,.184,.145,.082,.043],Qm=[.537,.349,.216,.184,.145,.082,.043,.027],Jm=[.537,.45,.349,.216,.184,.145,.082,.043],$m=[.88,.77,.66,.55,.44,.33,.22,.11],eg=[.11,.22,.33,.44,.55,.66,.77,.88],tg=[.96,.84,.7,.4,.12],og=[.1,.24,.44];function ng(e){return"number"==typeof e&&e>=qm.Unshaded&&e<=qm.Shade8}function rg(e,t){return{h:e.h,s:e.s,v:Em(e.v-e.v*t,100,0)}}function ig(e,t){return{h:e.h,s:Em(e.s-e.s*t,100,0),v:Em(e.v+(100-e.v)*t,100,0)}}function sg(e){return Fm(e.h,e.s,e.v).l<50}function ag(e,t,o){if(void 0===o&&(o=!1),!e)return null;if(t===qm.Unshaded||!ng(t))return e;var n=Fm(e.h,e.s,e.v),r={h:e.h,s:e.s,v:e.v},i=t-1,s=ig,a=rg;return o&&(s=rg,a=ig),Lm(As(Im((r=function(e){return e.r===fm&&e.g===fm&&e.b===fm}(e)?rg(r,Qm[i]):function(e){return 0===e.r&&0===e.g&&0===e.b}(e)?ig(r,Jm[i]):n.l/100>.8?a(r,eg[i]):n.l/100<.2?s(r,$m[i]):i<tg.length?s(r,tg[i]):a(r,og[i-tg.length])).h,r.s,r.v),{a:e.a}))}function lg(e,t,o){if(void 0===o&&(o=!1),!e)return null;if(t===qm.Unshaded||!ng(t))return e;var n={h:e.h,s:e.s,v:e.v},r=t-1;return Lm(As(Im((n=o?ig(n,Xm[Jm.length-1-r]):rg(n,Zm[r])).h,n.s,n.v),{a:e.a}))}function cg(e,t){function o(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}var n=.2126*o(e.r/fm)+.7152*o(e.g/fm)+.0722*o(e.b/fm);n+=.05;var r=.2126*o(t.r/fm)+.7152*o(t.g/fm)+.0722*o(t.b/fm);return n/(r+=.05)>1?n/r:r/n}function ug(e,t){var o=bm-t;return h(h({},e),{t:t,a:o,str:Am(e.r,e.g,e.b,o,e.hex)})}function dg(){0}function pg(e){}!function(e){e[e.Unshaded=0]="Unshaded",e[e.Shade1=1]="Shade1",e[e.Shade2=2]="Shade2",e[e.Shade3=3]="Shade3",e[e.Shade4=4]="Shade4",e[e.Shade5=5]="Shade5",e[e.Shade6=6]="Shade6",e[e.Shade7=7]="Shade7",e[e.Shade8=8]="Shade8"}(qm||(qm={}));var hg,mg=Mn(),gg=function(e){function t(t){var o=e.call(this,t)||this;o._textElement=b.createRef(),o._onFocus=function(e){o.props.onFocus&&o.props.onFocus(e),o.setState({isFocused:!0},(function(){o.props.validateOnFocusIn&&o._validate(o.value)}))},o._onBlur=function(e){o.props.onBlur&&o.props.onBlur(e),o.setState({isFocused:!1},(function(){o.props.validateOnFocusOut&&o._validate(o.value)}))},o._onRenderLabel=function(e){var t=e.label,n=e.required,r=o._classNames.subComponentStyles?o._classNames.subComponentStyles.label:void 0;return t?b.createElement(Hh,{required:n,htmlFor:o._id,styles:r,disabled:e.disabled,id:o._labelId},e.label):null},o._onRenderDescription=function(e){return e.description?b.createElement("span",{className:o._classNames.description},e.description):null},o._onRevealButtonClick=function(e){o.setState((function(e){return{isRevealingPassword:!e.isRevealingPassword}}))},o._onInputChange=function(e){var t,n=e.target.value;void 0!==n&&n!==o._lastChangeValue&&(o._lastChangeValue=n,e.persist(),o.setState((function(e,r){var i=fg(r,e)||"";return(t=n===i)||o._isControlled?null:{uncontrolledValue:n}}),(function(){var r=o.props.onChange;!t&&r&&r(e,n)})))},si(o),o._async=new di(o),o._fallbackId=ts("TextField"),o._descriptionId=ts("TextFieldDescription"),o._labelId=ts("TextFieldLabel"),o._warnControlledUsage();var n=t.defaultValue,r=void 0===n?"":n;return"number"==typeof r&&(r=String(r)),o.state={uncontrolledValue:o._isControlled?void 0:r,isFocused:!1,errorMessage:""},o._delayedValidate=o._async.debounce(o._validate,o.props.deferredValidationTime),o._lastValidation=0,o}return p(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return fg(this.props,this.state)},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this._adjustInputHeight(),this.props.validateOnLoad&&this._validate(this.value)},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.getSnapshotBeforeUpdate=function(e,t){return{selection:[this.selectionStart,this.selectionEnd]}},t.prototype.componentDidUpdate=function(e,t,o){var n=this.props,r=(o||{}).selection,i=void 0===r?[null,null]:r,s=i[0],a=i[1];!!e.multiline!=!!n.multiline&&t.isFocused&&(this.focus(),null!==s&&null!==a&&s>=0&&a>=0&&this.setSelectionRange(s,a));var l=fg(e,t),c=this.value;l!==c&&(this._warnControlledUsage(e),this.state.errorMessage&&!n.errorMessage&&this.setState({errorMessage:""}),this._adjustInputHeight(),this._lastChangeValue=void 0,vg(n)&&this._delayedValidate(c))},t.prototype.render=function(){var e=this.props,t=e.borderless,o=e.className,n=e.disabled,r=e.iconProps,i=e.inputClassName,s=e.label,a=e.multiline,l=e.required,c=e.underlined,u=e.prefix,d=e.resizable,p=e.suffix,m=e.theme,g=e.styles,f=e.autoAdjustHeight,v=e.canRevealPassword,_=e.type,y=e.onRenderPrefix,C=void 0===y?this._onRenderPrefix:y,S=e.onRenderSuffix,x=void 0===S?this._onRenderSuffix:S,k=e.onRenderLabel,w=void 0===k?this._onRenderLabel:k,I=e.onRenderDescription,D=void 0===I?this._onRenderDescription:I,P=this.state,T=P.isFocused,E=P.isRevealingPassword,M=this._errorMessage,R=!!v&&"password"===_&&function(){var e;if("boolean"!=typeof hg){var t=rt();if(null===(e=t)||void 0===e?void 0:e.navigator){var o=/Edg/.test(t.navigator.userAgent||"");hg=!(ni()||o)}else hg=!0}return hg}(),B=this._classNames=mg(g,{theme:m,className:o,disabled:n,focused:T,required:l,multiline:a,hasLabel:!!s,hasErrorMessage:!!M,borderless:t,resizable:d,hasIcon:!!r,underlined:c,inputClassName:i,autoAdjustHeight:f,hasRevealButton:R});return b.createElement("div",{className:B.root},b.createElement("div",{className:B.wrapper},w(this.props,this._onRenderLabel),b.createElement("div",{className:B.fieldGroup},(void 0!==u||this.props.onRenderPrefix)&&b.createElement("div",{className:B.prefix},C(this.props,this._onRenderPrefix)),a?this._renderTextArea():this._renderInput(),r&&b.createElement(Fr,h({className:B.icon},r)),R&&b.createElement("button",{className:B.revealButton,onClick:this._onRevealButtonClick,type:"button"},b.createElement("span",{className:B.revealSpan},b.createElement(Fr,{className:B.revealIcon,iconName:E?"Hide":"RedEye"}))),(void 0!==p||this.props.onRenderSuffix)&&b.createElement("div",{className:B.suffix},x(this.props,this._onRenderSuffix)))),this._isDescriptionAvailable&&b.createElement("span",{id:this._descriptionId},D(this.props,this._onRenderDescription),M&&b.createElement("div",{role:"alert"},b.createElement(mi,null,b.createElement("p",{className:B.errorMessage},b.createElement("span",{"data-automation-id":"error-message"},M))))))},t.prototype.focus=function(){this._textElement.current&&this._textElement.current.focus()},t.prototype.blur=function(){this._textElement.current&&this._textElement.current.blur()},t.prototype.select=function(){this._textElement.current&&this._textElement.current.select()},t.prototype.setSelectionStart=function(e){this._textElement.current&&(this._textElement.current.selectionStart=e)},t.prototype.setSelectionEnd=function(e){this._textElement.current&&(this._textElement.current.selectionEnd=e)},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._textElement.current?this._textElement.current.selectionStart:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._textElement.current?this._textElement.current.selectionEnd:-1},enumerable:!0,configurable:!0}),t.prototype.setSelectionRange=function(e,t){this._textElement.current&&this._textElement.current.setSelectionRange(e,t)},t.prototype._warnControlledUsage=function(e){this._id,this.props,null!==this.props.value||this._hasWarnedNullValue||(this._hasWarnedNullValue=!0,Zo("Warning: 'value' prop on 'TextField' should not be null. Consider using an empty string to clear the component or undefined to indicate an uncontrolled component."))},Object.defineProperty(t.prototype,"_id",{get:function(){return this.props.id||this._fallbackId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isControlled",{get:function(){return Oh(this.props,"value")},enumerable:!0,configurable:!0}),t.prototype._onRenderPrefix=function(e){var t=e.prefix;return b.createElement("span",{style:{paddingBottom:"1px"}},t)},t.prototype._onRenderSuffix=function(e){var t=e.suffix;return b.createElement("span",{style:{paddingBottom:"1px"}},t)},Object.defineProperty(t.prototype,"_errorMessage",{get:function(){var e=this.props.errorMessage;return(void 0===e?this.state.errorMessage:e)||""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isDescriptionAvailable",{get:function(){var e=this.props;return!!(e.onRenderDescription||e.description||this._errorMessage)},enumerable:!0,configurable:!0}),t.prototype._renderTextArea=function(){var e=fr(this.props,or,["defaultValue"]),t=this.props["aria-labelledby"]||(this.props.label?this._labelId:void 0);return b.createElement("textarea",h({id:this._id},e,{ref:this._textElement,value:this.value||"",onInput:this._onInputChange,onChange:this._onInputChange,className:this._classNames.field,"aria-labelledby":t,"aria-describedby":this._isDescriptionAvailable?this._descriptionId:this.props["aria-describedby"],"aria-invalid":!!this._errorMessage,"aria-label":this.props.ariaLabel,readOnly:this.props.readOnly,onFocus:this._onFocus,onBlur:this._onBlur}))},t.prototype._renderInput=function(){var e,t=fr(this.props,tr,["defaultValue","type"]),o=this.props["aria-labelledby"]||(this.props.label?this._labelId:void 0),n=this.state.isRevealingPassword?"text":null!=(e=this.props.type)?e:"text";return b.createElement("input",h({type:n,id:this._id,"aria-labelledby":o},t,{ref:this._textElement,value:this.value||"",onInput:this._onInputChange,onChange:this._onInputChange,className:this._classNames.field,"aria-label":this.props.ariaLabel,"aria-describedby":this._isDescriptionAvailable?this._descriptionId:this.props["aria-describedby"],"aria-invalid":!!this._errorMessage,readOnly:this.props.readOnly,onFocus:this._onFocus,onBlur:this._onBlur}))},t.prototype._validate=function(e){var t=this;if(this._latestValidateValue!==e||!vg(this.props)){this._latestValidateValue=e;var o=this.props.onGetErrorMessage,n=o&&o(e||"");if(void 0!==n)if("string"!=typeof n&&"then"in n){var r=++this._lastValidation;n.then((function(o){r===t._lastValidation&&t.setState({errorMessage:o}),t._notifyAfterValidate(e,o)}))}else this.setState({errorMessage:n}),this._notifyAfterValidate(e,n);else this._notifyAfterValidate(e,"")}},t.prototype._notifyAfterValidate=function(e,t){e===this.value&&this.props.onNotifyValidationResult&&this.props.onNotifyValidationResult(t,e)},t.prototype._adjustInputHeight=function(){if(this._textElement.current&&this.props.autoAdjustHeight&&this.props.multiline){var e=this._textElement.current;e.style.height="",e.style.height=e.scrollHeight+"px"}},t.defaultProps={resizable:!0,deferredValidationTime:200,validateOnLoad:!0,canRevealPassword:!1},t}(b.Component);function fg(e,t){var o=e.value,n=void 0===o?t.uncontrolledValue:o;return"number"==typeof n?String(n):n}function vg(e){return!(e.validateOnFocusIn||e.validateOnFocusOut)}var bg={root:"ms-TextField",description:"ms-TextField-description",errorMessage:"ms-TextField-errorMessage",field:"ms-TextField-field",fieldGroup:"ms-TextField-fieldGroup",prefix:"ms-TextField-prefix",suffix:"ms-TextField-suffix",wrapper:"ms-TextField-wrapper",revealButton:"ms-TextField-reveal",multiline:"ms-TextField--multiline",borderless:"ms-TextField--borderless",underlined:"ms-TextField--underlined",unresizable:"ms-TextField--unresizable",required:"is-required",disabled:"is-disabled",active:"is-active"};function _g(e){var t=e.underlined,o=e.disabled,n=e.focused,r=e.theme,i=r.palette,s=r.fonts;return function(){var e;return{root:[t&&o&&{color:i.neutralTertiary},t&&{fontSize:s.medium.fontSize,marginRight:8,paddingLeft:12,paddingRight:0,lineHeight:"22px",height:32},t&&n&&{selectors:(e={},e[jt]={height:31},e)}]}}}var yg=xn(gg,(function(e){var t,o,n,r,i,s,a,l,c,u,d,p,m=e.theme,g=e.className,f=e.disabled,v=e.focused,b=e.required,_=e.multiline,y=e.hasLabel,C=e.borderless,S=e.underlined,x=e.hasIcon,k=e.resizable,w=e.hasErrorMessage,I=e.inputClassName,D=e.autoAdjustHeight,P=e.hasRevealButton,T=m.semanticColors,E=m.effects,M=m.fonts,R=Oo(bg,m),B={background:T.disabledBackground,color:f?T.disabledText:T.inputPlaceholderText,display:"flex",alignItems:"center",padding:"0 10px",lineHeight:1,whiteSpace:"nowrap",flexShrink:0,selectors:(t={},t[jt]={background:"Window",color:f?"GrayText":"WindowText"},t)},N=[M.medium,{color:T.inputPlaceholderText,opacity:1,selectors:(o={},o[jt]={color:"GrayText"},o)}],F={color:T.disabledText,selectors:(n={},n[jt]={color:"GrayText"},n)};return{root:[R.root,M.medium,b&&R.required,f&&R.disabled,v&&R.active,_&&R.multiline,C&&R.borderless,S&&R.underlined,Uo,{position:"relative"},g],wrapper:[R.wrapper,S&&[{display:"flex",borderBottom:"1px solid "+(w?T.errorText:T.inputBorder),width:"100%"},f&&{borderBottomColor:T.disabledBackground,selectors:(r={},r[jt]=h({borderColor:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)},!f&&{selectors:{":hover":{borderBottomColor:w?T.errorText:T.inputBorderHovered,selectors:(i={},i[jt]=h({borderBottomColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)}}},v&&[{position:"relative"},_o(w?T.errorText:T.inputFocusBorderAlt,0,"borderBottom")]]],fieldGroup:[R.fieldGroup,Uo,{border:"1px solid "+T.inputBorder,borderRadius:E.roundedCorner2,background:T.inputBackground,cursor:"text",height:32,display:"flex",flexDirection:"row",alignItems:"stretch",position:"relative"},_&&{minHeight:"60px",height:"auto",display:"flex"},!v&&!f&&{selectors:{":hover":{borderColor:T.inputBorderHovered,selectors:(s={},s[jt]=h({borderColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s)}}},v&&!S&&_o(w?T.errorText:T.inputFocusBorderAlt,E.roundedCorner2),f&&{borderColor:T.disabledBackground,selectors:(a={},a[jt]=h({borderColor:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a),cursor:"default"},C&&{border:"none"},C&&v&&{border:"none",selectors:{":after":{border:"none"}}},S&&{flex:"1 1 0px",border:"none",textAlign:"left"},S&&f&&{backgroundColor:"transparent"},w&&!S&&{borderColor:T.errorText,selectors:{"&:hover":{borderColor:T.errorText}}},!y&&b&&{selectors:(l={":before":{content:"'*'",color:T.errorText,position:"absolute",top:-5,right:-10}},l[jt]={selectors:{":before":{color:"WindowText",right:-14}}},l)}],field:[M.medium,R.field,Uo,{borderRadius:0,border:"none",background:"none",backgroundColor:"transparent",color:T.inputText,padding:"0 8px",width:"100%",minWidth:0,textOverflow:"ellipsis",outline:0,selectors:(c={"&:active, &:focus, &:hover":{outline:0},"::-ms-clear":{display:"none"}},c[jt]={background:"Window",color:f?"GrayText":"WindowText"},c)},qo(N),_&&!k&&[R.unresizable,{resize:"none"}],_&&{minHeight:"inherit",lineHeight:17,flexGrow:1,paddingTop:6,paddingBottom:6,overflow:"auto",width:"100%"},_&&D&&{overflow:"hidden"},x&&!P&&{paddingRight:24},_&&x&&{paddingRight:40},f&&[{backgroundColor:T.disabledBackground,color:T.disabledText,borderColor:T.disabledBackground},qo(F)],S&&{textAlign:"left"},v&&!C&&{selectors:(u={},u[jt]={paddingLeft:11,paddingRight:11},u)},v&&_&&!C&&{selectors:(d={},d[jt]={paddingTop:4},d)},I],icon:[_&&{paddingRight:24,alignItems:"flex-end"},{pointerEvents:"none",position:"absolute",bottom:6,right:8,top:"auto",fontSize:je.medium,lineHeight:18},f&&{color:T.disabledText}],description:[R.description,{color:T.bodySubtext,fontSize:M.xSmall.fontSize}],errorMessage:[R.errorMessage,Ye.slideDownIn20,M.small,{color:T.errorText,margin:0,paddingTop:5,display:"flex",alignItems:"center"}],prefix:[R.prefix,B],suffix:[R.suffix,B],revealButton:[R.revealButton,"ms-Button","ms-Button--icon",{height:30,width:32,border:"none",padding:"0px 4px",backgroundColor:"transparent",color:T.link,selectors:{":hover":{outline:0,color:T.primaryButtonBackgroundHovered,backgroundColor:T.buttonBackgroundHovered,selectors:(p={},p[jt]={borderColor:"Highlight",color:"Highlight"},p)},":focus":{outline:0}}},x&&{marginRight:28}],revealSpan:{display:"flex",height:"100%",alignItems:"center"},revealIcon:{margin:"0px 4px",pointerEvents:"none",bottom:6,right:8,top:"auto",fontSize:je.medium,lineHeight:18},subComponentStyles:{label:_g(e)}}}),void 0,{scope:"TextField"}),Cg=Mn(),Sg=function(e){function t(t){var o=e.call(this,t)||this;return o._disposables=[],o._root=b.createRef(),o._isAdjustingSaturation=!0,o._descriptionId=ts("ColorRectangle-description"),o._onKeyDown=function(e){var t=o.state.color,n=t.s,r=t.v,i=e.shiftKey?10:1;switch(e.which){case wn.up:o._isAdjustingSaturation=!1,r+=i;break;case wn.down:o._isAdjustingSaturation=!1,r-=i;break;case wn.left:o._isAdjustingSaturation=!0,n-=i;break;case wn.right:o._isAdjustingSaturation=!0,n+=i;break;default:return}o._updateColor(e,Wm(t,Em(n,hm),Em(r,gm)))},o._onMouseDown=function(e){o._disposables.push(Ga(window,"mousemove",o._onMouseMove,!0),Ga(window,"mouseup",o._disposeListeners,!0)),o._onMouseMove(e)},o._onMouseMove=function(e){if(o._root.current){var t=function(e,t,o){var n=o.getBoundingClientRect(),r=(e.clientX-n.left)/n.width,i=(e.clientY-n.top)/n.height;return Wm(t,Em(Math.round(r*hm),hm),Em(Math.round(gm-i*gm),gm))}(e,o.state.color,o._root.current);t&&o._updateColor(e,t)}},o._disposeListeners=function(){o._disposables.forEach((function(e){return e()})),o._disposables=[]},si(o),o.state={color:t.color},o}return p(t,e),Object.defineProperty(t.prototype,"color",{get:function(){return this.state.color},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){e!==this.props&&this.props.color&&this.setState({color:this.props.color})},t.prototype.componentWillUnmount=function(){this._disposeListeners()},t.prototype.render=function(){var e=this.props,t=e.minSize,o=e.theme,n=e.className,r=e.styles,i=e.ariaValueFormat,s=e.ariaLabel,a=e.ariaDescription,l=this.state.color,c=Cg(r,{theme:o,className:n,minSize:t}),u=i.replace("{0}",String(l.s)).replace("{1}",String(l.v));return b.createElement("div",{ref:this._root,tabIndex:0,className:c.root,style:{backgroundColor:zm(l)},onMouseDown:this._onMouseDown,onKeyDown:this._onKeyDown,role:"slider","aria-valuetext":u,"aria-valuenow":this._isAdjustingSaturation?l.s:l.v,"aria-valuemin":0,"aria-valuemax":gm,"aria-label":s,"aria-describedby":this._descriptionId,"data-is-focusable":!0},b.createElement("div",{className:c.description,id:this._descriptionId},a),b.createElement("div",{className:c.light}),b.createElement("div",{className:c.dark}),b.createElement("div",{className:c.thumb,style:{left:l.s+"%",top:gm-l.v+"%",backgroundColor:l.str}}))},t.prototype._updateColor=function(e,t){var o=this.props.onChange,n=this.state.color;t.s===n.s&&t.v===n.v||(o&&o(e,t),e.defaultPrevented||(this.setState({color:t}),e.preventDefault()))},t.defaultProps={minSize:220,ariaLabel:"Saturation and brightness",ariaValueFormat:"Saturation {0} brightness {1}",ariaDescription:"Use left and right arrow keys to set saturation. Use up and down arrow keys to set brightness."},t}(b.Component);var xg=xn(Sg,(function(e){var t,o=e.className,n=e.theme,r=e.minSize,i=n.palette,s=n.effects;return{root:["ms-ColorPicker-colorRect",{position:"relative",marginBottom:8,border:"1px solid "+i.neutralLighter,borderRadius:s.roundedCorner2,minWidth:r,minHeight:r,outline:"none",selectors:(t={},t[jt]=h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t["."+ho+" &:focus"]={outline:"1px solid "+i.neutralSecondary},t)},o],light:["ms-ColorPicker-light",{position:"absolute",left:0,right:0,top:0,bottom:0,background:"linear-gradient(to right, white 0%, transparent 100%) /*@noflip*/"}],dark:["ms-ColorPicker-dark",{position:"absolute",left:0,right:0,top:0,bottom:0,background:"linear-gradient(to bottom, transparent 0, #000 100%)"}],thumb:["ms-ColorPicker-thumb",{position:"absolute",width:20,height:20,background:"white",border:"1px solid "+i.neutralSecondaryAlt,borderRadius:"50%",boxShadow:s.elevation8,transform:"translate(-50%, -50%)",selectors:{":before":{position:"absolute",left:0,right:0,top:0,bottom:0,border:"2px solid "+i.white,borderRadius:"50%",boxSizing:"border-box",content:'""'}}}],description:yo}}),void 0,{scope:"ColorRectangle"}),kg=Mn(),wg=function(e){function t(t){var o=e.call(this,t)||this;return o._disposables=[],o._root=b.createRef(),o._onKeyDown=function(e){var t=o.value,n=o._maxValue,r=e.shiftKey?10:1;switch(e.which){case wn.left:t-=r;break;case wn.right:t+=r;break;case wn.home:t=0;break;case wn.end:t=n;break;default:return}o._updateValue(e,Em(t,n))},o._onMouseDown=function(e){var t=rt(o);t&&o._disposables.push(Ga(t,"mousemove",o._onMouseMove,!0),Ga(t,"mouseup",o._disposeListeners,!0)),o._onMouseMove(e)},o._onMouseMove=function(e){if(o._root.current){var t=o._maxValue,n=o._root.current.getBoundingClientRect(),r=(e.clientX-n.left)/n.width,i=Em(Math.round(r*t),t);o._updateValue(e,i)}},o._disposeListeners=function(){o._disposables.forEach((function(e){return e()})),o._disposables=[]},si(o),"hue"===o._type||t.overlayColor||t.overlayStyle||Zo("ColorSlider: 'overlayColor' is required when 'type' is \"alpha\" or \"transparency\""),o.state={currentValue:t.value||0},o}return p(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.state.currentValue},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){e!==this.props&&void 0!==this.props.value&&this.setState({currentValue:this.props.value})},t.prototype.componentWillUnmount=function(){this._disposeListeners()},t.prototype.render=function(){var e=this._type,t=this._maxValue,o=this.props,n=o.overlayStyle,r=o.overlayColor,i=o.theme,s=o.className,a=o.styles,l=o.ariaLabel,c=void 0===l?e:l,u=this.value,d=kg(a,{theme:i,className:s,type:e}),p=100*u/t;return b.createElement("div",{ref:this._root,className:d.root,tabIndex:0,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,role:"slider","aria-valuenow":u,"aria-valuetext":String(u),"aria-valuemin":0,"aria-valuemax":t,"aria-label":c,"data-is-focusable":!0},!(!r&&!n)&&b.createElement("div",{className:d.sliderOverlay,style:r?{background:"transparency"===e?"linear-gradient(to right, #"+r+", transparent)":"linear-gradient(to right, transparent, #"+r+")"}:n}),b.createElement("div",{className:d.sliderThumb,style:{left:p+"%"}}))},Object.defineProperty(t.prototype,"_type",{get:function(){var e=this.props,t=e.isAlpha,o=e.type;return void 0===o?t?"alpha":"hue":o},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_maxValue",{get:function(){return"hue"===this._type?mm:bm},enumerable:!0,configurable:!0}),t.prototype._updateValue=function(e,t){if(t!==this.value){var o=this.props.onChange;o&&o(e,t),e.defaultPrevented||(this.setState({currentValue:t}),e.preventDefault())}},t.defaultProps={value:0},t}(b.Component),Ig={background:"linear-gradient("+["to left","red 0","#f09 10%","#cd00ff 20%","#3200ff 30%","#06f 40%","#00fffd 50%","#0f6 60%","#35ff00 70%","#cdff00 80%","#f90 90%","red 100%"].join(",")+")"},Dg={backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJUlEQVQYV2N89erVfwY0ICYmxoguxjgUFKI7GsTH5m4M3w1ChQC1/Ca8i2n1WgAAAABJRU5ErkJggg==)"},Pg=xn(wg,(function(e){var t,o=e.theme,n=e.className,r=e.type,i=void 0===r?"hue":r,s=e.isAlpha,a=void 0===s?"hue"!==i:s,l=o.palette,c=o.effects;return{root:["ms-ColorPicker-slider",{position:"relative",height:20,marginBottom:8,border:"1px solid "+l.neutralLight,borderRadius:c.roundedCorner2,boxSizing:"border-box",outline:"none",selectors:(t={},t["."+ho+" &:focus"]={outline:"1px solid "+l.neutralSecondary},t)},a?Dg:Ig,n],sliderOverlay:["ms-ColorPicker-sliderOverlay",{content:"",position:"absolute",left:0,right:0,top:0,bottom:0}],sliderThumb:["ms-ColorPicker-thumb","is-slider",{position:"absolute",width:20,height:20,background:"white",border:"1px solid "+l.neutralSecondaryAlt,borderRadius:"50%",boxShadow:c.elevation8,transform:"translate(-50%, -50%)",top:"50%"}]}}),void 0,{scope:"ColorSlider"}),Tg=Mn(),Eg=["hex","r","g","b","a","t"],Mg=function(e){function t(o){var n=e.call(this,o)||this;n._onSVChanged=function(e,t){n._updateColor(e,t)},n._onHChanged=function(e,t){n._updateColor(e,Vm(n.state.color,t))},n._onATChanged=function(e,t){var o="transparency"===n.props.alphaType?ug:Um;n._updateColor(e,o(n.state.color,Math.round(t)))},n._onBlur=function(e){var t,o=n.state,r=o.color,i=o.editingColor;if(i){var s=i.value,a=i.component,l="hex"===a,c="a"===a,u="t"===a,d=l?_m:Cm;if(s.length>=d&&(l||!isNaN(Number(s)))){var p=void 0;if(l)p=Hm("#"+Ym(s));else if(c||u){p=(c?Um:ug)(r,Em(Number(s),bm))}else p=Lm(Gm(h(h({},r),((t={})[a]=Number(s),t))));n._updateColor(e,p)}else n.setState({editingColor:void 0})}},si(n);var r=o.strings;r.hue&&Zo("ColorPicker property 'strings.hue' was used but has been deprecated. Use 'strings.hueAriaLabel' instead."),n.state={color:Rg(o)||Hm("#ffffff")},n._textChangeHandlers={};for(var i=0,s=Eg;i<s.length;i++){var a=s[i];n._textChangeHandlers[a]=n._onTextChange.bind(n,a)}var l=t.defaultProps.strings;return n._textLabels={r:o.redLabel||r.red||l.red,g:o.greenLabel||r.green||l.green,b:o.blueLabel||r.blue||l.blue,a:o.alphaLabel||r.alpha||l.alpha,hex:o.hexLabel||r.hex||l.hex,t:r.transparency||l.transparency},n._strings=h(h(h({},l),{alphaAriaLabel:n._textLabels.a,transparencyAriaLabel:n._textLabels.t}),r),n}return p(t,e),Object.defineProperty(t.prototype,"color",{get:function(){return this.state.color},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){if(e!==this.props){var o=Rg(this.props);o&&this._updateColor(void 0,o)}},t.prototype.render=function(){var e=this,t=this.props,o=this._strings,n=this._textLabels,r=t.theme,i=t.className,s=t.styles,a=t.alphaType,l=t.alphaSliderHidden,c=void 0===l?"none"===a:l,u=this.state.color,d="transparency"===a,p=["hex","r","g","b",d?"t":"a"],h=d?u.t:u.a,m=d?n.t:n.a,g=Tg(s,{theme:r,className:i,alphaType:a}),f=[n.r,u.r,n.g,u.g,n.b,u.b];c||"number"!=typeof h||f.push(m,h+"%");var v=o.rootAriaLabelFormat.replace("{0}",f.join(" "));return b.createElement("div",{className:g.root,role:"group","aria-label":v},b.createElement("div",{className:g.panel},b.createElement(xg,{color:u,onChange:this._onSVChanged,ariaLabel:o.svAriaLabel,ariaDescription:o.svAriaDescription,ariaValueFormat:o.svAriaValueFormat,className:g.colorRectangle}),b.createElement("div",{className:g.flexContainer},b.createElement("div",{className:g.flexSlider},b.createElement(Pg,{className:"is-hue",type:"hue",ariaLabel:o.hue||o.hueAriaLabel,value:u.h,onChange:this._onHChanged}),!c&&b.createElement(Pg,{className:"is-alpha",type:a,ariaLabel:d?o.transparencyAriaLabel:o.alphaAriaLabel,overlayColor:u.hex,value:h,onChange:this._onATChanged})),t.showPreview&&b.createElement("div",{className:g.flexPreviewBox},b.createElement("div",{className:g.colorSquare+" is-preview",style:{backgroundColor:u.str}}))),b.createElement("table",{className:g.table,role:"group",cellPadding:"0",cellSpacing:"0"},b.createElement("thead",null,b.createElement("tr",{className:g.tableHeader},b.createElement("td",{className:g.tableHexCell},n.hex),b.createElement("td",null,n.r),b.createElement("td",null,n.g),b.createElement("td",null,n.b),!c&&b.createElement("td",{className:g.tableAlphaCell},m))),b.createElement("tbody",null,b.createElement("tr",null,p.map((function(t){return"a"!==t&&"t"!==t||!c?b.createElement("td",{key:t},b.createElement(yg,{className:g.input,onChange:e._textChangeHandlers[t],onBlur:e._onBlur,value:e._getDisplayValue(t),spellCheck:!1,ariaLabel:n[t],"aria-live":"hex"!==t?"assertive":void 0,autoComplete:"off"})):null})))))))},t.prototype._getDisplayValue=function(e){var t=this.state,o=t.color,n=t.editingColor;return n&&n.component===e?n.value:"hex"===e?o[e]||"":"number"!=typeof o[e]||isNaN(o[e])?"":String(o[e])},t.prototype._onTextChange=function(e,t,o){var n,r=this.state.color,i="hex"===e,s="a"===e,a="t"===e;if(o=(o||"").substr(0,i?ym:Sm),(i?xm:km).test(o))if(""!==o&&(i?o.length===ym:s||a?Number(o)<=bm:Number(o)<=fm))if(String(r[e])===o)this.state.editingColor&&this.setState({editingColor:void 0});else{var l=i?Hm("#"+o):a?ug(r,Number(o)):Lm(h(h({},r),((n={})[e]=Number(o),n)));this._updateColor(t,l)}else this.setState({editingColor:{component:e,value:o}})},t.prototype._updateColor=function(e,t){if(t){var o=this.state,n=o.color,r=o.editingColor;if(t.h!==n.h||t.str!==n.str||r){if(e&&this.props.onChange&&(this.props.onChange(e,t),e.defaultPrevented))return;this.setState({color:t,editingColor:void 0})}}},t.defaultProps={alphaType:"alpha",strings:{rootAriaLabelFormat:"Color picker, {0} selected.",hex:"Hex",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha",transparency:"Transparency",hueAriaLabel:"Hue",svAriaLabel:Sg.defaultProps.ariaLabel,svAriaValueFormat:Sg.defaultProps.ariaValueFormat,svAriaDescription:Sg.defaultProps.ariaDescription}},t}(b.Component);function Rg(e){var t=e.color;return"string"==typeof t?Hm(t):t}var Bg,Ng,Fg,Ag=xn(Mg,(function(e){var t=e.className,o=e.theme,n=e.alphaType;return{root:["ms-ColorPicker",o.fonts.medium,{position:"relative",maxWidth:300},t],panel:["ms-ColorPicker-panel",{padding:"16px"}],table:["ms-ColorPicker-table",{tableLayout:"fixed",width:"100%",selectors:{"tbody td:last-of-type .ms-ColorPicker-input":{paddingRight:0}}}],tableHeader:[o.fonts.small,{selectors:{td:{paddingBottom:4}}}],tableHexCell:{width:"25%"},tableAlphaCell:"transparency"===n&&{width:"22%"},colorSquare:["ms-ColorPicker-colorSquare",{width:48,height:48,margin:"0 0 0 8px",border:"1px solid #c8c6c4"}],flexContainer:{display:"flex"},flexSlider:{flexGrow:"1"},flexPreviewBox:{flexGrow:"0"},input:["ms-ColorPicker-input",{width:"100%",border:"none",boxSizing:"border-box",height:30,selectors:{"&.ms-TextField":{paddingRight:4},"& .ms-TextField-field":{minWidth:"auto",padding:5,textOverflow:"clip"}}}]}}),void 0,{scope:"ColorPicker"});!function(e){e[e.Normal=0]="Normal",e[e.Divider=1]="Divider",e[e.Header=2]="Header"}(Bg||(Bg={}));var Lg,Hg,Og=No((function(e){var t,o=e.semanticColors;return{backgroundColor:o.disabledBackground,color:o.disabledText,cursor:"default",selectors:(t={":after":{borderColor:o.disabledBackground}},t[jt]={color:"GrayText",selectors:{":after":{borderColor:"GrayText"}}},t)}})),zg={selectors:(Ng={},Ng[jt]=h({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),Ng)},Wg={selectors:(Fg={},Fg[jt]=h({color:"WindowText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),Fg)},Vg=No((function(e,t,o,n,r){var i,s=e.palette,a=e.semanticColors,l={textHoveredColor:a.menuItemTextHovered,textSelectedColor:s.neutralDark,textDisabledColor:a.disabledText,backgroundHoveredColor:a.menuItemBackgroundHovered,backgroundPressedColor:a.menuItemBackgroundPressed};return dn({root:[e.fonts.medium,{backgroundColor:n?l.backgroundHoveredColor:"transparent",boxSizing:"border-box",cursor:"pointer",display:r?"none":"block",width:"100%",height:"auto",minHeight:36,lineHeight:"20px",padding:"0 8px",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",borderRadius:0,wordWrap:"break-word",overflowWrap:"break-word",textAlign:"left",selectors:(i={},i[jt]={border:"none",borderColor:"Background"},i["&.ms-Checkbox"]={display:"flex",alignItems:"center"},i["&.ms-Button--command:hover:active"]={backgroundColor:l.backgroundPressedColor},i[".ms-Checkbox-label"]={width:"100%"},i)}],rootHovered:{backgroundColor:l.backgroundHoveredColor,color:l.textHoveredColor},rootFocused:{backgroundColor:l.backgroundHoveredColor},rootChecked:[{backgroundColor:"transparent",color:l.textSelectedColor,selectors:{":hover":[{backgroundColor:l.backgroundHoveredColor},zg]}},go(e,{inset:-1,isFocusedOnly:!1}),zg],rootDisabled:{color:l.textDisabledColor,cursor:"default"},optionText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",minWidth:"0px",maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",display:"inline-block"},optionTextWrapper:{maxWidth:"100%",display:"flex",alignItems:"center"}},t,o)})),Kg=No((function(e,t){var o,n,r=e.semanticColors,i=e.fonts,s={buttonTextColor:r.bodySubtext,buttonTextHoveredCheckedColor:r.buttonTextChecked,buttonBackgroundHoveredColor:r.listItemBackgroundHovered,buttonBackgroundCheckedColor:r.listItemBackgroundChecked,buttonBackgroundCheckedHoveredColor:r.listItemBackgroundCheckedHovered},a={selectors:(o={},o[jt]=h({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)};return dn({root:{color:s.buttonTextColor,fontSize:i.small.fontSize,position:"absolute",top:0,height:"100%",lineHeight:30,width:32,textAlign:"center",cursor:"default",selectors:(n={},n[jt]=h({backgroundColor:"ButtonFace",borderColor:"ButtonText",color:"ButtonText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)},icon:{fontSize:i.small.fontSize},rootHovered:[{backgroundColor:s.buttonBackgroundHoveredColor,color:s.buttonTextHoveredCheckedColor,cursor:"pointer"},a],rootPressed:[{backgroundColor:s.buttonBackgroundCheckedColor,color:s.buttonTextHoveredCheckedColor},a],rootChecked:[{backgroundColor:s.buttonBackgroundCheckedColor,color:s.buttonTextHoveredCheckedColor},a],rootCheckedHovered:[{backgroundColor:s.buttonBackgroundCheckedHoveredColor,color:s.buttonTextHoveredCheckedColor},a],rootDisabled:[Og(e),{position:"absolute"}]},t)})),Ug=No((function(e,t,o){var n,r,i,s,a,l,c=e.semanticColors,u=e.fonts,d=e.effects,p={textColor:c.inputText,borderColor:c.inputBorder,borderHoveredColor:c.inputBorderHovered,borderPressedColor:c.inputFocusBorderAlt,borderFocusedColor:c.inputFocusBorderAlt,backgroundColor:c.inputBackground,erroredColor:c.errorText},m={headerTextColor:c.menuHeader,dividerBorderColor:c.bodyDivider},g={selectors:(n={},n[jt]={color:"GrayText"},n)},f=[{color:c.inputPlaceholderText},g],v=[{color:c.inputTextHovered},g],b=[{color:c.disabledText},g],_=h(h({color:"HighlightText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{":after":{borderColor:"Highlight"}}}),y=_o(p.borderPressedColor,d.roundedCorner2,"border",0);return dn({container:{},label:{},labelDisabled:{},root:[e.fonts.medium,{boxShadow:"none",marginLeft:"0",paddingRight:32,paddingLeft:9,color:p.textColor,position:"relative",outline:"0",userSelect:"none",backgroundColor:p.backgroundColor,cursor:"text",display:"block",height:32,whiteSpace:"nowrap",textOverflow:"ellipsis",boxSizing:"border-box",selectors:{".ms-Label":{display:"inline-block",marginBottom:"8px"},"&.is-open":{selectors:(r={},r[jt]=_,r)},":after":{pointerEvents:"none",content:"''",position:"absolute",left:0,top:0,bottom:0,right:0,borderWidth:"1px",borderStyle:"solid",borderColor:p.borderColor,borderRadius:d.roundedCorner2}}}],rootHovered:{selectors:(i={":after":{borderColor:p.borderHoveredColor},".ms-ComboBox-Input":[{color:c.inputTextHovered},qo(v),Wg]},i[jt]=h(h({color:"HighlightText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{":after":{borderColor:"Highlight"}}}),i)},rootPressed:[{position:"relative",selectors:(s={},s[jt]=_,s)}],rootFocused:[{selectors:(a={".ms-ComboBox-Input":[{color:c.inputTextHovered},Wg]},a[jt]=_,a)},y],rootDisabled:Og(e),rootError:{selectors:{":after":{borderColor:p.erroredColor},":hover:after":{borderColor:c.inputBorderHovered}}},rootDisallowFreeForm:{},input:[qo(f),{backgroundColor:p.backgroundColor,color:p.textColor,boxSizing:"border-box",width:"100%",height:"100%",borderStyle:"none",outline:"none",font:"inherit",textOverflow:"ellipsis",padding:"0",selectors:{"::-ms-clear":{display:"none"}}},Wg],inputDisabled:[Og(e),qo(b)],errorMessage:[e.fonts.small,{color:p.erroredColor,marginTop:"5px"}],callout:{boxShadow:d.elevation8},optionsContainerWrapper:{width:o},optionsContainer:{display:"block"},screenReaderText:yo,header:[u.medium,{fontWeight:Ge.semibold,color:m.headerTextColor,backgroundColor:"none",borderStyle:"none",height:36,lineHeight:36,cursor:"default",padding:"0 8px",userSelect:"none",textAlign:"left",selectors:(l={},l[jt]=h({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),l)}],divider:{height:1,backgroundColor:m.dividerBorderColor}},t)})),Gg=No((function(e,t,o,n,r,i,s,a){return{container:Q("ms-ComboBox-container",t,e.container),label:Q(e.label,n&&e.labelDisabled),root:Q("ms-ComboBox",a?e.rootError:o&&"is-open",r&&"is-required",e.root,!s&&e.rootDisallowFreeForm,a&&!i?e.rootError:!n&&i&&e.rootFocused,!n&&{selectors:{":hover":a?e.rootError:!o&&!i&&e.rootHovered,":active":a?e.rootError:e.rootPressed,":focus":a?e.rootError:e.rootFocused}},n&&["is-disabled",e.rootDisabled]),input:Q("ms-ComboBox-Input",e.input,n&&e.inputDisabled),errorMessage:Q(e.errorMessage),callout:Q("ms-ComboBox-callout",e.callout),optionsContainerWrapper:Q("ms-ComboBox-optionsContainerWrapper",e.optionsContainerWrapper),optionsContainer:Q("ms-ComboBox-optionsContainer",e.optionsContainer),header:Q("ms-ComboBox-header",e.header),divider:Q("ms-ComboBox-divider",e.divider),screenReaderText:Q(e.screenReaderText)}})),jg=No((function(e){return{optionText:Q("ms-ComboBox-optionText",e.optionText),root:Q("ms-ComboBox-option",e.root,{selectors:{":hover":e.rootHovered,":focus":e.rootFocused,":active":e.rootPressed}}),optionTextWrapper:Q(e.optionTextWrapper)}}));function Yg(e,t){for(var o=[],n=0,r=t;n<r.length;n++){var i=e[r[n]];i&&o.push(i)}return o}!function(e){e[e.backward=-1]="backward",e[e.none=0]="none",e[e.forward=1]="forward"}(Lg||(Lg={})),function(e){e[e.clearAll=-2]="clearAll",e[e.default=-1]="default"}(Hg||(Hg={}));var qg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){return this.props.render()},t.prototype.shouldComponentUpdate=function(e){return!Fs(h(h({},this.props),{render:void 0}),h(h({},e),{render:void 0}))},t}(b.Component),Zg=function(e){function t(t){var o=e.call(this,t)||this;o._root=b.createRef(),o._autofill=b.createRef(),o._comboBoxWrapper=b.createRef(),o._comboBoxMenu=b.createRef(),o._selectedElement=b.createRef(),o.focus=function(e,t){o._autofill.current&&(t?Zi(o._autofill.current):o._autofill.current.focus(),e&&o.setState({isOpen:!0})),o._hasFocus()||o.setState({focusState:"focused"})},o.dismissMenu=function(){o.state.isOpen&&o.setState({isOpen:!1})},o._onUpdateValueInAutofillWillReceiveProps=function(){var e=o._autofill.current;if(!e)return null;if(null===e.value||void 0===e.value)return null;var t=o._normalizeToString(o._currentVisibleValue);return e.value!==t?t||"":e.value},o._renderComboBoxWrapper=function(e,t,n){void 0===n&&(n={});var r=o.props,i=r.label,s=r.disabled,a=r.ariaLabel,l=r.ariaDescribedBy,c=r.required,u=r.errorMessage,d=r.buttonIconProps,p=r.isButtonAriaHidden,m=void 0===p||p,g=r.title,f=r.placeholder,v=r.tabIndex,_=r.autofill,y=r.iconButtonProps,C=o.state,S=C.isOpen,x=C.suggestedDisplayValue,k=o._hasFocus()&&o.props.multiSelect&&e?e:f;return b.createElement("div",{"data-ktp-target":n["data-ktp-target"],ref:o._comboBoxWrapper,id:o._id+"wrapper",className:o._classNames.root},b.createElement(pi,h({"data-ktp-execute-target":n["data-ktp-execute-target"],"data-is-interactable":!s,componentRef:o._autofill,id:o._id+"-input",className:o._classNames.input,type:"text",onFocus:o._onFocus,onBlur:o._onBlur,onKeyDown:o._onInputKeyDown,onKeyUp:o._onInputKeyUp,onClick:o._onAutofillClick,onTouchStart:o._onTouchStart,onInputValueChange:o._onInputChange,"aria-expanded":S,"aria-autocomplete":o._getAriaAutoCompleteValue(),role:"combobox",readOnly:s,"aria-labelledby":i&&o._id+"-label","aria-label":a&&!i?a:void 0,"aria-describedby":void 0!==u?Ns(l,n["aria-describedby"],t):Ns(l,n["aria-describedby"]),"aria-activedescendant":o._getAriaActiveDescendantValue(),"aria-required":c,"aria-disabled":s,"aria-owns":S?o._id+"-list":void 0,spellCheck:!1,defaultVisibleValue:o._currentVisibleValue,suggestedDisplayValue:x,updateValueInWillReceiveProps:o._onUpdateValueInAutofillWillReceiveProps,shouldSelectFullInputValueInComponentDidUpdate:o._onShouldSelectFullInputValueInAutofillComponentDidUpdate,title:g,preventValueSelection:!o._hasFocus(),placeholder:k,tabIndex:v},_)),b.createElement(eu,h({className:"ms-ComboBox-CaretDown-button",styles:o._getCaretButtonStyles(),role:"presentation","aria-hidden":m,"data-is-focusable":!1,tabIndex:-1,onClick:o._onComboBoxClick,onBlur:o._onBlur,iconProps:d,disabled:s,checked:S},y)))},o._onShouldSelectFullInputValueInAutofillComponentDidUpdate=function(){return o._currentVisibleValue===o.state.suggestedDisplayValue},o._getVisibleValue=function(){var e=o.props,t=e.text,n=e.allowFreeform,r=e.autoComplete,i=o.state,s=i.selectedIndices,a=i.currentPendingValueValidIndex,l=i.currentOptions,c=i.currentPendingValue,u=i.suggestedDisplayValue,d=i.isOpen,p=o._indexWithinBounds(l,a);if((!d||!p)&&t&&null==c)return t;if(o.props.multiSelect){if(o._hasFocus()){var h=-1;return"on"===r&&p&&(h=a),o._getPendingString(c,l,h)}return o._getMultiselectDisplayString(s,l,u)}h=o._getFirstSelectedIndex();return n?("on"===r&&p&&(h=a),o._getPendingString(c,l,h)):p&&"on"===r?(h=a,o._normalizeToString(c)):!o.state.isOpen&&c?o._indexWithinBounds(l,h)?c:o._normalizeToString(u):o._indexWithinBounds(l,h)?l[h].text:o._normalizeToString(u)},o._onInputChange=function(e){o.props.disabled?o._handleInputWhenDisabled(null):o.props.allowFreeform?o._processInputChangeWithFreeform(e):o._processInputChangeWithoutFreeform(e)},o._onFocus=function(){o._autofill.current&&o._autofill.current.inputElement&&o._autofill.current.inputElement.select(),o._hasFocus()||o.setState({focusState:"focusing"})},o._onResolveOptions=function(){if(o.props.onResolveOptions){var e=o.props.onResolveOptions(f(o.state.currentOptions));if(Array.isArray(e))o.setState({currentOptions:e});else if(e&&e.then){var t=o._currentPromise=e;t.then((function(e){t===o._currentPromise&&o.setState({currentOptions:e})}))}}},o._onBlur=function(e){var t=e.relatedTarget;if(null===e.relatedTarget&&(t=document.activeElement),t&&(o._root.current&&o._root.current.contains(t)||o._comboBoxMenu.current&&(o._comboBoxMenu.current.contains(t)||Ri(o._comboBoxMenu.current,(function(e){return e===t})))))return e.preventDefault(),void e.stopPropagation();o._hasFocus()&&(o.setState({focusState:"none"}),o.props.multiSelect&&!o.props.allowFreeform||o._submitPendingValue(e))},o._onRenderContainer=function(e){var t=e.onRenderList,n=e.calloutProps,r=e.dropdownWidth,i=e.dropdownMaxWidth,s=e.onRenderUpperContent,a=void 0===s?o._onRenderUpperContent:s,l=e.onRenderLowerContent,c=void 0===l?o._onRenderLowerContent:l,u=e.useComboBoxAsMenuWidth,d=e.persistMenu,p=e.shouldRestoreFocus,m=void 0===p||p,g=o.state.isOpen,f=u&&o._comboBoxWrapper.current?o._comboBoxWrapper.current.clientWidth+2:void 0;return b.createElement(uc,h({isBeakVisible:!1,gapSpace:0,doNotLayer:!1,directionalHint:ya.bottomLeftEdge,directionalHintFixed:!1},n,{onLayerMounted:o._onLayerMounted,className:Sr(o._classNames.callout,n?n.className:void 0),target:o._comboBoxWrapper.current,onDismiss:o._onDismiss,onMouseDown:o._onCalloutMouseDown,onScroll:o._onScroll,setInitialFocus:!1,calloutWidth:u&&o._comboBoxWrapper.current?f&&f:r,calloutMaxWidth:i||f,hidden:d?!g:void 0,shouldRestoreFocus:m}),a(o.props,o._onRenderUpperContent),b.createElement("div",{className:o._classNames.optionsContainerWrapper,ref:o._comboBoxMenu},t(h({},e),o._onRenderList)),c(o.props,o._onRenderLowerContent))},o._onLayerMounted=function(){o._onCalloutLayerMounted(),o.props.calloutProps&&o.props.calloutProps.onLayerMounted&&o.props.calloutProps.onLayerMounted()},o._onRenderLabel=function(e){var t=e.props,n=t.label,r=t.disabled,i=t.required;return n?b.createElement(Hh,{id:o._id+"-label",disabled:r,required:i,className:o._classNames.label},n,e.multiselectAccessibleText&&b.createElement("span",{className:o._classNames.screenReaderText},e.multiselectAccessibleText)):null},o._onRenderList=function(e){var t=e.onRenderItem,n=e.options,r=o._id;return b.createElement("div",{id:r+"-list",className:o._classNames.optionsContainer,"aria-labelledby":r+"-label",role:"listbox"},n.map((function(e){return t(e,o._onRenderItem)})))},o._onRenderItem=function(e){switch(e.itemType){case Bg.Divider:return o._renderSeparator(e);case Bg.Header:return o._renderHeader(e);default:return o._renderOption(e)}},o._onRenderLowerContent=function(){return null},o._onRenderUpperContent=function(){return null},o._renderOption=function(e){var t=o.props.onRenderOption,n=void 0===t?o._onRenderOptionContent:t,r=o._id,i=o._isOptionSelected(e.index),s=o._isOptionChecked(e.index),a=o._getCurrentOptionStyles(e),l=jg(o._getCurrentOptionStyles(e)),c=o._getPreviewText(e),u=function(){return n(e,o._onRenderOptionContent)};return b.createElement(qg,{key:e.key,index:e.index,disabled:e.disabled,isSelected:i,isChecked:s,text:e.text,render:function(){return o.props.multiSelect?b.createElement(Fh,{id:r+"-list"+e.index,ariaLabel:o._getPreviewText(e),key:e.key,"data-index":e.index,styles:a,className:"ms-ComboBox-option","data-is-focusable":!0,onChange:o._onItemClick(e),label:e.text,role:"option",checked:s,title:c,disabled:e.disabled,onRenderLabel:u,inputProps:{"aria-selected":i?"true":"false"}}):b.createElement(Yu,{id:r+"-list"+e.index,key:e.key,"data-index":e.index,styles:a,checked:i,className:"ms-ComboBox-option",onClick:o._onItemClick(e),onMouseEnter:o._onOptionMouseEnter.bind(o,e.index),onMouseMove:o._onOptionMouseMove.bind(o,e.index),onMouseLeave:o._onOptionMouseLeave,role:"option","aria-selected":i?"true":"false",ariaLabel:o._getPreviewText(e),disabled:e.disabled,title:c},b.createElement("span",{className:l.optionTextWrapper,ref:i?o._selectedElement:void 0},n(e,o._onRenderOptionContent)))},data:e.data})},o._onCalloutMouseDown=function(e){e.preventDefault()},o._onScroll=function(){o._isScrollIdle||void 0===o._scrollIdleTimeoutId?o._isScrollIdle=!1:(o._async.clearTimeout(o._scrollIdleTimeoutId),o._scrollIdleTimeoutId=void 0),o._scrollIdleTimeoutId=o._async.setTimeout((function(){o._isScrollIdle=!0}),250)},o._onRenderOptionContent=function(e){var t=jg(o._getCurrentOptionStyles(e));return b.createElement("span",{className:t.optionText},e.text)},o._onDismiss=function(){var e=o.props.onMenuDismiss;e&&e(),o.props.persistMenu&&o._onCalloutLayerMounted(),o._setOpenStateAndFocusOnClose(!1,!1),o._resetSelectedIndex()},o._onAfterClearPendingInfo=function(){o._processingClearPendingInfo=!1},o._onInputKeyDown=function(e){var t=o.props,n=t.disabled,r=t.allowFreeform,i=t.autoComplete,s=o.state,a=s.isOpen,l=s.currentOptions,c=s.currentPendingValueValidIndexOnHover;if(o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e),n)o._handleInputWhenDisabled(e);else{var u=o._getPendingSelectedIndex(!1);switch(e.which){case wn.enter:o._autofill.current&&o._autofill.current.inputElement&&o._autofill.current.inputElement.select(),o._submitPendingValue(e),o.props.multiSelect&&a?o.setState({currentPendingValueValidIndex:u}):(a||(!r||void 0===o.state.currentPendingValue||null===o.state.currentPendingValue||o.state.currentPendingValue.length<=0)&&o.state.currentPendingValueValidIndex<0)&&o.setState({isOpen:!a});break;case wn.tab:return o.props.multiSelect||o._submitPendingValue(e),void(a&&o._setOpenStateAndFocusOnClose(!a,!1));case wn.escape:if(o._resetSelectedIndex(),!a)return;o.setState({isOpen:!1});break;case wn.up:if(c===Hg.clearAll&&(u=o.state.currentOptions.length),e.altKey||e.metaKey){if(a){o._setOpenStateAndFocusOnClose(!a,!0);break}return}o._setPendingInfoFromIndexAndDirection(u,Lg.backward);break;case wn.down:e.altKey||e.metaKey?o._setOpenStateAndFocusOnClose(!0,!0):(c===Hg.clearAll&&(u=-1),o._setPendingInfoFromIndexAndDirection(u,Lg.forward));break;case wn.home:case wn.end:if(r)return;u=-1;var d=Lg.forward;e.which===wn.end&&(u=l.length,d=Lg.backward),o._setPendingInfoFromIndexAndDirection(u,d);break;case wn.space:if(!r&&"off"===i)break;default:if(e.which>=112&&e.which<=123)return;if(e.keyCode===wn.alt||"Meta"===e.key)return;if(!r&&"on"===i){o._onInputChange(e.key);break}return}e.stopPropagation(),e.preventDefault()}},o._onInputKeyUp=function(e){var t=o.props,n=t.disabled,r=t.allowFreeform,i=t.autoComplete,s=o.state.isOpen,a=o._lastKeyDownWasAltOrMeta&&o._isAltOrMeta(e);o._lastKeyDownWasAltOrMeta=!1;var l=a&&!(Ca()||Sa());if(n)o._handleInputWhenDisabled(e);else switch(e.which){case wn.space:return void(r||"off"!==i||o._setOpenStateAndFocusOnClose(!s,!!s));default:return void(l&&s?o._setOpenStateAndFocusOnClose(!s,!0):("focusing"===o.state.focusState&&o.props.openOnKeyboardFocus&&o.setState({isOpen:!0}),"focused"!==o.state.focusState&&o.setState({focusState:"focused"})))}},o._onOptionMouseLeave=function(){o._shouldIgnoreMouseEvent()||o.props.persistMenu&&!o.state.isOpen||o.setState({currentPendingValueValidIndexOnHover:Hg.clearAll})},o._onComboBoxClick=function(){var e=o.props.disabled,t=o.state.isOpen;e||(o._setOpenStateAndFocusOnClose(!t,!1),o.setState({focusState:"focused"}))},o._onAutofillClick=function(){var e=o.props,t=e.disabled;e.allowFreeform&&!t?o.focus(o.state.isOpen||o._processingTouch):o._onComboBoxClick()},o._onTouchStart=function(){o._comboBoxWrapper.current&&!("onpointerdown"in o._comboBoxWrapper)&&o._handleTouchAndPointerEvent()},o._onPointerDown=function(e){"touch"===e.pointerType&&(o._handleTouchAndPointerEvent(),e.preventDefault(),e.stopImmediatePropagation())},si(o),o._async=new di(o),o._events=new Ws(o),o._id=t.id||ts("ComboBox");var n=o._buildDefaultSelectedKeys(t.defaultSelectedKey,t.selectedKey);o._isScrollIdle=!0,o._processingTouch=!1,o._gotMouseMove=!1,o._processingClearPendingInfo=!1;var r=o._getSelectedIndices(t.options,n);return o.state={isOpen:!1,selectedIndices:r,focusState:"none",suggestedDisplayValue:void 0,currentOptions:o.props.options,currentPendingValueValidIndex:-1,currentPendingValue:void 0,currentPendingValueValidIndexOnHover:Hg.default},o}return p(t,e),Object.defineProperty(t.prototype,"selectedOptions",{get:function(){var e=this.state;return Yg(e.currentOptions,e.selectedIndices)},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this._comboBoxWrapper.current&&!this.props.disabled&&(this._events.on(this._comboBoxWrapper.current,"focus",this._onResolveOptions,!0),"onpointerdown"in this._comboBoxWrapper.current&&this._events.on(this._comboBoxWrapper.current,"pointerdown",this._onPointerDown,!0))},t.prototype.UNSAFE_componentWillReceiveProps=function(e){if(e.selectedKey!==this.props.selectedKey||e.text!==this.props.text||e.options!==this.props.options){var t=this._buildSelectedKeys(e.selectedKey),o=this._getSelectedIndices(e.options,t);this.setState({selectedIndices:o,currentOptions:e.options}),null===e.selectedKey&&this.setState({suggestedDisplayValue:void 0})}},t.prototype.componentDidUpdate=function(e,t){var o=this,n=this.props,r=n.allowFreeform,i=n.text,s=n.onMenuOpen,a=n.onMenuDismissed,l=this.state,c=l.isOpen,u=l.selectedIndices,d=l.currentPendingValueValidIndex;!c||t.isOpen&&t.currentPendingValueValidIndex===d||this._async.setTimeout((function(){return o._scrollIntoView()}),0),this._hasFocus()&&(c||t.isOpen&&!c&&this._focusInputAfterClose&&this._autofill.current&&document.activeElement!==this._autofill.current.inputElement)&&this.focus(void 0,!0),this._focusInputAfterClose&&(t.isOpen&&!c||this._hasFocus()&&(!c&&!this.props.multiSelect&&t.selectedIndices&&u&&t.selectedIndices[0]!==u[0]||!r||i!==e.text))&&this._onFocus(),this._notifyPendingValueChanged(t),c&&!t.isOpen&&s&&s(),!c&&t.isOpen&&a&&a()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this,t=this._id+"-error",o=this.props,n=o.className,r=o.disabled,i=o.required,s=o.errorMessage,a=o.onRenderContainer,l=void 0===a?this._onRenderContainer:a,c=o.onRenderLabel,u=void 0===c?this._onRenderLabel:c,d=o.onRenderList,p=void 0===d?this._onRenderList:d,m=o.onRenderItem,g=void 0===m?this._onRenderItem:m,f=o.onRenderOption,v=void 0===f?this._onRenderOptionContent:f,_=o.allowFreeform,y=o.styles,C=o.theme,S=o.keytipProps,x=o.persistMenu,k=o.multiSelect,w=this.state,I=w.isOpen,D=w.suggestedDisplayValue;this._currentVisibleValue=this._getVisibleValue();var P=k?this._getMultiselectDisplayString(this.state.selectedIndices,this.state.currentOptions,D):void 0,T=fr(this.props,gr,["onChange","value"]),E=!!(s&&s.length>0);this._classNames=this.props.getClassNames?this.props.getClassNames(C,!!I,!!r,!!i,!!this._hasFocus(),!!_,!!E,n):Gg(Ug(C,y),n,!!I,!!r,!!i,!!this._hasFocus(),!!_,!!E);var M=S?b.createElement(Zs,{keytipProps:S,disabled:r},(function(o){return e._renderComboBoxWrapper(P,t,o)})):this._renderComboBoxWrapper(P,t);return b.createElement("div",h({},T,{ref:this._root,className:this._classNames.container}),u({props:this.props,multiselectAccessibleText:P},this._onRenderLabel),M,(x||I)&&l(h(h({},this.props),{onRenderList:p,onRenderItem:g,onRenderOption:v,options:this.state.currentOptions.map((function(e,t){return h(h({},e),{index:t})})),onDismiss:this._onDismiss}),this._onRenderContainer),b.createElement("div",{role:"region","aria-live":"polite","aria-atomic":"true",id:t,className:E?this._classNames.errorMessage:""},void 0!==s?s:""))},t.prototype._getPendingString=function(e,t,o){return null!=e?e:this._indexWithinBounds(t,o)?t[o].text:""},t.prototype._getMultiselectDisplayString=function(e,t,o){for(var n=[],r=0;e&&r<e.length;r++){var i=e[r];n.push(this._indexWithinBounds(t,i)?t[i].text:this._normalizeToString(o))}var s=this.props.multiSelectDelimiter,a=void 0===s?", ":s;return n.join(a)},t.prototype._indexWithinBounds=function(e,t){return!!e&&(t>=0&&t<e.length)},t.prototype._processInputChangeWithFreeform=function(e){var t=this,o=this.state.currentOptions,n=-1;if(""===e)return 1===(i=o.map((function(e,t){return h(h({},e),{index:t})})).filter((function(e){return e.itemType!==Bg.Header&&e.itemType!==Bg.Divider})).filter((function(o){return t._getPreviewText(o)===e}))).length&&(n=i[0].index),void this._setPendingInfo(e,n,e);var r=e;e=e.toLocaleLowerCase();var i,s="";if("on"===this.props.autoComplete){if((i=o.map((function(e,t){return h(h({},e),{index:t})})).filter((function(e){return e.itemType!==Bg.Header&&e.itemType!==Bg.Divider})).filter((function(o){return 0===t._getPreviewText(o).toLocaleLowerCase().indexOf(e)}))).length>0){var a=this._getPreviewText(i[0]);s=a.toLocaleLowerCase()!==e?a:"",n=i[0].index}}else 1===(i=o.map((function(e,t){return h(h({},e),{index:t})})).filter((function(e){return e.itemType!==Bg.Header&&e.itemType!==Bg.Divider})).filter((function(o){return t._getPreviewText(o).toLocaleLowerCase()===e}))).length&&(n=i[0].index);this._setPendingInfo(r,n,s)},t.prototype._processInputChangeWithoutFreeform=function(e){var t=this,o=this.state,n=o.currentPendingValue,r=o.currentPendingValueValidIndex,i=o.currentOptions;if("on"===this.props.autoComplete&&""!==e){void 0!==this._lastReadOnlyAutoCompleteChangeTimeoutId&&(this._async.clearTimeout(this._lastReadOnlyAutoCompleteChangeTimeoutId),this._lastReadOnlyAutoCompleteChangeTimeoutId=void 0,e=this._normalizeToString(n)+e);var s=e;e=e.toLocaleLowerCase();var a=i.map((function(e,t){return h(h({},e),{index:t})})).filter((function(e){return e.itemType!==Bg.Header&&e.itemType!==Bg.Divider})).filter((function(t){return 0===t.text.toLocaleLowerCase().indexOf(e)}));return a.length>0&&this._setPendingInfo(s,a[0].index,this._getPreviewText(a[0])),void(this._lastReadOnlyAutoCompleteChangeTimeoutId=this._async.setTimeout((function(){t._lastReadOnlyAutoCompleteChangeTimeoutId=void 0}),1e3))}var l=r>=0?r:this._getFirstSelectedIndex();this._setPendingInfoFromIndex(l)},t.prototype._getFirstSelectedIndex=function(){return this.state.selectedIndices&&this.state.selectedIndices.length>0?this.state.selectedIndices[0]:-1},t.prototype._getNextSelectableIndex=function(e,t){var o=this.state.currentOptions,n=e+t;if(n=Math.max(0,Math.min(o.length-1,n)),!this._indexWithinBounds(o,n))return-1;var r=o[n];if(r.itemType===Bg.Header||r.itemType===Bg.Divider||!0===r.hidden){if(t===Lg.none||!(n>0&&t<Lg.none||n>=0&&n<o.length&&t>Lg.none))return e;n=this._getNextSelectableIndex(n,t)}return n},t.prototype._setSelectedIndex=function(e,t,o){var n=this;void 0===o&&(o=Lg.none);var r=this.props,i=r.onChange,s=r.onPendingValueChanged,a=this.state.currentOptions,l=this.state.selectedIndices,c=l?l.slice():[];if(e=this._getNextSelectableIndex(e,o),this._indexWithinBounds(a,e)){if(this.props.multiSelect||c.length<1||1===c.length&&c[0]!==e){var u=h({},a[e]);if(!u||u.disabled)return;if(this.props.multiSelect?(u.selected=void 0!==u.selected?!u.selected:c.indexOf(e)<0,u.selected&&c.indexOf(e)<0?c.push(e):!u.selected&&c.indexOf(e)>=0&&(c=c.filter((function(t){return t!==e})))):c[0]=e,t.persist(),this.props.selectedKey||null===this.props.selectedKey)this._hasPendingValue&&s&&(s(),this._hasPendingValue=!1),i&&i(t,u,e,void 0);else{var d=a.slice();d[e]=u,this.setState({selectedIndices:c,currentOptions:d},(function(){n._hasPendingValue&&s&&(s(),n._hasPendingValue=!1),i&&i(t,u,e,void 0)}))}}this.props.multiSelect&&this.state.isOpen||this._clearPendingInfo()}},t.prototype._submitPendingValue=function(e){var t=this.props,o=t.onChange,n=t.allowFreeform,r=t.autoComplete,i=this.state,s=i.currentPendingValue,a=i.currentPendingValueValidIndex,l=i.currentOptions,c=i.currentPendingValueValidIndexOnHover,u=this.state.selectedIndices;if(!this._processingClearPendingInfo){if(n){if(null==s)return void(c>=0&&(this._setSelectedIndex(c,e),this._clearPendingInfo()));if(this._indexWithinBounds(l,a)){var d=this._getPreviewText(l[a]).toLocaleLowerCase();if(s.toLocaleLowerCase()===d||r&&0===d.indexOf(s.toLocaleLowerCase())&&this._autofill.current&&this._autofill.current.isValueSelected&&s.length+(this._autofill.current.selectionEnd-this._autofill.current.selectionStart)===d.length||this._autofill.current&&this._autofill.current.inputElement&&this._autofill.current.inputElement.value.toLocaleLowerCase()===d){if(this._setSelectedIndex(a,e),this.props.multiSelect&&this.state.isOpen)return;return void this._clearPendingInfo()}}if(o)o&&o(e,void 0,void 0,s);else{var p={key:s||ts(),text:this._normalizeToString(s)};this.props.multiSelect&&(p.selected=!0);var h=l.concat([p]);u&&(this.props.multiSelect||(u=[]),u.push(h.length-1)),this.setState({currentOptions:h,selectedIndices:u})}}else a>=0?this._setSelectedIndex(a,e):c>=0&&this._setSelectedIndex(c,e);this._clearPendingInfo()}},t.prototype._onCalloutLayerMounted=function(){this._gotMouseMove=!1},t.prototype._renderSeparator=function(e){var t=e.index,o=e.key;return t&&t>0?b.createElement("div",{role:"separator",key:o,className:this._classNames.divider}):null},t.prototype._renderHeader=function(e){var t=this.props.onRenderOption,o=void 0===t?this._onRenderOptionContent:t;return b.createElement("div",{key:e.key,className:this._classNames.header},o(e,this._onRenderOptionContent))},t.prototype._isOptionSelected=function(e){return this.state.currentPendingValueValidIndexOnHover!==Hg.clearAll&&this._getPendingSelectedIndex(!0)===e},t.prototype._isOptionChecked=function(e){if(this.props.multiSelect&&void 0!==e&&this.state.selectedIndices){return this.state.selectedIndices.indexOf(e)>=0}return!1},t.prototype._getPendingSelectedIndex=function(e){var t=this.state,o=t.currentPendingValueValidIndexOnHover,n=t.currentPendingValueValidIndex,r=t.currentPendingValue;return o>=0?o:n>=0||e&&null!=r?n:this.props.multiSelect?0:this._getFirstSelectedIndex()},t.prototype._scrollIntoView=function(){var e=this.props,t=e.onScrollToItem,o=e.scrollSelectedToTop,n=this.state,r=n.currentPendingValueValidIndex,i=n.currentPendingValue;if(t)t(r>=0||""!==i?r:this._getFirstSelectedIndex());else if(this._selectedElement.current&&this._selectedElement.current.offsetParent)if(o)this._selectedElement.current.offsetParent.scrollIntoView(!0);else{var s=!0;if(this._comboBoxMenu.current&&this._comboBoxMenu.current.offsetParent){var a=this._comboBoxMenu.current.offsetParent.getBoundingClientRect(),l=this._selectedElement.current.offsetParent.getBoundingClientRect();if(a.top<=l.top&&a.top+a.height>=l.top+l.height)return;a.top+a.height<=l.top+l.height&&(s=!1)}this._selectedElement.current.offsetParent.scrollIntoView(s)}},t.prototype._onItemClick=function(e){var t=this,o=this.props.onItemClick,n=e.index;return function(r){t.props.multiSelect||(t._autofill.current&&t._autofill.current.focus(),t.setState({isOpen:!1})),o&&o(r,e,n),t._setSelectedIndex(n,r)}},t.prototype._getSelectedIndices=function(e,t){if(!e||!t)return[];var o={};e.forEach((function(e,t){e.selected&&(o[t]=!0)}));for(var n=function(t){var n=bi(e,(function(e){return e.key===t}));n>-1&&(o[n]=!0)},r=0,i=t;r<i.length;r++){n(i[r])}return Object.keys(o).map(Number).sort()},t.prototype._resetSelectedIndex=function(){var e=this.state.currentOptions;this._clearPendingInfo();var t=this._getFirstSelectedIndex();t>0&&t<e.length?this.setState({suggestedDisplayValue:e[t].text}):this.props.text&&this.setState({suggestedDisplayValue:this.props.text})},t.prototype._clearPendingInfo=function(){this._processingClearPendingInfo=!0,this.setState({currentPendingValue:void 0,currentPendingValueValidIndex:-1,suggestedDisplayValue:void 0,currentPendingValueValidIndexOnHover:Hg.default},this._onAfterClearPendingInfo)},t.prototype._setPendingInfo=function(e,t,o){void 0===t&&(t=-1),this._processingClearPendingInfo||this.setState({currentPendingValue:this._normalizeToString(e),currentPendingValueValidIndex:t,suggestedDisplayValue:o,currentPendingValueValidIndexOnHover:Hg.default})},t.prototype._setPendingInfoFromIndex=function(e){var t=this.state.currentOptions;if(e>=0&&e<t.length){var o=t[e];this._setPendingInfo(this._getPreviewText(o),e,this._getPreviewText(o))}else this._clearPendingInfo()},t.prototype._setPendingInfoFromIndexAndDirection=function(e,t){var o=this.state.currentOptions;t===Lg.forward&&e>=o.length-1?e=-1:t===Lg.backward&&e<=0&&(e=o.length);var n=this._getNextSelectableIndex(e,t);e===n?t===Lg.forward?e=this._getNextSelectableIndex(-1,t):t===Lg.backward&&(e=this._getNextSelectableIndex(o.length,t)):e=n,this._indexWithinBounds(o,e)&&this._setPendingInfoFromIndex(e)},t.prototype._notifyPendingValueChanged=function(e){var t=this.props.onPendingValueChanged;if(t){var o=this.state,n=o.currentPendingValue,r=o.currentOptions,i=o.currentPendingValueValidIndex,s=o.currentPendingValueValidIndexOnHover,a=void 0,l=void 0;s!==e.currentPendingValueValidIndexOnHover&&this._indexWithinBounds(r,s)?a=s:i!==e.currentPendingValueValidIndex&&this._indexWithinBounds(r,i)?a=i:n!==e.currentPendingValue&&(l=n),(void 0!==a||void 0!==l||this._hasPendingValue)&&(t(void 0!==a?r[a]:void 0,a,l),this._hasPendingValue=void 0!==a||void 0!==l)}},t.prototype._setOpenStateAndFocusOnClose=function(e,t){this._focusInputAfterClose=t,this.setState({isOpen:e})},t.prototype._isAltOrMeta=function(e){return e.which===wn.alt||"Meta"===e.key},t.prototype._onOptionMouseEnter=function(e){this._shouldIgnoreMouseEvent()||this.setState({currentPendingValueValidIndexOnHover:e})},t.prototype._onOptionMouseMove=function(e){this._gotMouseMove=!0,this._isScrollIdle&&this.state.currentPendingValueValidIndexOnHover!==e&&this.setState({currentPendingValueValidIndexOnHover:e})},t.prototype._shouldIgnoreMouseEvent=function(){return!this._isScrollIdle||!this._gotMouseMove},t.prototype._handleInputWhenDisabled=function(e){this.props.disabled&&(this.state.isOpen&&this.setState({isOpen:!1}),null!==e&&e.which!==wn.tab&&e.which!==wn.escape&&(e.which<112||e.which>123)&&(e.stopPropagation(),e.preventDefault()))},t.prototype._handleTouchAndPointerEvent=function(){var e=this;void 0!==this._lastTouchTimeoutId&&(this._async.clearTimeout(this._lastTouchTimeoutId),this._lastTouchTimeoutId=void 0),this._processingTouch=!0,this._lastTouchTimeoutId=this._async.setTimeout((function(){e._processingTouch=!1,e._lastTouchTimeoutId=void 0}),500)},t.prototype._getCaretButtonStyles=function(){var e=this.props.caretDownButtonStyles;return Kg(this.props.theme,e)},t.prototype._getCurrentOptionStyles=function(e){var t=this.props.comboBoxOptionStyles,o=e.styles;return Vg(this.props.theme,t,o,this._isPendingOption(e),e.hidden)},t.prototype._getAriaActiveDescendantValue=function(){var e=this.state.isOpen&&this.state.selectedIndices&&this.state.selectedIndices.length>0?this._id+"-list"+this.state.selectedIndices[0]:void 0;return this.state.isOpen&&this._hasFocus()&&-1!==this.state.currentPendingValueValidIndex&&(e=this._id+"-list"+this.state.currentPendingValueValidIndex),e},t.prototype._getAriaAutoCompleteValue=function(){return!this.props.disabled&&"on"===this.props.autoComplete?this.props.allowFreeform?"inline":"both":"none"},t.prototype._isPendingOption=function(e){return e&&e.index===this.state.currentPendingValueValidIndex},t.prototype._buildDefaultSelectedKeys=function(e,t){var o=this._buildSelectedKeys(e);return o.length?o:this._buildSelectedKeys(t)},t.prototype._buildSelectedKeys=function(e){return void 0===e?[]:e instanceof Array?e:[e]},t.prototype._getPreviewText=function(e){return e.useAriaLabelAsText&&e.ariaLabel?e.ariaLabel:e.text},t.prototype._normalizeToString=function(e){return e||""},t.prototype._hasFocus=function(){return"none"!==this.state.focusState},t.defaultProps={options:[],allowFreeform:!1,autoComplete:"on",buttonIconProps:{iconName:"ChevronDown"}},t=g([ec("ComboBox",["theme","styles"],!0)],t)}(b.Component),Xg={auto:0,top:1,bottom:2,center:3},Qg={top:-1,bottom:-1,left:-1,right:-1,width:0,height:0},Jg=function(e){return e.getBoundingClientRect()},$g=Jg,ef=Jg,tf=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._surface=b.createRef(),o._pageRefs={},o._getDerivedStateFromProps=function(e,t){return e.items!==o.props.items||e.renderCount!==o.props.renderCount||e.startIndex!==o.props.startIndex||e.version!==o.props.version?(o._resetRequiredWindows(),o._requiredRect=null,o._measureVersion++,o._invalidatePageCache(),o._updatePages(e,t)):t},o._onRenderRoot=function(e){var t=e.rootRef,o=e.surfaceElement,n=e.divProps;return b.createElement("div",h({ref:t},n),o)},o._onRenderSurface=function(e){var t=e.surfaceRef,o=e.pageElements,n=e.divProps;return b.createElement("div",h({ref:t},n),o)},o._onRenderPage=function(e,t){for(var n=o.props,r=n.onRenderCell,i=n.role,s=e.page,a=s.items,l=void 0===a?[]:a,c=s.startIndex,u=m(e,["page"]),d=void 0===i?"listitem":"presentation",p=[],g=0;g<l.length;g++){var f=c+g,v=l[g],_=o.props.getKey?o.props.getKey(v,f):v&&v.key;null==_&&(_=f),p.push(b.createElement("div",{role:d,className:"ms-List-cell",key:_,"data-list-index":f,"data-automationid":"ListCell"},r&&r(v,f,o.props.ignoreScrollingState?void 0:o.state.isScrolling)))}return b.createElement("div",h({},u),p)},si(o),o.state={pages:[],isScrolling:!1,getDerivedStateFromProps:o._getDerivedStateFromProps},o._async=new di(o),o._events=new Ws(o),o._estimatedPageHeight=0,o._totalEstimates=0,o._requiredWindowsAhead=0,o._requiredWindowsBehind=0,o._measureVersion=0,o._onAsyncScroll=o._async.debounce(o._onAsyncScroll,100,{leading:!1,maxWait:500}),o._onAsyncIdle=o._async.debounce(o._onAsyncIdle,200,{leading:!1}),o._onAsyncResize=o._async.debounce(o._onAsyncResize,16,{leading:!1}),o._onScrollingDone=o._async.debounce(o._onScrollingDone,500,{leading:!1}),o._cachedPageHeights={},o._estimatedPageHeight=0,o._focusedIndex=-1,o._pageCache={},o}return p(t,e),t.getDerivedStateFromProps=function(e,t){return t.getDerivedStateFromProps(e,t)},Object.defineProperty(t.prototype,"pageRefs",{get:function(){return this._pageRefs},enumerable:!0,configurable:!0}),t.prototype.scrollToIndex=function(e,t,o){void 0===o&&(o=Xg.auto);for(var n=this.props.startIndex,r=n+this._getRenderCount(),i=this._allowedRect,s=0,a=1,l=n;l<r;l+=a){var c=this._getPageSpecification(l,i),u=c.height;if(a=c.itemCount,l<=e&&l+a>e){if(t&&this._scrollElement){for(var d=ef(this._scrollElement),p={top:this._scrollElement.scrollTop,bottom:this._scrollElement.scrollTop+d.height},h=e-l,m=0;m<h;++m)s+=t(l+m);var g=s+t(e);switch(o){case Xg.top:return void(this._scrollElement.scrollTop=s);case Xg.bottom:return void(this._scrollElement.scrollTop=g-d.height);case Xg.center:return void(this._scrollElement.scrollTop=(s+g-d.height)/2);case Xg.auto:}if(s>=p.top&&g<=p.bottom)return;s<p.top||g>p.bottom&&(s=g-d.height)}return void(this._scrollElement.scrollTop=s)}s+=u}},t.prototype.getStartItemIndexInView=function(e){for(var t=0,o=this.state.pages||[];t<o.length;t++){var n=o[t];if(!n.isSpacer&&(this._scrollTop||0)>=n.top&&(this._scrollTop||0)<=n.top+n.height){if(!e){var r=Math.floor(n.height/n.itemCount);return n.startIndex+Math.floor((this._scrollTop-n.top)/r)}for(var i=0,s=n.startIndex;s<n.startIndex+n.itemCount;s++){r=e(s);if(n.top+i<=this._scrollTop&&this._scrollTop<n.top+i+r)return s;i+=r}}}return 0},t.prototype.componentDidMount=function(){this.setState(this._updatePages(this.props,this.state)),this._measureVersion++,this._scrollElement=hs(this._root.current),this._events.on(window,"resize",this._onAsyncResize),this._root.current&&this._events.on(this._root.current,"focus",this._onFocus,!0),this._scrollElement&&(this._events.on(this._scrollElement,"scroll",this._onScroll),this._events.on(this._scrollElement,"scroll",this._onAsyncScroll))},t.prototype.componentDidUpdate=function(e,t){var o=this.props,n=this.state;if(this.state.pagesVersion!==t.pagesVersion){if(o.getPageHeight)this._onAsyncIdle();else this._updatePageMeasurements(n.pages)?(this._materializedRect=null,this._hasCompletedFirstRender?this._onAsyncScroll():(this._hasCompletedFirstRender=!0,this.setState(this._updatePages(o,n)))):this._onAsyncIdle();o.onPagesUpdated&&o.onPagesUpdated(n.pages)}},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose(),delete this._scrollElement},t.prototype.shouldComponentUpdate=function(e,t){var o=this.state.pages,n=t.pages,r=!1;if(!t.isScrolling&&this.state.isScrolling)return!0;if(e.version!==this.props.version)return!0;if(e.items===this.props.items&&o.length===n.length)for(var i=0;i<o.length;i++){var s=o[i],a=n[i];if(s.key!==a.key||s.itemCount!==a.itemCount){r=!0;break}}else r=!0;return r},t.prototype.forceUpdate=function(){this._invalidatePageCache(),this._updateRenderRects(this.props,this.state,!0),this.setState(this._updatePages(this.props,this.state)),this._measureVersion++,e.prototype.forceUpdate.call(this)},t.prototype.getTotalListHeight=function(){return this._surfaceRect.height},t.prototype.render=function(){for(var e=this.props,t=e.className,o=e.role,n=void 0===o?"list":o,r=e.onRenderSurface,i=e.onRenderRoot,s=this.state.pages,a=void 0===s?[]:s,l=[],c=fr(this.props,gr),u=0,d=a;u<d.length;u++){var p=d[u];l.push(this._renderPage(p))}var m=r?Wh(r,this._onRenderSurface):this._onRenderSurface;return(i?Wh(i,this._onRenderRoot):this._onRenderRoot)({rootRef:this._root,pages:a,surfaceElement:m({surfaceRef:this._surface,pages:a,pageElements:l,divProps:{role:"presentation",className:"ms-List-surface"}}),divProps:h(h({},c),{className:Sr("ms-List",t),role:l.length>0?n:void 0})})},t.prototype._shouldVirtualize=function(e){void 0===e&&(e=this.props);var t=e.onShouldVirtualize;return!t||t(e)},t.prototype._invalidatePageCache=function(){this._pageCache={}},t.prototype._renderPage=function(e){var t,o=this,n=this.props.usePageCache;if(n&&(t=this._pageCache[e.key])&&t.pageElement)return t.pageElement;var r=this._getPageStyle(e),i=this.props.onRenderPage,s=(void 0===i?this._onRenderPage:i)({page:e,className:"ms-List-page",key:e.key,ref:function(t){o._pageRefs[e.key]=t},style:r,role:"presentation"},this._onRenderPage);return n&&0===e.startIndex&&(this._pageCache[e.key]={page:e,pageElement:s}),s},t.prototype._getPageStyle=function(e){var t=this.props.getPageStyle;return h(h({},t?t(e):{}),e.items?{}:{height:e.height})},t.prototype._onFocus=function(e){for(var t=e.target;t!==this._surface.current;){var o=t.getAttribute("data-list-index");if(o){this._focusedIndex=Number(o);break}t=Mi(t)}},t.prototype._onScroll=function(){this.state.isScrolling||this.props.ignoreScrollingState||this.setState({isScrolling:!0}),this._resetRequiredWindows(),this._onScrollingDone()},t.prototype._resetRequiredWindows=function(){this._requiredWindowsAhead=0,this._requiredWindowsBehind=0},t.prototype._onAsyncScroll=function(){var e,t;this._updateRenderRects(this.props,this.state),this._materializedRect&&(e=this._requiredRect,t=this._materializedRect,e.top>=t.top&&e.left>=t.left&&e.bottom<=t.bottom&&e.right<=t.right)||this.setState(this._updatePages(this.props,this.state))},t.prototype._onAsyncIdle=function(){var e=this.props,t=e.renderedWindowsAhead,o=e.renderedWindowsBehind,n=this._requiredWindowsAhead,r=this._requiredWindowsBehind,i=Math.min(t,n+1),s=Math.min(o,r+1);i===n&&s===r||(this._requiredWindowsAhead=i,this._requiredWindowsBehind=s,this._updateRenderRects(this.props,this.state),this.setState(this._updatePages(this.props,this.state))),(t>i||o>s)&&this._onAsyncIdle()},t.prototype._onScrollingDone=function(){this.props.ignoreScrollingState||this.setState({isScrolling:!1})},t.prototype._onAsyncResize=function(){this.forceUpdate()},t.prototype._updatePages=function(e,t){this._requiredRect||this._updateRenderRects(e,t);var o=this._buildPages(e,t),n=t.pages;return this._notifyPageChanges(n,o.pages,this.props),h(h(h({},t),o),{pagesVersion:{}})},t.prototype._notifyPageChanges=function(e,t,o){var n=o.onPageAdded,r=o.onPageRemoved;if(n||r){for(var i={},s=0,a=e;s<a.length;s++){(u=a[s]).items&&(i[u.startIndex]=u)}for(var l=0,c=t;l<c.length;l++){var u;(u=c[l]).items&&(i[u.startIndex]?delete i[u.startIndex]:this._onPageAdded(u))}for(var d in i)i.hasOwnProperty(d)&&this._onPageRemoved(i[d])}},t.prototype._updatePageMeasurements=function(e){var t=!1;if(!this._shouldVirtualize())return t;for(var o=0;o<e.length;o++){var n=e[o];n.items&&(t=this._measurePage(n)||t)}return t},t.prototype._measurePage=function(e){var t=!1,o=this._pageRefs[e.key],n=this._cachedPageHeights[e.startIndex];if(o&&this._shouldVirtualize()&&(!n||n.measureVersion!==this._measureVersion)){var r={width:o.clientWidth,height:o.clientHeight};(r.height||r.width)&&(t=e.height!==r.height,e.height=r.height,this._cachedPageHeights[e.startIndex]={height:r.height,measureVersion:this._measureVersion},this._estimatedPageHeight=Math.round((this._estimatedPageHeight*this._totalEstimates+r.height)/(this._totalEstimates+1)),this._totalEstimates++)}return t},t.prototype._onPageAdded=function(e){var t=this.props.onPageAdded;t&&t(e)},t.prototype._onPageRemoved=function(e){var t=this.props.onPageRemoved;t&&t(e)},t.prototype._buildPages=function(e,t){var o=e.renderCount,n=e.items,r=e.startIndex,i=e.getPageHeight;o=this._getRenderCount(e);for(var s=h({},Qg),a=[],l=1,c=0,u=null,d=this._focusedIndex,p=r+o,m=this._shouldVirtualize(e),g=0===this._estimatedPageHeight&&!i,f=this._allowedRect,v=function(e){var o=b._getPageSpecification(e,f),i=o.height,h=o.data,v=o.key;l=o.itemCount;var _,y,C=c+i-1,S=bi(t.pages,(function(t){return!!t.items&&t.startIndex===e}))>-1,x=!f||C>=f.top&&c<=f.bottom,k=!b._requiredRect||C>=b._requiredRect.top&&c<=b._requiredRect.bottom;if(!g&&(k||x&&S)||!m||d>=e&&d<e+l||e===r){u&&(a.push(u),u=null);var w=Math.min(l,p-e),I=b._createPage(v,n.slice(e,e+w),e,void 0,void 0,h);I.top=c,I.height=i,b._visibleRect&&b._visibleRect.bottom&&(I.isVisible=C>=b._visibleRect.top&&c<=b._visibleRect.bottom),a.push(I),k&&b._allowedRect&&(_=s,y={top:c,bottom:C,height:i,left:f.left,right:f.right,width:f.width},_.top=y.top<_.top||-1===_.top?y.top:_.top,_.left=y.left<_.left||-1===_.left?y.left:_.left,_.bottom=y.bottom>_.bottom||-1===_.bottom?y.bottom:_.bottom,_.right=y.right>_.right||-1===_.right?y.right:_.right,_.width=_.right-_.left+1,_.height=_.bottom-_.top+1)}else u||(u=b._createPage("spacer-"+e,void 0,e,0,void 0,h,!0)),u.height=(u.height||0)+(C-c)+1,u.itemCount+=l;if(c+=C-c+1,g&&m)return"break"},b=this,_=r;_<p;_+=l){if("break"===v(_))break}return u&&(u.key="spacer-end",a.push(u)),this._materializedRect=s,h(h({},t),{pages:a,measureVersion:this._measureVersion})},t.prototype._getPageSpecification=function(e,t){var o=this.props.getPageSpecification;if(o){var n=o(e,t),r=n.itemCount,i=void 0===r?this._getItemCountForPage(e,t):r,s=n.height;return{itemCount:i,height:void 0===s?this._getPageHeight(e,t,i):s,data:n.data,key:n.key}}return{itemCount:i=this._getItemCountForPage(e,t),height:this._getPageHeight(e,t,i)}},t.prototype._getPageHeight=function(e,t,o){if(this.props.getPageHeight)return this.props.getPageHeight(e,t,o);var n=this._cachedPageHeights[e];return n?n.height:this._estimatedPageHeight||30},t.prototype._getItemCountForPage=function(e,t){var o=this.props.getItemCountForPage?this.props.getItemCountForPage(e,t):10;return o||10},t.prototype._createPage=function(e,t,o,n,r,i,s){void 0===o&&(o=-1),void 0===n&&(n=t?t.length:0),void 0===r&&(r={}),e=e||"page-"+o;var a=this._pageCache[e];return a&&a.page?a.page:{key:e,startIndex:o,itemCount:n,items:t,style:r,top:0,height:0,data:i,isSpacer:s||!1}},t.prototype._getRenderCount=function(e){var t=e||this.props,o=t.items,n=t.startIndex,r=t.renderCount;return void 0===r?o?o.length-n:0:r},t.prototype._updateRenderRects=function(e,t,o){var n=e.renderedWindowsAhead,r=e.renderedWindowsBehind,i=t.pages;if(this._shouldVirtualize(e)){var s=this._surfaceRect||h({},Qg),a=this._scrollElement&&this._scrollElement.scrollHeight,l=this._scrollElement?this._scrollElement.scrollTop:0;this._surface.current&&(o||!i||!this._surfaceRect||!a||a!==this._scrollHeight||Math.abs(this._scrollTop-l)>this._estimatedPageHeight/3)&&(s=this._surfaceRect=$g(this._surface.current),this._scrollTop=l),!o&&a&&a===this._scrollHeight||this._measureVersion++,this._scrollHeight=a;var c=Math.max(0,-s.top),u=rt(this._root.current),d={top:c,left:s.left,bottom:c+u.innerHeight,right:s.right,width:s.width,height:u.innerHeight};this._requiredRect=of(d,this._requiredWindowsBehind,this._requiredWindowsAhead),this._allowedRect=of(d,r,n),this._visibleRect=d}},t.defaultProps={startIndex:0,onRenderCell:function(e,t,o){return b.createElement(b.Fragment,null,e&&e.name||"")},renderedWindowsAhead:2,renderedWindowsBehind:2},t}(b.Component);function of(e,t,o){var n=e.top-t*e.height,r=e.height+(t+o)*e.height;return{top:n,bottom:n+r,height:r,left:e.left,right:e.right,width:e.width}}var nf=function(e){function t(t){var o=e.call(this,t)||this;return o._comboBox=b.createRef(),o._list=b.createRef(),o._onRenderList=function(e){var t=e.onRenderItem;return b.createElement(tf,{componentRef:o._list,role:"listbox",items:e.options,onRenderCell:t?function(e){return t(e)}:function(){return null}})},o._onScrollToItem=function(e){o._list.current&&o._list.current.scrollToIndex(e)},si(o),o}return p(t,e),Object.defineProperty(t.prototype,"selectedOptions",{get:function(){return this._comboBox.current?this._comboBox.current.selectedOptions:[]},enumerable:!0,configurable:!0}),t.prototype.dismissMenu=function(){if(this._comboBox.current)return this._comboBox.current.dismissMenu()},t.prototype.focus=function(e,t){return!!this._comboBox.current&&(this._comboBox.current.focus(e,t),!0)},t.prototype.render=function(){return b.createElement(Zg,h({},this.props,{componentRef:this._comboBox,onRenderList:this._onRenderList,onScrollToItem:this._onScrollToItem}))},t}(b.Component);var rf=Fo((function(e){var t=e;return Fo((function(o){if(e===o)throw new Error("Attempted to compose a component with itself.");var n=o,r=Fo((function(e){return function(t){return b.createElement(n,h({},t,{defaultRender:e}))}}));return function(e){var o=e.defaultRender;return b.createElement(t,h({},e,{defaultRender:o?r(o):n}))}}))}));function sf(e,t){return rf(e)(t)}var af,lf,cf=Mn(),uf=function(e){function t(t){var o=e.call(this,t)||this;return o._focusZone=b.createRef(),o._persistedKeytips={},o._keytipManager=Vs.getInstance(),o._divContainer=b.createRef(),o._onRenderItems=function(e){return e.map((function(e,t){return b.createElement("div",{key:e.key,className:o._classNames.item},o.props.onRenderItem(e))}))},o._onRenderOverflowButtonWrapper=function(e){var t={className:o._classNames.overflowButton},n=o.props.keytipSequences,r=[];return n?e.forEach((function(e){var t=e.keytipProps;if(t){var i={content:t.content,keySequences:t.keySequences,disabled:t.disabled||!(!e.disabled&&!e.isDisabled),hasDynamicChildren:t.hasDynamicChildren,hasMenu:t.hasMenu};t.hasDynamicChildren||o._getSubMenuForItem(e)?i.onExecute=o._keytipManager.menuExecute.bind(o._keytipManager,n,e.keytipProps.keySequences):i.onExecute=t.onExecute,o._persistedKeytips[i.content]=i;var s=h(h({},e),{keytipProps:h(h({},t),{overflowSetSequence:n})});r.push(s)}else r.push(e)})):r=e,b.createElement("div",h({},t),o.props.onRenderOverflowButton(r))},si(o),o}return p(t,e),t.prototype.render=function(){var e,t,o=this.props,n=o.items,r=o.overflowItems,i=o.className,s=o.focusZoneProps,a=o.styles,l=o.vertical,c=o.doNotContainWithinFocusZone,u=o.role,d=o.overflowSide,p=void 0===d?"end":d;this._classNames=cf(a,{className:i,vertical:l}),c?(e="div",t=h(h({},fr(this.props,gr)),{ref:this._divContainer})):(e=ks,t=h(h(h({},fr(this.props,gr)),s),{componentRef:this._focusZone,direction:l?vs.vertical:vs.horizontal}));var m=r&&r.length>0;return b.createElement(e,h({role:u||"group","aria-orientation":"menubar"===u?!0===l?"vertical":"horizontal":void 0},t,{className:this._classNames.root}),"start"===p&&m&&this._onRenderOverflowButtonWrapper(r),n&&this._onRenderItems(n),"end"===p&&m&&this._onRenderOverflowButtonWrapper(r))},t.prototype.focus=function(e){var t=!1;return this.props.doNotContainWithinFocusZone?this._divContainer.current&&(t=Oi(this._divContainer.current)):this._focusZone.current&&(t=this._focusZone.current.focus(e)),t},t.prototype.focusElement=function(e){var t=!1;return!!e&&(this.props.doNotContainWithinFocusZone?this._divContainer.current&&Ni(this._divContainer.current,e)&&(e.focus(),t=document.activeElement===e):this._focusZone.current&&(t=this._focusZone.current.focusElement(e)),t)},t.prototype.componentDidMount=function(){this._registerPersistedKeytips()},t.prototype.componentWillUnmount=function(){this._unregisterPersistedKeytips()},t.prototype.UNSAFE_componentWillUpdate=function(){this._unregisterPersistedKeytips()},t.prototype.componentDidUpdate=function(){this._registerPersistedKeytips()},t.prototype._registerPersistedKeytips=function(){var e=this;Object.keys(this._persistedKeytips).forEach((function(t){var o=e._persistedKeytips[t],n=e._keytipManager.register(o,!0);e._persistedKeytips[n]=o,delete e._persistedKeytips[t]}))},t.prototype._unregisterPersistedKeytips=function(){var e=this;Object.keys(this._persistedKeytips).forEach((function(t){e._keytipManager.unregister(e._persistedKeytips[t],t,!0)})),this._persistedKeytips={}},t.prototype._getSubMenuForItem=function(e){return this.props.itemSubMenuProvider?this.props.itemSubMenuProvider(e):e.subMenuProps?e.subMenuProps.items:void 0},t}(b.Component),df={flexShrink:0,display:"inherit"},pf=xn(uf,(function(e){var t=e.className;return{root:["ms-OverflowSet",{position:"relative",display:"flex",flexWrap:"nowrap"},e.vertical&&{flexDirection:"column"},t],item:["ms-OverflowSet-item",df],overflowButton:["ms-OverflowSet-overflowButton",df]}}),void 0,{scope:"OverflowSet"}),hf=No((function(e){var t={height:"100%"},o={whiteSpace:"nowrap"},n=e||{},r=n.root,i=n.label,s=m(n,["root","label"]);return h(h({},s),{root:r?[t,r]:t,label:i?[o,i]:o})})),mf=Mn(),gf=function(e){function t(t){var o=e.call(this,t)||this;return o._overflowSet=b.createRef(),o._resizeGroup=b.createRef(),o._onRenderData=function(e){return b.createElement(ks,{className:Sr(o._classNames.root),direction:vs.horizontal,role:"menubar","aria-label":o.props.ariaLabel},b.createElement(pf,{role:"none",componentRef:o._overflowSet,className:Sr(o._classNames.primarySet),doNotContainWithinFocusZone:!0,items:e.primaryItems,overflowItems:e.overflowItems.length?e.overflowItems:void 0,onRenderItem:o._onRenderItem,onRenderOverflowButton:o._onRenderOverflowButton}),e.farItems&&e.farItems.length>0&&b.createElement(pf,{role:"none",className:Sr(o._classNames.secondarySet),doNotContainWithinFocusZone:!0,items:e.farItems,onRenderItem:o._onRenderItem,onRenderOverflowButton:sa}))},o._onRenderItem=function(e){if(e.onRender)return e.onRender(e,(function(){}));var t=e.text||e.name,n=h(h({allowDisabledFocus:!0,role:"menuitem"},e),{styles:hf(e.buttonStyles),className:Sr("ms-CommandBarItem-link",e.className),text:e.iconOnly?void 0:t,menuProps:e.subMenuProps,onClick:o._onButtonClick(e)});return e.iconOnly&&(void 0!==t||e.tooltipHostProps)?b.createElement(Cu,h({content:t},e.tooltipHostProps),o._commandButton(e,n)):o._commandButton(e,n)},o._commandButton=function(e,t){var n=o.props.buttonAs,r=e.commandBarButtonAs,i=ju;return r&&(i=sf(r,i)),n&&(i=sf(n,i)),b.createElement(i,h({},t))},o._onRenderOverflowButton=function(e){var t=o.props.overflowButtonProps,n=void 0===t?{}:t,r=f(n.menuProps?n.menuProps.items:[],e),i=h(h({role:"menuitem"},n),{styles:h({menuIcon:{fontSize:"17px"}},n.styles),className:Sr("ms-CommandBar-overflowButton",n.className),menuProps:h(h({},n.menuProps),{items:r}),menuIconProps:h({iconName:"More"},n.menuIconProps)}),s=o.props.overflowButtonAs?sf(o.props.overflowButtonAs,ju):ju;return b.createElement(s,h({},i))},o._onReduceData=function(e){var t=o.props,n=t.shiftOnReduce,r=t.onDataReduced,i=e.primaryItems,s=e.overflowItems,a=e.cacheKey,l=i[n?0:i.length-1];if(void 0!==l){l.renderedInOverflow=!0,s=f([l],s),i=n?i.slice(1):i.slice(0,-1);var c=h(h({},e),{primaryItems:i,overflowItems:s});return a=o._computeCacheKey({primaryItems:i,overflow:s.length>0}),r&&r(l),c.cacheKey=a,c}},o._onGrowData=function(e){var t=o.props,n=t.shiftOnReduce,r=t.onDataGrown,i=e.minimumOverflowItems,s=e.primaryItems,a=e.overflowItems,l=e.cacheKey,c=a[0];if(void 0!==c&&a.length>i){c.renderedInOverflow=!1,a=a.slice(1),s=n?f([c],s):f(s,[c]);var u=h(h({},e),{primaryItems:s,overflowItems:a});return l=o._computeCacheKey({primaryItems:s,overflow:a.length>0}),r&&r(c),u.cacheKey=l,u}},si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.items,o=e.overflowItems,n=e.farItems,r=e.styles,i=e.theme,s=e.dataDidRender,a=e.onReduceData,l=void 0===a?this._onReduceData:a,c=e.onGrowData,u=void 0===c?this._onGrowData:c,d={primaryItems:f(t),overflowItems:f(o),minimumOverflowItems:f(o).length,farItems:n,cacheKey:this._computeCacheKey({primaryItems:f(t),overflow:o&&o.length>0})};this._classNames=mf(r,{theme:i});var p=fr(this.props,gr);return b.createElement(lu,h({},p,{componentRef:this._resizeGroup,data:d,onReduceData:l,onGrowData:u,onRenderData:this._onRenderData,dataDidRender:s}))},t.prototype.focus=function(){var e=this._overflowSet.current;e&&e.focus()},t.prototype.remeasure=function(){this._resizeGroup.current&&this._resizeGroup.current.remeasure()},t.prototype._onButtonClick=function(e){return function(t){e.inactive||e.onClick&&e.onClick(t,e)}},t.prototype._computeCacheKey=function(e){var t=e.primaryItems,o=e.overflow;return[t&&t.reduce((function(e,t){var o=t.cacheKey;return e+(void 0===o?t.key:o)}),""),o?"overflow":""].join("")},t.defaultProps={items:[],overflowItems:[]},t}(b.Component),ff=xn(gf,(function(e){var t=e.className,o=e.theme,n=o.semanticColors;return{root:[o.fonts.medium,"ms-CommandBar",{display:"flex",backgroundColor:n.bodyBackground,padding:"0 14px 0 24px",height:44},t],primarySet:["ms-CommandBar-primaryCommand",{flexGrow:"1",display:"flex",alignItems:"stretch"}],secondarySet:["ms-CommandBar-secondaryCommand",{flexShrink:"0",display:"flex",alignItems:"stretch"}]}}),void 0,{scope:"CommandBar"}),vf=Mn(),bf={months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["S","M","T","W","T","F","S"],goToToday:"Go to today",prevMonthAriaLabel:"Go to previous month",nextMonthAriaLabel:"Go to next month",prevYearAriaLabel:"Go to previous year",nextYearAriaLabel:"Go to next year",prevYearRangeAriaLabel:"Previous year range",nextYearRangeAriaLabel:"Next year range",closeButtonAriaLabel:"Close date picker",weekNumberFormatString:"Week number {0}"},_f=function(e){function t(t){var o=e.call(this,t)||this;return o._calendar=b.createRef(),o._datePickerDiv=b.createRef(),o._textField=b.createRef(),o._onSelectDate=function(e){var t=o.props,n=t.formatDate,r=t.onSelectDate;o.props.calendarProps&&o.props.calendarProps.onSelectDate&&o.props.calendarProps.onSelectDate(e),o.setState({selectedDate:e,formattedDate:n&&e?n(e):""}),r&&r(e),o._calendarDismissed()},o._onCalloutPositioned=function(){var e=!0;o.props.calloutProps&&void 0!==o.props.calloutProps.setInitialFocus&&(e=o.props.calloutProps.setInitialFocus),o._calendar.current&&e&&o._calendar.current.focus()},o._onTextFieldFocus=function(e){o.props.disableAutoFocus||o.props.allowTextInput||(o._preventFocusOpeningPicker?o._preventFocusOpeningPicker=!1:o._showDatePickerPopup())},o._onTextFieldBlur=function(e){o._validateTextInput()},o._onTextFieldChanged=function(e,t){var n=o.props,r=n.allowTextInput,i=n.textField;if(r){o.state.isDatePickerShown&&o._dismissDatePickerPopup();var s=o.props,a=s.isRequired,l=s.strings;o.setState({errorMessage:a&&!t?l.isRequiredErrorMessage||" ":void 0,formattedDate:t})}i&&i.onChange&&i.onChange(e,t)},o._onTextFieldKeyDown=function(e){switch(e.which){case wn.enter:e.preventDefault(),e.stopPropagation(),o.state.isDatePickerShown?o.props.allowTextInput&&o._dismissDatePickerPopup():(o._validateTextInput(),o._showDatePickerPopup());break;case wn.escape:o._handleEscKey(e)}},o._onTextFieldClick=function(e){o.props.disableAutoFocus||o.state.isDatePickerShown||o.props.disabled?o.props.allowTextInput&&o._dismissDatePickerPopup():o._showDatePickerPopup()},o._onIconClick=function(e){e.stopPropagation(),o.state.isDatePickerShown||o.props.disabled?o.props.allowTextInput&&o._dismissDatePickerPopup():o._showDatePickerPopup()},o._dismissDatePickerPopup=function(){o.state.isDatePickerShown&&o.setState({isDatePickerShown:!1},(function(){o._validateTextInput()}))},o._calendarDismissed=function(){o._preventFocusOpeningPicker=!0,o._dismissDatePickerPopup()},o._handleEscKey=function(e){o.state.isDatePickerShown&&e.stopPropagation(),o._calendarDismissed()},o._validateTextInput=function(){var e=o.props,t=e.isRequired,n=e.allowTextInput,r=e.strings,i=e.parseDateFromString,s=e.onSelectDate,a=e.formatDate,l=e.minDate,c=e.maxDate,u=o.state.formattedDate;if(!o.state.isDatePickerShown)if(n){var d=null;if(u){if(o.state.selectedDate&&!o.state.errorMessage&&a&&a(o.state.selectedDate)===u)return;!(d=i(u))||isNaN(d.getTime())?(a&&(d=o.state.selectedDate,o.setState({formattedDate:a(d).toString()})),o.setState({errorMessage:r.invalidInputErrorMessage||" "})):o._isDateOutOfBounds(d,l,c)?o.setState({errorMessage:r.isOutOfBoundsErrorMessage||" "}):(o.setState({selectedDate:d,errorMessage:""}),a&&a(d)!==u&&o.setState({formattedDate:a(d).toString()}))}else o.setState({errorMessage:t?r.isRequiredErrorMessage||" ":""});s&&s(d)}else t&&!u?o.setState({errorMessage:r.isRequiredErrorMessage||" "}):o.setState({errorMessage:""})},si(o),o.state=o._getDefaultState(),o._id=t.id||ts("DatePicker"),o._preventFocusOpeningPicker=!1,o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=e.formatDate,o=e.value;fd(this.props.minDate,e.minDate)&&fd(this.props.maxDate,e.maxDate)&&this.props.isRequired===e.isRequired&&fd(this.state.selectedDate,o)&&this.props.formatDate===t||(this._setErrorMessage(!0,e),this._id=e.id||this._id,fd(this.state.selectedDate,o)&&this.props.formatDate===t||this.setState({selectedDate:o||void 0,formattedDate:t&&o?t(o):""}))},t.prototype.componentDidUpdate=function(e,t){t.isDatePickerShown&&!this.state.isDatePickerShown&&this.props.onAfterMenuDismiss&&this.props.onAfterMenuDismiss()},t.prototype.render=function(){var e=this.props,t=e.firstDayOfWeek,o=e.strings,n=e.label,r=e.theme,i=e.className,s=e.styles,a=e.initialPickerDate,l=e.isRequired,c=e.disabled,u=e.ariaLabel,d=e.pickerAriaLabel,p=e.placeholder,m=e.allowTextInput,g=e.borderless,f=e.minDate,v=e.maxDate,_=e.showCloseButton,y=e.calendarProps,C=e.calloutProps,S=e.textField,x=e.underlined,k=e.allFocusable,w=e.calendarAs,I=void 0===w?kh:w,D=e.tabIndex,P=this.state,T=P.isDatePickerShown,E=P.formattedDate,M=P.selectedDate,R=vf(s,{theme:r,className:i,disabled:c,label:!!n,isDatePickerShown:T}),B=ts("DatePicker-Callout"),N=fr(this.props,gr,["value"]),F=S&&S.iconProps;return b.createElement("div",h({},N,{className:R.root}),b.createElement("div",{ref:this._datePickerDiv,"aria-haspopup":"true","aria-owns":T?B:void 0,className:R.wrapper},b.createElement(yg,h({role:"combobox",label:n,"aria-expanded":T,ariaLabel:u,"aria-controls":T?B:void 0,required:l,disabled:c,errorMessage:this._getErrorMessage(),placeholder:p,borderless:g,value:E,componentRef:this._textField,underlined:x,tabIndex:D,readOnly:!m},S,{id:this._id+"-label",className:Sr(R.textField,S&&S.className),iconProps:h(h({iconName:"Calendar"},F),{className:Sr(R.icon,F&&F.className),onClick:this._onIconClick}),onKeyDown:this._onTextFieldKeyDown,onFocus:this._onTextFieldFocus,onBlur:this._onTextFieldBlur,onClick:this._onTextFieldClick,onChange:this._onTextFieldChanged}))),T&&b.createElement(uc,h({id:B,role:"dialog",ariaLabel:d,isBeakVisible:!1,gapSpace:0,doNotLayer:!1,target:this._datePickerDiv.current,directionalHint:ya.bottomLeftEdge},C,{className:Sr(R.callout,C&&C.className),onDismiss:this._calendarDismissed,onPositioned:this._onCalloutPositioned}),b.createElement(Ih,{isClickableOutsideFocusTrap:!0,disableFirstFocus:this.props.disableAutoFocus,forceFocusInsideTrap:!1},b.createElement(I,h({},y,{onSelectDate:this._onSelectDate,onDismiss:this._calendarDismissed,isMonthPickerVisible:this.props.isMonthPickerVisible,showMonthPickerAsOverlay:this.props.showMonthPickerAsOverlay,today:this.props.today,value:M||a,firstDayOfWeek:t,strings:o,highlightCurrentMonth:this.props.highlightCurrentMonth,highlightSelectedMonth:this.props.highlightSelectedMonth,showWeekNumbers:this.props.showWeekNumbers,firstWeekOfYear:this.props.firstWeekOfYear,showGoToToday:this.props.showGoToToday,dateTimeFormatter:this.props.dateTimeFormatter,minDate:f,maxDate:v,componentRef:this._calendar,showCloseButton:_,allFocusable:k})))))},t.prototype.focus=function(){this._textField.current&&this._textField.current.focus()},t.prototype.reset=function(){this.setState(this._getDefaultState())},t.prototype._setErrorMessage=function(e,t){var o=t||this.props,n=o.isRequired,r=o.strings,i=o.value,s=o.minDate,a=o.maxDate,l=o.initialPickerDate||!n||i?void 0:r.isRequiredErrorMessage||" ";return!l&&i&&(l=this._isDateOutOfBounds(i,s,a)?r.isOutOfBoundsErrorMessage||" ":void 0),e&&this.setState({errorMessage:l}),l},t.prototype._showDatePickerPopup=function(){this.state.isDatePickerShown||(this._preventFocusOpeningPicker=!0,this.setState({isDatePickerShown:!0}))},t.prototype._getDefaultState=function(e){return void 0===e&&(e=this.props),{selectedDate:e.value||void 0,formattedDate:e.formatDate&&e.value?e.formatDate(e.value):"",isDatePickerShown:!1,errorMessage:this._setErrorMessage(!1)}},t.prototype._isDateOutOfBounds=function(e,t,o){return!!t&&vd(t,e)>0||!!o&&vd(o,e)<0},t.prototype._getErrorMessage=function(){if(!this.state.isDatePickerShown)return this.state.errorMessage},t.defaultProps={allowTextInput:!1,formatDate:function(e){return e?e.toDateString():""},parseDateFromString:function(e){var t=Date.parse(e);return t?new Date(t):null},firstDayOfWeek:Bu.Sunday,initialPickerDate:new Date,isRequired:!1,isMonthPickerVisible:!0,showMonthPickerAsOverlay:!1,strings:bf,highlightCurrentMonth:!1,highlightSelectedMonth:!1,borderless:!1,pickerAriaLabel:"Calendar",showWeekNumbers:!1,firstWeekOfYear:Fu.FirstDay,showGoToToday:!0,dateTimeFormatter:void 0,showCloseButton:!1,underlined:!1,allFocusable:!1},t}(b.Component),yf={root:"ms-DatePicker",callout:"ms-DatePicker-callout",withLabel:"ms-DatePicker-event--with-label",withoutLabel:"ms-DatePicker-event--without-label",disabled:"msDatePickerDisabled "},Cf=xn(_f,(function(e){var t=e.className,o=e.theme,n=e.disabled,r=e.label,i=e.isDatePickerShown,s=o.palette,a=o.semanticColors,l=o.effects,c=o.fonts,u=Oo(yf,o),d={color:s.neutralSecondary,fontSize:c.mediumPlus.fontSize,lineHeight:"18px",pointerEvents:"none",position:"absolute",right:"4px",padding:"5px"};return{root:[u.root,o.fonts.medium,i&&"is-open",Uo,t],textField:[{position:"relative",selectors:{"& input[readonly]":{cursor:"pointer"},input:{selectors:{"::-ms-clear":{display:"none"}}}}},n&&{selectors:{"& input[readonly]":{cursor:"default"}}}],callout:[u.callout,{boxShadow:l.elevation8}],icon:[d,r?u.withLabel:u.withoutLabel,{paddingTop:"7px"},!n&&[u.disabled,{pointerEvents:"initial",cursor:"pointer"}],n&&{color:a.disabledText,cursor:"default"}]}}),void 0,{scope:"DatePicker"}),Sf="change";!function(e){e[e.none=0]="none",e[e.single=1]="single",e[e.multiple=2]="multiple"}(af||(af={})),function(e){e[e.horizontal=0]="horizontal",e[e.vertical=1]="vertical"}(lf||(lf={}));var xf=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=e[0]||{},n=o.onSelectionChanged,r=o.getKey,i=o.canSelectItem,s=void 0===i?function(){return!0}:i,a=o.items,l=o.selectionMode,c=void 0===l?af.multiple:l;this.mode=c,this._getKey=r||kf,this._changeEventSuppressionCount=0,this._exemptedCount=0,this._anchoredIndex=0,this._unselectableCount=0,this._onSelectionChanged=n,this._canSelectItem=s,this._isModal=!1,this.setItems(a||[],!0),this.count=this.getSelectedCount()}return e.prototype.canSelectItem=function(e,t){return!("number"==typeof t&&t<0)&&this._canSelectItem(e,t)},e.prototype.getKey=function(e,t){var o=this._getKey(e,t);return"number"==typeof o||o?""+o:""},e.prototype.setChangeEvents=function(e,t){this._changeEventSuppressionCount+=e?-1:1,0===this._changeEventSuppressionCount&&this._hasChanged&&(this._hasChanged=!1,t||this._change())},e.prototype.isModal=function(){return this._isModal},e.prototype.setModal=function(e){this._isModal!==e&&(this.setChangeEvents(!1),this._isModal=e,e||this.setAllSelected(!1),this._change(),this.setChangeEvents(!0))},e.prototype.setItems=function(e,t){void 0===t&&(t=!0);var o={},n={},r=!1;this.setChangeEvents(!1),this._unselectableCount=0;for(var i=0;i<e.length;i++){if(u=e[i]){var s=this.getKey(u,i);s&&(o[s]=i)}n[i]=u&&!this.canSelectItem(u),n[i]&&this._unselectableCount++}(t||0===e.length)&&this._setAllSelected(!1,!0);var a={},l=0;for(var c in this._exemptedIndices)if(this._exemptedIndices.hasOwnProperty(c)){var u,d=Number(c),p=(u=this._items[d])?this.getKey(u,Number(d)):void 0,h=p?o[p]:d;void 0===h?r=!0:(a[h]=!0,l++,r=r||h!==d)}this._items&&0===this._exemptedCount&&e.length!==this._items.length&&this._isAllSelected&&(r=!0),this._exemptedIndices=a,this._exemptedCount=l,this._keyToIndexMap=o,this._unselectableIndices=n,this._items=e,this._selectedItems=null,r&&(this._updateCount(),this._change()),this.setChangeEvents(!0)},e.prototype.getItems=function(){return this._items},e.prototype.getSelection=function(){if(!this._selectedItems){this._selectedItems=[];var e=this._items;if(e)for(var t=0;t<e.length;t++)this.isIndexSelected(t)&&this._selectedItems.push(e[t])}return this._selectedItems},e.prototype.getSelectedCount=function(){return this._isAllSelected?this._items.length-this._exemptedCount-this._unselectableCount:this._exemptedCount},e.prototype.getSelectedIndices=function(){if(!this._selectedIndices){this._selectedIndices=[];var e=this._items;if(e)for(var t=0;t<e.length;t++)this.isIndexSelected(t)&&this._selectedIndices.push(t)}return this._selectedIndices},e.prototype.isRangeSelected=function(e,t){if(0===t)return!1;for(var o=e+t,n=e;n<o;n++)if(!this.isIndexSelected(n))return!1;return!0},e.prototype.isAllSelected=function(){var e=this._items.length-this._unselectableCount;return this.mode===af.single&&(e=Math.min(e,1)),this.count>0&&this._isAllSelected&&0===this._exemptedCount||!this._isAllSelected&&this._exemptedCount===e&&e>0},e.prototype.isKeySelected=function(e){var t=this._keyToIndexMap[e];return this.isIndexSelected(t)},e.prototype.isIndexSelected=function(e){return!!(this.count>0&&this._isAllSelected&&!this._exemptedIndices[e]&&!this._unselectableIndices[e]||!this._isAllSelected&&this._exemptedIndices[e])},e.prototype.setAllSelected=function(e){if(!e||this.mode===af.multiple){var t=this._items?this._items.length-this._unselectableCount:0;this.setChangeEvents(!1),t>0&&(this._exemptedCount>0||e!==this._isAllSelected)&&(this._exemptedIndices={},(e!==this._isAllSelected||this._exemptedCount>0)&&(this._exemptedCount=0,this._isAllSelected=e,this._change()),this._updateCount()),this.setChangeEvents(!0)}},e.prototype.setKeySelected=function(e,t,o){var n=this._keyToIndexMap[e];n>=0&&this.setIndexSelected(n,t,o)},e.prototype.setIndexSelected=function(e,t,o){if(this.mode!==af.none&&!((e=Math.min(Math.max(0,e),this._items.length-1))<0||e>=this._items.length)){this.setChangeEvents(!1);var n=this._exemptedIndices[e];!this._unselectableIndices[e]&&(t&&this.mode===af.single&&this._setAllSelected(!1,!0),n&&(t&&this._isAllSelected||!t&&!this._isAllSelected)&&(delete this._exemptedIndices[e],this._exemptedCount--),!n&&(t&&!this._isAllSelected||!t&&this._isAllSelected)&&(this._exemptedIndices[e]=!0,this._exemptedCount++),o&&(this._anchoredIndex=e)),this._updateCount(),this.setChangeEvents(!0)}},e.prototype.selectToKey=function(e,t){this.selectToIndex(this._keyToIndexMap[e],t)},e.prototype.selectToIndex=function(e,t){if(this.mode!==af.none)if(this.mode!==af.single){var o=this._anchoredIndex||0,n=Math.min(e,o),r=Math.max(e,o);for(this.setChangeEvents(!1),t&&this._setAllSelected(!1,!0);n<=r;n++)this.setIndexSelected(n,!0,!1);this.setChangeEvents(!0)}else this.setIndexSelected(e,!0,!0)},e.prototype.toggleAllSelected=function(){this.setAllSelected(!this.isAllSelected())},e.prototype.toggleKeySelected=function(e){this.setKeySelected(e,!this.isKeySelected(e),!0)},e.prototype.toggleIndexSelected=function(e){this.setIndexSelected(e,!this.isIndexSelected(e),!0)},e.prototype.toggleRangeSelected=function(e,t){if(this.mode!==af.none){var o=this.isRangeSelected(e,t),n=e+t;if(!(this.mode===af.single&&t>1)){this.setChangeEvents(!1);for(var r=e;r<n;r++)this.setIndexSelected(r,!o,!1);this.setChangeEvents(!0)}}},e.prototype._updateCount=function(e){void 0===e&&(e=!1);var t=this.getSelectedCount();t!==this.count&&(this.count=t,this._change()),this.count||e||this.setModal(!1)},e.prototype._setAllSelected=function(e,t){if(void 0===t&&(t=!1),!e||this.mode===af.multiple){var o=this._items?this._items.length-this._unselectableCount:0;this.setChangeEvents(!1),o>0&&(this._exemptedCount>0||e!==this._isAllSelected)&&(this._exemptedIndices={},(e!==this._isAllSelected||this._exemptedCount>0)&&(this._exemptedCount=0,this._isAllSelected=e,this._change()),this._updateCount(t)),this.setChangeEvents(!0)}},e.prototype._change=function(){0===this._changeEventSuppressionCount?(this._selectedItems=null,this._selectedIndices=void 0,Ws.raise(this,Sf),this._onSelectionChanged&&this._onSelectionChanged()):this._hasChanged=!0},e}();function kf(e,t){var o=(e||{}).key;return void 0===o?""+t:o}var wf,If,Df,Pf,Tf,Ef,Mf=function(e){function t(t){var o=e.call(this,t)||this;o._root=b.createRef(),o.ignoreNextFocus=function(){o._handleNextFocus(!1)},o._onSelectionChange=function(){var e=o.props.selection,t=e.isModal&&e.isModal();o.setState({isModal:t})},o._onMouseDownCapture=function(e){var t=e.target;if(document.activeElement===t||Ni(document.activeElement,t)){if(Ni(t,o._root.current))for(;t!==o._root.current;){if(o._hasAttribute(t,"data-selection-invoke")){o.ignoreNextFocus();break}t=Mi(t)}}else o.ignoreNextFocus()},o._onFocus=function(e){var t=e.target,n=o.props.selection,r=o._isCtrlPressed||o._isMetaPressed,i=o._getSelectionMode();if(o._shouldHandleFocus&&i!==af.none){var s=o._hasAttribute(t,"data-selection-toggle"),a=o._findItemRoot(t);if(!s&&a){var l=o._getItemIndex(a);r?(n.setIndexSelected(l,n.isIndexSelected(l),!0),o.props.enterModalOnTouch&&o._isTouch&&n.setModal&&(n.setModal(!0),o._setIsTouch(!1))):o.props.isSelectedOnFocus&&o._onItemSurfaceClick(e,l)}}o._handleNextFocus(!1)},o._onMouseDown=function(e){o._updateModifiers(e);var t=e.target,n=o._findItemRoot(t);if(!o._isSelectionDisabled(t))for(;t!==o._root.current&&!o._hasAttribute(t,"data-selection-all-toggle");){if(n){if(o._hasAttribute(t,"data-selection-toggle"))break;if(o._hasAttribute(t,"data-selection-invoke"))break;if(!(t!==n&&!o._shouldAutoSelect(t)||o._isShiftPressed||o._isCtrlPressed||o._isMetaPressed)){o._onInvokeMouseDown(e,o._getItemIndex(n));break}if(o.props.disableAutoSelectOnInputElements&&("A"===t.tagName||"BUTTON"===t.tagName||"INPUT"===t.tagName))return}t=Mi(t)}},o._onTouchStartCapture=function(e){o._setIsTouch(!0)},o._onClick=function(e){var t=o.props.enableTouchInvocationTarget,n=void 0!==t&&t;o._updateModifiers(e);for(var r=e.target,i=o._findItemRoot(r),s=o._isSelectionDisabled(r);r!==o._root.current;){if(o._hasAttribute(r,"data-selection-all-toggle")){s||o._onToggleAllClick(e);break}if(i){var a=o._getItemIndex(i);if(o._hasAttribute(r,"data-selection-toggle")){s||(o._isShiftPressed?o._onItemSurfaceClick(e,a):o._onToggleClick(e,a));break}if(o._isTouch&&n&&o._hasAttribute(r,"data-selection-touch-invoke")||o._hasAttribute(r,"data-selection-invoke")){o._onInvokeClick(e,a);break}if(r===i){s||o._onItemSurfaceClick(e,a);break}if("A"===r.tagName||"BUTTON"===r.tagName||"INPUT"===r.tagName)return}r=Mi(r)}},o._onContextMenu=function(e){var t=e.target,n=o.props,r=n.onItemContextMenu,i=n.selection;if(r){var s=o._findItemRoot(t);if(s){var a=o._getItemIndex(s);o._onInvokeMouseDown(e,a),r(i.getItems()[a],a,e.nativeEvent)||e.preventDefault()}}},o._onDoubleClick=function(e){var t=e.target,n=o.props.onItemInvoked,r=o._findItemRoot(t);if(r&&n&&!o._isInputElement(t)){for(var i=o._getItemIndex(r);t!==o._root.current&&!o._hasAttribute(t,"data-selection-toggle")&&!o._hasAttribute(t,"data-selection-invoke");){if(t===r){o._onInvokeClick(e,i);break}t=Mi(t)}t=Mi(t)}},o._onKeyDownCapture=function(e){o._updateModifiers(e),o._handleNextFocus(!0)},o._onKeyDown=function(e){o._updateModifiers(e);var t=e.target,n=o._isSelectionDisabled(t),r=o.props.selection,i=e.which===wn.a&&(o._isCtrlPressed||o._isMetaPressed),s=e.which===wn.escape;if(!o._isInputElement(t)){var a=o._getSelectionMode();if(i&&a===af.multiple&&!r.isAllSelected())return n||r.setAllSelected(!0),e.stopPropagation(),void e.preventDefault();if(s&&r.getSelectedCount()>0)return n||r.setAllSelected(!1),e.stopPropagation(),void e.preventDefault();var l=o._findItemRoot(t);if(l)for(var c=o._getItemIndex(l);t!==o._root.current&&!o._hasAttribute(t,"data-selection-toggle");){if(o._shouldAutoSelect(t)){n||o._onInvokeMouseDown(e,c);break}if(!(e.which!==wn.enter&&e.which!==wn.space||"BUTTON"!==t.tagName&&"A"!==t.tagName&&"INPUT"!==t.tagName))return!1;if(t===l){if(e.which===wn.enter)return o._onInvokeClick(e,c),void e.preventDefault();if(e.which===wn.space)return n||o._onToggleClick(e,c),void e.preventDefault();break}t=Mi(t)}}},o._events=new Ws(o),o._async=new di(o),si(o);var n=o.props.selection,r=n.isModal&&n.isModal();return o.state={isModal:r},o}return p(t,e),t.getDerivedStateFromProps=function(e,t){var o=e.selection.isModal&&e.selection.isModal();return h(h({},t),{isModal:o})},t.prototype.componentDidMount=function(){var e=rt(this._root.current);this._events.on(e,"keydown, keyup",this._updateModifiers,!0),this._events.on(document,"click",this._findScrollParentAndTryClearOnEmptyClick),this._events.on(document.body,"touchstart",this._onTouchStartCapture,!0),this._events.on(document.body,"touchend",this._onTouchStartCapture,!0),this._events.on(this.props.selection,"change",this._onSelectionChange)},t.prototype.render=function(){var e=this.state.isModal;return b.createElement("div",{className:Sr("ms-SelectionZone",this.props.className,{"ms-SelectionZone--modal":!!e}),ref:this._root,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onKeyDownCapture:this._onKeyDownCapture,onClick:this._onClick,role:"presentation",onDoubleClick:this._onDoubleClick,onContextMenu:this._onContextMenu,onMouseDownCapture:this._onMouseDownCapture,onFocusCapture:this._onFocus,"data-selection-is-modal":!!e||void 0},this.props.children,b.createElement(ha,null))},t.prototype.componentDidUpdate=function(e){var t=this.props.selection;t!==e.selection&&(this._events.off(e.selection),this._events.on(t,"change",this._onSelectionChange))},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose()},t.prototype._isSelectionDisabled=function(e){if(this._getSelectionMode()===af.none)return!0;for(;e!==this._root.current;){if(this._hasAttribute(e,"data-selection-disabled"))return!0;e=Mi(e)}return!1},t.prototype._onToggleAllClick=function(e){var t=this.props.selection;this._getSelectionMode()===af.multiple&&(t.toggleAllSelected(),e.stopPropagation(),e.preventDefault())},t.prototype._onToggleClick=function(e,t){var o=this.props.selection,n=this._getSelectionMode();if(o.setChangeEvents(!1),this.props.enterModalOnTouch&&this._isTouch&&!o.isIndexSelected(t)&&o.setModal&&(o.setModal(!0),this._setIsTouch(!1)),n===af.multiple)o.toggleIndexSelected(t);else{if(n!==af.single)return void o.setChangeEvents(!0);var r=o.isIndexSelected(t),i=o.isModal&&o.isModal();o.setAllSelected(!1),o.setIndexSelected(t,!r,!0),i&&o.setModal&&o.setModal(!0)}o.setChangeEvents(!0),e.stopPropagation()},t.prototype._onInvokeClick=function(e,t){var o=this.props,n=o.selection,r=o.onItemInvoked;r&&(r(n.getItems()[t],t,e.nativeEvent),e.preventDefault(),e.stopPropagation())},t.prototype._onItemSurfaceClick=function(e,t){var o=this.props.selection,n=this._isCtrlPressed||this._isMetaPressed,r=this._getSelectionMode();r===af.multiple?this._isShiftPressed&&!this._isTabPressed?o.selectToIndex(t,!n):n?o.toggleIndexSelected(t):this._clearAndSelectIndex(t):r===af.single&&this._clearAndSelectIndex(t)},t.prototype._onInvokeMouseDown=function(e,t){this.props.selection.isIndexSelected(t)||this._clearAndSelectIndex(t)},t.prototype._findScrollParentAndTryClearOnEmptyClick=function(e){var t=hs(this._root.current);this._events.off(document,"click",this._findScrollParentAndTryClearOnEmptyClick),this._events.on(t,"click",this._tryClearOnEmptyClick),(t&&e.target instanceof Node&&t.contains(e.target)||t===e.target)&&this._tryClearOnEmptyClick(e)},t.prototype._tryClearOnEmptyClick=function(e){!this.props.selectionPreservedOnEmptyClick&&this._isNonHandledClick(e.target)&&this.props.selection.setAllSelected(!1)},t.prototype._clearAndSelectIndex=function(e){var t=this.props.selection;if(!(1===t.getSelectedCount()&&t.isIndexSelected(e))){var o=t.isModal&&t.isModal();t.setChangeEvents(!1),t.setAllSelected(!1),t.setIndexSelected(e,!0,!0),(o||this.props.enterModalOnTouch&&this._isTouch)&&(t.setModal&&t.setModal(!0),this._isTouch&&this._setIsTouch(!1)),t.setChangeEvents(!0)}},t.prototype._updateModifiers=function(e){this._isShiftPressed=e.shiftKey,this._isCtrlPressed=e.ctrlKey,this._isMetaPressed=e.metaKey;var t=e.keyCode;this._isTabPressed=!!t&&t===wn.tab},t.prototype._findItemRoot=function(e){for(var t=this.props.selection;e!==this._root.current;){var o=e.getAttribute("data-selection-index"),n=Number(o);if(null!==o&&n>=0&&n<t.getItems().length)break;e=Mi(e)}if(e!==this._root.current)return e},t.prototype._getItemIndex=function(e){return Number(e.getAttribute("data-selection-index"))},t.prototype._shouldAutoSelect=function(e){return this._hasAttribute(e,"data-selection-select")},t.prototype._hasAttribute=function(e,t){for(var o=!1;!o&&e!==this._root.current;)o="true"===e.getAttribute(t),e=Mi(e);return o},t.prototype._isInputElement=function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName},t.prototype._isNonHandledClick=function(e){var t=tt();if(t&&e)for(;e&&e!==t.documentElement;){if(Ki(e))return!1;e=Mi(e)}return!0},t.prototype._handleNextFocus=function(e){var t=this;this._shouldHandleFocusTimeoutId&&(this._async.clearTimeout(this._shouldHandleFocusTimeoutId),this._shouldHandleFocusTimeoutId=void 0),this._shouldHandleFocus=e,e&&this._async.setTimeout((function(){t._shouldHandleFocus=!1}),100)},t.prototype._setIsTouch=function(e){var t=this;this._isTouchTimeoutId&&(this._async.clearTimeout(this._isTouchTimeoutId),this._isTouchTimeoutId=void 0),this._isTouch=!0,e&&this._async.setTimeout((function(){t._isTouch=!1}),300)},t.prototype._getSelectionMode=function(){var e=this.props.selection,t=this.props.selectionMode;return void 0===t?e?e.mode:af.none:t},t.defaultProps={isSelectedOnFocus:!0,selectionMode:af.multiple},t}(b.Component);!function(e){e[e.hidden=0]="hidden",e[e.visible=1]="visible"}(wf||(wf={})),function(e){e[e.disabled=0]="disabled",e[e.clickable=1]="clickable",e[e.hasDropdown=2]="hasDropdown"}(If||(If={})),function(e){e[e.unconstrained=0]="unconstrained",e[e.horizontalConstrained=1]="horizontalConstrained"}(Df||(Df={})),function(e){e[e.outside=0]="outside",e[e.surface=1]="surface",e[e.header=2]="header"}(Pf||(Pf={})),function(e){e[e.fixedColumns=0]="fixedColumns",e[e.justified=1]="justified"}(Tf||(Tf={})),function(e){e[e.onHover=0]="onHover",e[e.always=1]="always",e[e.hidden=2]="hidden"}(Ef||(Ef={}));var Rf=function(e){var t=e.count,o=e.indentWidth,n=void 0===o?36:o,r=e.role,i=void 0===r?"presentation":r,s=t*n;return t>0?b.createElement("span",{className:"ms-GroupSpacer",style:{display:"inline-block",width:s},role:i}):null},Bf={root:"ms-DetailsRow",compact:"ms-DetailsList--Compact",cell:"ms-DetailsRow-cell",cellAnimation:"ms-DetailsRow-cellAnimation",cellCheck:"ms-DetailsRow-cellCheck",check:"ms-DetailsRow-check",cellMeasurer:"ms-DetailsRow-cellMeasurer",listCellFirstChild:"ms-List-cell:first-child",isContentUnselectable:"is-contentUnselectable",isSelected:"is-selected",isCheckVisible:"is-check-visible",isRowHeader:"is-row-header",fields:"ms-DetailsRow-fields"},Nf={cellLeftPadding:12,cellRightPadding:8,cellExtraRightPadding:24},Ff={rowHeight:42,compactRowHeight:32},Af=h(h({},Ff),{rowVerticalPadding:11,compactRowVerticalPadding:6}),Lf=function(e){var t,o,n,r,i,s,a,l,c,u,d,p,m=e.theme,g=e.isSelected,f=e.canSelect,v=e.droppingClassName,b=e.anySelected,_=e.isCheckVisible,y=e.checkboxCellClassName,C=e.compact,S=e.className,x=e.cellStyleProps,k=void 0===x?Nf:x,w=e.enableUpdateAnimations,I=m.palette,D=m.fonts,P=I.neutralPrimary,T=I.white,E=I.neutralSecondary,M=I.neutralLighter,R=I.neutralLight,B=I.neutralDark,N=I.neutralQuaternaryAlt,F=m.semanticColors.focusBorder,A=Oo(Bf,m),L={defaultHeaderText:P,defaultMetaText:E,defaultBackground:T,defaultHoverHeaderText:B,defaultHoverMetaText:P,defaultHoverBackground:M,selectedHeaderText:B,selectedMetaText:P,selectedBackground:R,selectedHoverHeaderText:B,selectedHoverMetaText:P,selectedHoverBackground:N,focusHeaderText:B,focusMetaText:P,focusBackground:R,focusHoverBackground:N},H=[go(m,{inset:-1,borderColor:F,outlineColor:T}),A.isSelected,{color:L.selectedMetaText,background:L.selectedBackground,borderBottom:"1px solid "+T,selectors:(t={"&:before":{position:"absolute",display:"block",top:-1,height:1,bottom:0,left:0,right:0,content:"",borderTop:"1px solid "+T},"&:hover":{background:L.selectedHoverBackground,color:L.selectedHoverMetaText,selectors:(o={},o["."+A.cell+" "+jt]={color:"HighlightText",selectors:{"> a":{color:"HighlightText"}}},o["."+A.isRowHeader]={color:L.selectedHoverHeaderText,selectors:(n={},n[jt]={color:"HighlightText"},n)},o[jt]={background:"Highlight"},o)},"&:focus":{background:L.focusBackground,selectors:(r={},r["."+A.cell]={color:L.focusMetaText,selectors:(i={},i[jt]={color:"HighlightText",selectors:{"> a":{color:"HighlightText"}}},i)},r["."+A.isRowHeader]={color:L.focusHeaderText,selectors:(s={},s[jt]={color:"HighlightText"},s)},r[jt]={background:"Highlight"},r)}},t[jt]=h(h({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{a:{color:"HighlightText"}}}),t["&:focus:hover"]={background:L.focusHoverBackground},t)}],O=[A.isContentUnselectable,{userSelect:"none",cursor:"default"}],z={minHeight:Af.compactRowHeight,border:0},W={minHeight:Af.compactRowHeight,paddingTop:Af.compactRowVerticalPadding,paddingBottom:Af.compactRowVerticalPadding,paddingLeft:k.cellLeftPadding+"px"},V=[go(m,{inset:-1}),A.cell,{display:"inline-block",position:"relative",boxSizing:"border-box",minHeight:Af.rowHeight,verticalAlign:"top",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:Af.rowVerticalPadding,paddingBottom:Af.rowVerticalPadding,paddingLeft:k.cellLeftPadding+"px",selectors:(a={"& > button":{maxWidth:"100%"}},a["[data-is-focusable='true']"]=go(m,{inset:-1,borderColor:E,outlineColor:T}),a)},g&&{selectors:(l={},l[jt]=h(h({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{a:{color:"HighlightText"}}}),l)},C&&W];return{root:[A.root,Ye.fadeIn400,v,m.fonts.small,_&&A.isCheckVisible,go(m,{borderColor:F,outlineColor:T}),{borderBottom:"1px solid "+M,background:L.defaultBackground,color:L.defaultMetaText,display:"inline-flex",minWidth:"100%",minHeight:Af.rowHeight,whiteSpace:"nowrap",padding:0,boxSizing:"border-box",verticalAlign:"top",textAlign:"left",selectors:(c={},c["."+A.listCellFirstChild+" &:before"]={display:"none"},c["&:hover"]={background:L.defaultHoverBackground,color:L.defaultHoverMetaText,selectors:(u={},u["."+A.isRowHeader]={color:L.defaultHoverHeaderText},u)},c["&:hover ."+A.check]={opacity:1},c["."+ho+" &:focus ."+A.check]={opacity:1},c)},g&&H,!f&&O,C&&z,S],cellUnpadded:{paddingRight:k.cellRightPadding+"px"},cellPadded:{paddingRight:k.cellExtraRightPadding+k.cellRightPadding+"px",selectors:(d={},d["&."+A.cellCheck]={paddingRight:0},d)},cell:V,cellAnimation:w&&Ae.slideLeftIn40,cellMeasurer:[A.cellMeasurer,{overflow:"visible",whiteSpace:"nowrap"}],checkCell:[V,A.cellCheck,y,{padding:0,paddingTop:1,marginTop:-1,flexShrink:0}],checkCover:{position:"absolute",top:-1,left:0,bottom:0,right:0,display:b?"block":"none"},fields:[A.fields,{display:"flex",alignItems:"stretch"}],isRowHeader:[A.isRowHeader,{color:L.defaultHeaderText,fontSize:D.medium.fontSize},g&&{color:L.selectedHeaderText,fontWeight:Ge.semibold,selectors:(p={},p[jt]={color:"HighlightText"},p)}],isMultiline:[V,{whiteSpace:"normal",wordBreak:"break-word",textOverflow:"clip"}],check:[A.check]}},Hf={tooltipHost:"ms-TooltipHost",root:"ms-DetailsHeader",cell:"ms-DetailsHeader-cell",cellIsCheck:"ms-DetailsHeader-cellIsCheck",collapseButton:"ms-DetailsHeader-collapseButton",isCollapsed:"is-collapsed",isAllSelected:"is-allSelected",isSelectAllHidden:"is-selectAllHidden",isResizingColumn:"is-resizingColumn",cellSizer:"ms-DetailsHeader-cellSizer",isResizing:"is-resizing",dropHintCircleStyle:"ms-DetailsHeader-dropHintCircleStyle",dropHintCaretStyle:"ms-DetailsHeader-dropHintCaretStyle",dropHintLineStyle:"ms-DetailsHeader-dropHintLineStyle",cellTitle:"ms-DetailsHeader-cellTitle",cellName:"ms-DetailsHeader-cellName",filterChevron:"ms-DetailsHeader-filterChevron",gripperBarVertical:"ms-DetailsColumn-gripperBarVertical",checkTooltip:"ms-DetailsHeader-checkTooltip",check:"ms-DetailsHeader-check"},Of=function(e){var t=e.theme,o=e.cellStyleProps,n=void 0===o?Nf:o,r=t.semanticColors;return[Oo(Hf,t).cell,go(t),{color:r.bodyText,position:"relative",display:"inline-block",boxSizing:"border-box",padding:"0 "+n.cellRightPadding+"px 0 "+n.cellLeftPadding+"px",lineHeight:"inherit",margin:"0",height:42,verticalAlign:"top",whiteSpace:"nowrap",textOverflow:"ellipsis",textAlign:"left"}]},zf={root:"ms-DetailsRow-check",isDisabled:"ms-DetailsRow-check--isDisabled",isHeader:"ms-DetailsRow-check--isHeader"},Wf=Mn(),Vf=b.memo((function(e){return b.createElement(Mh,{theme:e.theme,checked:e.checked,className:e.className,useFastIcons:!0})}));function Kf(e){return b.createElement(Mh,{checked:e.checked})}function Uf(e){return b.createElement(Vf,{theme:e.theme,checked:e.checked})}var Gf,jf=xn((function(e){var t=e.isVisible,o=void 0!==t&&t,n=e.canSelect,r=void 0!==n&&n,i=e.anySelected,s=void 0!==i&&i,a=e.selected,l=void 0!==a&&a,c=e.isHeader,u=void 0!==c&&c,d=e.className,p=(e.checkClassName,e.styles),g=e.theme,f=e.compact,v=e.onRenderDetailsCheckbox,_=e.useFastIcons,y=void 0===_||_,C=m(e,["isVisible","canSelect","anySelected","selected","isHeader","className","checkClassName","styles","theme","compact","onRenderDetailsCheckbox","useFastIcons"]),S=y?Uf:Kf,x=v?Wh(v,S):S,k=Wf(p,{theme:g,canSelect:r,selected:l,anySelected:s,className:d,isHeader:u,isVisible:o,compact:f}),w={checked:l,theme:g};return r?b.createElement("div",h({},C,{role:"checkbox",className:Sr(k.root,k.check),"aria-checked":l,"data-selection-toggle":!0,"data-automationid":"DetailsRowCheck"}),x(w)):b.createElement("div",h({},C,{className:Sr(k.root,k.check)}))}),(function(e){var t=e.theme,o=e.className,n=e.isHeader,r=e.selected,i=e.anySelected,s=e.canSelect,a=e.compact,l=e.isVisible,c=Oo(zf,t),u=Ff.rowHeight,d=Ff.compactRowHeight,p=n?42:a?d:u,h=l||r||i;return{root:[c.root,o],check:[!s&&c.isDisabled,n&&c.isHeader,go(t),t.fonts.small,Eh.checkHost,{display:"flex",alignItems:"center",justifyContent:"center",cursor:"default",boxSizing:"border-box",verticalAlign:"top",background:"none",backgroundColor:"transparent",border:"none",opacity:h?1:0,height:p,width:48,padding:0,margin:0}],isDisabled:[]}}),void 0,{scope:"DetailsRowCheck"},!0),Yf=function(){function e(e){this._selection=e.selection,this._dragEnterCounts={},this._activeTargets={},this._lastId=0,this._initialized=!1}return e.prototype.dispose=function(){this._events&&this._events.dispose()},e.prototype.subscribe=function(e,t,o){var n=this;if(!this._initialized){this._events=new Ws(this);var r=tt();r&&(this._events.on(r.body,"mouseup",this._onMouseUp.bind(this),!0),this._events.on(r,"mouseup",this._onDocumentMouseUp.bind(this),!0)),this._initialized=!0}var i,s,a,l,c,u,d,p,h,m,g=o.key,f=void 0===g?""+ ++this._lastId:g,v=[];if(o&&e){var b=o.eventMap,_=o.context,y=o.updateDropState,C={root:e,options:o,key:f};if(p=this._isDraggable(C),h=this._isDroppable(C),(p||h)&&b)for(var S=0,x=b;S<x.length;S++){var k=x[S],w={callback:k.callback.bind(null,_),eventName:k.eventName};v.push(w),this._events.on(e,w.eventName,w.callback)}h&&(s=function(e){e.isHandled||(e.isHandled=!0,n._dragEnterCounts[f]--,0===n._dragEnterCounts[f]&&y(!1,e))},a=function(e){e.preventDefault(),e.isHandled||(e.isHandled=!0,n._dragEnterCounts[f]++,1===n._dragEnterCounts[f]&&y(!0,e))},l=function(e){n._dragEnterCounts[f]=0,y(!1,e)},c=function(e){n._dragEnterCounts[f]=0,y(!1,e),o.onDrop&&o.onDrop(o.context.data,e)},u=function(e){e.preventDefault(),o.onDragOver&&o.onDragOver(o.context.data,e)},this._dragEnterCounts[f]=0,t.on(e,"dragenter",a),t.on(e,"dragleave",s),t.on(e,"dragend",l),t.on(e,"drop",c),t.on(e,"dragover",u)),p&&(d=this._onMouseDown.bind(this,C),l=this._onDragEnd.bind(this,C),i=function(t){var r=o;r&&r.onDragStart&&r.onDragStart(r.context.data,r.context.index,n._selection.getSelection(),t),n._isDragging=!0,t.dataTransfer&&t.dataTransfer.setData("id",e.id)},t.on(e,"dragstart",i),t.on(e,"mousedown",d),t.on(e,"dragend",l)),m={target:C,dispose:function(){if(n._activeTargets[f]===m&&delete n._activeTargets[f],e){for(var o=0,r=v;o<r.length;o++){var g=r[o];n._events.off(e,g.eventName,g.callback)}h&&(t.off(e,"dragenter",a),t.off(e,"dragleave",s),t.off(e,"dragend",l),t.off(e,"dragover",u),t.off(e,"drop",c)),p&&(t.off(e,"dragstart",i),t.off(e,"mousedown",d),t.off(e,"dragend",l))}}},this._activeTargets[f]=m}return{key:f,dispose:function(){m&&m.dispose()}}},e.prototype.unsubscribe=function(e,t){var o=this._activeTargets[t];o&&o.dispose()},e.prototype._onDragEnd=function(e,t){var o=e.options;o.onDragEnd&&o.onDragEnd(o.context.data,t)},e.prototype._onMouseUp=function(e){if(this._isDragging=!1,this._dragData){for(var t=0,o=Object.keys(this._activeTargets);t<o.length;t++){var n=o[t],r=this._activeTargets[n];r.target.root&&(this._events.off(r.target.root,"mousemove"),this._events.off(r.target.root,"mouseleave"))}this._dragData.dropTarget&&(Ws.raise(this._dragData.dropTarget.root,"dragleave"),Ws.raise(this._dragData.dropTarget.root,"drop"))}this._dragData=null},e.prototype._onDocumentMouseUp=function(e){var t=tt();t&&e.target===t.documentElement&&this._onMouseUp(e)},e.prototype._onMouseMove=function(e,t){var o=t.buttons,n=void 0===o?1:o;if(this._dragData&&1!==n)this._onMouseUp(t);else{var r=e.root,i=e.key;this._isDragging&&this._isDroppable(e)&&this._dragData&&this._dragData.dropTarget&&this._dragData.dropTarget.key!==i&&!this._isChild(r,this._dragData.dropTarget.root)&&this._dragEnterCounts[this._dragData.dropTarget.key]>0&&(Ws.raise(this._dragData.dropTarget.root,"dragleave"),Ws.raise(r,"dragenter"),this._dragData.dropTarget=e)}},e.prototype._onMouseLeave=function(e,t){this._isDragging&&this._dragData&&this._dragData.dropTarget&&this._dragData.dropTarget.key===e.key&&(Ws.raise(e.root,"dragleave"),this._dragData.dropTarget=void 0)},e.prototype._onMouseDown=function(e,t){if(0===t.button)if(this._isDraggable(e)){this._dragData={clientX:t.clientX,clientY:t.clientY,eventTarget:t.target,dragTarget:e};for(var o=0,n=Object.keys(this._activeTargets);o<n.length;o++){var r=n[o],i=this._activeTargets[r];i.target.root&&(this._events.on(i.target.root,"mousemove",this._onMouseMove.bind(this,i.target)),this._events.on(i.target.root,"mouseleave",this._onMouseLeave.bind(this,i.target)))}}else this._dragData=null},e.prototype._isChild=function(e,t){for(;t&&t.parentElement;){if(t.parentElement===e)return!0;t=t.parentElement}return!1},e.prototype._isDraggable=function(e){var t=e.options;return!(!t.canDrag||!t.canDrag(t.context.data))},e.prototype._isDroppable=function(e){var t=e.options,o=this._dragData&&this._dragData.dragTarget?this._dragData.dragTarget.options.context:void 0;return!(!t.canDrop||!t.canDrop(t.context,o))},e}(),qf=Mn(),Zf=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._onRenderColumnHeaderTooltip=function(e){return b.createElement("span",{className:e.hostClassName},e.children)},o._onColumnClick=function(e){var t=o.props,n=t.onColumnClick,r=t.column;r.columnActionsMode!==If.disabled&&(r.onColumnClick&&r.onColumnClick(e,r),n&&n(e,r))},o._onDragStart=function(e,t,n,r){var i=o._classNames;t&&(o._updateHeaderDragInfo(t),o._root.current.classList.add(i.borderWhileDragging),o._async.setTimeout((function(){o._root.current&&o._root.current.classList.add(i.noBorderWhileDragging)}),20))},o._onDragEnd=function(e,t){var n=o._classNames;t&&o._updateHeaderDragInfo(-1,t),o._root.current.classList.remove(n.borderWhileDragging),o._root.current.classList.remove(n.noBorderWhileDragging)},o._updateHeaderDragInfo=function(e,t){o.props.setDraggedItemIndex&&o.props.setDraggedItemIndex(e),o.props.updateDragInfo&&o.props.updateDragInfo({itemIndex:e},t)},o._onColumnContextMenu=function(e){var t=o.props,n=t.onColumnContextMenu,r=t.column;r.onColumnContextMenu&&(r.onColumnContextMenu(r,e),e.preventDefault()),n&&(n(r,e),e.preventDefault())},o._onRootMouseDown=function(e){o.props.isDraggable&&0===e.button&&e.stopPropagation()},si(o),o._async=new di(o),o._events=new Ws(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.column,o=e.columnIndex,n=e.parentId,r=e.isDraggable,i=e.styles,s=e.theme,a=e.cellStyleProps,l=void 0===a?Nf:a,c=e.useFastIcons,u=void 0===c||c,d=this.props.onRenderColumnHeaderTooltip,p=void 0===d?this._onRenderColumnHeaderTooltip:d;this._classNames=qf(i,{theme:s,headerClassName:t.headerClassName,iconClassName:t.iconClassName,isActionable:t.columnActionsMode!==If.disabled,isEmpty:!t.name,isIconVisible:t.isSorted||t.isGrouped||t.isFiltered,isPadded:t.isPadded,isIconOnly:t.isIconOnly,cellStyleProps:l,transitionDurationDrag:200,transitionDurationDrop:1500});var h=this._classNames,m=u?Mr:Fr;return b.createElement(b.Fragment,null,b.createElement("div",{key:t.key,ref:this._root,role:"columnheader","aria-sort":t.isSorted?t.isSortedDescending?"descending":"ascending":"none","aria-colindex":o,className:h.root,"data-is-draggable":r,draggable:r,style:{width:t.calculatedWidth+l.cellLeftPadding+l.cellRightPadding+(t.isPadded?l.cellExtraRightPadding:0)},"data-automationid":"ColumnsHeaderColumn","data-item-key":t.key},r&&b.createElement(m,{iconName:"GripperBarVertical",className:h.gripperBarVerticalStyle}),p({hostClassName:h.cellTooltip,id:n+"-"+t.key+"-tooltip",setAriaDescribedBy:!1,column:t,content:t.columnActionsMode!==If.disabled?t.ariaLabel:"",children:b.createElement("span",{id:n+"-"+t.key,"aria-label":t.isIconOnly?t.name:void 0,"aria-labelledby":t.isIconOnly?void 0:n+"-"+t.key+"-name",className:h.cellTitle,"data-is-focusable":t.columnActionsMode!==If.disabled,role:t.columnActionsMode===If.disabled||void 0===t.onColumnClick&&void 0===this.props.onColumnClick?void 0:"button","aria-describedby":!this.props.onRenderColumnHeaderTooltip&&this._hasAccessibleLabel()?n+"-"+t.key+"-tooltip":void 0,onContextMenu:this._onColumnContextMenu,onClick:this._onColumnClick,"aria-haspopup":t.columnActionsMode===If.hasDropdown,"aria-expanded":t.columnActionsMode===If.hasDropdown?!!t.isMenuOpen:void 0},b.createElement("span",{id:n+"-"+t.key+"-name",className:h.cellName},(t.iconName||t.iconClassName)&&b.createElement(m,{className:h.iconClassName,iconName:t.iconName}),t.isIconOnly?b.createElement("span",{className:h.accessibleLabel},t.name):t.name),t.isFiltered&&b.createElement(m,{className:h.nearIcon,iconName:"Filter"}),t.isSorted&&b.createElement(m,{className:h.sortIcon,iconName:t.isSortedDescending?"SortDown":"SortUp"}),t.isGrouped&&b.createElement(m,{className:h.nearIcon,iconName:"GroupedDescending"}),t.columnActionsMode===If.hasDropdown&&!t.isIconOnly&&b.createElement(m,{"aria-hidden":!0,className:h.filterChevron,iconName:"ChevronDown"}))},this._onRenderColumnHeaderTooltip)),this.props.onRenderColumnHeaderTooltip?null:this._renderAccessibleLabel())},t.prototype.componentDidMount=function(){var e=this;this.props.dragDropHelper&&this.props.isDraggable&&this._addDragDropHandling();var t=this._classNames;this.props.isDropped&&(this._root.current&&(this._root.current.classList.add(t.borderAfterDropping),this._async.setTimeout((function(){e._root.current&&e._root.current.classList.add(t.noBorderAfterDropping)}),20)),this._async.setTimeout((function(){e._root.current&&(e._root.current.classList.remove(t.borderAfterDropping),e._root.current.classList.remove(t.noBorderAfterDropping))}),1520))},t.prototype.componentWillUnmount=function(){this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this._async.dispose(),this._events.dispose()},t.prototype.componentDidUpdate=function(){!this._dragDropSubscription&&this.props.dragDropHelper&&this.props.isDraggable&&this._addDragDropHandling(),this._dragDropSubscription&&!this.props.isDraggable&&(this._dragDropSubscription.dispose(),this._events.off(this._root.current,"mousedown"),delete this._dragDropSubscription)},t.prototype._getColumnDragDropOptions=function(){var e=this,t=this.props.columnIndex;return{selectionIndex:t,context:{data:t,index:t},canDrag:function(){return e.props.isDraggable},canDrop:function(){return!1},onDragStart:this._onDragStart,updateDropState:function(){},onDrop:function(){},onDragEnd:this._onDragEnd}},t.prototype._hasAccessibleLabel=function(){var e=this.props.column;return!!(e.ariaLabel||e.filterAriaLabel||e.sortAscendingAriaLabel||e.sortDescendingAriaLabel||e.groupAriaLabel)},t.prototype._renderAccessibleLabel=function(){var e=this.props,t=e.column,o=e.parentId,n=this._classNames;return this._hasAccessibleLabel()&&!this.props.onRenderColumnHeaderTooltip?b.createElement("label",{key:t.key+"_label",id:o+"-"+t.key+"-tooltip",className:n.accessibleLabel},t.ariaLabel,t.isFiltered&&t.filterAriaLabel||null,t.isSorted&&(t.isSortedDescending?t.sortDescendingAriaLabel:t.sortAscendingAriaLabel)||null,t.isGrouped&&t.groupAriaLabel||null):null},t.prototype._addDragDropHandling=function(){this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getColumnDragDropOptions()),this._events.on(this._root.current,"mousedown",this._onRootMouseDown)},t}(b.Component),Xf={isActionable:"is-actionable",cellIsCheck:"ms-DetailsHeader-cellIsCheck",collapseButton:"ms-DetailsHeader-collapseButton",isCollapsed:"is-collapsed",isAllSelected:"is-allSelected",isSelectAllHidden:"is-selectAllHidden",isResizingColumn:"is-resizingColumn",isEmpty:"is-empty",isIconVisible:"is-icon-visible",cellSizer:"ms-DetailsHeader-cellSizer",isResizing:"is-resizing",dropHintCircleStyle:"ms-DetailsHeader-dropHintCircleStyle",dropHintLineStyle:"ms-DetailsHeader-dropHintLineStyle",cellTitle:"ms-DetailsHeader-cellTitle",cellName:"ms-DetailsHeader-cellName",filterChevron:"ms-DetailsHeader-filterChevron",gripperBarVerticalStyle:"ms-DetailsColumn-gripperBar",nearIcon:"ms-DetailsColumn-nearIcon"},Qf=xn(Zf,(function(e){var t,o=e.theme,n=e.headerClassName,r=e.iconClassName,i=e.isActionable,s=e.isEmpty,a=e.isIconVisible,l=e.isPadded,c=e.isIconOnly,u=e.cellStyleProps,d=void 0===u?Nf:u,p=e.transitionDurationDrag,m=e.transitionDurationDrop,g=o.semanticColors,f=o.palette,v=o.fonts,b=Oo(Xf,o),_={iconForegroundColor:g.bodySubtext,headerForegroundColor:g.bodyText,headerBackgroundColor:g.bodyBackground,dropdownChevronForegroundColor:f.neutralSecondary,resizerColor:f.neutralTertiaryAlt},y={color:_.iconForegroundColor,opacity:1,paddingLeft:8},C={outline:"1px solid "+f.themePrimary},S={outlineColor:"transparent"};return{root:[Of(e),v.small,i&&[b.isActionable,{selectors:{":hover":{color:g.bodyText,background:g.listHeaderBackgroundHovered},":active":{background:g.listHeaderBackgroundPressed}}}],s&&[b.isEmpty,{textOverflow:"clip"}],a&&b.isIconVisible,l&&{paddingRight:d.cellExtraRightPadding+d.cellRightPadding},{selectors:{':hover i[data-icon-name="GripperBarVertical"]':{display:"block"}}},n],gripperBarVerticalStyle:{display:"none",position:"absolute",textAlign:"left",color:f.neutralTertiary,left:1},nearIcon:[b.nearIcon,y],sortIcon:[y,{paddingLeft:4,position:"relative",top:1}],iconClassName:[{color:_.iconForegroundColor,opacity:1},r],filterChevron:[b.filterChevron,{color:_.dropdownChevronForegroundColor,paddingLeft:6,verticalAlign:"middle",fontSize:v.small.fontSize}],cellTitle:[b.cellTitle,go(o),h({display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"stretch",boxSizing:"border-box",overflow:"hidden",padding:"0 "+d.cellRightPadding+"px 0 "+d.cellLeftPadding+"px"},c?{alignContent:"flex-end",maxHeight:"100%",flexWrap:"wrap-reverse"}:{})],cellName:[b.cellName,{flex:"0 1 auto",overflow:"hidden",textOverflow:"ellipsis",fontWeight:Ge.semibold,fontSize:v.medium.fontSize},c&&{selectors:(t={},t["."+b.nearIcon]={paddingLeft:0},t)}],cellTooltip:{display:"block",position:"absolute",top:0,left:0,bottom:0,right:0},accessibleLabel:yo,borderWhileDragging:C,noBorderWhileDragging:[S,{transition:"outline "+p+"ms ease"}],borderAfterDropping:C,noBorderAfterDropping:[S,{transition:"outline "+m+"ms ease"}]}}),void 0,{scope:"DetailsColumn"});!function(e){e[e.none=0]="none",e[e.hidden=1]="hidden",e[e.visible=2]="visible"}(Gf||(Gf={}));var Jf=Mn(),$f=[],ev=function(e){function t(t){var o=e.call(this,t)||this;return o._rootElement=b.createRef(),o._rootComponent=b.createRef(),o._draggedColumnIndex=-1,o._dropHintDetails={},o._updateDroppingState=function(e,t){o._draggedColumnIndex>=0&&"drop"!==t.type&&!e&&o._resetDropHints()},o._onDragOver=function(e,t){o._draggedColumnIndex>=0&&(t.stopPropagation(),o._computeDropHintToBeShown(t.clientX))},o._onDrop=function(e,t){var n=o._getColumnReorderProps();if(o._draggedColumnIndex>=0&&t){var r=o._draggedColumnIndex>o._currentDropHintIndex?o._currentDropHintIndex:o._currentDropHintIndex-1,i=o._isValidCurrentDropHintIndex();if(t.stopPropagation(),i)if(o._onDropIndexInfo.sourceIndex=o._draggedColumnIndex,o._onDropIndexInfo.targetIndex=r,n.onColumnDrop){var s={draggedIndex:o._draggedColumnIndex,targetIndex:r};n.onColumnDrop(s)}else n.handleColumnReorder&&n.handleColumnReorder(o._draggedColumnIndex,r)}o._resetDropHints(),o._dropHintDetails={},o._draggedColumnIndex=-1},o._updateDragInfo=function(e,t){var n=o._getColumnReorderProps(),r=e.itemIndex;if(r>=0)o._draggedColumnIndex=o._isCheckboxColumnHidden()?r-1:r-2,o._getDropHintPositions(),n.onColumnDragStart&&n.onColumnDragStart(!0);else if(t&&o._draggedColumnIndex>=0&&(o._resetDropHints(),o._draggedColumnIndex=-1,o._dropHintDetails={},n.onColumnDragEnd)){var i=o._isEventOnHeader(t);n.onColumnDragEnd({dropLocation:i},t)}},o._getDropHintPositions=function(){for(var e,t=o.props.columns,n=void 0===t?$f:t,r=o._getColumnReorderProps(),i=0,s=0,a=r.frozenColumnCountFromStart||0,l=r.frozenColumnCountFromEnd||0,c=a;c<n.length-l+1;c++)if(o._rootElement.current){var u=o._rootElement.current.querySelectorAll("#columnDropHint_"+c)[0];if(u)if(c===a)i=u.offsetLeft,s=u.offsetLeft,e=u;else{var d=(u.offsetLeft+i)/2;o._dropHintDetails[c-1]={originX:i,startX:s,endX:d,dropHintElementRef:e},s=d,e=u,i=u.offsetLeft,c===n.length-l&&(o._dropHintDetails[c]={originX:i,startX:s,endX:u.offsetLeft,dropHintElementRef:e})}}},o._computeDropHintToBeShown=function(e){var t=In(o.props.theme);if(o._rootElement.current){var n=e-o._rootElement.current.getBoundingClientRect().left,r=o._currentDropHintIndex;if(o._isValidCurrentDropHintIndex()&&tv(t,n,o._dropHintDetails[r].startX,o._dropHintDetails[r].endX))return;var i=o.props.columns,s=void 0===i?$f:i,a=o._getColumnReorderProps(),l=a.frozenColumnCountFromStart||0,c=a.frozenColumnCountFromEnd||0,u=l,d=s.length-c,p=-1;if(ov(t,n,o._dropHintDetails[u].endX)?p=u:nv(t,n,o._dropHintDetails[d].startX)?p=d:o._isValidCurrentDropHintIndex()&&(o._dropHintDetails[r+1]&&tv(t,n,o._dropHintDetails[r+1].startX,o._dropHintDetails[r+1].endX)?p=r+1:o._dropHintDetails[r-1]&&tv(t,n,o._dropHintDetails[r-1].startX,o._dropHintDetails[r-1].endX)&&(p=r-1)),-1===p)for(var h=l,m=d;h<m;){var g=Math.ceil((m+h)/2);if(tv(t,n,o._dropHintDetails[g].startX,o._dropHintDetails[g].endX)){p=g;break}ov(t,n,o._dropHintDetails[g].originX)?m=g:nv(t,n,o._dropHintDetails[g].originX)&&(h=g)}p===o._draggedColumnIndex||p===o._draggedColumnIndex+1?o._isValidCurrentDropHintIndex()&&o._resetDropHints():r!==p&&p>=0&&(o._resetDropHints(),o._updateDropHintElement(o._dropHintDetails[p].dropHintElementRef,"inline-block"),o._currentDropHintIndex=p)}},o._renderColumnSizer=function(e){var t,n=e.columnIndex,r=o.props.columns,i=void 0===r?$f:r,s=i[n],a=o.state.columnResizeDetails,l=o._classNames;return s.isResizable?b.createElement("div",{key:s.key+"_sizer","aria-hidden":!0,role:"button","data-is-focusable":!1,onClick:rv,"data-sizer-index":n,onBlur:o._onSizerBlur,className:Sr(l.cellSizer,n<i.length-1?l.cellSizerStart:l.cellSizerEnd,(t={},t[l.cellIsResizing]=a&&a.columnIndex===n,t)),onDoubleClick:o._onSizerDoubleClick.bind(o,n)}):null},o._onRenderColumnHeaderTooltip=function(e){return b.createElement("span",{className:e.hostClassName},e.children)},o._onSelectAllClicked=function(){var e=o.props.selection;e&&e.toggleAllSelected()},o._onRootMouseDown=function(e){var t=e.target.getAttribute("data-sizer-index"),n=Number(t),r=o.props.columns,i=void 0===r?$f:r;null!==t&&0===e.button&&(o.setState({columnResizeDetails:{columnIndex:n,columnMinWidth:i[n].calculatedWidth,originX:e.clientX}}),e.preventDefault(),e.stopPropagation())},o._onRootMouseMove=function(e){var t=o.state,n=t.columnResizeDetails,r=t.isSizing;n&&!r&&e.clientX!==n.originX&&o.setState({isSizing:!0})},o._onRootKeyDown=function(e){var t=o.state,n=t.columnResizeDetails,r=t.isSizing,i=o.props,s=i.columns,a=void 0===s?$f:s,l=i.onColumnResized,c=e.target.getAttribute("data-sizer-index");if(c&&!r){var u=Number(c);if(n){var d=void 0;e.which===wn.enter?(o.setState({columnResizeDetails:void 0}),e.preventDefault(),e.stopPropagation()):e.which===wn.left?d=In(o.props.theme)?1:-1:e.which===wn.right&&(d=In(o.props.theme)?-1:1),d&&(e.shiftKey||(d*=10),o.setState({columnResizeDetails:h(h({},n),{columnMinWidth:n.columnMinWidth+d})}),l&&l(a[u],n.columnMinWidth+d,u),e.preventDefault(),e.stopPropagation())}else e.which===wn.enter&&(o.setState({columnResizeDetails:{columnIndex:u,columnMinWidth:a[u].calculatedWidth}}),e.preventDefault(),e.stopPropagation())}},o._onSizerMouseMove=function(e){var t=e.buttons,n=o.props,r=n.onColumnIsSizingChanged,i=n.onColumnResized,s=n.columns,a=void 0===s?$f:s,l=o.state.columnResizeDetails;if(void 0===t||1===t){if(e.clientX!==l.originX&&r&&r(a[l.columnIndex],!0),i){var c=e.clientX-l.originX;In(o.props.theme)&&(c=-c),i(a[l.columnIndex],l.columnMinWidth+c,l.columnIndex)}}else o._onSizerMouseUp(e)},o._onSizerBlur=function(e){o.state.columnResizeDetails&&o.setState({columnResizeDetails:void 0,isSizing:!1})},o._onSizerMouseUp=function(e){var t=o.props,n=t.columns,r=void 0===n?$f:n,i=t.onColumnIsSizingChanged,s=o.state.columnResizeDetails;o.setState({columnResizeDetails:void 0,isSizing:!1}),i&&i(r[s.columnIndex],!1)},o._onToggleCollapseAll=function(){var e=o.props.onToggleCollapseAll,t=!o.state.isAllCollapsed;o.setState({isAllCollapsed:t}),e&&e(t)},si(o),o._events=new Ws(o),o.state={columnResizeDetails:void 0,isAllCollapsed:o.props.isAllCollapsed,isAllSelected:!!o.props.selection&&o.props.selection.isAllSelected()},o._onDropIndexInfo={sourceIndex:-1,targetIndex:-1},o._id=ts("header"),o._currentDropHintIndex=-1,o._dragDropHelper=new Yf({selection:{getSelection:function(){}},minimumPixelsForDrag:o.props.minimumPixelsForDrag}),o}return p(t,e),t.prototype.componentDidMount=function(){var e=this.props.selection;this._events.on(e,Sf,this._onSelectionChanged),this._rootElement.current&&(this._events.on(this._rootElement.current,"mousedown",this._onRootMouseDown),this._events.on(this._rootElement.current,"keydown",this._onRootKeyDown),this._getColumnReorderProps()&&(this._subscriptionObject=this._dragDropHelper.subscribe(this._rootElement.current,this._events,this._getHeaderDragDropOptions())))},t.prototype.componentDidUpdate=function(e){if(this._getColumnReorderProps()?!this._subscriptionObject&&this._rootElement.current&&(this._subscriptionObject=this._dragDropHelper.subscribe(this._rootElement.current,this._events,this._getHeaderDragDropOptions())):this._subscriptionObject&&(this._subscriptionObject.dispose(),delete this._subscriptionObject),this.props!==e&&this._onDropIndexInfo.sourceIndex>=0&&this._onDropIndexInfo.targetIndex>=0){var t=e.columns,o=void 0===t?$f:t,n=this.props.columns,r=void 0===n?$f:n;o[this._onDropIndexInfo.sourceIndex].key===r[this._onDropIndexInfo.targetIndex].key&&(this._onDropIndexInfo={sourceIndex:-1,targetIndex:-1})}this.props.isAllCollapsed!==e.isAllCollapsed&&this.setState({isAllCollapsed:this.props.isAllCollapsed})},t.prototype.componentWillUnmount=function(){this._subscriptionObject&&(this._subscriptionObject.dispose(),delete this._subscriptionObject),this._dragDropHelper.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this,t=this.props,o=t.columns,n=void 0===o?$f:o,r=t.ariaLabel,i=t.ariaLabelForToggleAllGroupsButton,s=t.ariaLabelForSelectAllCheckbox,a=t.selectAllVisibility,l=t.ariaLabelForSelectionColumn,c=t.indentWidth,u=t.onColumnClick,d=t.onColumnContextMenu,p=t.onRenderColumnHeaderTooltip,h=void 0===p?this._onRenderColumnHeaderTooltip:p,m=t.styles,g=t.selectionMode,f=t.theme,v=t.onRenderDetailsCheckbox,_=t.groupNestingDepth,y=t.useFastIcons,C=t.checkboxVisibility,S=t.className,x=this.state,k=x.isAllSelected,w=x.columnResizeDetails,I=x.isSizing,D=x.isAllCollapsed,P=a!==Gf.none,T=a===Gf.hidden,E=C===Ef.always,M=this._getColumnReorderProps(),R=M&&M.frozenColumnCountFromStart?M.frozenColumnCountFromStart:0,B=M&&M.frozenColumnCountFromEnd?M.frozenColumnCountFromEnd:0;this._classNames=Jf(m,{theme:f,isAllSelected:k,isSelectAllHidden:a===Gf.hidden,isResizingColumn:!!w&&I,isSizing:I,isAllCollapsed:D,isCheckboxHidden:T,className:S});var N=this._classNames,F=y?Mr:Fr,A=In(f);return b.createElement(ks,{role:"row","aria-label":r,className:N.root,componentRef:this._rootComponent,elementRef:this._rootElement,onMouseMove:this._onRootMouseMove,"data-automationid":"DetailsHeader",direction:vs.horizontal},P?[b.createElement("div",{key:"__checkbox",className:N.cellIsCheck,"aria-labelledby":this._id+"-check",onClick:T?void 0:this._onSelectAllClicked,"aria-colindex":1,role:"columnheader"},h({hostClassName:N.checkTooltip,id:this._id+"-checkTooltip",setAriaDescribedBy:!1,content:s,children:b.createElement(jf,{id:this._id+"-check","aria-label":g===af.multiple?s:l,"aria-describedby":T?l&&!this.props.onRenderColumnHeaderTooltip?this._id+"-checkTooltip":void 0:s&&!this.props.onRenderColumnHeaderTooltip?this._id+"-checkTooltip":void 0,"data-is-focusable":!T||void 0,isHeader:!0,selected:k,anySelected:!1,canSelect:!T,className:N.check,onRenderDetailsCheckbox:v,useFastIcons:y,isVisible:E})},this._onRenderColumnHeaderTooltip)),this.props.onRenderColumnHeaderTooltip?null:s&&!T?b.createElement("label",{key:"__checkboxLabel",id:this._id+"-checkTooltip",className:N.accessibleLabel,"aria-hidden":!0},s):l&&T?b.createElement("label",{key:"__checkboxLabel",id:this._id+"-checkTooltip",className:N.accessibleLabel,"aria-hidden":!0},l):null]:null,_>0&&this.props.collapseAllVisibility===wf.visible?b.createElement("div",{className:N.cellIsGroupExpander,onClick:this._onToggleCollapseAll,"data-is-focusable":!0,"aria-label":i,"aria-expanded":!D,role:"columnheader"},b.createElement(F,{className:N.collapseButton,iconName:A?"ChevronLeftMed":"ChevronRightMed"})):null,b.createElement(Rf,{indentWidth:c,role:"gridcell",count:_-1}),n.map((function(t,o){var r=!!M&&(o>=R&&o<n.length-B);return[M&&(r||o===n.length-B)&&e._renderDropHint(o),b.createElement(Qf,{column:t,styles:t.styles,key:t.key,columnIndex:(P?2:1)+o,parentId:e._id,isDraggable:r,updateDragInfo:e._updateDragInfo,dragDropHelper:e._dragDropHelper,onColumnClick:u,onColumnContextMenu:d,onRenderColumnHeaderTooltip:e.props.onRenderColumnHeaderTooltip,isDropped:e._onDropIndexInfo.targetIndex===o,cellStyleProps:e.props.cellStyleProps,useFastIcons:y}),e._renderColumnDivider(o)]})),M&&0===B&&this._renderDropHint(n.length),I&&b.createElement(cc,null,b.createElement("div",{className:N.sizingOverlay,onMouseMove:this._onSizerMouseMove,onMouseUp:this._onSizerMouseUp})))},t.prototype.focus=function(){var e;return!!(null===(e=this._rootComponent.current)||void 0===e?void 0:e.focus())},t.prototype._getColumnReorderProps=function(){var e=this.props,t=e.columnReorderOptions;return e.columnReorderProps||t&&h(h({},t),{onColumnDragEnd:void 0})},t.prototype._getHeaderDragDropOptions=function(){return{selectionIndex:1,context:{data:this,index:0},canDrag:function(){return!1},canDrop:function(){return!0},onDragStart:function(){},updateDropState:this._updateDroppingState,onDrop:this._onDrop,onDragEnd:function(){},onDragOver:this._onDragOver}},t.prototype._isValidCurrentDropHintIndex=function(){return this._currentDropHintIndex>=0},t.prototype._isCheckboxColumnHidden=function(){var e=this.props,t=e.selectionMode,o=e.checkboxVisibility;return t===af.none||o===Ef.hidden},t.prototype._resetDropHints=function(){this._currentDropHintIndex>=0&&(this._updateDropHintElement(this._dropHintDetails[this._currentDropHintIndex].dropHintElementRef,"none"),this._currentDropHintIndex=-1)},t.prototype._updateDropHintElement=function(e,t){e.childNodes[1].style.display=t,e.childNodes[0].style.display=t},t.prototype._isEventOnHeader=function(e){if(this._rootElement.current){var t=this._rootElement.current.getBoundingClientRect();if(e.clientX>t.left&&e.clientX<t.right&&e.clientY>t.top&&e.clientY<t.bottom)return Pf.header}},t.prototype._renderColumnDivider=function(e){var t=this.props.columns,o=(void 0===t?$f:t)[e],n=o.onRenderDivider;return n?n({column:o,columnIndex:e},this._renderColumnSizer):this._renderColumnSizer({column:o,columnIndex:e})},t.prototype._renderDropHint=function(e){var t=this._classNames,o=this.props.useFastIcons?Mr:Fr;return b.createElement("div",{key:"dropHintKey",className:t.dropHintStyle,id:"columnDropHint_"+e},b.createElement("div",{role:"presentation",key:"dropHintCircleKey",className:t.dropHintCaretStyle,"data-is-focusable":!1,"data-sizer-index":e,"aria-hidden":!0},b.createElement(o,{iconName:"CircleShapeSolid"})),b.createElement("div",{key:"dropHintLineKey","aria-hidden":!0,"data-is-focusable":!1,"data-sizer-index":e,className:t.dropHintLineStyle}))},t.prototype._onSizerDoubleClick=function(e,t){var o=this.props,n=o.onColumnAutoResized,r=o.columns;n&&n((void 0===r?$f:r)[e],e)},t.prototype._onSelectionChanged=function(){var e=!!this.props.selection&&this.props.selection.isAllSelected();this.state.isAllSelected!==e&&this.setState({isAllSelected:e})},t.defaultProps={selectAllVisibility:Gf.visible,collapseAllVisibility:wf.visible,useFastIcons:!0},t}(b.Component);function tv(e,t,o,n){return e?t<=o&&t>=n:t>=o&&t<=n}function ov(e,t,o){return e?t>=o:t<=o}function nv(e,t,o){return e?t<=o:t>=o}function rv(e){e.stopPropagation()}var iv=xn(ev,(function(e){var t,o,n,r,i=e.theme,s=e.className,a=e.isAllSelected,l=e.isResizingColumn,c=e.isSizing,u=e.isAllCollapsed,d=e.cellStyleProps,p=void 0===d?Nf:d,m=i.semanticColors,g=i.palette,f=i.fonts,v=Oo(Hf,i),b={iconForegroundColor:m.bodySubtext,headerForegroundColor:m.bodyText,headerBackgroundColor:m.bodyBackground,resizerColor:g.neutralTertiaryAlt},_={opacity:1,transition:"opacity 0.3s linear"},y=Of(e);return{root:[v.root,f.small,{display:"inline-block",background:b.headerBackgroundColor,position:"relative",minWidth:"100%",verticalAlign:"top",height:42,lineHeight:42,whiteSpace:"nowrap",boxSizing:"content-box",paddingBottom:"1px",paddingTop:"16px",borderBottom:"1px solid "+m.bodyDivider,cursor:"default",userSelect:"none",selectors:(t={},t["&:hover ."+v.check]={opacity:1},t["& ."+v.tooltipHost+" ."+v.checkTooltip]={display:"block"},t)},a&&v.isAllSelected,l&&v.isResizingColumn,s],check:[v.check,{height:42},{selectors:(o={},o["."+ho+" &:focus"]={opacity:1},o)}],cellWrapperPadded:{paddingRight:p.cellExtraRightPadding+p.cellRightPadding},cellIsCheck:[y,v.cellIsCheck,{position:"relative",padding:0,margin:0,display:"inline-flex",alignItems:"center",border:"none"},a&&{opacity:1}],cellIsGroupExpander:[y,{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:f.small.fontSize,padding:0,border:"none",width:36,color:g.neutralSecondary,selectors:{":hover":{backgroundColor:g.neutralLighter},":active":{backgroundColor:g.neutralLight}}}],cellIsActionable:{selectors:{":hover":{color:m.bodyText,background:m.listHeaderBackgroundHovered},":active":{background:m.listHeaderBackgroundPressed}}},cellIsEmpty:{textOverflow:"clip"},cellSizer:[v.cellSizer,{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}},{display:"inline-block",position:"relative",cursor:"ew-resize",bottom:0,top:0,overflow:"hidden",height:"inherit",background:"transparent",zIndex:1,width:16,selectors:(n={":after":{content:'""',position:"absolute",top:0,bottom:0,width:1,background:b.resizerColor,opacity:0,left:"50%"},":focus:after":_,":hover:after":_},n["&."+v.isResizing+":after"]=[_,{boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.4)"}],n)}],cellIsResizing:v.isResizing,cellSizerStart:{margin:"0 -8px"},cellSizerEnd:{margin:0,marginLeft:-16},collapseButton:[v.collapseButton,{transformOrigin:"50% 50%",transition:"transform .1s linear"},u?[v.isCollapsed,{transform:"rotate(0deg)"}]:{transform:In(i)?"rotate(-90deg)":"rotate(90deg)"}],checkTooltip:v.checkTooltip,sizingOverlay:c&&{position:"absolute",left:0,top:0,right:0,bottom:0,cursor:"ew-resize",background:"rgba(255, 255, 255, 0)",selectors:(r={},r[jt]=h({background:"transparent"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)},accessibleLabel:yo,dropHintCircleStyle:[v.dropHintCircleStyle,{display:"inline-block",visibility:"hidden",position:"absolute",bottom:0,height:9,width:9,borderRadius:"50%",marginLeft:-5,top:34,overflow:"visible",zIndex:10,border:"1px solid "+g.themePrimary,background:g.white}],dropHintCaretStyle:[v.dropHintCaretStyle,{display:"none",position:"absolute",top:-28,left:-6.5,fontSize:f.medium.fontSize,color:g.themePrimary,overflow:"visible",zIndex:10}],dropHintLineStyle:[v.dropHintLineStyle,{display:"none",position:"absolute",bottom:0,top:0,overflow:"hidden",height:42,width:1,background:g.themePrimary,zIndex:10}],dropHintStyle:{display:"inline-block",position:"absolute"}}}),void 0,{scope:"DetailsHeader"}),sv=function(e){var t=e.columns,o=e.columnStartIndex,n=e.rowClassNames,r=e.cellStyleProps,i=void 0===r?Nf:r,s=e.item,a=e.itemIndex,l=e.onRenderItemColumn,c=e.getCellValueKey,u=e.cellsByColumn,d=e.enableUpdateAnimations,p=b.useRef(),h=p.current||(p.current={});return b.createElement("div",{className:n.fields,"data-automationid":"DetailsRowFields",role:"presentation"},t.map((function(e,t){var r=void 0===e.calculatedWidth?"auto":e.calculatedWidth+i.cellLeftPadding+i.cellRightPadding+(e.isPadded?i.cellExtraRightPadding:0),p=e.onRender,m=void 0===p?l:p,g=e.getValueKey,f=void 0===g?c:g,v=u&&e.key in u?u[e.key]:m?m(s,a,e):function(e,t){var o=e&&t&&t.fieldName?e[t.fieldName]:"";return null==o&&(o=""),"boolean"==typeof o?o.toString():o}(s,e),_=h[e.key],y=d&&f?f(s,a,e):void 0,C=!1;void 0!==y&&void 0!==_&&y!==_&&(C=!0),h[e.key]=y;var S=e.key+(void 0!==y?"-"+y:"");return b.createElement("div",{key:S,role:e.isRowHeader?"rowheader":"gridcell","aria-readonly":!0,"aria-colindex":t+o+1,className:Sr(e.className,e.isMultiline&&n.isMultiline,e.isRowHeader&&n.isRowHeader,n.cell,e.isPadded?n.cellPadded:n.cellUnpadded,C&&n.cellAnimation),style:{width:r},"data-automationid":"DetailsRowCell","data-automation-key":e.key},v)})))},av=Mn(),lv=[],cv=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._cellMeasurer=b.createRef(),o._focusZone=b.createRef(),o._onSelectionChanged=function(){var e=uv(o.props);Fs(e,o.state.selectionState)||o.setState({selectionState:e})},o._updateDroppingState=function(e,t){var n=o.state.isDropping,r=o.props,i=r.dragDropEvents,s=r.item;e?i.onDragEnter&&(o._droppingClassNames=i.onDragEnter(s,t)):i.onDragLeave&&i.onDragLeave(s,t),n!==e&&o.setState({isDropping:e})},si(o),o._events=new Ws(o),o.state={selectionState:uv(t),columnMeasureInfo:void 0,isDropping:!1},o._droppingClassNames="",o}return p(t,e),t.getDerivedStateFromProps=function(e,t){return h(h({},t),{selectionState:uv(e)})},t.prototype.componentDidMount=function(){var e=this.props,t=e.dragDropHelper,o=e.selection,n=e.item,r=e.onDidMount;t&&this._root.current&&(this._dragDropSubscription=t.subscribe(this._root.current,this._events,this._getRowDragDropOptions())),o&&this._events.on(o,Sf,this._onSelectionChanged),r&&n&&(this._onDidMountCalled=!0,r(this))},t.prototype.componentDidUpdate=function(e){var t=this.state,o=this.props,n=o.item,r=o.onDidMount,i=t.columnMeasureInfo;if(this.props.itemIndex===e.itemIndex&&this.props.item===e.item&&this.props.dragDropHelper===e.dragDropHelper||(this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this.props.dragDropHelper&&this._root.current&&(this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getRowDragDropOptions()))),i&&i.index>=0&&this._cellMeasurer.current){var s=this._cellMeasurer.current.getBoundingClientRect().width;i.onMeasureDone(s),this.setState({columnMeasureInfo:void 0})}n&&r&&!this._onDidMountCalled&&(this._onDidMountCalled=!0,r(this))},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.item,o=e.onWillUnmount;o&&t&&o(this),this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this._events.dispose()},t.prototype.shouldComponentUpdate=function(e,t){if(this.props.useReducedRowRenderer){var o=uv(e);return this.state.selectionState.isSelected!==o.isSelected||!Fs(this.props,e)}return!0},t.prototype.render=function(){var e=this.props,t=e.className,o=e.columns,n=void 0===o?lv:o,r=e.dragDropEvents,i=e.item,s=e.itemIndex,a=e.onRenderCheck,l=void 0===a?this._onRenderCheck:a,c=e.onRenderDetailsCheckbox,u=e.onRenderItemColumn,d=e.getCellValueKey,p=e.selectionMode,m=e.rowWidth,g=void 0===m?0:m,f=e.checkboxVisibility,v=e.getRowAriaLabel,_=e.getRowAriaDescribedBy,y=e.checkButtonAriaLabel,C=e.checkboxCellClassName,S=e.rowFieldsAs,x=void 0===S?sv:S,k=e.selection,w=e.indentWidth,I=e.enableUpdateAnimations,D=e.compact,P=e.theme,T=e.styles,E=e.cellsByColumn,M=e.groupNestingDepth,R=e.useFastIcons,B=void 0===R||R,N=e.cellStyleProps,F=this.state,A=F.columnMeasureInfo,L=F.isDropping,H=this.state.selectionState,O=H.isSelected,z=void 0!==O&&O,W=H.isSelectionModal,V=void 0!==W&&W,K=r?!(!r.canDrag||!r.canDrag(i)):void 0,U=L?this._droppingClassNames||"is-dropping":"",G=v?v(i):void 0,j=_?_(i):void 0,Y=!!k&&k.canSelectItem(i,s),q=p===af.multiple,Z=p!==af.none&&f!==Ef.hidden,X=p===af.none?void 0:z;this._classNames=h(h({},this._classNames),av(T,{theme:P,isSelected:z,canSelect:!q,anySelected:V,checkboxCellClassName:C,droppingClassName:U,className:t,compact:D,enableUpdateAnimations:I,cellStyleProps:N}));var Q={isMultiline:this._classNames.isMultiline,isRowHeader:this._classNames.isRowHeader,cell:this._classNames.cell,cellAnimation:this._classNames.cellAnimation,cellPadded:this._classNames.cellPadded,cellUnpadded:this._classNames.cellUnpadded,fields:this._classNames.fields};Fs(this._rowClassNames||{},Q)||(this._rowClassNames=Q);var J=b.createElement(x,{rowClassNames:this._rowClassNames,cellsByColumn:E,columns:n,item:i,itemIndex:s,columnStartIndex:(Z?1:0)+(M?1:0),onRenderItemColumn:u,getCellValueKey:d,enableUpdateAnimations:I,cellStyleProps:N});return b.createElement(ks,h({"data-is-focusable":!0},fr(this.props,gr),"boolean"==typeof K?{"data-is-draggable":K,draggable:K}:{},{direction:vs.horizontal,elementRef:this._root,componentRef:this._focusZone,role:"row","aria-label":G,"aria-describedby":j,className:this._classNames.root,"data-selection-index":s,"data-selection-touch-invoke":!0,"data-item-index":s,"aria-rowindex":s+1,"aria-level":M&&M+1||void 0,"data-automationid":"DetailsRow",style:{minWidth:g},"aria-selected":X,allowFocusRoot:!0}),Z&&b.createElement("div",{role:"gridcell","aria-colindex":1,"data-selection-toggle":!0,className:this._classNames.checkCell},l({selected:z,anySelected:V,"aria-label":y,canSelect:Y,compact:D,className:this._classNames.check,theme:P,isVisible:f===Ef.always,onRenderDetailsCheckbox:c,useFastIcons:B})),b.createElement(Rf,{indentWidth:w,role:"gridcell",count:M-(this.props.collapseAllVisibility===wf.hidden?1:0)}),i&&J,A&&b.createElement("span",{role:"presentation",className:Sr(this._classNames.cellMeasurer,this._classNames.cell),ref:this._cellMeasurer},b.createElement(x,{rowClassNames:this._rowClassNames,columns:[A.column],item:i,itemIndex:s,columnStartIndex:(Z?1:0)+(M?1:0)+n.length,onRenderItemColumn:u,getCellValueKey:d})),b.createElement("span",{role:"checkbox",className:this._classNames.checkCover,"aria-checked":z,"data-selection-toggle":!0}))},t.prototype.measureCell=function(e,t){var o=this.props.columns,n=h({},(void 0===o?lv:o)[e]);n.minWidth=0,n.maxWidth=999999,delete n.calculatedWidth,this.setState({columnMeasureInfo:{index:e,column:n,onMeasureDone:t}})},t.prototype.focus=function(e){var t;return void 0===e&&(e=!1),!!(null===(t=this._focusZone.current)||void 0===t?void 0:t.focus(e))},t.prototype._onRenderCheck=function(e){return b.createElement(jf,h({},e))},t.prototype._getRowDragDropOptions=function(){var e=this.props,t=e.item,o=e.itemIndex,n=e.dragDropEvents;return{eventMap:e.eventsToRegister,selectionIndex:o,context:{data:t,index:o},canDrag:n.canDrag,canDrop:n.canDrop,onDragStart:n.onDragStart,updateDropState:this._updateDroppingState,onDrop:n.onDrop,onDragEnd:n.onDragEnd,onDragOver:n.onDragOver}},t}(b.Component);function uv(e){var t,o,n,r,i=e.itemIndex,s=e.selection;return{isSelected:!!(null===(t=s)||void 0===t?void 0:t.isIndexSelected(i)),isSelectionModal:!!(null===(r=null===(o=s)||void 0===o?void 0:(n=o).isModal)||void 0===r?void 0:r.call(n))}}var dv,pv,hv=xn(cv,Lf,void 0,{scope:"DetailsRow"}),mv={root:"ms-GroupedList",compact:"ms-GroupedList--Compact",group:"ms-GroupedList-group",link:"ms-Link",listCell:"ms-List-cell"},gv="cubic-bezier(0.445, 0.050, 0.550, 0.950)",fv={root:"ms-GroupHeader",compact:"ms-GroupHeader--compact",check:"ms-GroupHeader-check",dropIcon:"ms-GroupHeader-dropIcon",expand:"ms-GroupHeader-expand",isCollapsed:"is-collapsed",title:"ms-GroupHeader-title",isSelected:"is-selected",iconTag:"ms-Icon--Tag",group:"ms-GroupedList-group",isDropping:"is-dropping"},vv="cubic-bezier(0.075, 0.820, 0.165, 1.000)",bv="cubic-bezier(0.390, 0.575, 0.565, 1.000)",_v="cubic-bezier(0.600, -0.280, 0.735, 0.045)";!function(e){e[e.xSmall=0]="xSmall",e[e.small=1]="small",e[e.medium=2]="medium",e[e.large=3]="large"}(dv||(dv={})),function(e){e[e.normal=0]="normal",e[e.large=1]="large"}(pv||(pv={}));var yv=Mn(),Cv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.type,o=e.size,n=e.ariaLabel,r=e.ariaLive,i=e.styles,s=e.label,a=e.theme,l=e.className,c=e.labelPosition,u=n,d=fr(this.props,gr,["size"]),p=o;void 0===p&&void 0!==t&&(p=t===pv.large?dv.large:dv.medium);var m=yv(i,{theme:a,size:p,className:l,labelPosition:c});return b.createElement("div",h({},d,{className:m.root}),b.createElement("div",{className:m.circle}),s&&b.createElement("div",{className:m.label},s),u&&b.createElement("div",{role:"status","aria-live":r},b.createElement(mi,null,b.createElement("div",{className:m.screenReaderText},u))))},t.defaultProps={size:dv.medium,ariaLive:"polite",labelPosition:"bottom"},t}(b.Component),Sv={root:"ms-Spinner",circle:"ms-Spinner-circle",label:"ms-Spinner-label"},xv=No((function(){return ee({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}})})),kv=xn(Cv,(function(e){var t,o=e.theme,n=e.size,r=e.className,i=e.labelPosition,s=o.palette,a=Oo(Sv,o);return{root:[a.root,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},"top"===i&&{flexDirection:"column-reverse"},"right"===i&&{flexDirection:"row"},"left"===i&&{flexDirection:"row-reverse"},r],circle:[a.circle,{boxSizing:"border-box",borderRadius:"50%",border:"1.5px solid "+s.themeLight,borderTopColor:s.themePrimary,animationName:xv(),animationDuration:"1.3s",animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(.53,.21,.29,.67)",selectors:(t={},t[jt]=h({borderTopColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},n===dv.xSmall&&["ms-Spinner--xSmall",{width:12,height:12}],n===dv.small&&["ms-Spinner--small",{width:16,height:16}],n===dv.medium&&["ms-Spinner--medium",{width:20,height:20}],n===dv.large&&["ms-Spinner--large",{width:28,height:28}]],label:[a.label,o.fonts.small,{color:s.themePrimary,margin:"8px 0 0",textAlign:"center"},"top"===i&&{margin:"0 0 8px"},"right"===i&&{margin:"0 0 0 8px"},"left"===i&&{margin:"0 8px 0 0"}],screenReaderText:yo}}),void 0,{scope:"Spinner"}),wv=Mn(),Iv=function(e){function t(t){var o=e.call(this,t)||this;return o._toggleCollapse=function(){var e=o.props,t=e.group,n=e.onToggleCollapse,r=e.isGroupLoading,i=!o.state.isCollapsed,s=!i&&r&&r(t);o.setState({isCollapsed:i,isLoadingVisible:s}),n&&n(t)},o._onKeyUp=function(e){var t=o.props,n=t.group,r=t.onGroupHeaderKeyUp;if(r&&r(e,n),!e.defaultPrevented){var i=o.state.isCollapsed&&e.which===Pn(wn.right,o.props.theme);(!o.state.isCollapsed&&e.which===Pn(wn.left,o.props.theme)||i)&&(o._toggleCollapse(),e.stopPropagation(),e.preventDefault())}},o._onToggleClick=function(e){o._toggleCollapse(),e.stopPropagation(),e.preventDefault()},o._onToggleSelectGroupClick=function(e){var t=o.props,n=t.onToggleSelectGroup,r=t.group;n&&n(r),e.preventDefault(),e.stopPropagation()},o._onHeaderClick=function(){var e=o.props,t=e.group,n=e.onGroupHeaderClick,r=e.onToggleSelectGroup;n?n(t):r&&r(t)},o._onRenderTitle=function(e){var t=e.group,n=e.ariaColSpan;return t?b.createElement("div",{className:o._classNames.title,id:o._id,role:"gridcell","aria-colspan":n},b.createElement("span",null,t.name),b.createElement("span",{className:o._classNames.headerCount},"(",t.count,t.hasMoreData&&"+",")")):null},o._id=ts("GroupHeader"),o.state={isCollapsed:o.props.group&&o.props.group.isCollapsed,isLoadingVisible:!1},o}return p(t,e),t.getDerivedStateFromProps=function(e,t){if(e.group){var o=e.group.isCollapsed,n=e.isGroupLoading,r=!o&&n&&n(e.group);return h(h({},t),{isCollapsed:o||!1,isLoadingVisible:r||!1})}return t},t.prototype.render=function(){var e=this.props,t=e.group,o=e.groupLevel,n=void 0===o?0:o,r=e.viewport,i=e.selectionMode,s=e.loadingText,a=e.isSelected,l=void 0!==a&&a,c=e.selected,u=void 0!==c&&c,d=e.indentWidth,p=e.onRenderTitle,m=void 0===p?this._onRenderTitle:p,g=e.onRenderGroupHeaderCheckbox,f=e.isCollapsedGroupSelectVisible,v=void 0===f||f,_=e.expandButtonProps,y=e.expandButtonIcon,C=e.selectAllButtonProps,S=e.theme,x=e.styles,k=e.className,w=e.compact,I=e.ariaPosInSet,D=e.ariaSetSize,P=e.ariaRowCount,T=e.ariaRowIndex,E=e.useFastIcons?this._fastDefaultCheckboxRender:this._defaultCheckboxRender,M=g?Wh(g,E):E,R=this.state,B=R.isCollapsed,N=R.isLoadingVisible,F=i===af.multiple,A=F&&(v||!(t&&t.isCollapsed)),L=u||l,H=In(S);return this._classNames=wv(x,{theme:S,className:k,selected:L,isCollapsed:B,compact:w}),t?b.createElement("div",{className:this._classNames.root,style:r?{minWidth:r.width}:{},onClick:this._onHeaderClick,role:"row","aria-setsize":D,"aria-posinset":I,"aria-rowcount":P,"aria-rowindex":T,"data-is-focusable":!0,onKeyUp:this._onKeyUp,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabel?void 0:this._id,"aria-expanded":!this.state.isCollapsed,"aria-selected":F?L:void 0,"aria-level":n+1},b.createElement("div",{className:this._classNames.groupHeaderContainer,role:"presentation"},A?b.createElement("div",{role:"gridcell"},b.createElement("button",h({"data-is-focusable":!1,type:"button",className:this._classNames.check,role:"checkbox","aria-checked":L,"data-selection-toggle":!0,onClick:this._onToggleSelectGroupClick},C),M({checked:L,theme:S},M))):i!==af.none&&b.createElement(Rf,{indentWidth:d,count:1}),b.createElement(Rf,{indentWidth:d,count:n}),b.createElement("div",{className:this._classNames.dropIcon,role:"presentation"},b.createElement(Fr,{iconName:"Tag"})),b.createElement("div",{role:"gridcell"},b.createElement("button",h({"data-is-focusable":!1,type:"button",className:this._classNames.expand,onClick:this._onToggleClick,"aria-expanded":!this.state.isCollapsed},_),b.createElement(Fr,{className:this._classNames.expandIsCollapsed,iconName:y||(H?"ChevronLeftMed":"ChevronRightMed")}))),m(this.props,this._onRenderTitle),N&&b.createElement(kv,{label:s}))):null},t.prototype._defaultCheckboxRender=function(e){return b.createElement(Mh,{checked:e.checked})},t.prototype._fastDefaultCheckboxRender=function(e){return b.createElement(Dv,{theme:e.theme,checked:e.checked})},t.defaultProps={expandButtonProps:{"aria-label":"expand collapse group"}},t}(b.Component),Dv=b.memo((function(e){return b.createElement(Mh,{theme:e.theme,checked:e.checked,className:e.className,useFastIcons:!0})})),Pv=xn(Iv,(function(e){var t,o,n,r,i,s=e.theme,a=e.className,l=e.selected,c=e.isCollapsed,u=e.compact,d=Nf.cellLeftPadding,p=u?40:48,h=s.semanticColors,m=s.palette,g=s.fonts,f=Oo(fv,s),v=[go(s),{cursor:"default",background:"none",backgroundColor:"transparent",border:"none",padding:0}];return{root:[f.root,go(s),s.fonts.medium,{borderBottom:"1px solid "+h.listBackground,cursor:"default",userSelect:"none",selectors:(t={":hover":{background:h.listItemBackgroundHovered,color:h.actionLinkHovered}},t["&:hover ."+f.check]={opacity:1},t["."+ho+" &:focus ."+f.check]={opacity:1},t[":global(."+f.group+"."+f.isDropping+")"]={selectors:(o={},o["& > ."+f.root+" ."+f.dropIcon]={transition:"transform "+Fe.durationValue4+" "+vv+" opacity "+Fe.durationValue1+" "+bv,transitionDelay:Fe.durationValue3,opacity:1,transform:"rotate(0.2deg) scale(1);"},o["."+f.check]={opacity:0},o)},t)},l&&[f.isSelected,{background:h.listItemBackgroundChecked,selectors:(n={":hover":{background:h.listItemBackgroundCheckedHovered}},n[""+f.check]={opacity:1},n)}],u&&[f.compact,{border:"none"}],a],groupHeaderContainer:[{display:"flex",alignItems:"center",height:p}],headerCount:[{padding:"0px 4px"}],check:[f.check,v,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:1,marginTop:-1,opacity:0,width:48,height:p,selectors:(r={},r["."+ho+" &:focus"]={opacity:1},r)}],expand:[f.expand,v,{display:"flex",alignItems:"center",justifyContent:"center",fontSize:g.small.fontSize,width:36,height:p,color:l?m.neutralPrimary:m.neutralSecondary,selectors:{":hover":{backgroundColor:l?m.neutralQuaternary:m.neutralLight},":active":{backgroundColor:l?m.neutralTertiaryAlt:m.neutralQuaternaryAlt}}}],expandIsCollapsed:[c?[f.isCollapsed,{transform:"rotate(0deg)",transformOrigin:"50% 50%",transition:"transform .1s linear"}]:{transform:In(s)?"rotate(-90deg)":"rotate(90deg)",transformOrigin:"50% 50%",transition:"transform .1s linear"}],title:[f.title,{paddingLeft:d,fontSize:u?g.medium.fontSize:g.mediumPlus.fontSize,fontWeight:c?Ge.regular:Ge.semibold,cursor:"pointer",outline:0,whiteSpace:"nowrap",textOverflow:"ellipsis"}],dropIcon:[f.dropIcon,{position:"absolute",left:-26,fontSize:je.large,color:m.neutralSecondary,transition:"transform "+Fe.durationValue2+" "+_v+", opacity "+Fe.durationValue4+" "+bv,opacity:0,transform:"rotate(0.2deg) scale(0.65)",transformOrigin:"10px 10px",selectors:(i={},i[":global(."+f.iconTag+")"]={position:"absolute"},i)}]}}),void 0,{scope:"GroupHeader"}),Tv={root:"ms-GroupShowAll",link:"ms-Link"},Ev=Mn(),Mv=xn((function(e){var t=e.group,o=e.groupLevel,n=e.showAllLinkText,r=void 0===n?"Show All":n,i=e.styles,s=e.theme,a=e.onToggleSummarize,l=Ev(i,{theme:s}),c=Object(b.useCallback)((function(e){a(t),e.stopPropagation(),e.preventDefault()}),[a,t]);return t?b.createElement("div",{className:l.root},b.createElement(Rf,{count:o}),b.createElement($s,{onClick:c},r)):null}),(function(e){var t,o=e.theme,n=o.fonts,r=Oo(Tv,o);return{root:[r.root,{position:"relative",padding:"10px 84px",cursor:"pointer",selectors:(t={},t["."+r.link]={fontSize:n.small.fontSize},t)}]}}),void 0,{scope:"GroupShowAll"}),Rv={root:"ms-groupFooter"},Bv=Mn(),Nv=xn((function(e){var t=e.group,o=e.groupLevel,n=e.footerText,r=e.indentWidth,i=e.styles,s=e.theme,a=Bv(i,{theme:s});return t&&n?b.createElement("div",{className:a.root},b.createElement(Rf,{indentWidth:r,count:o}),n):null}),(function(e){var t=e.theme,o=e.className,n=Oo(Rv,t);return{root:[t.fonts.medium,n.root,{position:"relative",padding:"5px 38px"},o]}}),void 0,{scope:"GroupFooter"}),Fv=function(e){function t(o){var n=e.call(this,o)||this;n._root=b.createRef(),n._list=b.createRef(),n._subGroupRefs={},n._droppingClassName="",n._onRenderGroupHeader=function(e){return b.createElement(Pv,h({},e))},n._onRenderGroupShowAll=function(e){return b.createElement(Mv,h({},e))},n._onRenderGroupFooter=function(e){return b.createElement(Nv,h({},e))},n._renderSubGroup=function(e,o){var r=n.props,i=r.dragDropEvents,s=r.dragDropHelper,a=r.eventsToRegister,l=r.getGroupItemLimit,c=r.groupNestingDepth,u=r.groupProps,d=r.items,p=r.headerProps,h=r.showAllProps,m=r.footerProps,g=r.listProps,f=r.onRenderCell,v=r.selection,_=r.selectionMode,y=r.viewport,C=r.onRenderGroupHeader,S=r.onRenderGroupShowAll,x=r.onRenderGroupFooter,k=r.onShouldVirtualize,w=r.group,I=r.compact,D=e.level?e.level+1:c;return!e||e.count>0||u&&u.showEmptyGroups?b.createElement(t,{ref:function(e){return n._subGroupRefs["subGroup_"+o]=e},key:n._getGroupKey(e,o),dragDropEvents:i,dragDropHelper:s,eventsToRegister:a,footerProps:m,getGroupItemLimit:l,group:e,groupIndex:o,groupNestingDepth:D,groupProps:u,headerProps:p,items:d,listProps:g,onRenderCell:f,selection:v,selectionMode:_,showAllProps:h,viewport:y,onRenderGroupHeader:C,onRenderGroupShowAll:S,onRenderGroupFooter:x,onShouldVirtualize:k,groups:w?w.children:[],compact:I}):null},n._getGroupDragDropOptions=function(){var e=n.props,t=e.group,o=e.groupIndex,r=e.dragDropEvents;return{eventMap:e.eventsToRegister,selectionIndex:-1,context:{data:t,index:o,isGroup:!0},updateDropState:n._updateDroppingState,canDrag:r.canDrag,canDrop:r.canDrop,onDrop:r.onDrop,onDragStart:r.onDragStart,onDragEnter:r.onDragEnter,onDragLeave:r.onDragLeave,onDragEnd:r.onDragEnd,onDragOver:r.onDragOver}},n._updateDroppingState=function(e,t){var o=n.state.isDropping,r=n.props,i=r.dragDropEvents,s=r.group;o!==e&&(o?i&&i.onDragLeave&&i.onDragLeave(s,t):i&&i.onDragEnter&&(n._droppingClassName=i.onDragEnter(s,t)),n.setState({isDropping:e}))};var r=o.selection,i=o.group;return si(n),n._id=ts("GroupedListSection"),n.state={isDropping:!1,isSelected:!(!r||!i)&&r.isRangeSelected(i.startIndex,i.count)},n._events=new Ws(n),n}return p(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.dragDropHelper,o=e.selection;t&&this._root.current&&(this._dragDropSubscription=t.subscribe(this._root.current,this._events,this._getGroupDragDropOptions())),o&&this._events.on(o,Sf,this._onSelectionChange)},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._dragDropSubscription&&this._dragDropSubscription.dispose()},t.prototype.componentDidUpdate=function(e){this.props.group===e.group&&this.props.groupIndex===e.groupIndex&&this.props.dragDropHelper===e.dragDropHelper||(this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this.props.dragDropHelper&&this._root.current&&(this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getGroupDragDropOptions())))},t.prototype.render=function(){var e=this.props,t=e.getGroupItemLimit,o=e.group,n=e.groupIndex,r=e.headerProps,i=e.showAllProps,s=e.footerProps,a=e.viewport,l=e.selectionMode,c=e.onRenderGroupHeader,u=void 0===c?this._onRenderGroupHeader:c,d=e.onRenderGroupShowAll,p=void 0===d?this._onRenderGroupShowAll:d,m=e.onRenderGroupFooter,g=void 0===m?this._onRenderGroupFooter:m,f=e.onShouldVirtualize,v=e.groupedListClassNames,_=e.groups,y=e.compact,C=e.listProps,S=void 0===C?{}:C,x=this.state.isSelected,k=o&&t?t(o):1/0,w=o&&!o.children&&!o.isCollapsed&&!o.isShowingAll&&(o.count>k||o.hasMoreData),I=o&&o.children&&o.children.length>0,D=S.version,P={group:o,groupIndex:n,groupLevel:o?o.level:0,isSelected:x,selected:x,viewport:a,selectionMode:l,groups:_,compact:y},T={groupedListId:this._id,ariaSetSize:_?_.length:void 0,ariaPosInSet:void 0!==n?n+1:void 0},E=h(h(h({},r),P),T),M=h(h({},i),P),R=h(h({},s),P),B=!!this.props.dragDropHelper&&this._getGroupDragDropOptions().canDrag(o)&&!!this.props.dragDropEvents.canDragGroups;return b.createElement("div",h({ref:this._root},B&&{draggable:!0},{className:Sr(v&&v.group,this._getDroppingClassName()),role:"presentation"}),u(E,this._onRenderGroupHeader),o&&o.isCollapsed?null:I?b.createElement(tf,{role:"group",ref:this._list,items:o?o.children:[],onRenderCell:this._renderSubGroup,getItemCountForPage:this._returnOne,onShouldVirtualize:f,version:D,id:this._id}):this._onRenderGroup(k),o&&o.isCollapsed?null:w&&p(M,this._onRenderGroupShowAll),g(R,this._onRenderGroupFooter))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this.forceListUpdate()},t.prototype.forceListUpdate=function(){var e=this.props.group;if(this._list.current){if(this._list.current.forceUpdate(),e&&e.children&&e.children.length>0)for(var t=e.children.length,o=0;o<t;o++){var n;(n=this._list.current.pageRefs["subGroup_"+String(o)])&&n.forceListUpdate()}}else(n=this._subGroupRefs["subGroup_"+String(0)])&&n.forceListUpdate()},t.prototype._onSelectionChange=function(){var e=this.props,t=e.group,o=e.selection;if(o&&t){var n=o.isRangeSelected(t.startIndex,t.count);n!==this.state.isSelected&&this.setState({isSelected:n})}},t.prototype._onRenderGroupCell=function(e,t){return function(o,n){return e(t,o,n)}},t.prototype._onRenderGroup=function(e){var t,o=this.props,n=o.group,r=o.items,i=o.onRenderCell,s=o.listProps,a=o.groupNestingDepth,l=o.onShouldVirtualize,c=o.groupProps,u=n&&!n.isShowingAll?n.count:r.length,d=n?n.startIndex:0;return b.createElement(tf,h({role:c&&c.role?c.role:"group","aria-label":null===(t=n)||void 0===t?void 0:t.name,items:r,onRenderCell:this._onRenderGroupCell(i,a),ref:this._list,renderCount:Math.min(u,e),startIndex:d,onShouldVirtualize:l,id:this._id},s))},t.prototype._returnOne=function(){return 1},t.prototype._getGroupKey=function(e,t){return"group-"+(e&&e.key?e.key:String(e.level)+String(t))},t.prototype._getDroppingClassName=function(){var e=this.state.isDropping,t=this.props,o=t.group,n=t.groupedListClassNames;return Sr((e=!(!o||!e))&&this._droppingClassName,e&&"is-dropping",e&&n&&n.groupIsDropping)},t}(b.Component),Av=Mn(),Lv=Ff.rowHeight,Hv=Ff.compactRowHeight,Ov=function(e){function t(t){var o=e.call(this,t)||this;o._list=b.createRef(),o._renderGroup=function(e,t){var n=o.props,r=n.dragDropEvents,i=n.dragDropHelper,s=n.eventsToRegister,a=n.groupProps,l=n.items,c=n.listProps,u=n.onRenderCell,d=n.selectionMode,p=n.selection,m=n.viewport,g=n.onShouldVirtualize,f=n.groups,v=n.compact,_={onToggleSelectGroup:o._onToggleSelectGroup,onToggleCollapse:o._onToggleCollapse,onToggleSummarize:o._onToggleSummarize},y=h(h({},a.headerProps),_),C=h(h({},a.showAllProps),_),S=h(h({},a.footerProps),_),x=o._getGroupNestingDepth();if(!a.showEmptyGroups&&e&&0===e.count)return null;var k=h(h({},c||{}),{version:o.state.version});return b.createElement(Fv,{key:o._getGroupKey(e,t),dragDropEvents:r,dragDropHelper:i,eventsToRegister:s,footerProps:S,getGroupItemLimit:a&&a.getGroupItemLimit,group:e,groupIndex:t,groupNestingDepth:x,groupProps:a,headerProps:y,listProps:k,items:l,onRenderCell:u,onRenderGroupHeader:a.onRenderHeader,onRenderGroupShowAll:a.onRenderShowAll,onRenderGroupFooter:a.onRenderFooter,selectionMode:d,selection:p,showAllProps:C,viewport:m,onShouldVirtualize:g,groupedListClassNames:o._classNames,groups:f,compact:v})},o._getDefaultGroupItemLimit=function(e){return e.count},o._getGroupItemLimit=function(e){var t=o.props.groupProps;return(t&&t.getGroupItemLimit?t.getGroupItemLimit:o._getDefaultGroupItemLimit)(e)},o._getGroupHeight=function(e){var t=o.props.compact?Hv:Lv;return t+(e.isCollapsed?0:t*o._getGroupItemLimit(e))},o._getPageHeight=function(e){var t=o.state.groups,n=o.props.getGroupHeight,r=void 0===n?o._getGroupHeight:n,i=t&&t[e];return i?r(i,e):0},o._onToggleCollapse=function(e){var t=o.props.groupProps,n=t&&t.headerProps&&t.headerProps.onToggleCollapse;e&&(n&&n(e),e.isCollapsed=!e.isCollapsed,o._updateIsSomeGroupExpanded(),o.forceUpdate())},o._onToggleSelectGroup=function(e){var t=o.props,n=t.selection,r=t.selectionMode;e&&n&&r===af.multiple&&n.toggleRangeSelected(e.startIndex,e.count)},o._isInnerZoneKeystroke=function(e){return e.which===Pn(wn.right)},o._onToggleSummarize=function(e){var t=o.props.groupProps,n=t&&t.showAllProps&&t.showAllProps.onToggleSummarize;n?n(e):(e&&(e.isShowingAll=!e.isShowingAll),o.forceUpdate())},o._getPageSpecification=function(e){var t=o.state.groups,n=t&&t[e];return{key:n&&n.key}},si(o),o._isSomeGroupExpanded=o._computeIsSomeGroupExpanded(t.groups);var n=t.listProps,r=(void 0===n?{}:n).version,i=void 0===r?{}:r;return o.state={groups:t.groups,items:t.items,listProps:t.listProps,version:i},o}return p(t,e),t.getDerivedStateFromProps=function(e,t){var o=e.groups,n=e.selectionMode,r=e.compact,i=e.items,s=e.listProps,a=s&&s.version,l=h(h({},t),{selectionMode:n,compact:r,groups:o,listProps:s}),c=!1;return a===(t.listProps&&t.listProps.version)&&i===t.items&&o===t.groups&&n===t.selectionMode&&r===t.compact||(c=!0),c&&(l=h(h({},l),{version:{}})),l},t.prototype.scrollToIndex=function(e,t,o){this._list.current&&this._list.current.scrollToIndex(e,t,o)},t.prototype.getStartItemIndexInView=function(){return this._list.current.getStartItemIndexInView()||0},t.prototype.componentDidMount=function(){var e=this.props,t=e.groupProps,o=e.groups,n=void 0===o?[]:o;t&&t.isAllGroupsCollapsed&&this._setGroupsCollapsedState(n,t.isAllGroupsCollapsed)},t.prototype.render=function(){var e=this.props,t=e.className,o=e.usePageCache,n=e.onShouldVirtualize,r=e.theme,i=e.role,s=void 0===i?"treegrid":i,a=e.styles,l=e.compact,c=e.focusZoneProps,u=void 0===c?{}:c,d=e.rootListProps,p=void 0===d?{}:d,m=this.state,g=m.groups,f=m.version;this._classNames=Av(a,{theme:r,className:t,compact:l});var v=u.shouldEnterInnerZone,_=void 0===v?this._isInnerZoneKeystroke:v;return b.createElement(ks,h({direction:vs.vertical,"data-automationid":"GroupedList","data-is-scrollable":"false",role:"presentation"},u,{shouldEnterInnerZone:_,className:Sr(this._classNames.root,u.className)}),g?b.createElement(tf,h({ref:this._list,role:s,items:g,onRenderCell:this._renderGroup,getItemCountForPage:this._returnOne,getPageHeight:this._getPageHeight,getPageSpecification:this._getPageSpecification,usePageCache:o,onShouldVirtualize:n,version:f},p)):this._renderGroup(void 0,0))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this._forceListUpdates()},t.prototype.toggleCollapseAll=function(e){var t=this.state.groups,o=void 0===t?[]:t,n=this.props.groupProps,r=n&&n.onToggleCollapseAll;o.length>0&&(r&&r(e),this._setGroupsCollapsedState(o,e),this._updateIsSomeGroupExpanded(),this.forceUpdate())},t.prototype._setGroupsCollapsedState=function(e,t){for(var o=0;o<e.length;o++)e[o].isCollapsed=t},t.prototype._returnOne=function(){return 1},t.prototype._getGroupKey=function(e,t){return"group-"+(e&&e.key?e.key:String(t))},t.prototype._getGroupNestingDepth=function(){for(var e=0,t=this.state.groups;t&&t.length>0;)e++,t=t[0].children;return e},t.prototype._forceListUpdates=function(e){this.setState({version:{}})},t.prototype._computeIsSomeGroupExpanded=function(e){var t=this;return!(!e||!e.some((function(e){return e.children?t._computeIsSomeGroupExpanded(e.children):!e.isCollapsed})))},t.prototype._updateIsSomeGroupExpanded=function(){var e=this.state.groups,t=this.props.onGroupExpandStateChanged,o=this._computeIsSomeGroupExpanded(e);this._isSomeGroupExpanded!==o&&(t&&t(o),this._isSomeGroupExpanded=o)},t.defaultProps={selectionMode:af.multiple,isHeaderVisible:!0,groupProps:{},compact:!1},t}(b.Component),zv=xn(Ov,(function(e){var t,o,n=e.theme,r=e.className,i=e.compact,s=n.palette,a=Oo(mv,n);return{root:[a.root,n.fonts.small,{position:"relative",selectors:(t={},t["."+a.listCell]={minHeight:38},t)},i&&[a.compact,{selectors:(o={},o["."+a.listCell]={minHeight:32},o)}],r],group:[a.group,{transition:"background-color "+Fe.durationValue2+" "+gv}],groupIsDropping:{backgroundColor:s.neutralLight}}}),void 0,{scope:"GroupedList"});function Wv(e){var t;return e&&(e===window?t={left:0,top:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:e.getBoundingClientRect&&(t=e.getBoundingClientRect())),t}function Vv(e){return function(t){function o(e){var o=t.call(this,e)||this;return o._root=b.createRef(),o._registerResizeObserver=function(){var e=rt(o._root.current);o._viewportResizeObserver=new e.ResizeObserver(o._onAsyncResize),o._viewportResizeObserver.observe(o._root.current)},o._unregisterResizeObserver=function(){o._viewportResizeObserver&&(o._viewportResizeObserver.disconnect(),delete o._viewportResizeObserver)},o._updateViewport=function(e){var t=o.state.viewport,n=o._root.current,r=Wv(hs(n)),i=Wv(n);((i&&i.width)!==t.width||(r&&r.height)!==t.height)&&o._resizeAttempts<3&&i&&r?(o._resizeAttempts++,o.setState({viewport:{width:i.width,height:r.height}},(function(){o._updateViewport(e)}))):(o._resizeAttempts=0,e&&o._composedComponentInstance&&o._composedComponentInstance.forceUpdate())},o._async=new di(o),o._events=new Ws(o),o._resizeAttempts=0,o.state={viewport:{width:0,height:0}},o}return p(o,t),o.prototype.componentDidMount=function(){var e=this.props,t=e.skipViewportMeasures,o=e.disableResizeObserver,n=rt(this._root.current);this._onAsyncResize=this._async.debounce(this._onAsyncResize,500,{leading:!1}),t||(!o&&this._isResizeObserverAvailable()?this._registerResizeObserver():this._events.on(n,"resize",this._onAsyncResize),this._updateViewport())},o.prototype.componentDidUpdate=function(e){var t=e.skipViewportMeasures,o=this.props,n=o.skipViewportMeasures,r=o.disableResizeObserver,i=rt(this._root.current);n!==t&&(n?(this._unregisterResizeObserver(),this._events.off(i,"resize",this._onAsyncResize)):(!r&&this._isResizeObserverAvailable()?this._viewportResizeObserver||this._registerResizeObserver():this._events.on(i,"resize",this._onAsyncResize),this._updateViewport()))},o.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose(),this._unregisterResizeObserver()},o.prototype.render=function(){var t=this.state.viewport,o=t.width>0&&t.height>0?t:void 0;return b.createElement("div",{className:"ms-Viewport",ref:this._root,style:{minWidth:1,minHeight:1}},b.createElement(e,h({ref:this._updateComposedComponentRef,viewport:o},this.props)))},o.prototype.forceUpdate=function(){this._updateViewport(!0)},o.prototype._onAsyncResize=function(){this._updateViewport()},o.prototype._isResizeObserverAvailable=function(){var e=rt(this._root.current);return e&&e.ResizeObserver},o}(Ea)}var Kv=Mn(),Uv=function(e){var t=e.selection,o=e.ariaLabelForListHeader,n=e.ariaLabelForSelectAllCheckbox,r=e.ariaLabelForSelectionColumn,i=e.className,s=e.checkboxVisibility,a=e.compact,l=e.constrainMode,c=e.dragDropEvents,u=e.groups,d=e.groupProps,p=e.indentWidth,m=e.items,g=e.isPlaceholderData,v=e.isHeaderVisible,_=e.layoutMode,y=e.onItemInvoked,C=e.onItemContextMenu,S=e.onColumnHeaderClick,x=e.onColumnHeaderContextMenu,k=e.selectionMode,w=void 0===k?t.mode:k,I=e.selectionPreservedOnEmptyClick,D=e.selectionZoneProps,P=e.ariaLabel,T=e.ariaLabelForGrid,E=e.rowElementEventMap,M=e.shouldApplyApplicationRole,R=void 0!==M&&M,B=e.getKey,N=e.listProps,F=e.usePageCache,A=e.onShouldVirtualize,L=e.viewport,H=e.minimumPixelsForDrag,O=e.getGroupHeight,z=e.styles,W=e.theme,V=e.cellStyleProps,K=void 0===V?Nf:V,U=e.onRenderCheckbox,G=e.useFastIcons,j=e.dragDropHelper,Y=e.adjustedColumns,q=e.isCollapsed,Z=e.isSizing,X=e.isSomeGroupExpanded,Q=e.version,J=e.rootRef,$=e.listRef,ee=e.focusZoneRef,te=e.columnReorderOptions,oe=e.groupedListRef,ne=e.headerRef,re=e.onGroupExpandStateChanged,ie=e.onColumnIsSizingChanged,se=e.onRowDidMount,ae=e.onRowWillUnmount,le=e.disableSelectionZone,ce=e.onColumnResized,ue=e.onColumnAutoResized,de=e.onToggleCollapse,pe=e.onActiveRowChanged,he=e.onBlur,me=e.rowElementEventMap,ge=e.onRenderMissingItem,fe=e.onRenderItemColumn,ve=e.getCellValueKey,be=e.getRowAriaLabel,_e=e.getRowAriaDescribedBy,ye=e.checkButtonAriaLabel,Ce=e.checkboxCellClassName,Se=e.useReducedRowRenderer,xe=e.enableUpdateAnimations,ke=e.enterModalSelectionOnTouch,we=e.onRenderDefaultRow,Ie=e.selectionZoneRef,De=function(e){var t=0,o=e;for(;o&&o.length>0;)t++,o=o[0].children;return t}(u),Pe=b.useMemo((function(){return h({renderedWindowsAhead:Z?0:2,renderedWindowsBehind:Z?0:2,getKey:B,version:Q},N)}),[Z,B,Q,N]),Te=Gf.none;if(w===af.single&&(Te=Gf.hidden),w===af.multiple){var Ee=d&&d.headerProps&&d.headerProps.isCollapsedGroupSelectVisible;void 0===Ee&&(Ee=!0),Te=Ee||!u||X?Gf.visible:Gf.hidden}s===Ef.hidden&&(Te=Gf.none);var Me=b.useCallback((function(e){return b.createElement(iv,h({},e))}),[]),Re=b.useCallback((function(){return null}),[]),Be=e.onRenderDetailsHeader,Ne=b.useMemo((function(){return Be?Wh(Be,Me):Me}),[Be,Me]),Fe=e.onRenderDetailsFooter,Ae=b.useMemo((function(){return Fe?Wh(Fe,Re):Re}),[Fe,Re]),Le=b.useMemo((function(){return{columns:Y,groupNestingDepth:De,selection:t,selectionMode:w,viewport:L,checkboxVisibility:s,indentWidth:p,cellStyleProps:K}}),[Y,De,t,w,L,s,p,K]),He=te&&te.onDragEnd,Oe=b.useCallback((function(e,t){var o=e.dropLocation,n=Pf.outside;if(He){if(o&&o!==Pf.header)n=o;else if(J.current){var r=J.current.getBoundingClientRect();t.clientX>r.left&&t.clientX<r.right&&t.clientY>r.top&&t.clientY<r.bottom&&(n=Pf.surface)}He(n)}}),[He,J]),ze=b.useMemo((function(){if(te)return h(h({},te),{onColumnDragEnd:Oe})}),[te,Oe]),We=(v?1:0)+function(e){var t=0;if(e)for(var o=f(e),n=void 0;o&&o.length>0;)++t,(n=o.pop())&&n.children&&o.push.apply(o,n.children);return t}(u)+(m?m.length:0),Ve=(Te!==Gf.none?1:0)+(Y?Y.length:0)+(u?1:0),Ke=b.useMemo((function(){return Kv(z,{theme:W,compact:a,isFixed:_===Tf.fixedColumns,isHorizontalConstrained:l===Df.horizontalConstrained,className:i})}),[z,W,a,_,l,i]),Ue=d&&d.onRenderFooter,Ge=b.useMemo((function(){return Ue?function(e,o){return Ue(h(h({},e),{columns:Y,groupNestingDepth:De,indentWidth:p,selection:t,selectionMode:w,viewport:L,checkboxVisibility:s,cellStyleProps:K}),o)}:void 0}),[Ue,Y,De,p,t,w,L,s,K]),je=d&&d.onRenderHeader,Ye=b.useMemo((function(){return je?function(e,o){var n=e.ariaPosInSet,r=e.ariaSetSize;return je(h(h({},e),{columns:Y,groupNestingDepth:De,indentWidth:p,selection:t,selectionMode:w,viewport:L,checkboxVisibility:s,cellStyleProps:K,ariaColSpan:Y.length,ariaPosInSet:void 0,ariaSetSize:void 0,ariaRowCount:r?r+(v?1:0):void 0,ariaRowIndex:n?n+(v?1:0):void 0}),o)}:function(e,t){var o=e.ariaPosInSet,n=e.ariaSetSize;return t(h(h({},e),{ariaColSpan:Y.length,ariaPosInSet:void 0,ariaSetSize:void 0,ariaRowCount:n?n+(v?1:0):void 0,ariaRowIndex:o?o+(v?1:0):void 0}))}}),[je,Y,De,p,v,t,w,L,s,K]),qe=b.useMemo((function(){return h(h({},d),{role:"rowgroup",onRenderFooter:Ge,onRenderHeader:Ye})}),[d,Ge,Ye]),Ze=Bs((function(){return No((function(e){var t=0;return e.forEach((function(e){return t+=e.calculatedWidth||e.minWidth})),t}))})),Xe=d&&d.collapseAllVisibility,Qe=b.useMemo((function(){return Ze(Y)}),[Y,Ze]),Je=b.useCallback((function(o,n,r){var i=e.onRenderRow?Wh(e.onRenderRow,we):we,l={item:n,itemIndex:r,compact:a,columns:Y,groupNestingDepth:o,selectionMode:w,selection:t,onDidMount:se,onWillUnmount:ae,onRenderItemColumn:fe,getCellValueKey:ve,eventsToRegister:me,dragDropEvents:c,dragDropHelper:j,viewport:L,checkboxVisibility:s,collapseAllVisibility:Xe,getRowAriaLabel:be,getRowAriaDescribedBy:_e,checkButtonAriaLabel:ye,checkboxCellClassName:Ce,useReducedRowRenderer:Se,indentWidth:p,cellStyleProps:K,onRenderDetailsCheckbox:U,enableUpdateAnimations:xe,rowWidth:Qe,useFastIcons:G};return n?i(l):ge?ge(r,l):null}),[a,Y,w,t,se,ae,fe,ve,me,c,j,L,s,Xe,be,_e,ye,Ce,Se,p,K,U,xe,G,we,ge,e.onRenderRow,Qe]),$e=b.useCallback((function(e){return function(t,o){return Je(e,t,o)}}),[Je]),et=b.useCallback((function(e){return e.which===Pn(wn.right,W)}),[W]),tt={componentRef:ee,className:Ke.focusZone,direction:vs.vertical,shouldEnterInnerZone:et,onActiveElementChanged:pe,shouldRaiseClicks:!1,onBlur:he},ot=u?b.createElement(zv,{focusZoneProps:tt,componentRef:oe,groups:u,groupProps:qe,items:m,onRenderCell:Je,role:"presentation",selection:t,selectionMode:s!==Ef.hidden?w:af.none,dragDropEvents:c,dragDropHelper:j,eventsToRegister:E,listProps:Pe,onGroupExpandStateChanged:re,usePageCache:F,onShouldVirtualize:A,getGroupHeight:O,compact:a}):b.createElement(ks,h({},tt),b.createElement(tf,h({ref:$,role:"presentation",items:m,onRenderCell:$e(0),usePageCache:F,onShouldVirtualize:A},Pe))),nt=b.useCallback((function(e){e.which===wn.down&&ee.current&&ee.current.focus()&&(0===t.getSelectedIndices().length&&t.setIndexSelected(0,!0,!1),e.preventDefault(),e.stopPropagation())}),[t,ee]),rt=b.useCallback((function(e){e.which!==wn.up||e.altKey||ne.current&&ne.current.focus()&&(e.preventDefault(),e.stopPropagation())}),[ne]);return b.createElement("div",h({ref:J,className:Ke.root,"data-automationid":"DetailsList","data-is-scrollable":"false","aria-label":P},R?{role:"application"}:{}),b.createElement(ha,null),b.createElement("div",{role:"grid","aria-label":T,"aria-rowcount":g?-1:We,"aria-colcount":Ve,"aria-readonly":"true","aria-busy":g},b.createElement("div",{onKeyDown:nt,role:"presentation",className:Ke.headerWrapper},v&&Ne({componentRef:ne,selectionMode:w,layoutMode:_,selection:t,columns:Y,onColumnClick:S,onColumnContextMenu:x,onColumnResized:ce,onColumnIsSizingChanged:ie,onColumnAutoResized:ue,groupNestingDepth:De,isAllCollapsed:q,onToggleCollapseAll:de,ariaLabel:o,ariaLabelForSelectAllCheckbox:n,ariaLabelForSelectionColumn:r,selectAllVisibility:Te,collapseAllVisibility:d&&d.collapseAllVisibility,viewport:L,columnReorderProps:ze,minimumPixelsForDrag:H,cellStyleProps:K,checkboxVisibility:s,indentWidth:p,onRenderDetailsCheckbox:U,rowWidth:Ze(Y),useFastIcons:G},Ne)),b.createElement("div",{onKeyDown:rt,role:"presentation",className:Ke.contentWrapper},le?ot:b.createElement(Mf,h({ref:Ie,selection:t,selectionPreservedOnEmptyClick:I,selectionMode:w,onItemInvoked:y,onItemContextMenu:C,enterModalOnTouch:ke},D||{}),ot)),Ae(h({},Le))))},Gv=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._header=b.createRef(),o._groupedList=b.createRef(),o._list=b.createRef(),o._focusZone=b.createRef(),o._selectionZone=b.createRef(),o._onRenderRow=function(e,t){return b.createElement(hv,h({},e))},o._getDerivedStateFromProps=function(e,t){var n=o.props,r=n.checkboxVisibility,i=n.items,s=n.setKey,a=n.selectionMode,l=void 0===a?o._selection.mode:a,c=n.columns,u=n.viewport,d=n.compact,p=n.dragDropEvents,m=(o.props.groupProps||{}).isAllGroupsCollapsed,g=void 0===m?void 0:m,f=e.viewport&&e.viewport.width||0,v=u&&u.width||0,b=e.setKey!==s||void 0===e.setKey,_=!1;e.layoutMode!==o.props.layoutMode&&(_=!0);var y=t;return b&&(o._initialFocusedIndex=e.initialFocusedIndex,y=h(h({},y),{focusedItemIndex:void 0!==o._initialFocusedIndex?o._initialFocusedIndex:-1})),o.props.disableSelectionZone||e.items===i||o._selection.setItems(e.items,b),e.checkboxVisibility===r&&e.columns===c&&f===v&&e.compact===d||(_=!0),y=h(h({},y),o._adjustColumns(e,y,!0)),e.selectionMode!==l&&(_=!0),void 0===g&&e.groupProps&&void 0!==e.groupProps.isAllGroupsCollapsed&&(y=h(h({},y),{isCollapsed:e.groupProps.isAllGroupsCollapsed,isSomeGroupExpanded:!e.groupProps.isAllGroupsCollapsed})),e.dragDropEvents!==p&&(o._dragDropHelper&&o._dragDropHelper.dispose(),o._dragDropHelper=e.dragDropEvents?new Yf({selection:o._selection,minimumPixelsForDrag:e.minimumPixelsForDrag}):void 0,_=!0),_&&(y=h(h({},y),{version:{}})),y},o._onGroupExpandStateChanged=function(e){o.setState({isSomeGroupExpanded:e})},o._onColumnIsSizingChanged=function(e,t){o.setState({isSizing:t})},o._onRowDidMount=function(e){var t=e.props,n=t.item,r=t.itemIndex,i=o._getItemKey(n,r);o._activeRows[i]=e,o._setFocusToRowIfPending(e);var s=o.props.onRowDidMount;s&&s(n,r)},o._onRowWillUnmount=function(e){var t=o.props.onRowWillUnmount,n=e.props,r=n.item,i=n.itemIndex,s=o._getItemKey(r,i);delete o._activeRows[s],t&&t(r,i)},o._onToggleCollapse=function(e){o.setState({isCollapsed:e}),o._groupedList.current&&o._groupedList.current.toggleCollapseAll(e)},o._onColumnResized=function(e,t,n){var r=Math.max(e.minWidth||100,t);o.props.onColumnResize&&o.props.onColumnResize(e,r,n),o._rememberCalculatedWidth(e,r),o.setState(h(h({},o._adjustColumns(o.props,o.state,!0,n)),{version:{}}))},o._onColumnAutoResized=function(e,t){var n=0,r=0,i=Object.keys(o._activeRows).length;for(var s in o._activeRows){if(o._activeRows.hasOwnProperty(s))o._activeRows[s].measureCell(t,(function(s){n=Math.max(n,s),++r===i&&o._onColumnResized(e,n,t)}))}},o._onActiveRowChanged=function(e,t){var n=o.props,r=n.items,i=n.onActiveItemChanged;if(e&&e.getAttribute("data-item-index")){var s=Number(e.getAttribute("data-item-index"));s>=0&&(i&&i(r[s],s,t),o.setState({focusedItemIndex:s}))}},o._onBlur=function(e){o.setState({focusedItemIndex:-1})},si(o),o._async=new di(o),o._activeRows={},o._columnOverrides={},o.state={focusedItemIndex:-1,lastWidth:0,adjustedColumns:o._getAdjustedColumns(t,void 0),isSizing:!1,isCollapsed:t.groupProps&&t.groupProps.isAllGroupsCollapsed,isSomeGroupExpanded:t.groupProps&&!t.groupProps.isAllGroupsCollapsed,version:{},getDerivedStateFromProps:o._getDerivedStateFromProps},o._selection=t.selection||new xf({onSelectionChanged:void 0,getKey:t.getKey,selectionMode:t.selectionMode}),o.props.disableSelectionZone||o._selection.setItems(t.items,!1),o._dragDropHelper=t.dragDropEvents?new Yf({selection:o._selection,minimumPixelsForDrag:t.minimumPixelsForDrag}):void 0,o._initialFocusedIndex=t.initialFocusedIndex,o}return p(t,e),t.getDerivedStateFromProps=function(e,t){return t.getDerivedStateFromProps(e,t)},t.prototype.scrollToIndex=function(e,t,o){this._list.current&&this._list.current.scrollToIndex(e,t,o),this._groupedList.current&&this._groupedList.current.scrollToIndex(e,t,o)},t.prototype.focusIndex=function(e,t,o,n){void 0===t&&(t=!1);var r=this.props.items[e];if(r){this.scrollToIndex(e,o,n);var i=this._getItemKey(r,e),s=this._activeRows[i];s&&this._setFocusToRow(s,t)}},t.prototype.getStartItemIndexInView=function(){return this._list&&this._list.current?this._list.current.getStartItemIndexInView():this._groupedList&&this._groupedList.current?this._groupedList.current.getStartItemIndexInView():0},t.prototype.componentWillUnmount=function(){this._dragDropHelper&&this._dragDropHelper.dispose(),this._async.dispose()},t.prototype.componentDidUpdate=function(e,t){if((this._notifyColumnsResized(),void 0!==this._initialFocusedIndex)&&(i=this.props.items[this._initialFocusedIndex])){var o=this._getItemKey(i,this._initialFocusedIndex);(n=this._activeRows[o])&&this._setFocusToRowIfPending(n)}if(this.props.items!==e.items&&this.props.items.length>0&&-1!==this.state.focusedItemIndex&&!Ni(this._root.current,document.activeElement,!1)){var n,r=this.state.focusedItemIndex<this.props.items.length?this.state.focusedItemIndex:this.props.items.length-1,i=this.props.items[r];o=this._getItemKey(i,this.state.focusedItemIndex);(n=this._activeRows[o])?this._setFocusToRow(n):this._initialFocusedIndex=r}this.props.onDidUpdate&&this.props.onDidUpdate(this)},t.prototype.render=function(){return b.createElement(Uv,h({},this.props,this.state,{selection:this._selection,dragDropHelper:this._dragDropHelper,rootRef:this._root,listRef:this._list,groupedListRef:this._groupedList,focusZoneRef:this._focusZone,headerRef:this._header,selectionZoneRef:this._selectionZone,onGroupExpandStateChanged:this._onGroupExpandStateChanged,onColumnIsSizingChanged:this._onColumnIsSizingChanged,onRowDidMount:this._onRowDidMount,onRowWillUnmount:this._onRowWillUnmount,onColumnResized:this._onColumnResized,onColumnAutoResized:this._onColumnAutoResized,onToggleCollapse:this._onToggleCollapse,onActiveRowChanged:this._onActiveRowChanged,onBlur:this._onBlur,onRenderDefaultRow:this._onRenderRow}))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this._forceListUpdates()},t.prototype._getGroupNestingDepth=function(){for(var e=0,t=this.props.groups;t&&t.length>0;)e++,t=t[0].children;return e},t.prototype._setFocusToRowIfPending=function(e){var t=e.props.itemIndex;void 0!==this._initialFocusedIndex&&t===this._initialFocusedIndex&&(this._setFocusToRow(e),delete this._initialFocusedIndex)},t.prototype._setFocusToRow=function(e,t){void 0===t&&(t=!1),this._selectionZone.current&&this._selectionZone.current.ignoreNextFocus(),this._async.setTimeout((function(){e.focus(t)}),0)},t.prototype._forceListUpdates=function(){this._groupedList.current&&this._groupedList.current.forceUpdate(),this._list.current&&this._list.current.forceUpdate()},t.prototype._notifyColumnsResized=function(){this.state.adjustedColumns.forEach((function(e){e.onColumnResize&&e.onColumnResize(e.currentWidth)}))},t.prototype._adjustColumns=function(e,t,o,n){var r=this._getAdjustedColumns(e,t,o,n),i=this.props.viewport,s=i&&i.width?i.width:0;return h(h({},t),{adjustedColumns:r,lastWidth:s})},t.prototype._getAdjustedColumns=function(e,t,o,n){var r,i=this,s=e.items,a=e.layoutMode,l=e.selectionMode,c=e.viewport,u=c&&c.width?c.width:0,d=e.columns,p=this.props?this.props.columns:[],h=t?t.lastWidth:-1,m=t?t.lastSelectionMode:void 0;return o||h!==u||m!==l||p&&d!==p?(d=d||jv(s,!0),a===Tf.fixedColumns?(r=this._getFixedColumns(d)).forEach((function(e){i._rememberCalculatedWidth(e,e.calculatedWidth)})):(r=void 0!==n?this._getJustifiedColumnsAfterResize(d,u,e,n):this._getJustifiedColumns(d,u,e,0)).forEach((function(e){i._getColumnOverride(e.key).currentWidth=e.calculatedWidth})),r):d||[]},t.prototype._getFixedColumns=function(e){var t=this;return e.map((function(e){var o=h(h({},e),t._columnOverrides[e.key]);return o.calculatedWidth||(o.calculatedWidth=o.maxWidth||o.minWidth||100),o}))},t.prototype._getJustifiedColumnsAfterResize=function(e,t,o,n){var r=this,i=e.slice(0,n);i.forEach((function(e){return e.calculatedWidth=r._getColumnOverride(e.key).currentWidth}));var s=i.reduce((function(e,t,n){return e+Yv(t,0===n,o)}),0),a=e.slice(n),l=t-s;return f(i,this._getJustifiedColumns(a,l,o,n))},t.prototype._getJustifiedColumns=function(e,t,o,n){for(var r=this,i=o.selectionMode,s=void 0===i?this._selection.mode:i,a=o.checkboxVisibility,l=s!==af.none&&a!==Ef.hidden?48:0,c=36*this._getGroupNestingDepth(),u=0,d=t-(l+c),p=e.map((function(e,t){var i=h(h(h({},e),{calculatedWidth:e.minWidth||100}),r._columnOverrides[e.key]);return u+=Yv(i,t+n===0,o),i})),m=p.length-1;m>0&&u>d;){var g=(_=p[m]).minWidth||100,f=u-d;if(_.calculatedWidth-g>=f||!_.isCollapsible&&!_.isCollapsable){var v=_.calculatedWidth;_.calculatedWidth=Math.max(_.calculatedWidth-f,g),u-=v-_.calculatedWidth}else u-=Yv(_,!1,o),p.splice(m,1);m--}for(var b=0;b<p.length&&u<d;b++){var _=p[b],y=b===p.length-1,C=this._columnOverrides[_.key];if(!C||!C.calculatedWidth||y){var S=d-u,x=void 0;if(y)x=S;else{var k=_.maxWidth;g=_.minWidth||k||100;x=k?Math.min(S,k-g):S}_.calculatedWidth=_.calculatedWidth+x,u+=x}}return p},t.prototype._rememberCalculatedWidth=function(e,t){var o=this._getColumnOverride(e.key);o.calculatedWidth=t,o.currentWidth=t},t.prototype._getColumnOverride=function(e){return this._columnOverrides[e]=this._columnOverrides[e]||{}},t.prototype._getItemKey=function(e,t){var o=this.props.getKey,n=void 0;return e&&(n=e.key),o&&(n=o(e,t)),n||(n=t),n},t.defaultProps={layoutMode:Tf.justified,selectionMode:af.multiple,constrainMode:Df.horizontalConstrained,checkboxVisibility:Ef.onHover,isHeaderVisible:!0,compact:!1,useFastIcons:!0},t=g([Vv],t)}(b.Component);function jv(e,t,o,n,r,i,s){var a=[];if(e&&e.length){var l=e[0];for(var c in l)l.hasOwnProperty(c)&&a.push({key:c,name:c,fieldName:c,minWidth:100,maxWidth:300,isCollapsable:!!a.length,isCollapsible:!!a.length,isMultiline:void 0!==s&&s,isSorted:n===c,isSortedDescending:!!r,isRowHeader:!1,columnActionsMode:If.clickable,isResizable:t,onColumnClick:o,isGrouped:i===c})}return a}function Yv(e,t,o){var n=o.cellStyleProps,r=void 0===n?Nf:n;return e.calculatedWidth+r.cellLeftPadding+r.cellRightPadding+(e.isPadded?r.cellExtraRightPadding:0)}var qv,Zv={root:"ms-DetailsList",compact:"ms-DetailsList--Compact",contentWrapper:"ms-DetailsList-contentWrapper",headerWrapper:"ms-DetailsList-headerWrapper",isFixed:"is-fixed",isHorizontalConstrained:"is-horizontalConstrained",listCell:"ms-List-cell"},Xv=xn(Gv,(function(e){var t,o,n=e.theme,r=e.className,i=e.isHorizontalConstrained,s=e.compact,a=e.isFixed,l=n.semanticColors,c=Oo(Zv,n);return{root:[c.root,n.fonts.small,{position:"relative",color:l.listText,selectors:(t={},t["& ."+c.listCell]={minHeight:38,wordBreak:"break-word"},t)},a&&c.isFixed,s&&[c.compact,{selectors:(o={},o["."+c.listCell]={minHeight:32},o)}],i&&[c.isHorizontalConstrained,{overflowX:"auto",overflowY:"visible",WebkitOverflowScrolling:"touch"}],r],focusZone:[{display:"inline-block",minWidth:"100%",minHeight:1}],headerWrapper:c.headerWrapper,contentWrapper:c.contentWrapper}}),void 0,{scope:"DetailsList"});!function(e){e[e.normal=0]="normal",e[e.largeHeader=1]="largeHeader",e[e.close=2]="close"}(qv||(qv={}));var Qv,Jv=Fe.durationValue2,$v={root:"ms-Modal",main:"ms-Dialog-main",scrollableContent:"ms-Modal-scrollableContent",isOpen:"is-open",layer:"ms-Modal-Layer"},eb=Mn(),tb=function(e){function t(t){var o=e.call(this,t)||this;si(o);var n=o.props.allowTouchBodyScroll,r=void 0!==n&&n;return o._allowTouchBodyScroll=r,o}return p(t,e),t.prototype.componentDidMount=function(){!this._allowTouchBodyScroll&&us()},t.prototype.componentWillUnmount=function(){!this._allowTouchBodyScroll&&ds()},t.prototype.render=function(){var e=this.props,t=e.isDarkThemed,o=e.className,n=e.theme,r=e.styles,i=fr(this.props,gr),s=eb(r,{theme:n,className:o,isDark:t});return b.createElement("div",h({},i,{className:s.root}))},t}(b.Component),ob={root:"ms-Overlay",rootDark:"ms-Overlay--dark"},nb=xn(tb,(function(e){var t,o=e.className,n=e.theme,r=e.isNone,i=e.isDark,s=n.palette,a=Oo(ob,n);return{root:[a.root,n.fonts.medium,{backgroundColor:s.whiteTranslucent40,top:0,right:0,bottom:0,left:0,position:"absolute",selectors:(t={},t[jt]={border:"1px solid WindowText",opacity:0},t)},r&&{visibility:"hidden"},i&&[a.rootDark,{backgroundColor:s.blackTranslucent40}],o]}}),void 0,{scope:"Overlay"}),rb=No((function(e,t){return{root:Q(e,t&&{touchAction:"none",selectors:{"& *":{userSelect:"none"}}})}})),ib={start:"touchstart",move:"touchmove",stop:"touchend"},sb={start:"mousedown",move:"mousemove",stop:"mouseup"},ab=function(e){function t(t){var o=e.call(this,t)||this;return o._currentEventType=sb,o._events=[],o._onMouseDown=function(e){var t=b.Children.only(o.props.children).props.onMouseDown;return t&&t(e),o._currentEventType=sb,o._onDragStart(e)},o._onMouseUp=function(e){var t=b.Children.only(o.props.children).props.onMouseUp;return t&&t(e),o._currentEventType=sb,o._onDragStop(e)},o._onTouchStart=function(e){var t=b.Children.only(o.props.children).props.onTouchStart;return t&&t(e),o._currentEventType=ib,o._onDragStart(e)},o._onTouchEnd=function(e){var t=b.Children.only(o.props.children).props.onTouchEnd;t&&t(e),o._currentEventType=ib,o._onDragStop(e)},o._onDragStart=function(e){if("number"==typeof e.button&&0!==e.button)return!1;if(!(o.props.handleSelector&&!o._matchesSelector(e.target,o.props.handleSelector)||o.props.preventDragSelector&&o._matchesSelector(e.target,o.props.preventDragSelector))){o._touchId=o._getTouchId(e);var t=o._getControlPosition(e);if(void 0!==t){var n=o._createDragDataFromPosition(t);o.props.onStart&&o.props.onStart(e,n),o.setState({isDragging:!0,lastPosition:t}),o._events=[Ga(document.body,o._currentEventType.move,o._onDrag,!0),Ga(document.body,o._currentEventType.stop,o._onDragStop,!0)]}}},o._onDrag=function(e){"touchmove"===e.type&&e.preventDefault();var t=o._getControlPosition(e);if(t){var n=o._createUpdatedDragData(o._createDragDataFromPosition(t)),r=n.position;o.props.onDragChange&&o.props.onDragChange(e,n),o.setState({position:r,lastPosition:t})}},o._onDragStop=function(e){if(o.state.isDragging){var t=o._getControlPosition(e);if(t){var n=o._createDragDataFromPosition(t);o.setState({isDragging:!1,lastPosition:void 0}),o.props.onStop&&o.props.onStop(e,n),o.props.position&&o.setState({position:o.props.position}),o._events.forEach((function(e){return e()}))}}},o.state={isDragging:!1,position:o.props.position||{x:0,y:0},lastPosition:void 0},o}return p(t,e),t.prototype.componentDidUpdate=function(e){!this.props.position||e.position&&this.props.position===e.position||this.setState({position:this.props.position})},t.prototype.componentWillUnmount=function(){this._events.forEach((function(e){return e()}))},t.prototype.render=function(){var e=b.Children.only(this.props.children),t=e.props,o=this.props.position,n=this.state,r=n.position,i=n.isDragging,s=r.x,a=r.y;return o&&!i&&(s=o.x,a=o.y),b.cloneElement(e,{style:h(h({},t.style),{transform:"translate("+s+"px, "+a+"px)"}),className:rb(t.className,this.state.isDragging).root,onMouseDown:this._onMouseDown,onMouseUp:this._onMouseUp,onTouchStart:this._onTouchStart,onTouchEnd:this._onTouchEnd})},t.prototype._getControlPosition=function(e){var t=this._getActiveTouch(e);if(void 0===this._touchId||t){var o=t||e;return{x:o.clientX,y:o.clientY}}},t.prototype._getActiveTouch=function(e){return e.targetTouches&&this._findTouchInTouchList(e.targetTouches)||e.changedTouches&&this._findTouchInTouchList(e.changedTouches)},t.prototype._getTouchId=function(e){var t=e.targetTouches&&e.targetTouches[0]||e.changedTouches&&e.changedTouches[0];if(t)return t.identifier},t.prototype._matchesSelector=function(e,t){if(!e||e===document.body)return!1;var o=e.matches||e.webkitMatchesSelector||e.msMatchesSelector;return!!o&&(o.call(e,t)||this._matchesSelector(e.parentElement,t))},t.prototype._findTouchInTouchList=function(e){if(void 0!==this._touchId)for(var t=0;t<e.length;t++)if(e[t].identifier===this._touchId)return e[t]},t.prototype._createDragDataFromPosition=function(e){var t=this.state.lastPosition;return void 0===t?{delta:{x:0,y:0},lastPosition:e,position:e}:{delta:{x:e.x-t.x,y:e.y-t.y},lastPosition:t,position:e}},t.prototype._createUpdatedDragData=function(e){var t=this.state.position;return{position:{x:t.x+e.delta.x,y:t.y+e.delta.y},delta:e.delta,lastPosition:t}},t}(b.Component),lb={eventBubblingEnabled:!1},cb=Mn(),ub=function(e){function t(t){var o=e.call(this,t)||this;o._focusTrapZone=b.createRef(),o._registerInitialModalPosition=function(){var e,t=document.querySelector("[data-id="+o.state.id+"]");if(t){var n=t.getBoundingClientRect();!(null===(e=o.props.dragOptions)||void 0===e?void 0:e.keepInBounds)||o._minClampedPosition||o._maxClampedPosition||(o._minClampedPosition={x:-n.x,y:-n.y},o._maxClampedPosition={x:n.x,y:n.y}),o.setState({modalRectangleTop:n.top})}},o._allowScrollOnModal=function(e){e?o._allowTouchBodyScroll?ls(e,o._events):as(e,o._events):o._events.off(o._scrollableContent),o._scrollableContent=e},o._onModalContextMenuClose=function(){o.setState({isModalMenuOpen:!1})},o._onModalClose=function(){o._lastSetX=0,o._lastSetY=0,o.setState({isModalMenuOpen:!1,isInKeyboardMoveMode:!1,isOpen:!1,x:0,y:0}),o.props.dragOptions&&o._hasRegisteredKeyUp&&o._events.off(window,"keyup",o._onKeyUp,!0),o.props.onDismissed&&o.props.onDismissed()},o._onDragStart=function(){o.setState({isModalMenuOpen:!1,isInKeyboardMoveMode:!1})},o._onDrag=function(e,t){var n=o.state,r=n.x,i=n.y;o.setState(o._getClampedPosition({x:r+t.delta.x,y:i+t.delta.y}))},o._onDragStop=function(){o.focus()},o._onKeyUp=function(e){e.altKey&&e.ctrlKey&&e.keyCode===wn.space&&Ni(o._scrollableContent,e.target)&&(o.setState({isModalMenuOpen:!o.state.isModalMenuOpen}),e.preventDefault(),e.stopPropagation())},o._onKeyDown=function(e){if(e.altKey&&e.ctrlKey&&e.keyCode===wn.space)return e.preventDefault(),void e.stopPropagation();if(o.state.isModalMenuOpen&&(e.altKey||e.keyCode===wn.escape)&&o.setState({isModalMenuOpen:!1}),!o.state.isInKeyboardMoveMode||e.keyCode!==wn.escape&&e.keyCode!==wn.enter||(o.setState({isInKeyboardMoveMode:!1}),e.preventDefault(),e.stopPropagation()),o.state.isInKeyboardMoveMode){var t=!0,n=o._getMoveDelta(e);switch(e.keyCode){case wn.escape:o.setState({x:o._lastSetX,y:o._lastSetY});case wn.enter:o._lastSetX=0,o._lastSetY=0,o.setState({isInKeyboardMoveMode:!1});break;case wn.up:o.setState({y:o._getClampedPositionY(o.state.y-n)});break;case wn.down:o.setState({y:o._getClampedPositionY(o.state.y+n)});break;case wn.left:o.setState({x:o._getClampedPositionX(o.state.x-n)});break;case wn.right:o.setState({x:o._getClampedPositionX(o.state.x+n)});break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())}},o._onEnterKeyboardMoveMode=function(){o._lastSetX=o.state.x,o._lastSetY=o.state.y,o.setState({isInKeyboardMoveMode:!0,isModalMenuOpen:!1}),o._events.on(window,"keydown",o._onKeyDown,!0)},o._onExitKeyboardMoveMode=function(){o._lastSetX=0,o._lastSetY=0,o.setState({isInKeyboardMoveMode:!1}),o._events.off(window,"keydown",o._onKeyDown,!0)},o._registerForKeyUp=function(){o._hasRegisteredKeyUp||(o._events.on(window,"keyup",o._onKeyUp,!0),o._hasRegisteredKeyUp=!0)},o._async=new di(o),o._events=new Ws(o),si(o),o.state={id:ts("Modal"),isOpen:t.isOpen,isVisible:t.isOpen,hasBeenOpened:t.isOpen,x:0,y:0},o._lastSetX=0,o._lastSetY=0;var n=o.props.allowTouchBodyScroll,r=void 0!==n&&n;return o._allowTouchBodyScroll=r,o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){clearTimeout(this._onModalCloseTimer),e.isOpen&&(this.state.isOpen?this.setState({hasBeenOpened:!0,isVisible:!0}):(this.setState({isOpen:!0}),e.dragOptions&&this._registerForKeyUp())),!e.isOpen&&this.state.isOpen&&(this._onModalCloseTimer=this._async.setTimeout(this._onModalClose,1e3*parseFloat(Jv)),this.setState({isVisible:!1}))},t.prototype.componentDidMount=function(){var e=this;this.state.isOpen&&this.state.isVisible&&(this._registerForKeyUp(),requestAnimationFrame((function(){return setTimeout(e._registerInitialModalPosition,0)})))},t.prototype.componentDidUpdate=function(e,t){var o=this;e.isOpen||t.isVisible||this.setState({isVisible:!0}),!e.isOpen&&this.props.isOpen&&requestAnimationFrame((function(){return setTimeout(o._registerInitialModalPosition,0)}))},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this.props,t=e.className,o=e.containerClassName,n=e.scrollableContentClassName,r=e.elementToFocusOnDismiss,i=e.firstFocusableSelector,s=e.forceFocusInsideTrap,a=e.ignoreExternalFocusing,l=e.isBlocking,c=e.isClickableOutsideFocusTrap,u=e.isDarkOverlay,d=e.onDismiss,p=e.layerProps,m=e.overlay,g=e.responsiveMode,f=e.titleAriaId,v=e.styles,_=e.subtitleAriaId,y=e.theme,C=e.topOffsetFixed,S=e.onLayerDidMount,x=e.isModeless,k=e.dragOptions,w=e.enableAriaHiddenSiblings,I=this.state,D=I.isOpen,P=I.isVisible,T=I.hasBeenOpened,E=I.modalRectangleTop,M=I.x,R=I.y,B=I.isInKeyboardMoveMode;if(!D)return null;var N=void 0===p?"":p.className,F=cb(v,{theme:y,className:t,containerClassName:o,scrollableContentClassName:n,isOpen:D,isVisible:P,hasBeenOpened:T,modalRectangleTop:E,topOffsetFixed:C,isModeless:x,layerClassName:N,isDefaultDragHandle:k&&!k.dragHandleSelector}),A=h(h(h({},lb),this.props.layerProps),{onLayerDidMount:p&&p.onLayerDidMount?p.onLayerDidMount:S,insertFirst:x,className:F.layer}),L=b.createElement(Ih,{"data-id":this.state.id,componentRef:this._focusTrapZone,className:F.main,elementToFocusOnDismiss:r,isClickableOutsideFocusTrap:x||c||!l,ignoreExternalFocusing:a,forceFocusInsideTrap:x?!x:s,firstFocusableSelector:i,focusPreviouslyFocusedInnerElement:!0,onBlur:B?this._onExitKeyboardMoveMode:void 0,enableAriaHiddenSiblings:w},k&&B&&b.createElement("div",{className:F.keyboardMoveIconContainer},k.keyboardMoveIconProps?b.createElement(Fr,h({},k.keyboardMoveIconProps)):b.createElement(Fr,{iconName:"move",className:F.keyboardMoveIcon})),b.createElement("div",{ref:this._allowScrollOnModal,className:F.scrollableContent,"data-is-scrollable":!0},k&&this.state.isModalMenuOpen&&b.createElement(k.menu,{items:[{key:"move",text:k.moveMenuItemText,onClick:this._onEnterKeyboardMoveMode},{key:"close",text:k.closeMenuItemText,onClick:this._onModalClose}],onDismiss:this._onModalContextMenuClose,alignTargetEdge:!0,coverTarget:!0,directionalHint:ya.topLeftEdge,directionalHintFixed:!0,shouldFocusOnMount:!0,target:this._scrollableContent}),this.props.children));return g>=Ra.small?b.createElement(cc,h({},A),b.createElement(Rl,{role:x||!l?"dialog":"alertdialog","aria-modal":!x,ariaLabelledBy:f,ariaDescribedBy:_,onDismiss:d,shouldRestoreFocus:!a},b.createElement("div",{className:F.root,role:x?void 0:"document"},!x&&b.createElement(nb,h({isDarkThemed:u,onClick:l?void 0:d,allowTouchBodyScroll:this._allowTouchBodyScroll},m)),k?b.createElement(ab,{handleSelector:k.dragHandleSelector||"."+F.main.split(" ")[0],preventDragSelector:"button",onStart:this._onDragStart,onDragChange:this._onDrag,onStop:this._onDragStop,position:{x:M,y:R}},L):L))):null},t.prototype.focus=function(){this._focusTrapZone.current&&this._focusTrapZone.current.focus()},t.prototype._getClampedPosition=function(e){return this.props.dragOptions&&this.props.dragOptions.keepInBounds?{x:this._getClampedPositionX(e.x),y:this._getClampedPositionY(e.y)}:e},t.prototype._getClampedPositionY=function(e){var t=this._minClampedPosition,o=this._maxClampedPosition;return t&&(e=Math.max(t.y,e)),o&&(e=Math.min(o.y,e)),e},t.prototype._getClampedPositionX=function(e){var t=this._minClampedPosition,o=this._maxClampedPosition;return t&&(e=Math.max(t.x,e)),o&&(e=Math.min(o.x,e)),e},t.prototype._getMoveDelta=function(e){var t=10;return e.shiftKey?e.ctrlKey||(t=50):e.ctrlKey&&(t=1),t},t.defaultProps={isOpen:!1,isDarkOverlay:!0,isBlocking:!1,className:"",containerClassName:""},t=g([Ka],t)}(b.Component),db=xn(ub,(function(e){var t,o=e.className,n=e.containerClassName,r=e.scrollableContentClassName,i=e.isOpen,s=e.isVisible,a=e.hasBeenOpened,l=e.modalRectangleTop,c=e.theme,u=e.topOffsetFixed,d=e.isModeless,p=e.layerClassName,h=e.isDefaultDragHandle,m=c.palette,g=c.effects,f=c.fonts,v=Oo($v,c);return{root:[v.root,f.medium,{backgroundColor:"transparent",position:d?"absolute":"fixed",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,pointerEvents:"none",transition:"opacity "+Jv},u&&"number"==typeof l&&a&&{alignItems:"flex-start"},i&&v.isOpen,s&&{opacity:1,pointerEvents:"auto"},o],main:[v.main,{boxShadow:g.elevation64,borderRadius:g.roundedCorner2,backgroundColor:m.white,boxSizing:"border-box",position:"relative",textAlign:"left",outline:"3px solid transparent",maxHeight:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)",minHeight:"176px",minWidth:"288px",overflowY:"auto",zIndex:d?po.Layer:void 0},u&&"number"==typeof l&&a&&{top:l},h&&{cursor:"move"},n],scrollableContent:[v.scrollableContent,{overflowY:"auto",flexGrow:1,maxHeight:"100vh",selectors:(t={},t["@supports (-webkit-overflow-scrolling: touch)"]={maxHeight:window.innerHeight},t)},r],layer:d&&[p,v.layer,{position:"static",width:"unset",height:"unset"}],keyboardMoveIconContainer:{position:"absolute",display:"flex",justifyContent:"center",width:"100%",padding:"3px 0px"},keyboardMoveIcon:{fontSize:f.xLargePlus.fontSize,width:"24px"}}}),void 0,{scope:"Modal",fields:["theme","styles","enableAriaHiddenSiblings"]}),pb=Mn(),hb=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.styles,n=e.theme;return this._classNames=pb(o,{theme:n,className:t}),b.createElement("div",{className:this._classNames.actions},b.createElement("div",{className:this._classNames.actionsRight},this._renderChildrenAsActions()))},t.prototype._renderChildrenAsActions=function(){var e=this;return b.Children.map(this.props.children,(function(t){return t?b.createElement("span",{className:e._classNames.action},t):null}))},t}(b.Component),mb={actions:"ms-Dialog-actions",action:"ms-Dialog-action",actionsRight:"ms-Dialog-actionsRight"},gb=xn(hb,(function(e){var t=e.className,o=e.theme,n=Oo(mb,o);return{actions:[n.actions,{position:"relative",width:"100%",minHeight:"24px",lineHeight:"24px",margin:"16px 0 0",fontSize:"0",selectors:{".ms-Button":{lineHeight:"normal"}}},t],action:[n.action,{margin:"0 4px"}],actionsRight:[n.actionsRight,{textAlign:"right",marginRight:"-4px",fontSize:"0"}]}}),void 0,{scope:"DialogFooter"}),fb=Mn(),vb=b.createElement(gb,null).type,bb=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e,t=this.props,o=t.showCloseButton,n=t.className,r=t.closeButtonAriaLabel,i=t.onDismiss,s=t.subTextId,a=t.subText,l=t.titleProps,c=void 0===l?{}:l,u=t.titleId,d=t.title,p=t.type,m=t.styles,g=t.theme,f=t.draggableHeaderClassName,v=fb(m,{theme:g,className:n,isLargeHeader:p===qv.largeHeader,isClose:p===qv.close,draggableHeaderClassName:f}),_=this._groupChildren();return a&&(e=b.createElement("p",{className:v.subText,id:s},a)),b.createElement("div",{className:v.content},b.createElement("div",{className:v.header},b.createElement("div",h({id:u,role:"heading","aria-level":1},c,{className:Sr(v.title,c.className)}),d),b.createElement("div",{className:v.topButton},this.props.topButtonsProps.map((function(e,t){return b.createElement(eu,h({key:e.uniqueId||t},e))})),(p===qv.close||o&&p!==qv.largeHeader)&&b.createElement(eu,{className:v.button,iconProps:{iconName:"Cancel"},ariaLabel:r,onClick:i,title:r}))),b.createElement("div",{className:v.inner},b.createElement("div",{className:v.innerContent},e,_.contents),_.footers))},t.prototype._groupChildren=function(){var e={footers:[],contents:[]};return b.Children.map(this.props.children,(function(t){"object"==typeof t&&null!==t&&t.type===vb?e.footers.push(t):e.contents.push(t)})),e},t.defaultProps={showCloseButton:!1,className:"",topButtonsProps:[],closeButtonAriaLabel:"Close"},t=g([Ka],t)}(b.Component),_b={contentLgHeader:"ms-Dialog-lgHeader",close:"ms-Dialog--close",subText:"ms-Dialog-subText",header:"ms-Dialog-header",headerLg:"ms-Dialog--lgHeader",button:"ms-Dialog-button ms-Dialog-button--close",inner:"ms-Dialog-inner",content:"ms-Dialog-content",title:"ms-Dialog-title"},yb=xn(bb,(function(e){var t,o,n,r=e.className,i=e.theme,s=e.isLargeHeader,a=e.isClose,l=e.hidden,c=e.isMultiline,u=e.draggableHeaderClassName,d=i.palette,p=i.fonts,h=i.effects,m=i.semanticColors,g=Oo(_b,i);return{content:[s&&[g.contentLgHeader,{borderTop:"4px solid "+d.themePrimary}],a&&g.close,{flexGrow:1,overflowY:"hidden"},r],subText:[g.subText,p.medium,{margin:"0 0 24px 0",color:m.bodySubtext,lineHeight:"1.5",wordWrap:"break-word",fontWeight:Ge.regular}],header:[g.header,{position:"relative",width:"100%",boxSizing:"border-box"},a&&g.close,u&&[u,{cursor:"move"}]],button:[g.button,l&&{selectors:{".ms-Icon.ms-Icon--Cancel":{color:m.buttonText,fontSize:je.medium}}}],inner:[g.inner,{padding:"0 24px 24px",selectors:(t={},t["@media (min-width: "+Xt+"px) and (max-width: "+oo+"px)"]={padding:"0 16px 16px"},t)}],innerContent:[g.content,{position:"relative",width:"100%"}],title:[g.title,p.xLarge,{color:m.bodyText,margin:"0",minHeight:p.xLarge.fontSize,padding:"16px 46px 20px 24px",lineHeight:"normal",selectors:(o={},o["@media (min-width: "+Xt+"px) and (max-width: "+oo+"px)"]={padding:"16px 46px 16px 16px"},o)},s&&{color:m.menuHeader},c&&{fontSize:p.xxLarge.fontSize}],topButton:[{display:"flex",flexDirection:"row",flexWrap:"nowrap",position:"absolute",top:"0",right:"0",padding:"15px 15px 0 0",selectors:(n={"> *":{flex:"0 0 auto"},".ms-Dialog-button":{color:m.buttonText},".ms-Dialog-button:hover":{color:m.buttonTextHovered,borderRadius:h.roundedCorner2}},n["@media (min-width: "+Xt+"px) and (max-width: "+oo+"px)"]={padding:"15px 8px 0 0"},n)}]}}),void 0,{scope:"DialogContent"}),Cb=Mn(),Sb={isDarkOverlay:!1,isBlocking:!1,className:"",containerClassName:"",topOffsetFixed:!1},xb={type:qv.normal,className:"",topButtonsProps:[]},kb=function(e){function t(t){var o=e.call(this,t)||this;return o._getSubTextId=function(){var e=o.props,t=e.ariaDescribedById,n=e.modalProps,r=e.dialogContentProps,i=e.subText,s=n&&n.subtitleAriaId||t;return s||(s=(r&&r.subText||i)&&o._defaultSubTextId),s},o._getTitleTextId=function(){var e=o.props,t=e.ariaLabelledById,n=e.modalProps,r=e.dialogContentProps,i=e.title,s=n&&n.titleAriaId||t;return s||(s=(r&&r.title||i)&&o._defaultTitleTextId),s},o._id=ts("Dialog"),o._defaultTitleTextId=o._id+"-title",o._defaultSubTextId=o._id+"-subText",o}return p(t,e),t.prototype.render=function(){var e,t,o,n,r=this.props,i=r.className,s=r.containerClassName,a=r.contentClassName,l=r.elementToFocusOnDismiss,c=r.firstFocusableSelector,u=r.forceFocusInsideTrap,d=r.styles,p=r.hidden,m=r.ignoreExternalFocusing,g=r.isBlocking,f=r.isClickableOutsideFocusTrap,v=r.isDarkOverlay,_=r.isOpen,y=r.onDismiss,C=r.onDismissed,S=r.onLayerDidMount,x=r.responsiveMode,k=r.subText,w=r.theme,I=r.title,D=r.topButtonsProps,P=r.type,T=r.minWidth,E=r.maxWidth,M=r.modalProps,R=h({},M?M.layerProps:{onLayerDidMount:S});S&&!R.onLayerDidMount&&(R.onLayerDidMount=S),M&&M.dragOptions&&!M.dragOptions.dragHandleSelector?(o="ms-Dialog-draggable-header",n=h(h({},M.dragOptions),{dragHandleSelector:"."+o})):n=M&&M.dragOptions;var B=h(h(h(h({},Sb),{className:i,containerClassName:s,isBlocking:g,isDarkOverlay:v,onDismissed:C}),M),{layerProps:R,dragOptions:n}),N=h(h(h({className:a,subText:k,title:I,topButtonsProps:D,type:P},xb),this.props.dialogContentProps),{draggableHeaderClassName:o,titleProps:h({id:(null===(e=this.props.dialogContentProps)||void 0===e?void 0:e.titleId)||this._defaultTitleTextId},null===(t=this.props.dialogContentProps)||void 0===t?void 0:t.titleProps)}),F=Cb(d,{theme:w,className:B.className,containerClassName:B.containerClassName,hidden:p,dialogDefaultMinWidth:T,dialogDefaultMaxWidth:E});return b.createElement(db,h({elementToFocusOnDismiss:l,firstFocusableSelector:c,forceFocusInsideTrap:u,ignoreExternalFocusing:m,isClickableOutsideFocusTrap:f,onDismissed:B.onDismissed,responsiveMode:x},B,{isDarkOverlay:B.isDarkOverlay,isBlocking:B.isBlocking,isOpen:void 0!==_?_:!p,className:F.root,containerClassName:F.main,onDismiss:y||B.onDismiss,subtitleAriaId:this._getSubTextId(),titleAriaId:this._getTitleTextId()}),b.createElement(yb,h({subTextId:this._defaultSubTextId,title:N.title,subText:N.subText,showCloseButton:B.isBlocking,topButtonsProps:N.topButtonsProps,type:N.type,onDismiss:y||N.onDismiss,className:N.className},N),this.props.children))},t.defaultProps={hidden:!0},t=g([Ka],t)}(b.Component),wb={root:"ms-Dialog"},Ib=xn(kb,(function(e){var t,o=e.className,n=e.containerClassName,r=e.dialogDefaultMinWidth,i=void 0===r?"288px":r,s=e.dialogDefaultMaxWidth,a=void 0===s?"340px":s,l=e.hidden,c=e.theme;return{root:[Oo(wb,c).root,c.fonts.medium,o],main:[{width:i,outline:"3px solid transparent",selectors:(t={},t["@media (min-width: "+Qt+"px)"]={width:"auto",maxWidth:a,minWidth:i},t)},!l&&{display:"flex"},n]}}),void 0,{scope:"Dialog"});Ib.displayName="Dialog",function(e){e[e.normal=0]="normal",e[e.compact=1]="compact"}(Qv||(Qv={}));var Db,Pb=Mn(),Tb=function(e){function t(t){var o=e.call(this,t)||this;return o._rootElement=b.createRef(),o._onClick=function(e){o._onAction(e)},o._onKeyDown=function(e){e.which!==wn.enter&&e.which!==wn.space||o._onAction(e)},o._onAction=function(e){var t=o.props,n=t.onClick,r=t.onClickHref,i=t.onClickTarget;n?n(e):!n&&r&&(i?window.open(r,i,"noreferrer noopener nofollow"):window.location.href=r,e.preventDefault(),e.stopPropagation())},si(o),o}return p(t,e),t.prototype.render=function(){var e,t=this.props,o=t.onClick,n=t.onClickHref,r=t.children,i=t.type,s=t.accentColor,a=t.styles,l=t.theme,c=t.className,u=fr(this.props,gr,["className","onClick","type","role"]),d=!(!o&&!n);this._classNames=Pb(a,{theme:l,className:c,actionable:d,compact:i===Qv.compact}),i===Qv.compact&&s&&(e={borderBottomColor:s});var p=this.props.role||(d?o?"button":"link":void 0),m=d?0:void 0;return b.createElement("div",h({ref:this._rootElement,tabIndex:m,"data-is-focusable":d,role:p,className:this._classNames.root,onKeyDown:d?this._onKeyDown:void 0,onClick:d?this._onClick:void 0,style:e},u),r)},t.prototype.focus=function(){this._rootElement.current&&this._rootElement.current.focus()},t.defaultProps={type:Qv.normal},t}(b.Component),Eb={root:"ms-DocumentCardPreview",icon:"ms-DocumentCardPreview-icon",iconContainer:"ms-DocumentCardPreview-iconContainer"},Mb={root:"ms-DocumentCardActivity",multiplePeople:"ms-DocumentCardActivity--multiplePeople",details:"ms-DocumentCardActivity-details",name:"ms-DocumentCardActivity-name",activity:"ms-DocumentCardActivity-activity",avatars:"ms-DocumentCardActivity-avatars",avatar:"ms-DocumentCardActivity-avatar"},Rb={root:"ms-DocumentCardTitle"},Bb={root:"ms-DocumentCardLocation"},Nb={root:"ms-DocumentCard",rootActionable:"ms-DocumentCard--actionable",rootCompact:"ms-DocumentCard--compact"},Fb=xn(Tb,(function(e){var t,o,n=e.className,r=e.theme,i=e.actionable,s=e.compact,a=r.palette,l=r.fonts,c=r.effects,u=Oo(Nb,r);return{root:[u.root,{WebkitFontSmoothing:"antialiased",backgroundColor:a.white,border:"1px solid "+a.neutralLight,maxWidth:"320px",minWidth:"206px",userSelect:"none",position:"relative",selectors:(t={":focus":{outline:"0px solid"}},t["."+ho+" &:focus"]=_o(a.neutralSecondary,c.roundedCorner2),t["."+Bb.root+" + ."+Rb.root]={paddingTop:"4px"},t)},i&&[u.rootActionable,{selectors:{":hover":{cursor:"pointer",borderColor:a.neutralTertiaryAlt},":hover:after":{content:'" "',position:"absolute",top:0,right:0,bottom:0,left:0,border:"1px solid "+a.neutralTertiaryAlt,pointerEvents:"none"}}}],s&&[u.rootCompact,{display:"flex",maxWidth:"480px",height:"108px",selectors:(o={},o["."+Eb.root]={borderRight:"1px solid "+a.neutralLight,borderBottom:0,maxHeight:"106px",maxWidth:"144px"},o["."+Eb.icon]={maxHeight:"32px",maxWidth:"32px"},o["."+Mb.root]={paddingBottom:"12px"},o["."+Rb.root]={paddingBottom:"12px 16px 8px 16px",fontSize:l.mediumPlus.fontSize,lineHeight:"16px"},o)}],n]}}),void 0,{scope:"DocumentCard"}),Ab=Mn(),Lb=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.actions,n=t.views,r=t.styles,i=t.theme,s=t.className;return this._classNames=Ab(r,{theme:i,className:s}),b.createElement("div",{className:this._classNames.root},o&&o.map((function(t,o){return b.createElement("div",{className:e._classNames.action,key:o},b.createElement(eu,h({},t)))})),n>0&&b.createElement("div",{className:this._classNames.views},b.createElement(Fr,{iconName:"View",className:this._classNames.viewsIcon}),n))},t}(b.Component),Hb={root:"ms-DocumentCardActions",action:"ms-DocumentCardActions-action",views:"ms-DocumentCardActions-views"},Ob=xn(Lb,(function(e){var t=e.className,o=e.theme,n=o.palette,r=o.fonts,i=Oo(Hb,o);return{root:[i.root,{height:"34px",padding:"4px 12px",position:"relative"},t],action:[i.action,{float:"left",marginRight:"4px",color:n.neutralSecondary,cursor:"pointer",selectors:{".ms-Button":{fontSize:r.mediumPlus.fontSize,height:34,width:34},".ms-Button:hover .ms-Button-icon":{color:o.semanticColors.buttonText,cursor:"pointer"}}}],views:[i.views,{textAlign:"right",lineHeight:34}],viewsIcon:{marginRight:"8px",fontSize:r.medium.fontSize,verticalAlign:"top"}}}),void 0,{scope:"DocumentCardActions"}),zb=Mn(),Wb=xn(function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.activity,o=e.people,n=e.styles,r=e.theme,i=e.className;return this._classNames=zb(n,{theme:r,className:i,multiplePeople:o.length>1}),o&&0!==o.length?b.createElement("div",{className:this._classNames.root},this._renderAvatars(o),b.createElement("div",{className:this._classNames.details},b.createElement("span",{className:this._classNames.name},this._getNameString(o)),b.createElement("span",{className:this._classNames.activity},t))):null},t.prototype._renderAvatars=function(e){return b.createElement("div",{className:this._classNames.avatars},e.length>1?this._renderAvatar(e[1]):null,this._renderAvatar(e[0]))},t.prototype._renderAvatar=function(e){return b.createElement("div",{className:this._classNames.avatar},b.createElement(ti,{imageInitials:e.initials,text:e.name,imageUrl:e.profileImageSrc,initialsColor:e.initialsColor,allowPhoneInitials:e.allowPhoneInitials,role:"presentation",size:xr.size32}))},t.prototype._getNameString=function(e){var t=e[0].name;return e.length>=2&&(t+=" +"+(e.length-1)),t},t}(b.Component),(function(e){var t=e.theme,o=e.className,n=e.multiplePeople,r=t.palette,i=t.fonts,s=Oo(Mb,t);return{root:[s.root,n&&s.multiplePeople,{padding:"8px 16px",position:"relative"},o],avatars:[s.avatars,{marginLeft:"-2px",height:"32px"}],avatar:[s.avatar,{display:"inline-block",verticalAlign:"top",position:"relative",textAlign:"center",width:32,height:32,selectors:{"&:after":{content:'" "',position:"absolute",left:"-1px",top:"-1px",right:"-1px",bottom:"-1px",border:"2px solid "+r.white,borderRadius:"50%"},":nth-of-type(2)":n&&{marginLeft:"-16px"}}}],details:[s.details,{left:n?"72px":"56px",height:32,position:"absolute",top:8,width:"calc(100% - 72px)"}],name:[s.name,{display:"block",fontSize:i.small.fontSize,lineHeight:"15px",height:"15px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:r.neutralPrimary,fontWeight:Ge.semibold}],activity:[s.activity,{display:"block",fontSize:i.small.fontSize,lineHeight:"15px",height:"15px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:r.neutralSecondary}]}}),void 0,{scope:"DocumentCardActivity"}),Vb=Mn(),Kb=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.children,o=e.styles,n=e.theme,r=e.className;return this._classNames=Vb(o,{theme:n,className:r}),b.createElement("div",{className:this._classNames.root},t)},t}(b.Component),Ub={root:"ms-DocumentCardDetails"},Gb=xn(Kb,(function(e){var t=e.className,o=e.theme;return{root:[Oo(Ub,o).root,{display:"flex",flexDirection:"column",flex:1,justifyContent:"space-between",overflow:"hidden"},t]}}),void 0,{scope:"DocumentCardDetails"}),jb=Mn(),Yb=xn(function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.location,o=e.locationHref,n=e.ariaLabel,r=e.onClick,i=e.styles,s=e.theme,a=e.className;return this._classNames=jb(i,{theme:s,className:a}),b.createElement("a",{className:this._classNames.root,href:o,onClick:r,"aria-label":n},t)},t}(b.Component),(function(e){var t=e.theme,o=e.className,n=t.palette,r=t.fonts;return{root:[Oo(Bb,t).root,r.small,{color:n.themePrimary,display:"block",fontWeight:Ge.semibold,overflow:"hidden",padding:"8px 16px",position:"relative",textDecoration:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",selectors:{":hover":{color:n.themePrimary,cursor:"pointer"}}},o]}}),void 0,{scope:"DocumentCardLocation"}),qb=Mn(),Zb=xn(function(e){function t(t){var o=e.call(this,t)||this;return o._renderPreviewList=function(e){var t=o.props.getOverflowDocumentCountText,n=e.length-3,r=n?t?t(n):"+"+n:null,i=e.slice(0,3).map((function(e,t){return b.createElement("li",{key:t},b.createElement(yr,{className:o._classNames.fileListIcon,src:e.iconSrc,role:"presentation",alt:"",width:"16px",height:"16px"}),b.createElement($s,h({className:o._classNames.fileListLink},(e.linkProps,{href:e.linkProps&&e.linkProps.href||e.url})),e.name))}));return b.createElement("div",null,b.createElement("ul",{className:o._classNames.fileList},i),r&&b.createElement("span",{className:o._classNames.fileListOverflowText},r))},si(o),o}return p(t,e),t.prototype.render=function(){var e,t,o=this.props,n=o.previewImages,r=o.styles,i=o.theme,s=o.className,a=n.length>1;return this._classNames=qb(r,{theme:i,className:s,isFileList:a}),n.length>1?t=this._renderPreviewList(n):1===n.length&&(t=this._renderPreviewImage(n[0]),n[0].accentColor&&(e={borderBottomColor:n[0].accentColor})),b.createElement("div",{className:this._classNames.root,style:e},t)},t.prototype._renderPreviewImage=function(e){var t=e.width,o=e.height,n=e.imageFit,r=e.previewIconProps,i=e.previewIconContainerClass;if(r)return b.createElement("div",{className:Sr(this._classNames.previewIcon,i),style:{width:t,height:o}},b.createElement(Fr,h({},r)));var s,a=b.createElement(yr,{width:t,height:o,imageFit:n,src:e.previewImageSrc,role:"presentation",alt:""});return e.iconSrc&&(s=b.createElement(yr,{className:this._classNames.icon,src:e.iconSrc,role:"presentation",alt:""})),b.createElement("div",null,a,s)},t}(b.Component),(function(e){var t,o,n=e.theme,r=e.className,i=e.isFileList,s=n.palette,a=n.fonts,l=Oo(Eb,n);return{root:[l.root,a.small,{backgroundColor:i?s.white:s.neutralLighterAlt,borderBottom:"1px solid "+s.neutralLight,overflow:"hidden",position:"relative"},r],previewIcon:[l.iconContainer,{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}],icon:[l.icon,{left:"10px",bottom:"10px",position:"absolute"}],fileList:{padding:"16px 16px 0 16px",listStyleType:"none",margin:0,selectors:{li:{height:"16px",lineHeight:"16px",marginBottom:"8px",overflow:"hidden"}}},fileListIcon:{display:"inline-block",marginRight:"8px"},fileListLink:[go(n,{highContrastStyle:{border:"1px solid WindowText",outline:"none"}}),{boxSizing:"border-box",color:s.neutralDark,overflow:"hidden",display:"inline-block",textDecoration:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"calc(100% - 24px)",selectors:(t={":hover":{color:s.themePrimary}},t["."+ho+" &:focus"]={selectors:(o={},o[jt]={outline:"none"},o)},t)}],fileListOverflowText:{padding:"0px 16px 8px 16px",display:"block"}}}),void 0,{scope:"DocumentCardPreview"}),Xb=Mn(),Qb=function(e){function t(t){var o=e.call(this,t)||this;return o._onImageLoad=function(){o.setState({imageHasLoaded:!0})},si(o),o.state={imageHasLoaded:!1},o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.width,n=e.height,r=e.imageFit,i=e.imageSrc;return this._classNames=Xb(t,this.props),b.createElement("div",{className:this._classNames.root},i&&b.createElement(yr,{width:o,height:n,imageFit:r,src:i,role:"presentation",alt:"",onLoad:this._onImageLoad}),this.state.imageHasLoaded?this._renderCornerIcon():this._renderCenterIcon())},t.prototype._renderCenterIcon=function(){var e=this.props.iconProps;return b.createElement("div",{className:this._classNames.centeredIconWrapper},b.createElement(Fr,h({className:this._classNames.centeredIcon},e)))},t.prototype._renderCornerIcon=function(){var e=this.props.iconProps;return b.createElement(Fr,h({className:this._classNames.cornerIcon},e))},t}(b.Component),Jb=xn(Qb,(function(e){var t=e.theme,o=e.className,n=e.height,r=e.width,i=t.palette;return{root:[{borderBottom:"1px solid "+i.neutralLight,position:"relative",backgroundColor:i.neutralLighterAlt,overflow:"hidden",height:n&&n+"px",width:r&&r+"px"},o],centeredIcon:[{height:"42px",width:"42px",fontSize:"42px"}],centeredIconWrapper:[{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",width:"100%",position:"absolute",top:0,left:0}],cornerIcon:[{left:"10px",bottom:"10px",height:"32px",width:"32px",fontSize:"32px",position:"absolute",overflow:"visible"}]}}),void 0,{scope:"DocumentCardImage"}),$b=Mn(),e_=xn(function(e){function t(t){var o=e.call(this,t)||this;return o._titleElement=b.createRef(),o._measureTitleElement=b.createRef(),o._truncateTitle=function(){o.state.needMeasurement&&o._async.requestAnimationFrame(o._truncateWhenInAnimation)},o._truncateWhenInAnimation=function(){var e=o.props.title,t=o._measureTitleElement.current;if(t){var n=getComputedStyle(t);if(n.width&&n.lineHeight&&n.height){var r=t.clientWidth,i=t.scrollWidth,s=Math.floor((parseInt(n.height,10)+5)/parseInt(n.lineHeight,10)),a=i/(parseInt(n.width,10)*s);if(a>1){var l=e.length/a-3;return o.setState({truncatedTitleFirstPiece:e.slice(0,l/2),truncatedTitleSecondPiece:e.slice(e.length-l/2),clientWidth:r,needMeasurement:!1})}}}return o.setState({needMeasurement:!1})},o._shrinkTitle=function(){var e=o.state,t=e.truncatedTitleFirstPiece,n=e.truncatedTitleSecondPiece;if(t&&n){var r=o._titleElement.current;if(!r)return;(r.scrollHeight>r.clientHeight+5||r.scrollWidth>r.clientWidth)&&o.setState({truncatedTitleFirstPiece:t.slice(0,t.length-1),truncatedTitleSecondPiece:n.slice(1)})}},si(o),o._async=new di(o),o._events=new Ws(o),o.state={truncatedTitleFirstPiece:"",truncatedTitleSecondPiece:"",previousTitle:t.title,needMeasurement:!!t.shouldTruncate},o}return p(t,e),t.prototype.componentDidUpdate=function(){this.props.title!==this.state.previousTitle&&this.setState({truncatedTitleFirstPiece:void 0,truncatedTitleSecondPiece:void 0,clientWidth:void 0,previousTitle:this.props.title,needMeasurement:!!this.props.shouldTruncate}),this._events.off(window,"resize",this._updateTruncation),this.props.shouldTruncate&&(this._truncateTitle(),requestAnimationFrame(this._shrinkTitle),this._events.on(window,"resize",this._updateTruncation))},t.prototype.componentDidMount=function(){this.props.shouldTruncate&&(this._truncateTitle(),this._events.on(window,"resize",this._updateTruncation))},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.title,o=e.shouldTruncate,n=e.showAsSecondaryTitle,r=e.styles,i=e.theme,s=e.className,a=this.state,l=a.truncatedTitleFirstPiece,c=a.truncatedTitleSecondPiece,u=a.needMeasurement;return this._classNames=$b(r,{theme:i,className:s,showAsSecondaryTitle:n}),u?b.createElement("div",{className:this._classNames.root,ref:this._measureTitleElement,title:t,style:{whiteSpace:"nowrap"}},t):o&&l&&c?b.createElement("div",{className:this._classNames.root,ref:this._titleElement,title:t},l,"…",c):b.createElement("div",{className:this._classNames.root,ref:this._titleElement,title:t},t)},t.prototype._updateTruncation=function(){var e=this;this._async.requestAnimationFrame((function(){if(e._titleElement.current){var t=e._titleElement.current.clientWidth;clearTimeout(e._titleTruncationTimer),e.state.clientWidth!==t&&(e._titleTruncationTimer=e._async.setTimeout((function(){return e.setState({truncatedTitleFirstPiece:void 0,truncatedTitleSecondPiece:void 0,needMeasurement:!0})}),250))}}))},t}(b.Component),(function(e){var t=e.theme,o=e.className,n=e.showAsSecondaryTitle,r=t.palette,i=t.fonts;return{root:[Oo(Rb,t).root,n?i.medium:i.large,{padding:"8px 16px",display:"block",overflow:"hidden",wordWrap:"break-word",height:n?"45px":"38px",lineHeight:n?"18px":"21px",color:n?r.neutralSecondary:r.neutralPrimary},o]}}),void 0,{scope:"DocumentCardTitle"}),t_=Mn(),o_=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.logoIcon,o=e.styles,n=e.theme,r=e.className;return this._classNames=t_(o,{theme:n,className:r}),b.createElement("div",{className:this._classNames.root},b.createElement(Fr,{iconName:t}))},t}(b.Component),n_={root:"ms-DocumentCardLogo"},r_=xn(o_,(function(e){var t=e.theme,o=e.className,n=t.palette,r=t.fonts;return{root:[Oo(n_,t).root,{fontSize:r.xxLargePlus.fontSize,color:n.themePrimary,display:"block",padding:"16px 16px 0 16px"},o]}}),void 0,{scope:"DocumentCardLogo"}),i_=Mn(),s_=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.statusIcon,o=e.status,n=e.styles,r=e.theme,i=e.className,s={iconName:t,styles:{root:{padding:"8px"}}};return this._classNames=i_(n,{theme:r,className:i}),b.createElement("div",{className:this._classNames.root},t&&b.createElement(Fr,h({},s)),o)},t}(b.Component),a_={root:"ms-DocumentCardStatus"},l_=xn(s_,(function(e){var t=e.className,o=e.theme,n=o.palette,r=o.fonts;return{root:[Oo(a_,o).root,r.medium,{margin:"8px 16px",color:n.neutralPrimary,backgroundColor:n.neutralLighter,height:"32px"},t]}}),void 0,{scope:"DocumentCardStatus"}),c_=function(e){var t;return function(o){t||(t=new Set,ii(e,{componentWillUnmount:function(){t.forEach((function(e){return cancelAnimationFrame(e)}))}}));var n=requestAnimationFrame((function(){t.delete(n),o()}));t.add(n)}},u_=function(){function e(){this._size=0}return e.prototype.updateOptions=function(e){for(var t=[],o=0,n=0;n<e.length;n++)e[n].itemType===Bg.Divider||e[n].itemType===Bg.Header?t.push(n):e[n].hidden||o++;this._size=o,this._displayOnlyOptionsCache=t,this._cachedOptions=f(e)},Object.defineProperty(e.prototype,"optionSetSize",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cachedOptions",{get:function(){return this._cachedOptions},enumerable:!0,configurable:!0}),e.prototype.positionInSet=function(e){if(void 0!==e){for(var t=0;e>this._displayOnlyOptionsCache[t];)t++;if(this._displayOnlyOptionsCache[t]===e)throw new Error("Unexpected: Option at index "+e+" is not a selectable element.");return e-t+1}},e}();!function(e){e[e.smallFluid=0]="smallFluid",e[e.smallFixedFar=1]="smallFixedFar",e[e.smallFixedNear=2]="smallFixedNear",e[e.medium=3]="medium",e[e.large=4]="large",e[e.largeFixed=5]="largeFixed",e[e.extraLarge=6]="extraLarge",e[e.custom=7]="custom",e[e.customNear=8]="customNear"}(Db||(Db={}));var d_,p_=Mn();!function(e){e[e.closed=0]="closed",e[e.animatingOpen=1]="animatingOpen",e[e.open=2]="open",e[e.animatingClosed=3]="animatingClosed"}(d_||(d_={}));var h_,m_,g_,f_,v_,b_,__,y_,C_=function(e){function t(t){var o=e.call(this,t)||this;o._panel=b.createRef(),o._animationCallback=null,o._hasCustomNavigation=!(!o.props.onRenderNavigation&&!o.props.onRenderNavigationContent),o.dismiss=function(e){o.props.onDismiss&&o.props.onDismiss(e),(!e||e&&!e.defaultPrevented)&&o.close()},o._allowScrollOnPanel=function(e){e?o._allowTouchBodyScroll?ls(e,o._events):as(e,o._events):o._events.off(o._scrollableContent),o._scrollableContent=e},o._onRenderNavigation=function(e){if(!o.props.onRenderNavigationContent&&!o.props.onRenderNavigation&&!o.props.hasCloseButton)return null;var t=o.props.onRenderNavigationContent,n=void 0===t?o._onRenderNavigationContent:t;return b.createElement("div",{className:o._classNames.navigation},n(e,o._onRenderNavigationContent))},o._onRenderNavigationContent=function(e){var t,n=e.closeButtonAriaLabel,r=e.hasCloseButton,i=e.onRenderHeader,s=void 0===i?o._onRenderHeader:i;if(r){var a=null===(t=o._classNames.subComponentStyles)||void 0===t?void 0:t.closeButton();return b.createElement(b.Fragment,null,!o._hasCustomNavigation&&s(o.props,o._onRenderHeader,o._headerTextId),b.createElement(eu,{styles:a,className:o._classNames.closeButton,onClick:o._onPanelClick,ariaLabel:n,title:n,"data-is-visible":!0,iconProps:{iconName:"Cancel"}}))}return null},o._onRenderHeader=function(e,t,n){var r=e.headerText,i=e.headerTextProps,s=void 0===i?{}:i;return r?b.createElement("div",{className:o._classNames.header},b.createElement("div",h({id:n,role:"heading","aria-level":1},s,{className:Sr(o._classNames.headerText,s.className)}),r)):null},o._onRenderBody=function(e){return b.createElement("div",{className:o._classNames.content},e.children)},o._onRenderFooter=function(e){var t=o.props.onRenderFooterContent,n=void 0===t?null:t;return n?b.createElement("div",{className:o._classNames.footer},b.createElement("div",{className:o._classNames.footerInner},n())):null},o._animateTo=function(e){e===d_.open&&o.props.onOpen&&o.props.onOpen(),o._animationCallback=o._async.setTimeout((function(){o.setState({visibility:e}),o._onTransitionComplete()}),200)},o._clearExistingAnimationTimer=function(){null!==o._animationCallback&&o._async.clearTimeout(o._animationCallback)},o._onPanelClick=function(e){o.dismiss(e)},o._onTransitionComplete=function(){o._updateFooterPosition(),o.state.visibility===d_.open&&o.props.onOpened&&o.props.onOpened(),o.state.visibility===d_.closed&&o.props.onDismissed&&o.props.onDismissed()};var n=o.props.allowTouchBodyScroll,r=void 0!==n&&n;return o._allowTouchBodyScroll=r,o._async=new di(o),o._events=new Ws(o),si(o),o.state={isFooterSticky:!1,visibility:d_.closed,id:ts("Panel")},o}return p(t,e),t.getDerivedStateFromProps=function(e,t){return void 0===e.isOpen?null:!e.isOpen||t.visibility!==d_.closed&&t.visibility!==d_.animatingClosed?e.isOpen||t.visibility!==d_.open&&t.visibility!==d_.animatingOpen?null:{visibility:d_.animatingClosed}:{visibility:d_.animatingOpen}},t.prototype.componentDidMount=function(){this._events.on(window,"resize",this._updateFooterPosition),this._shouldListenForOuterClick(this.props)&&this._events.on(document.body,"mousedown",this._dismissOnOuterClick,!0),this.props.isOpen&&this.setState({visibility:d_.animatingOpen})},t.prototype.componentDidUpdate=function(e,t){var o=this._shouldListenForOuterClick(this.props),n=this._shouldListenForOuterClick(e);this.state.visibility!==t.visibility&&(this._clearExistingAnimationTimer(),this.state.visibility===d_.animatingOpen?this._animateTo(d_.open):this.state.visibility===d_.animatingClosed&&this._animateTo(d_.closed)),o&&!n?this._events.on(document.body,"mousedown",this._dismissOnOuterClick,!0):!o&&n&&this._events.off(document.body,"mousedown",this._dismissOnOuterClick,!0)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this.props,t=e.className,o=void 0===t?"":t,n=e.elementToFocusOnDismiss,r=e.firstFocusableSelector,i=e.focusTrapZoneProps,s=e.forceFocusInsideTrap,a=e.hasCloseButton,l=e.headerText,c=e.headerClassName,u=void 0===c?"":c,d=e.ignoreExternalFocusing,p=e.isBlocking,m=e.isFooterAtBottom,g=e.isLightDismiss,f=e.isHiddenOnDismiss,v=e.layerProps,_=e.overlayProps,y=e.popupProps,C=e.type,S=e.styles,x=e.theme,k=e.customWidth,w=e.onLightDismissClick,I=void 0===w?this._onPanelClick:w,D=e.onRenderNavigation,P=void 0===D?this._onRenderNavigation:D,T=e.onRenderHeader,E=void 0===T?this._onRenderHeader:T,M=e.onRenderBody,R=void 0===M?this._onRenderBody:M,B=e.onRenderFooter,N=void 0===B?this._onRenderFooter:B,F=this.state,A=F.isFooterSticky,L=F.visibility,H=F.id,O=C===Db.smallFixedNear||C===Db.customNear,z=In(x)?O:!O,W=C===Db.custom||C===Db.customNear?{width:k}:{},V=fr(this.props,gr),K=this.isActive,U=L===d_.animatingClosed||L===d_.animatingOpen;if(this._headerTextId=l&&H+"-headerText",!K&&!U&&!f)return null;this._classNames=p_(S,{theme:x,className:o,focusTrapZoneClassName:i?i.className:void 0,hasCloseButton:a,headerClassName:u,isAnimating:U,isFooterSticky:A,isFooterAtBottom:m,isOnRightSide:z,isOpen:K,isHiddenOnDismiss:f,type:C,hasCustomNavigation:this._hasCustomNavigation});var G,j=this._classNames,Y=this._allowTouchBodyScroll;return p&&K&&(G=b.createElement(nb,h({className:j.overlay,isDarkThemed:!1,onClick:g?I:void 0,allowTouchBodyScroll:Y},_))),b.createElement(cc,h({},v),b.createElement(Rl,h({role:"dialog","aria-modal":"true",ariaLabelledBy:this._headerTextId?this._headerTextId:void 0,onDismiss:this.dismiss,className:j.hiddenPanel},y),b.createElement("div",h({"aria-hidden":!K&&U},V,{ref:this._panel,className:j.root}),G,b.createElement(Ih,h({ignoreExternalFocusing:d,forceFocusInsideTrap:!(!p||f&&!K)&&s,firstFocusableSelector:r,isClickableOutsideFocusTrap:!0},i,{className:j.main,style:W,elementToFocusOnDismiss:n}),b.createElement("div",{className:j.commands,"data-is-visible":!0},P(this.props,this._onRenderNavigation)),b.createElement("div",{className:j.contentInner},(this._hasCustomNavigation||!a)&&E(this.props,this._onRenderHeader,this._headerTextId),b.createElement("div",{ref:this._allowScrollOnPanel,className:j.scrollableContent,"data-is-scrollable":!0},R(this.props,this._onRenderBody)),N(this.props,this._onRenderFooter))))))},t.prototype.open=function(){void 0===this.props.isOpen&&(this.isActive||this.setState({visibility:d_.animatingOpen}))},t.prototype.close=function(){void 0===this.props.isOpen&&this.isActive&&this.setState({visibility:d_.animatingClosed})},Object.defineProperty(t.prototype,"isActive",{get:function(){return this.state.visibility===d_.open||this.state.visibility===d_.animatingOpen},enumerable:!0,configurable:!0}),t.prototype._shouldListenForOuterClick=function(e){return!!e.isBlocking&&!!e.isOpen},t.prototype._updateFooterPosition=function(){var e=this._scrollableContent;if(e){var t=e.clientHeight,o=e.scrollHeight;this.setState({isFooterSticky:t<o})}},t.prototype._dismissOnOuterClick=function(e){var t=this._panel.current;this.isActive&&t&&!e.defaultPrevented&&(Ni(t,e.target)||(this.props.onOuterClick?this.props.onOuterClick(e):this.dismiss(e)))},t.defaultProps={isHiddenOnDismiss:!1,isOpen:void 0,isBlocking:!0,hasCloseButton:!0,type:Db.smallFixedFar},t}(b.Component),S_={root:"ms-Panel",main:"ms-Panel-main",commands:"ms-Panel-commands",contentInner:"ms-Panel-contentInner",scrollableContent:"ms-Panel-scrollableContent",navigation:"ms-Panel-navigation",closeButton:"ms-Panel-closeButton ms-PanelAction-close",header:"ms-Panel-header",headerText:"ms-Panel-headerText",content:"ms-Panel-content",footer:"ms-Panel-footer",footerInner:"ms-Panel-footerInner",isOpen:"is-open",hasCloseButton:"ms-Panel--hasCloseButton",smallFluid:"ms-Panel--smFluid",smallFixedNear:"ms-Panel--smLeft",smallFixedFar:"ms-Panel--sm",medium:"ms-Panel--md",large:"ms-Panel--lg",largeFixed:"ms-Panel--fixed",extraLarge:"ms-Panel--xl",custom:"ms-Panel--custom",customNear:"ms-Panel--customLeft"},x_="100%",k_="auto",w_=272,I_=592,D_=644,P_=940,T_="auto",E_=0,M_=48,R_=428,B_=176,N_=((h_={})["@media (min-width: "+Qt+"px)"]={width:340},h_),F_=((m_={})["@media (min-width: "+Jt+"px)"]={width:I_},m_["@media (min-width: "+$t+"px)"]={width:D_},m_),A_=((g_={})["@media (min-width: "+ao+"px)"]={left:M_,width:k_},g_["@media (min-width: "+eo+"px)"]={left:R_},g_),L_=((f_={})["@media (min-width: "+eo+"px)"]={left:T_,width:P_},f_),H_=((v_={})["@media (min-width: "+eo+"px)"]={left:B_},v_),O_=function(e){var t;switch(e){case Db.smallFixedFar:t=h({},N_);break;case Db.medium:t=h(h({},N_),F_);break;case Db.large:t=h(h(h({},N_),F_),A_);break;case Db.largeFixed:t=h(h(h(h({},N_),F_),A_),L_);break;case Db.extraLarge:t=h(h(h(h({},N_),F_),A_),H_)}return t},z_={paddingLeft:"24px",paddingRight:"24px"},W_=xn(C_,(function(e){var t,o=e.className,n=e.focusTrapZoneClassName,r=e.hasCloseButton,i=e.headerClassName,s=e.isAnimating,a=e.isFooterSticky,l=e.isFooterAtBottom,c=e.isOnRightSide,u=e.isOpen,d=e.isHiddenOnDismiss,p=e.hasCustomNavigation,m=e.theme,g=e.type,f=void 0===g?Db.smallFixedFar:g,v=m.effects,b=m.fonts,_=m.semanticColors,y=Oo(S_,m),C=f===Db.custom||f===Db.customNear;return{root:[y.root,m.fonts.medium,u&&y.isOpen,r&&y.hasCloseButton,{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0},C&&c&&y.custom,C&&!c&&y.customNear,o],overlay:[{pointerEvents:"auto",cursor:"pointer"},u&&s&&Ye.fadeIn100,!u&&s&&Ye.fadeOut100],hiddenPanel:[!u&&!s&&d&&{visibility:"hidden"}],main:[y.main,{backgroundColor:_.bodyBackground,boxShadow:v.elevation64,pointerEvents:"auto",position:"absolute",display:"flex",flexDirection:"column",overflowX:"hidden",overflowY:"auto",WebkitOverflowScrolling:"touch",bottom:0,top:0,left:T_,right:E_,width:x_,selectors:h((t={},t[jt]={borderLeft:"3px solid "+_.variantBorder,borderRight:"3px solid "+_.variantBorder},t),O_(f))},f===Db.smallFluid&&{left:E_},f===Db.smallFixedNear&&{left:E_,right:T_,width:w_},f===Db.customNear&&{right:"auto",left:0},C&&{maxWidth:"100vw"},u&&s&&!c&&Ye.slideRightIn40,u&&s&&c&&Ye.slideLeftIn40,!u&&s&&!c&&Ye.slideLeftOut40,!u&&s&&c&&Ye.slideRightOut40,n],commands:[y.commands,{marginTop:18},p&&{marginTop:"inherit"}],navigation:[y.navigation,{display:"flex",justifyContent:"flex-end"},p&&{height:"44px"}],contentInner:[y.contentInner,{display:"flex",flexDirection:"column",flexGrow:1,overflowY:"hidden"}],header:[y.header,z_,{alignSelf:"flex-start"},r&&!p&&{flexGrow:1},p&&{flexShrink:0}],headerText:[y.headerText,b.xLarge,{color:_.bodyText,lineHeight:"27px",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},i],scrollableContent:[y.scrollableContent,{overflowY:"auto"},l&&{flexGrow:1}],content:[y.content,z_,{paddingBottom:20}],footer:[y.footer,{flexShrink:0,borderTop:"1px solid transparent",transition:"opacity "+Fe.durationValue3+" "+Fe.easeFunction2},a&&{background:_.bodyBackground,borderTopColor:_.variantBorder}],footerInner:[y.footerInner,z_,{paddingBottom:16,paddingTop:16}],subComponentStyles:{closeButton:{root:[y.closeButton,{marginRight:14,color:m.palette.neutralSecondary,fontSize:je.large},p&&{marginRight:0,height:"auto",width:"44px"}],rootHovered:{color:m.palette.neutralPrimary}}}}}),void 0,{scope:"Panel"}),V_=Mn(),K_=function(e){function t(t){var o=e.call(this,t)||this;o._host=b.createRef(),o._focusZone=b.createRef(),o._dropDown=b.createRef(),o._scrollIdleDelay=250,o._sizePosCache=new u_,o._requestAnimationFrame=c_(o),o._onChange=function(e,t,n,r,i){var s=o.props,a=s.onChange,l=s.onChanged;if(a||l){var c=i?h(h({},t[n]),{selected:!r}):t[n];a&&a(h(h({},e),{target:o._dropDown.current}),c,n),l&&l(c,n)}},o._getPlaceholder=function(){return o.props.placeholder||o.props.placeHolder},o._getTitle=function(e,t){var n=o.props.multiSelectDelimiter,r=void 0===n?", ":n;return e.map((function(e){return e.text})).join(r)},o._onRenderTitle=function(e){return b.createElement(b.Fragment,null,o._getTitle(e))},o._onRenderPlaceholder=function(e){return o._getPlaceholder()?b.createElement(b.Fragment,null,o._getPlaceholder()):null},o._onRenderContainer=function(e){var t=e.calloutProps,n=e.panelProps,r=o.props,i=r.responsiveMode,s=r.dropdownWidth,a=i<=Ra.medium,l=o._classNames.subComponentStyles?o._classNames.subComponentStyles.panel:void 0;return a?b.createElement(W_,h({isOpen:!0,isLightDismiss:!0,onDismiss:o._onDismiss,hasCloseButton:!1,styles:l},n),o._renderFocusableList(e)):b.createElement(uc,h({isBeakVisible:!1,gapSpace:0,doNotLayer:!1,directionalHintFixed:!1,directionalHint:ya.bottomLeftEdge},t,{className:o._classNames.callout,target:o._dropDown.current,onDismiss:o._onDismiss,onScroll:o._onScroll,onPositioned:o._onPositioned,calloutWidth:s||(o._dropDown.current?o._dropDown.current.clientWidth:0)}),o._renderFocusableList(e))},o._onRenderCaretDown=function(e){return b.createElement(Fr,{className:o._classNames.caretDown,iconName:"ChevronDown","aria-hidden":!0})},o._onRenderList=function(e){var t=e.onRenderItem,n=void 0===t?o._onRenderItem:t,r={items:[]},i=[],s=function(){var e=r.id?[b.createElement("div",{role:"group",key:r.id,"aria-labelledby":r.id},r.items)]:r.items;i=f(i,e),r={items:[]}};return e.options.forEach((function(e,t){!function(e,t){switch(e.itemType){case Bg.Header:r.items.length>0&&s();var i=o._id+e.key;r.items.push(n(h(h({id:i},e),{index:t}),o._onRenderItem)),r.id=i;break;case Bg.Divider:t>0&&r.items.push(n(h(h({},e),{index:t}),o._onRenderItem)),r.items.length>0&&s();break;default:r.items.push(n(h(h({},e),{index:t}),o._onRenderItem))}}(e,t)})),r.items.length>0&&s(),b.createElement(b.Fragment,null,i)},o._onRenderItem=function(e){switch(e.itemType){case Bg.Divider:return o._renderSeparator(e);case Bg.Header:return o._renderHeader(e);default:return o._renderOption(e)}},o._renderOption=function(e){var t=o.props.onRenderOption,n=void 0===t?o._onRenderOption:t,r=o.state.selectedIndices,i=void 0===r?[]:r,s=!(void 0===e.index||!i)&&i.indexOf(e.index)>-1,a=e.hidden?o._classNames.dropdownItemHidden:s&&!0===e.disabled?o._classNames.dropdownItemSelectedAndDisabled:s?o._classNames.dropdownItemSelected:!0===e.disabled?o._classNames.dropdownItemDisabled:o._classNames.dropdownItem,l=e.title,c=void 0===l?e.text:l,u=o._classNames.subComponentStyles?o._classNames.subComponentStyles.multiSelectItem:void 0;return o.props.multiSelect?b.createElement(Fh,{id:o._listId+e.index,key:e.key,"data-index":e.index,"data-is-focusable":!e.disabled,disabled:e.disabled,onChange:o._onItemClick(e),inputProps:{"aria-selected":s,onMouseEnter:o._onItemMouseEnter.bind(o,e),onMouseLeave:o._onMouseItemLeave.bind(o,e),onMouseMove:o._onItemMouseMove.bind(o,e),role:"option"},label:e.text,title:c,onRenderLabel:o._onRenderItemLabel.bind(o,e),className:a,checked:s,styles:u,ariaPositionInSet:o._sizePosCache.positionInSet(e.index),ariaSetSize:o._sizePosCache.optionSetSize}):b.createElement(Yu,{id:o._listId+e.index,key:e.key,"data-index":e.index,"data-is-focusable":!e.disabled,disabled:e.disabled,className:a,onClick:o._onItemClick(e),onMouseEnter:o._onItemMouseEnter.bind(o,e),onMouseLeave:o._onMouseItemLeave.bind(o,e),onMouseMove:o._onItemMouseMove.bind(o,e),role:"option","aria-selected":s?"true":"false",ariaLabel:e.ariaLabel,title:c,"aria-posinset":o._sizePosCache.positionInSet(e.index),"aria-setsize":o._sizePosCache.optionSetSize},n(e,o._onRenderOption))},o._onRenderOption=function(e){return b.createElement("span",{className:o._classNames.dropdownOptionText},e.text)},o._onRenderItemLabel=function(e){var t=o.props.onRenderOption;return(void 0===t?o._onRenderOption:t)(e,o._onRenderOption)},o._onPositioned=function(e){o._focusZone.current&&o._requestAnimationFrame((function(){var e=o.state.selectedIndices;if(o._focusZone.current)if(e&&e[0]&&!o.props.options[e[0]].disabled){var t=tt().getElementById(o._id+"-list"+e[0]);t&&o._focusZone.current.focusElement(t)}else o._focusZone.current.focus()})),o.state.calloutRenderEdge&&o.state.calloutRenderEdge===e.targetEdge||o.setState({calloutRenderEdge:e.targetEdge})},o._onItemClick=function(e){return function(t){e.disabled||(o.setSelectedIndex(t,e.index),o.props.multiSelect||o.setState({isOpen:!1}))}},o._onScroll=function(){o._isScrollIdle||void 0===o._scrollIdleTimeoutId?o._isScrollIdle=!1:(clearTimeout(o._scrollIdleTimeoutId),o._scrollIdleTimeoutId=void 0),o._scrollIdleTimeoutId=setTimeout((function(){o._isScrollIdle=!0}),o._scrollIdleDelay)},o._onMouseItemLeave=function(e,t){if(!o._shouldIgnoreMouseEvent()&&o._host.current)if(o._host.current.setActive)try{o._host.current.setActive()}catch(e){}else o._host.current.focus()},o._onDismiss=function(){o.setState({isOpen:!1})},o._onDropdownBlur=function(e){o._isDisabled()||(o.setState({hasFocus:!1}),o.state.isOpen||o.props.onBlur&&o.props.onBlur(e))},o._onDropdownKeyDown=function(e){if(!o._isDisabled()&&(o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e),!o.props.onKeyDown||(o.props.onKeyDown(e),!e.defaultPrevented))){var t,n=o.state.selectedIndices.length?o.state.selectedIndices[0]:-1,r=e.altKey||e.metaKey,i=o.state.isOpen;switch(e.which){case wn.enter:o.setState({isOpen:!i});break;case wn.escape:if(!i)return;o.setState({isOpen:!1});break;case wn.up:if(r){if(i){o.setState({isOpen:!1});break}return}o.props.multiSelect?o.setState({isOpen:!0}):o._isDisabled()||(t=o._moveIndex(e,-1,n-1,n));break;case wn.down:r&&(e.stopPropagation(),e.preventDefault()),r&&!i||o.props.multiSelect?o.setState({isOpen:!0}):o._isDisabled()||(t=o._moveIndex(e,1,n+1,n));break;case wn.home:o.props.multiSelect||(t=o._moveIndex(e,1,0,n));break;case wn.end:o.props.multiSelect||(t=o._moveIndex(e,-1,o.props.options.length-1,n));break;case wn.space:break;default:return}t!==n&&(e.stopPropagation(),e.preventDefault())}},o._onDropdownKeyUp=function(e){if(!o._isDisabled()){var t=o._shouldHandleKeyUp(e),n=o.state.isOpen;if(!o.props.onKeyUp||(o.props.onKeyUp(e),!e.defaultPrevented)){switch(e.which){case wn.space:o.setState({isOpen:!n});break;default:return void(t&&n&&o.setState({isOpen:!1}))}e.stopPropagation(),e.preventDefault()}}},o._onZoneKeyDown=function(e){var t;o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e);var n=e.altKey||e.metaKey;switch(e.which){case wn.up:n?o.setState({isOpen:!1}):o._host.current&&(t=Ai(o._host.current,o._host.current.lastChild,!0));break;case wn.home:case wn.end:case wn.pageUp:case wn.pageDown:break;case wn.down:!n&&o._host.current&&(t=Fi(o._host.current,o._host.current.firstChild,!0));break;case wn.escape:o.setState({isOpen:!1});break;case wn.tab:return void o.setState({isOpen:!1});default:return}t&&t.focus(),e.stopPropagation(),e.preventDefault()},o._onZoneKeyUp=function(e){o._shouldHandleKeyUp(e)&&o.state.isOpen&&(o.setState({isOpen:!1}),e.preventDefault())},o._onDropdownClick=function(e){if(!o.props.onClick||(o.props.onClick(e),!e.defaultPrevented)){var t=o.state.isOpen;o._isDisabled()||o._shouldOpenOnFocus()||o.setState({isOpen:!t}),o._isFocusedByClick=!1}},o._onDropdownMouseDown=function(){o._isFocusedByClick=!0},o._onFocus=function(e){var t=o.state,n=t.isOpen,r=t.selectedIndices,i=o.props.multiSelect;if(!o._isDisabled()){o._isFocusedByClick||n||0!==r.length||i||o._moveIndex(e,1,0,-1),o.props.onFocus&&o.props.onFocus(e);var s={hasFocus:!0};o._shouldOpenOnFocus()&&(s.isOpen=!0),o.setState(s)}},o._isDisabled=function(){var e=o.props.disabled,t=o.props.isDisabled;return void 0===e&&(e=t),e},o._onRenderLabel=function(e){var t=e.label,n=e.required,r=e.disabled,i=o._classNames.subComponentStyles?o._classNames.subComponentStyles.label:void 0;return t?b.createElement(Hh,{className:o._classNames.label,id:o._labelId,required:n,styles:i,disabled:r},t):null},si(o);var n,r=t.multiSelect,i=t.selectedKey,s=t.selectedKeys,a=t.defaultSelectedKey,l=t.defaultSelectedKeys,c=t.options;return o._id=t.id||ts("Dropdown"),o._labelId=o._id+"-label",o._listId=o._id+"-list",o._optionId=o._id+"-option",o._isScrollIdle=!0,n=r?o._getSelectedIndexes(c,void 0!==l?l:s):o._getSelectedIndexes(c,void 0!==a?a:i),o._sizePosCache.updateOptions(c),o.state={isOpen:!1,selectedIndices:n,hasFocus:!1,calloutRenderEdge:void 0},o}return p(t,e),Object.defineProperty(t.prototype,"selectedOptions",{get:function(){return Yg(this.props.options,this.state.selectedIndices)},enumerable:!0,configurable:!0}),t.prototype.componentWillUnmount=function(){clearTimeout(this._scrollIdleTimeoutId)},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t,o=e.options!==this.props.options;void 0===e[t=e.multiSelect?o&&void 0!==e.defaultSelectedKeys?"defaultSelectedKeys":"selectedKeys":o&&void 0!==e.defaultSelectedKey?"defaultSelectedKey":"selectedKey"]||e[t]===this.props[t]&&!o||this.setState({selectedIndices:this._getSelectedIndexes(e.options,e[t])})},t.prototype.componentDidUpdate=function(e,t){!0===t.isOpen&&!1===this.state.isOpen&&(this._gotMouseMove=!1,this.props.onDismiss&&this.props.onDismiss())},t.prototype.render=function(){var e,t,o=this,n=this._id,r=this.props,i=r.className,s=r.label,a=r.options,l=r.ariaLabel,c=r.required,u=r.errorMessage,d=r.keytipProps,p=r.styles,m=r.theme,g=r.panelProps,f=r.calloutProps,v=r.multiSelect,_=r.onRenderTitle,y=void 0===_?this._getTitle:_,C=r.onRenderContainer,S=void 0===C?this._onRenderContainer:C,x=r.onRenderCaretDown,k=void 0===x?this._onRenderCaretDown:x,w=r.onRenderLabel,I=void 0===w?this._onRenderLabel:w,D=this.state,P=D.isOpen,T=D.selectedIndices,E=D.calloutRenderEdge,M=r.onRenderPlaceholder||r.onRenderPlaceHolder||this._getPlaceholder;a!==this._sizePosCache.cachedOptions&&this._sizePosCache.updateOptions(a);var R=Yg(a,T),B=fr(r,gr),N=this._isDisabled(),F=n+"-errorMessage",A=N?void 0:P&&1===T.length&&T[0]>=0?this._listId+T[0]:void 0,L=v?{role:"button"}:{role:"listbox",childRole:"option",ariaRequired:c,ariaSetSize:this._sizePosCache.optionSetSize,ariaPosInSet:this._sizePosCache.positionInSet(T[0]),ariaSelected:void 0!==T[0]||void 0};this._classNames=V_(p,{theme:m,className:i,hasError:!!(u&&u.length>0),hasLabel:!!s,isOpen:P,required:c,disabled:N,isRenderingPlaceholder:!R.length,panelClassName:null===(e=g)||void 0===e?void 0:e.className,calloutClassName:null===(t=f)||void 0===t?void 0:t.className,calloutRenderEdge:E});var H=!!u&&u.length>0;return b.createElement("div",{className:this._classNames.root},I(this.props,this._onRenderLabel),b.createElement(Zs,{keytipProps:d,disabled:N},(function(e){return b.createElement("div",h({},e,{"data-is-focusable":!N,ref:o._dropDown,id:n,tabIndex:N?-1:0,role:L.role,"aria-haspopup":"listbox","aria-expanded":P?"true":"false","aria-label":l,"aria-labelledby":s&&!l?Ns(o._labelId,o._optionId):void 0,"aria-describedby":Ns(e["aria-describedby"],H?o._id+"-errorMessage":void 0),"aria-activedescendant":A,"aria-required":L.ariaRequired,"aria-disabled":N,"aria-owns":P?o._listId:void 0},B,{className:o._classNames.dropdown,onBlur:o._onDropdownBlur,onKeyDown:o._onDropdownKeyDown,onKeyUp:o._onDropdownKeyUp,onClick:o._onDropdownClick,onMouseDown:o._onDropdownMouseDown,onFocus:o._onFocus}),b.createElement("span",{id:o._optionId,className:o._classNames.title,"aria-live":"polite","aria-atomic":!0,"aria-invalid":H,role:L.childRole,"aria-setsize":L.ariaSetSize,"aria-posinset":L.ariaPosInSet,"aria-selected":L.ariaSelected},R.length?y(R,o._onRenderTitle):M(r,o._onRenderPlaceholder)),b.createElement("span",{className:o._classNames.caretDownWrapper},k(r,o._onRenderCaretDown)))})),P&&S(h(h({},r),{onDismiss:this._onDismiss}),this._onRenderContainer),H&&b.createElement("div",{role:"alert",id:F,className:this._classNames.errorMessage},u))},t.prototype.focus=function(e){this._dropDown.current&&(this._dropDown.current.focus(),e&&this.setState({isOpen:!0}))},t.prototype.setSelectedIndex=function(e,t){var o=this,n=this.props,r=n.options,i=n.selectedKey,s=n.selectedKeys,a=n.multiSelect,l=n.notifyOnReselect,c=this.state.selectedIndices,u=void 0===c?[]:c,d=!!u&&u.indexOf(t)>-1,p=[];if(t=Math.max(0,Math.min(r.length-1,t)),void 0===i&&void 0===s){if(a||l||t!==u[0]){if(a)if(p=u?this._copyArray(u):[],d){var h=p.indexOf(t);h>-1&&p.splice(h,1)}else p.push(t);else p=[t];e.persist(),this.setState({selectedIndices:p},(function(){o._onChange(e,r,t,d,a)}))}}else this._onChange(e,r,t,d,a)},t.prototype._copyArray=function(e){for(var t=[],o=0,n=e;o<n.length;o++){var r=n[o];t.push(r)}return t},t.prototype._moveIndex=function(e,t,o,n){var r=this.props.options;if(n===o||0===r.length)return n;o>=r.length?o=0:o<0&&(o=r.length-1);for(var i=0;r[o].itemType===Bg.Header||r[o].itemType===Bg.Divider||r[o].disabled;){if(i>=r.length)return n;o+t<0?o=r.length:o+t>=r.length&&(o=-1),o+=t,i++}return this.setSelectedIndex(e,o),o},t.prototype._renderFocusableList=function(e){var t=e.onRenderList,o=void 0===t?this._onRenderList:t,n=e.label,r=e.ariaLabel,i=e.multiSelect;return b.createElement("div",{className:this._classNames.dropdownItemsWrapper,onKeyDown:this._onZoneKeyDown,onKeyUp:this._onZoneKeyUp,ref:this._host,tabIndex:0},b.createElement(ks,{ref:this._focusZone,direction:vs.vertical,id:this._listId,className:this._classNames.dropdownItems,role:"listbox","aria-label":r,"aria-labelledby":n&&!r?this._labelId:void 0,"aria-multiselectable":i},o(e,this._onRenderList)))},t.prototype._renderSeparator=function(e){var t=e.index,o=e.key;return t>0?b.createElement("div",{role:"separator",key:o,className:this._classNames.dropdownDivider}):null},t.prototype._renderHeader=function(e){var t=this.props.onRenderOption,o=void 0===t?this._onRenderOption:t,n=e.key,r=e.id;return b.createElement("div",{id:r,key:n,className:this._classNames.dropdownItemHeader},o(e,this._onRenderOption))},t.prototype._onItemMouseEnter=function(e,t){this._shouldIgnoreMouseEvent()||t.currentTarget.focus()},t.prototype._onItemMouseMove=function(e,t){var o=t.currentTarget;this._gotMouseMove=!0,this._isScrollIdle&&document.activeElement!==o&&o.focus()},t.prototype._shouldIgnoreMouseEvent=function(){return!this._isScrollIdle||!this._gotMouseMove},t.prototype._getSelectedIndexes=function(e,t){if(void 0===t)return this.props.multiSelect?this._getAllSelectedIndices(e):-1!==(i=this._getSelectedIndex(e,null))?[i]:[];if(!Array.isArray(t))return-1!==(i=this._getSelectedIndex(e,t))?[i]:[];for(var o=[],n=0,r=t;n<r.length;n++){var i,s=r[n];-1!==(i=this._getSelectedIndex(e,s))&&o.push(i)}return o},t.prototype._getAllSelectedIndices=function(e){return e.map((function(e,t){return e.selected?t:-1})).filter((function(e){return-1!==e}))},t.prototype._getSelectedIndex=function(e,t){return bi(e,(function(e){return null!=t?e.key===t:!!e.selected||!!e.isSelected}))},t.prototype._isAltOrMeta=function(e){return e.which===wn.alt||"Meta"===e.key},t.prototype._shouldHandleKeyUp=function(e){var t=this._lastKeyDownWasAltOrMeta&&this._isAltOrMeta(e);return this._lastKeyDownWasAltOrMeta=!1,!!t&&!(Ca()||Sa())},t.prototype._shouldOpenOnFocus=function(){var e=this.state.hasFocus,t=this.props.openOnKeyboardFocus;return!this._isFocusedByClick&&!0===t&&!e},t.defaultProps={options:[]},t=g([Ka],t)}(b.Component),U_={root:"ms-Dropdown-container",label:"ms-Dropdown-label",dropdown:"ms-Dropdown",title:"ms-Dropdown-title",caretDownWrapper:"ms-Dropdown-caretDownWrapper",caretDown:"ms-Dropdown-caretDown",callout:"ms-Dropdown-callout",panel:"ms-Dropdown-panel",dropdownItems:"ms-Dropdown-items",dropdownItem:"ms-Dropdown-item",dropdownDivider:"ms-Dropdown-divider",dropdownOptionText:"ms-Dropdown-optionText",dropdownItemHeader:"ms-Dropdown-header",titleIsPlaceHolder:"ms-Dropdown-titleIsPlaceHolder",titleHasError:"ms-Dropdown-title--hasError"},G_=((b_={})[jt+", "+Yt.replace("@media ","")]=h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),b_),j_={selectors:h((__={},__[jt]={backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},__),G_)},Y_={selectors:(y_={},y_[jt]={borderColor:"Highlight"},y_)},q_=lo(0,Qt),Z_=xn(K_,(function(e){var t,o,n,r,i,s,a,l,c,u,d,p=e.theme,m=e.hasError,g=e.hasLabel,v=e.className,b=e.isOpen,_=e.disabled,y=e.required,C=e.isRenderingPlaceholder,S=e.panelClassName,x=e.calloutClassName,k=e.calloutRenderEdge;if(!p)throw new Error("theme is undefined or null in base Dropdown getStyles function.");var w=Oo(U_,p),I=p.palette,D=p.semanticColors,P=p.effects,T=p.fonts,E={color:D.menuItemTextHovered},M={color:D.menuItemText},R={borderColor:D.errorText},B=[w.dropdownItem,{backgroundColor:"transparent",boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",padding:"0 8px",width:"100%",minHeight:36,lineHeight:20,height:0,position:"relative",border:"1px solid transparent",borderRadius:0,wordWrap:"break-word",overflowWrap:"break-word",textAlign:"left",".ms-Button-flexContainer":{width:"100%"}}],N=D.menuItemBackgroundPressed,F=function(e){var t;return void 0===e&&(e=!1),{selectors:(t={"&:hover:focus":[{color:D.menuItemTextHovered,backgroundColor:e?N:D.menuItemBackgroundHovered},j_],"&:focus":[{backgroundColor:e?N:"transparent"},j_],"&:active":[{color:D.menuItemTextHovered,backgroundColor:e?D.menuItemBackgroundHovered:D.menuBackground},j_]},t["."+ho+" &:focus:after"]={left:0,top:0,bottom:0,right:0},t[jt]={border:"none"},t)}},A=f(B,[{backgroundColor:N,color:D.menuItemTextHovered},F(!0),j_]),L=f(B,[{color:D.disabledText,cursor:"default",selectors:(t={},t[jt]={color:"GrayText",border:"none"},t)}]),H=k===Oa.bottom?P.roundedCorner2+" "+P.roundedCorner2+" 0 0":"0 0 "+P.roundedCorner2+" "+P.roundedCorner2,O=k===Oa.bottom?"0 0 "+P.roundedCorner2+" "+P.roundedCorner2:P.roundedCorner2+" "+P.roundedCorner2+" 0 0";return{root:[w.root,v],label:w.label,dropdown:[w.dropdown,Uo,T.medium,{color:D.menuItemText,borderColor:D.focusBorder,position:"relative",outline:0,userSelect:"none",selectors:(o={},o["&:hover ."+w.title]=[!_&&E,{borderColor:b?I.neutralSecondary:I.neutralPrimary},Y_],o["&:focus ."+w.title]=[!_&&E,{selectors:(n={},n[jt]={color:"Highlight"},n)}],o["&:focus:after"]=[{pointerEvents:"none",content:"''",position:"absolute",boxSizing:"border-box",top:"0px",left:"0px",width:"100%",height:"100%",border:_?"none":"2px solid "+I.themePrimary,borderRadius:"2px",selectors:(r={},r[jt]={color:"Highlight"},r)}],o["&:active ."+w.title]=[!_&&E,{borderColor:I.themePrimary},Y_],o["&:hover ."+w.caretDown]=!_&&M,o["&:focus ."+w.caretDown]=[!_&&M,{selectors:(i={},i[jt]={color:"Highlight"},i)}],o["&:active ."+w.caretDown]=!_&&M,o["&:hover ."+w.titleIsPlaceHolder]=!_&&M,o["&:focus ."+w.titleIsPlaceHolder]=!_&&M,o["&:active ."+w.titleIsPlaceHolder]=!_&&M,o["&:hover ."+w.titleHasError]=R,o["&:active ."+w.titleHasError]=R,o)},b&&"is-open",_&&"is-disabled",y&&"is-required",y&&!g&&{selectors:(s={":before":{content:"'*'",color:D.errorText,position:"absolute",top:-5,right:-10}},s[jt]={selectors:{":after":{right:-14}}},s)}],title:[w.title,Uo,{backgroundColor:D.inputBackground,borderWidth:1,borderStyle:"solid",borderColor:D.inputBorder,borderRadius:b?H:P.roundedCorner2,cursor:"pointer",display:"block",height:32,lineHeight:30,padding:"0 28px 0 8px",position:"relative",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},C&&[w.titleIsPlaceHolder,{color:D.inputPlaceholderText}],m&&[w.titleHasError,R],_&&{backgroundColor:D.disabledBackground,border:"none",color:D.disabledText,cursor:"default",selectors:(a={},a[jt]=h({border:"1px solid GrayText",color:"GrayText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a)}],caretDownWrapper:[w.caretDownWrapper,{position:"absolute",top:1,right:8,height:32,lineHeight:30},!_&&{cursor:"pointer"}],caretDown:[w.caretDown,{color:I.neutralSecondary,fontSize:T.small.fontSize,pointerEvents:"none"},_&&{color:D.disabledText,selectors:(l={},l[jt]=h({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),l)}],errorMessage:h(h({color:D.errorText},p.fonts.small),{paddingTop:5}),callout:[w.callout,{boxShadow:P.elevation8,borderRadius:O,selectors:(c={},c[".ms-Callout-main"]={borderRadius:O},c)},x],dropdownItemsWrapper:{selectors:{"&:focus":{outline:0}}},dropdownItems:[w.dropdownItems,{display:"block"}],dropdownItem:f(B,[F()]),dropdownItemSelected:A,dropdownItemDisabled:L,dropdownItemSelectedAndDisabled:[A,L,{backgroundColor:"transparent"}],dropdownItemHidden:f(B,[{display:"none"}]),dropdownDivider:[w.dropdownDivider,{height:1,backgroundColor:D.bodyDivider}],dropdownOptionText:[w.dropdownOptionText,{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",minWidth:0,maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",margin:"1px"}],dropdownItemHeader:[w.dropdownItemHeader,h(h({},T.medium),{fontWeight:Ge.semibold,color:D.menuHeader,background:"none",backgroundColor:"transparent",border:"none",height:36,lineHeight:36,cursor:"default",padding:"0 8px",userSelect:"none",textAlign:"left",selectors:(u={},u[jt]=h({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),u)})],subComponentStyles:{label:{root:{display:"inline-block"}},multiSelectItem:{root:{padding:0},label:{alignSelf:"stretch",padding:"0 8px",width:"100%"}},panel:{root:[S],main:{selectors:(d={},d[q_]={width:272},d)},contentInner:{padding:"0 0 20px"}}}}}),void 0,{scope:"Dropdown"});Object(Dt.a)([{rawString:".pickerText_09f52d0d{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid "},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:";min-width:180px;padding:1px;min-height:32px}.pickerText_09f52d0d:hover{border-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.pickerInput_09f52d0d{height:34px;border:none;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;outline:0;padding:0 6px 0;margin:1px}.pickerInput_09f52d0d::-ms-clear{display:none}"}]);var X_,Q_,J_="pickerText_09f52d0d",$_="pickerInput_09f52d0d",ey=r,ty=function(e){function t(t){var o=e.call(this,t)||this;return o.floatingPicker=b.createRef(),o.selectedItemsList=b.createRef(),o.root=b.createRef(),o.input=b.createRef(),o.onSelectionChange=function(){o.forceUpdate()},o.onInputChange=function(e,t){t||(o.setState({queryString:e}),o.floatingPicker.current&&o.floatingPicker.current.onQueryStringChanged(e))},o.onInputFocus=function(e){o.selectedItemsList.current&&o.selectedItemsList.current.unselectAll(),o.props.inputProps&&o.props.inputProps.onFocus&&o.props.inputProps.onFocus(e)},o.onInputClick=function(e){if(o.selectedItemsList.current&&o.selectedItemsList.current.unselectAll(),o.floatingPicker.current&&o.inputElement){var t=""===o.inputElement.value||o.inputElement.value!==o.floatingPicker.current.inputText;o.floatingPicker.current.showPicker(t)}},o.onBackspace=function(e){e.which===wn.backspace&&o.selectedItemsList.current&&o.items.length&&(o.input.current&&!o.input.current.isValueSelected&&o.input.current.inputElement===document.activeElement&&0===o.input.current.cursorLocation?(o.floatingPicker.current&&o.floatingPicker.current.hidePicker(),e.preventDefault(),o.selectedItemsList.current.removeItemAt(o.items.length-1),o._onSelectedItemsChanged()):o.selectedItemsList.current.hasSelectedItems()&&(o.floatingPicker.current&&o.floatingPicker.current.hidePicker(),e.preventDefault(),o.selectedItemsList.current.removeSelectedItems(),o._onSelectedItemsChanged()))},o.onCopy=function(e){o.selectedItemsList.current&&o.selectedItemsList.current.onCopy(e)},o.onPaste=function(e){if(o.props.onPaste){var t=e.clipboardData.getData("Text");e.preventDefault(),o.props.onPaste(t)}},o._onSuggestionSelected=function(e){var t=o.props.currentRenderedQueryString,n=o.state.queryString;if(void 0===t||t===n){var r=o.props.onItemSelected?o.props.onItemSelected(e):e;if(null===r)return;var i,s=r,a=r;a&&a.then?a.then((function(e){i=e,o._addProcessedItem(i)})):(i=s,o._addProcessedItem(i))}},o._onSelectedItemsChanged=function(){o.focus()},o._onSuggestionsShownOrHidden=function(){o.forceUpdate()},si(o),o.selection=new xf({onSelectionChanged:function(){return o.onSelectionChange()}}),o.state={queryString:"",suggestionItems:o.props.suggestionItems?o.props.suggestionItems:null,selectedItems:o.props.defaultSelectedItems?o.props.defaultSelectedItems:o.props.selectedItems?o.props.selectedItems:null},o.floatingPickerProps=o.props.floatingPickerProps,o.selectedItemsListProps=o.props.selectedItemsListProps,o}return p(t,e),Object.defineProperty(t.prototype,"items",{get:function(){var e,t,o;return null!=(o=null!=(e=this.state.selectedItems)?e:null===(t=this.selectedItemsList.current)||void 0===t?void 0:t.items)?o:null},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this.forceUpdate()},t.prototype.UNSAFE_componentWillReceiveProps=function(e){e.floatingPickerProps&&(this.floatingPickerProps=e.floatingPickerProps),e.selectedItemsListProps&&(this.selectedItemsListProps=e.selectedItemsListProps),e.selectedItems&&this.setState({selectedItems:e.selectedItems})},t.prototype.focus=function(){this.input.current&&this.input.current.focus()},t.prototype.clearInput=function(){this.input.current&&this.input.current.clear()},Object.defineProperty(t.prototype,"inputElement",{get:function(){return this.input.current&&this.input.current.inputElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"highlightedItems",{get:function(){return this.selectedItemsList.current?this.selectedItemsList.current.highlightedItems():[]},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.className,o=e.inputProps,n=e.disabled,r=e.focusZoneProps,i=this.floatingPicker.current&&-1!==this.floatingPicker.current.currentSelectedSuggestionIndex?"sug-"+this.floatingPicker.current.currentSelectedSuggestionIndex:void 0,s=!!this.floatingPicker.current&&this.floatingPicker.current.isSuggestionsShown;return b.createElement("div",{ref:this.root,className:Sr("ms-BasePicker ms-BaseExtendedPicker",t||""),onKeyDown:this.onBackspace,onCopy:this.onCopy},b.createElement(ks,h({direction:vs.bidirectional},r),b.createElement(Mf,{selection:this.selection,selectionMode:af.multiple},b.createElement("div",{className:Sr("ms-BasePicker-text",ey.pickerText),role:"list"},this.props.headerComponent,this.renderSelectedItemsList(),this.canAddItems()&&b.createElement(pi,h({},o,{className:Sr("ms-BasePicker-input",ey.pickerInput),ref:this.input,onFocus:this.onInputFocus,onClick:this.onInputClick,onInputValueChange:this.onInputChange,"aria-activedescendant":i,"aria-owns":s?"suggestion-list":void 0,"aria-expanded":s,"aria-haspopup":"true",role:"combobox",disabled:n,onPaste:this.onPaste}))))),this.renderFloatingPicker())},t.prototype.canAddItems=function(){var e=this.props.itemLimit;return void 0===e||this.items.length<e},t.prototype.renderFloatingPicker=function(){var e=this.props.onRenderFloatingPicker;return b.createElement(e,h({componentRef:this.floatingPicker,onChange:this._onSuggestionSelected,onSuggestionsHidden:this._onSuggestionsShownOrHidden,onSuggestionsShown:this._onSuggestionsShownOrHidden,inputElement:this.input.current?this.input.current.inputElement:void 0,selectedItems:this.items,suggestionItems:this.props.suggestionItems?this.props.suggestionItems:void 0},this.floatingPickerProps))},t.prototype.renderSelectedItemsList=function(){var e=this.props.onRenderSelectedItems;return b.createElement(e,h({componentRef:this.selectedItemsList,selection:this.selection,selectedItems:this.props.selectedItems?this.props.selectedItems:void 0,onItemsDeleted:this.props.selectedItems?this.props.onItemsRemoved:void 0},this.selectedItemsListProps))},t.prototype._addProcessedItem=function(e){this.props.onItemAdded&&this.props.onItemAdded(e),this.selectedItemsList.current&&this.selectedItemsList.current.addItems([e]),this.input.current&&this.input.current.clear(),this.floatingPicker.current&&this.floatingPicker.current.hidePicker(),this.focus()},t}(b.Component),oy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(ty),ny=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(oy);(Q_=X_||(X_={}))[Q_.none=0]="none",Q_[Q_.descriptive=1]="descriptive",Q_[Q_.more=2]="more",Q_[Q_.downArrow=3]="downArrow";var ry=No((function(e,t,o){var n=Qc(e),r=dn(n,o);return h(h({},r),{root:[n.root,t,e.fonts.medium,o&&o.root]})})),iy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.styles,n=m(e,["className","styles"]),r=ry(this.props.theme,t,o);return b.createElement(qc,h({},n,{variantClassName:"ms-Button--facepile",styles:r,onRenderDescription:sa}))},t=g([ec("FacepileButton",["theme","styles"],!0)],t)}(b.Component),sy=Mn(),ay=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderPersonaCoin=function(e){return b.createElement(ti,h({},e))},o}return p(t,e),t.prototype.render=function(){var e=this._onRenderText(this._getText()),t=this._onRenderText(this.props.secondaryText),o=this._onRenderText(this.props.tertiaryText),n=this._onRenderText(this.props.optionalText),r=this.props,i=r.hidePersonaDetails,s=r.onRenderOptionalText,a=void 0===s?n:s,l=r.onRenderPrimaryText,c=void 0===l?e:l,u=r.onRenderSecondaryText,d=void 0===u?t:u,p=r.onRenderTertiaryText,m=void 0===p?o:p,g=r.onRenderPersonaCoin,f=void 0===g?this._onRenderPersonaCoin:g,v=this.props.size,_=this.props,y=_.allowPhoneInitials,C=_.className,S=_.coinProps,x=_.showUnknownPersonaCoin,k=_.coinSize,w=_.styles,I=_.imageAlt,D=_.imageInitials,P=_.imageShouldFadeIn,T=_.imageShouldStartVisible,E=_.imageUrl,M=_.initialsColor,R=_.initialsTextColor,B=_.isOutOfOffice,N=_.onPhotoLoadingStateChange,F=_.onRenderCoin,A=_.onRenderInitials,L=_.presence,H=_.presenceTitle,O=_.presenceColors,z=_.showInitialsUntilImageLoads,W=_.showSecondaryText,V=_.theme,K=h({allowPhoneInitials:y,showUnknownPersonaCoin:x,coinSize:k,imageAlt:I,imageInitials:D,imageShouldFadeIn:P,imageShouldStartVisible:T,imageUrl:E,initialsColor:M,initialsTextColor:R,onPhotoLoadingStateChange:N,onRenderCoin:F,onRenderInitials:A,presence:L,presenceTitle:H,showInitialsUntilImageLoads:z,size:v,text:this._getText(),isOutOfOffice:B,presenceColors:O},S),U=sy(w,{theme:V,className:C,showSecondaryText:W,presence:L,size:v}),G=fr(this.props,gr),j=b.createElement("div",{className:U.details},this._renderElement(U.primaryText,c,e),this._renderElement(U.secondaryText,d,t),this._renderElement(U.tertiaryText,m,o),this._renderElement(U.optionalText,a,n),this.props.children);return b.createElement("div",h({},G,{className:U.root,style:k?{height:k,minWidth:k}:void 0}),f(K,this._onRenderPersonaCoin),(!i||v===xr.size8||v===xr.size10||v===xr.tiny)&&j)},t.prototype._renderElement=function(e,t,o){return b.createElement("div",{dir:"auto",className:e},t&&t(this.props,o))},t.prototype._getText=function(){return this.props.text||this.props.primaryText||""},t.prototype._onRenderText=function(e){return e?function(){return b.createElement(Cu,{content:e,overflowMode:tu.Parent,directionalHint:ya.topLeftEdge},e)}:void 0},t.defaultProps={size:xr.size48,presence:kr.none,imageAlt:""},t}(b.Component),ly={root:"ms-Persona",size8:"ms-Persona--size8",size10:"ms-Persona--size10",size16:"ms-Persona--size16",size24:"ms-Persona--size24",size28:"ms-Persona--size28",size32:"ms-Persona--size32",size40:"ms-Persona--size40",size48:"ms-Persona--size48",size56:"ms-Persona--size56",size72:"ms-Persona--size72",size100:"ms-Persona--size100",size120:"ms-Persona--size120",available:"ms-Persona--online",away:"ms-Persona--away",blocked:"ms-Persona--blocked",busy:"ms-Persona--busy",doNotDisturb:"ms-Persona--donotdisturb",offline:"ms-Persona--offline",details:"ms-Persona-details",primaryText:"ms-Persona-primaryText",secondaryText:"ms-Persona-secondaryText",tertiaryText:"ms-Persona-tertiaryText",optionalText:"ms-Persona-optionalText",textContent:"ms-Persona-textContent"},cy=xn(ay,(function(e){var t=e.className,o=e.showSecondaryText,n=e.theme,r=n.semanticColors,i=n.fonts,s=Oo(ly,n),a=Ar(e.size),l=Hr(e.presence),c={color:r.bodySubtext,fontWeight:Ge.regular,fontSize:i.small.fontSize};return{root:[s.root,n.fonts.medium,Uo,{color:r.bodyText,position:"relative",height:Dr.size48,minWidth:Dr.size48,display:"flex",alignItems:"center",selectors:{".contextualHost":{display:"none"}}},a.isSize8&&[s.size8,{height:Dr.size8,minWidth:Dr.size8}],a.isSize10&&[s.size10,{height:Dr.size10,minWidth:Dr.size10}],a.isSize16&&[s.size16,{height:Dr.size16,minWidth:Dr.size16}],a.isSize24&&[s.size24,{height:Dr.size24,minWidth:Dr.size24}],a.isSize24&&o&&{height:"36px"},a.isSize28&&[s.size28,{height:Dr.size28,minWidth:Dr.size28}],a.isSize28&&o&&{height:"32px"},a.isSize32&&[s.size32,{height:Dr.size32,minWidth:Dr.size32}],a.isSize40&&[s.size40,{height:Dr.size40,minWidth:Dr.size40}],a.isSize48&&s.size48,a.isSize56&&[s.size56,{height:Dr.size56,minWidth:Dr.size56}],a.isSize72&&[s.size72,{height:Dr.size72,minWidth:Dr.size72}],a.isSize100&&[s.size100,{height:Dr.size100,minWidth:Dr.size100}],a.isSize120&&[s.size120,{height:Dr.size120,minWidth:Dr.size120}],l.isAvailable&&s.available,l.isAway&&s.away,l.isBlocked&&s.blocked,l.isBusy&&s.busy,l.isDoNotDisturb&&s.doNotDisturb,l.isOffline&&s.offline,t],details:[s.details,{padding:"0 24px 0 16px",minWidth:0,width:"100%",textAlign:"left",display:"flex",flexDirection:"column",justifyContent:"space-around"},(a.isSize8||a.isSize10)&&{paddingLeft:17},(a.isSize24||a.isSize28||a.isSize32)&&{padding:"0 8px"},(a.isSize40||a.isSize48)&&{padding:"0 12px"}],primaryText:[s.primaryText,Go,{color:r.bodyText,fontWeight:Ge.regular,fontSize:i.medium.fontSize,selectors:{":hover":{color:r.inputTextHovered}}},o&&{height:"16px",lineHeight:"16px",overflowX:"hidden"},(a.isSize8||a.isSize10)&&{fontSize:i.small.fontSize,lineHeight:Dr.size8},a.isSize16&&{lineHeight:Dr.size28},(a.isSize24||a.isSize28||a.isSize32||a.isSize40||a.isSize48)&&o&&{height:18},(a.isSize56||a.isSize72||a.isSize100||a.isSize120)&&{fontSize:i.xLarge.fontSize},(a.isSize56||a.isSize72||a.isSize100||a.isSize120)&&o&&{height:22}],secondaryText:[s.secondaryText,Go,c,(a.isSize8||a.isSize10||a.isSize16||a.isSize24||a.isSize28||a.isSize32)&&{display:"none"},o&&{display:"block",height:"16px",lineHeight:"16px",overflowX:"hidden"},a.isSize24&&o&&{height:18},(a.isSize56||a.isSize72||a.isSize100||a.isSize120)&&{fontSize:i.medium.fontSize},(a.isSize56||a.isSize72||a.isSize100||a.isSize120)&&o&&{height:18}],tertiaryText:[s.tertiaryText,Go,c,{display:"none",fontSize:i.medium.fontSize},(a.isSize72||a.isSize100||a.isSize120)&&{display:"block"}],optionalText:[s.optionalText,Go,c,{display:"none",fontSize:i.medium.fontSize},(a.isSize100||a.isSize120)&&{display:"block"}],textContent:[s.textContent,Go]}}),void 0,{scope:"Persona"}),uy=Mn(),dy=function(e){function t(t){var o=e.call(this,t)||this;return o._classNames=uy(o.props.styles,{theme:o.props.theme,className:o.props.className}),o._getPersonaControl=function(e){var t=o.props,n=t.getPersonaProps,r=t.personaSize;return b.createElement(cy,h({imageInitials:e.imageInitials,imageUrl:e.imageUrl,initialsColor:e.initialsColor,allowPhoneInitials:e.allowPhoneInitials,text:e.personaName,size:r},n?n(e):null,{styles:{details:{flex:"1 0 auto"}}}))},o._getPersonaCoinControl=function(e){var t=o.props,n=t.getPersonaProps,r=t.personaSize;return b.createElement(ti,h({imageInitials:e.imageInitials,imageUrl:e.imageUrl,initialsColor:e.initialsColor,allowPhoneInitials:e.allowPhoneInitials,text:e.personaName,size:r},n?n(e):null))},si(o),o._ariaDescriptionId=ts(),o}return p(t,e),t.prototype.render=function(){var e=this.props.overflowButtonProps,t=this.props,o=t.chevronButtonProps,n=t.maxDisplayablePersonas,r=t.personas,i=t.overflowPersonas,s=t.showAddButton,a=t.ariaLabel,l=this._classNames,c="number"==typeof n?Math.min(r.length,n):r.length;o&&!e&&(e=o);var u=i&&i.length>0,d=u?r:r.slice(0,c),p=(u?i:r.slice(c))||[];return b.createElement("div",{className:l.root},this.onRenderAriaDescription(),b.createElement("div",{className:l.itemContainer},s?this._getAddNewElement():null,b.createElement("ul",{className:l.members,"aria-label":a},this._onRenderVisiblePersonas(d,0===p.length&&1===r.length)),e?this._getOverflowElement(p):null))},t.prototype.onRenderAriaDescription=function(){var e=this.props.ariaDescription,t=this._classNames;return e&&b.createElement("span",{className:t.screenReaderOnly,id:this._ariaDescriptionId},e)},t.prototype._onRenderVisiblePersonas=function(e,t){var o=this,n=this.props,r=n.onRenderPersona,i=void 0===r?this._getPersonaControl:r,s=n.onRenderPersonaCoin,a=void 0===s?this._getPersonaCoinControl:s;return e.map((function(e,n){var r=t?i(e,o._getPersonaControl):a(e,o._getPersonaCoinControl);return b.createElement("li",{key:(t?"persona":"personaCoin")+"-"+n,className:o._classNames.member},e.onClick?o._getElementWithOnClickEvent(r,e,n):o._getElementWithoutOnClickEvent(r,e,n))}))},t.prototype._getElementWithOnClickEvent=function(e,t,o){var n=t.keytipProps;return b.createElement(iy,h({},fr(t,er),this._getElementProps(t,o),{keytipProps:n,onClick:this._onPersonaClick.bind(this,t)}),e)},t.prototype._getElementWithoutOnClickEvent=function(e,t,o){return b.createElement("div",h({},fr(t,er),this._getElementProps(t,o)),e)},t.prototype._getElementProps=function(e,t){var o=this._classNames;return{key:(e.imageUrl?"i":"")+t,"data-is-focusable":!0,className:o.itemButton,title:e.personaName,onMouseMove:this._onPersonaMouseMove.bind(this,e),onMouseOut:this._onPersonaMouseOut.bind(this,e)}},t.prototype._getOverflowElement=function(e){switch(this.props.overflowButtonType){case X_.descriptive:return this._getDescriptiveOverflowElement(e);case X_.downArrow:return this._getIconElement("ChevronDown");case X_.more:return this._getIconElement("More");default:return null}},t.prototype._getDescriptiveOverflowElement=function(e){var t=this.props.personaSize;if(!e||e.length<1)return null;var o=e.map((function(e){return e.personaName})).join(", "),n=h({title:o},this.props.overflowButtonProps),r=Math.max(e.length,0),i=this._classNames;return b.createElement(iy,h({},n,{ariaDescription:n.title,className:i.descriptiveOverflowButton}),b.createElement(ti,{size:t,onRenderInitials:this._renderInitialsNotPictured(r),initialsColor:wr.transparent}))},t.prototype._getIconElement=function(e){var t=this.props,o=t.overflowButtonProps,n=t.personaSize,r=this._classNames;return b.createElement(iy,h({},o,{className:r.overflowButton}),b.createElement(ti,{size:n,onRenderInitials:this._renderInitials(e,!0),initialsColor:wr.transparent}))},t.prototype._getAddNewElement=function(){var e=this.props,t=e.addButtonProps,o=e.personaSize,n=this._classNames;return b.createElement(iy,h({},t,{className:n.addButton}),b.createElement(ti,{size:o,onRenderInitials:this._renderInitials("AddFriend")}))},t.prototype._onPersonaClick=function(e,t){e.onClick(t,e),t.preventDefault(),t.stopPropagation()},t.prototype._onPersonaMouseMove=function(e,t){e.onMouseMove&&e.onMouseMove(t,e)},t.prototype._onPersonaMouseOut=function(e,t){e.onMouseOut&&e.onMouseOut(t,e)},t.prototype._renderInitials=function(e,t){var o=this._classNames;return function(){return b.createElement(Fr,{iconName:e,className:t?o.overflowInitialsIcon:""})}},t.prototype._renderInitialsNotPictured=function(e){var t=this._classNames;return function(){return b.createElement("span",{className:t.overflowInitialsIcon},e<100?"+"+e:"99+")}},t.defaultProps={maxDisplayablePersonas:5,personas:[],overflowPersonas:[],personaSize:xr.size32},t}(b.Component),py={root:"ms-Facepile",addButton:"ms-Facepile-addButton ms-Facepile-itemButton",descriptiveOverflowButton:"ms-Facepile-descriptiveOverflowButton ms-Facepile-itemButton",itemButton:"ms-Facepile-itemButton ms-Facepile-person",itemContainer:"ms-Facepile-itemContainer",members:"ms-Facepile-members",member:"ms-Facepile-member",overflowButton:"ms-Facepile-overflowButton ms-Facepile-itemButton"},hy=xn(dy,(function(e){var t=e.className,o=e.theme,n=e.spacingAroundItemButton,r=void 0===n?2:n,i=o.palette,s=o.fonts,a=Oo(py,o),l={textAlign:"center",padding:0,borderRadius:"50%",verticalAlign:"top",display:"inline",backgroundColor:"transparent",border:"none",selectors:{"&::-moz-focus-inner":{padding:0,border:0}}};return{root:[a.root,o.fonts.medium,{width:"auto"},t],addButton:[a.addButton,go(o,{inset:-1}),l,{fontSize:s.medium.fontSize,color:i.white,backgroundColor:i.themePrimary,marginRight:2*r+"px",selectors:{"&:hover":{backgroundColor:i.themeDark},"&:focus":{backgroundColor:i.themeDark},"&:active":{backgroundColor:i.themeDarker},"&:disabled":{backgroundColor:i.neutralTertiaryAlt}}}],descriptiveOverflowButton:[a.descriptiveOverflowButton,go(o,{inset:-1}),l,{fontSize:s.small.fontSize,color:i.neutralSecondary,backgroundColor:i.neutralLighter,marginLeft:2*r+"px"}],itemButton:[a.itemButton,l],itemContainer:[a.itemContainer,{display:"flex"}],members:[a.members,{display:"flex",overflow:"hidden",listStyleType:"none",padding:0,margin:"-"+r+"px"}],member:[a.member,{display:"inline-flex",flex:"0 0 auto",margin:r+"px"}],overflowButton:[a.overflowButton,go(o,{inset:-1}),l,{fontSize:s.medium.fontSize,color:i.neutralSecondary,backgroundColor:i.neutralLighter,marginLeft:2*r+"px"}],overflowInitialsIcon:[{color:i.neutralPrimary}],screenReaderOnly:yo}}),void 0,{scope:"Facepile"});Object(Dt.a)([{rawString:".callout_a547b158 .ms-Suggestions-itemButton{padding:0;border:none}.callout_a547b158 .ms-Suggestions{min-width:300px}"}]);var my="callout_a547b158";Object(Dt.a)([{rawString:".root_a8ad5804{min-width:260px}.suggestionsItem_a8ad5804{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;position:relative;overflow:hidden}.suggestionsItem_a8ad5804:hover{background:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:"}.suggestionsItem_a8ad5804:hover .closeButton_a8ad5804{display:block}.suggestionsItem_a8ad5804.suggestionsItemIsSuggested_a8ad5804{background:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.suggestionsItem_a8ad5804.suggestionsItemIsSuggested_a8ad5804:hover{background:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:"}@media screen and (-ms-high-contrast:active){.suggestionsItem_a8ad5804.suggestionsItemIsSuggested_a8ad5804:hover{background:Highlight;color:HighlightText}}@media screen and (-ms-high-contrast:active){.suggestionsItem_a8ad5804.suggestionsItemIsSuggested_a8ad5804{background:Highlight;color:HighlightText;-ms-high-contrast-adjust:none}}.suggestionsItem_a8ad5804.suggestionsItemIsSuggested_a8ad5804 .closeButton_a8ad5804:hover{background:"},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:";color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:"}@media screen and (-ms-high-contrast:active){.suggestionsItem_a8ad5804.suggestionsItemIsSuggested_a8ad5804 .itemButton_a8ad5804{color:HighlightText}}.suggestionsItem_a8ad5804 .closeButton_a8ad5804{display:none;color:"},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:"}.suggestionsItem_a8ad5804 .closeButton_a8ad5804:hover{background:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.actionButton_a8ad5804{background-color:transparent;border:0;cursor:pointer;margin:0;position:relative;border-top:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";height:40px;width:100%;font-size:12px}[dir=ltr] .actionButton_a8ad5804{padding-left:8px}[dir=rtl] .actionButton_a8ad5804{padding-right:8px}html[dir=ltr] .actionButton_a8ad5804{text-align:left}html[dir=rtl] .actionButton_a8ad5804{text-align:right}.actionButton_a8ad5804:hover{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";cursor:pointer}.actionButton_a8ad5804:active,.actionButton_a8ad5804:focus{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.actionButton_a8ad5804 .ms-Button-icon{font-size:16px;width:25px}.actionButton_a8ad5804 .ms-Button-label{margin:0 4px 0 9px}html[dir=rtl] .actionButton_a8ad5804 .ms-Button-label{margin:0 9px 0 4px}.buttonSelected_a8ad5804{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.suggestionsTitle_a8ad5804{padding:0 12px;color:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:";font-size:12px;line-height:40px;border-bottom:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.suggestionsContainer_a8ad5804{overflow-y:auto;overflow-x:hidden;max-height:300px;border-bottom:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.suggestionsNone_a8ad5804{text-align:center;color:#797775;font-size:12px;line-height:30px}.suggestionsSpinner_a8ad5804{margin:5px 0;white-space:nowrap;line-height:20px;font-size:12px}html[dir=ltr] .suggestionsSpinner_a8ad5804{padding-left:14px}html[dir=rtl] .suggestionsSpinner_a8ad5804{padding-right:14px}html[dir=ltr] .suggestionsSpinner_a8ad5804{text-align:left}html[dir=rtl] .suggestionsSpinner_a8ad5804{text-align:right}.suggestionsSpinner_a8ad5804 .ms-Spinner-circle{display:inline-block;vertical-align:middle}.suggestionsSpinner_a8ad5804 .ms-Spinner-label{display:inline-block;margin:0 10px 0 16px;vertical-align:middle}html[dir=rtl] .suggestionsSpinner_a8ad5804 .ms-Spinner-label{margin:0 16px 0 10px}.itemButton_a8ad5804.itemButton_a8ad5804{width:100%;padding:0;min-width:0;height:100%}@media screen and (-ms-high-contrast:active){.itemButton_a8ad5804.itemButton_a8ad5804{color:WindowText}}.itemButton_a8ad5804.itemButton_a8ad5804:hover{color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.closeButton_a8ad5804.closeButton_a8ad5804{padding:0 4px;height:auto;width:32px}@media screen and (-ms-high-contrast:active){.closeButton_a8ad5804.closeButton_a8ad5804{color:WindowText}}.closeButton_a8ad5804.closeButton_a8ad5804:hover{background:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.suggestionsAvailable_a8ad5804{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"}]);var gy="root_a8ad5804",fy="suggestionsItem_a8ad5804",vy="closeButton_a8ad5804",by="suggestionsItemIsSuggested_a8ad5804",_y="itemButton_a8ad5804",yy="actionButton_a8ad5804",Cy="buttonSelected_a8ad5804",Sy="suggestionsTitle_a8ad5804",xy="suggestionsContainer_a8ad5804",ky="suggestionsNone_a8ad5804",wy="suggestionsSpinner_a8ad5804",Iy="suggestionsAvailable_a8ad5804",Dy=s,Py=Mn(),Ty=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e,t=this.props,o=t.suggestionModel,n=t.RenderSuggestion,r=t.onClick,i=t.className,s=t.id,a=t.onRemoveItem,l=t.isSelectedOverride,c=t.removeButtonAriaLabel,u=t.styles,d=t.theme,p=u?Py(u,{theme:d,className:i,suggested:o.selected||l}):{root:Sr("ms-Suggestions-item",Dy.suggestionsItem,(e={},e["is-suggested "+Dy.suggestionsItemIsSuggested]=o.selected||l,e),i),itemButton:Sr("ms-Suggestions-itemButton",Dy.itemButton),closeButton:Sr("ms-Suggestions-closeButton",Dy.closeButton)};return b.createElement("div",{className:p.root},b.createElement(Yu,{onClick:r,className:p.itemButton,id:s,"aria-selected":o.selected,role:"option","aria-label":o.ariaLabel},n(o.item,this.props)),this.props.showRemoveButton?b.createElement(eu,{iconProps:{iconName:"Cancel",styles:{root:{fontSize:"12px"}}},title:c,ariaLabel:c,onClick:a,className:p.closeButton}):null)},t}(b.Component);Object(Dt.a)([{rawString:".suggestionsContainer_8483b091{overflow-y:auto;overflow-x:hidden;max-height:300px}.suggestionsContainer_8483b091 .ms-Suggestion-item:hover{background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";cursor:pointer}.suggestionsContainer_8483b091 .is-suggested{background-color:"},{theme:"themeLighter",defaultValue:"#deecf9"},{rawString:"}.suggestionsContainer_8483b091 .is-suggested:hover{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:";cursor:pointer}"}]);var Ey="suggestionsContainer_8483b091",My=a,Ry=function(e){function t(t){var o=e.call(this,t)||this;return o._selectedElement=b.createRef(),o.SuggestionsItemOfProperType=Ty,o._onClickTypedSuggestionsItem=function(e,t){return function(n){o.props.onSuggestionClick(n,e,t)}},o._onRemoveTypedSuggestionsItem=function(e,t){return function(n){(0,o.props.onSuggestionRemove)(n,e,t),n.stopPropagation()}},si(o),o.currentIndex=-1,o}return p(t,e),t.prototype.nextSuggestion=function(){var e=this.props.suggestions;if(e&&e.length>0){if(-1===this.currentIndex)return this.setSelectedSuggestion(0),!0;if(this.currentIndex<e.length-1)return this.setSelectedSuggestion(this.currentIndex+1),!0;if(this.props.shouldLoopSelection&&this.currentIndex===e.length-1)return this.setSelectedSuggestion(0),!0}return!1},t.prototype.previousSuggestion=function(){var e=this.props.suggestions;if(e&&e.length>0){if(-1===this.currentIndex)return this.setSelectedSuggestion(e.length-1),!0;if(this.currentIndex>0)return this.setSelectedSuggestion(this.currentIndex-1),!0;if(this.props.shouldLoopSelection&&0===this.currentIndex)return this.setSelectedSuggestion(e.length-1),!0}return!1},Object.defineProperty(t.prototype,"selectedElement",{get:function(){return this._selectedElement.current||void 0},enumerable:!0,configurable:!0}),t.prototype.getCurrentItem=function(){return this.props.suggestions[this.currentIndex]},t.prototype.getSuggestionAtIndex=function(e){return this.props.suggestions[e]},t.prototype.hasSuggestionSelected=function(){return-1!==this.currentIndex&&this.currentIndex<this.props.suggestions.length},t.prototype.removeSuggestion=function(e){this.props.suggestions.splice(e,1)},t.prototype.deselectAllSuggestions=function(){this.currentIndex>-1&&this.props.suggestions[this.currentIndex]&&(this.props.suggestions[this.currentIndex].selected=!1,this.currentIndex=-1,this.forceUpdate())},t.prototype.setSelectedSuggestion=function(e){var t=this.props.suggestions;e>t.length-1||e<0?(this.currentIndex=0,this.currentSuggestion.selected=!1,this.currentSuggestion=t[0],this.currentSuggestion.selected=!0):(this.currentIndex>-1&&t[this.currentIndex]&&(t[this.currentIndex].selected=!1),t[e].selected=!0,this.currentIndex=e,this.currentSuggestion=t[e]),this.forceUpdate()},t.prototype.componentDidUpdate=function(){this.scrollSelected()},t.prototype.render=function(){var e=this,t=this.props,o=t.onRenderSuggestion,n=t.suggestionsItemClassName,r=t.resultsMaximumNumber,i=t.showRemoveButtons,s=t.suggestionsContainerAriaLabel,a=this.SuggestionsItemOfProperType,l=this.props.suggestions;return r&&(l=l.slice(0,r)),b.createElement("div",{className:Sr("ms-Suggestions-container",My.suggestionsContainer),id:"suggestion-list",role:"list","aria-label":s},l.map((function(t,r){return b.createElement("div",{ref:t.selected||r===e.currentIndex?e._selectedElement:void 0,key:t.item.key?t.item.key:r,id:"sug-"+r,role:"listitem","aria-label":t.ariaLabel},b.createElement(a,{id:"sug-item"+r,suggestionModel:t,RenderSuggestion:o,onClick:e._onClickTypedSuggestionsItem(t.item,r),className:n,showRemoveButton:i,onRemoveItem:e._onRemoveTypedSuggestionsItem(t.item,r),isSelectedOverride:r===e.currentIndex}))})))},t.prototype.scrollSelected=function(){var e;void 0!==(null===(e=this._selectedElement.current)||void 0===e?void 0:e.scrollIntoView)&&this._selectedElement.current.scrollIntoView(!1)},t}(b.Component);Object(Dt.a)([{rawString:".root_8b6c8586{min-width:260px}.actionButton_8b6c8586{background:0 0;background-color:transparent;border:0;cursor:pointer;margin:0;padding:0;position:relative;width:100%;font-size:12px}html[dir=ltr] .actionButton_8b6c8586{text-align:left}html[dir=rtl] .actionButton_8b6c8586{text-align:right}.actionButton_8b6c8586:hover{background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";cursor:pointer}.actionButton_8b6c8586:active,.actionButton_8b6c8586:focus{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.actionButton_8b6c8586 .ms-Button-icon{font-size:16px;width:25px}.actionButton_8b6c8586 .ms-Button-label{margin:0 4px 0 9px}html[dir=rtl] .actionButton_8b6c8586 .ms-Button-label{margin:0 9px 0 4px}.buttonSelected_8b6c8586{background-color:"},{theme:"themeLighter",defaultValue:"#deecf9"},{rawString:"}.buttonSelected_8b6c8586:hover{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:";cursor:pointer}@media screen and (-ms-high-contrast:active){.buttonSelected_8b6c8586:hover{background-color:Highlight;color:HighlightText}}@media screen and (-ms-high-contrast:active){.buttonSelected_8b6c8586{background-color:Highlight;color:HighlightText;-ms-high-contrast-adjust:none}}.suggestionsTitle_8b6c8586{font-size:12px}.suggestionsSpinner_8b6c8586{margin:5px 0;white-space:nowrap;line-height:20px;font-size:12px}html[dir=ltr] .suggestionsSpinner_8b6c8586{padding-left:14px}html[dir=rtl] .suggestionsSpinner_8b6c8586{padding-right:14px}html[dir=ltr] .suggestionsSpinner_8b6c8586{text-align:left}html[dir=rtl] .suggestionsSpinner_8b6c8586{text-align:right}.suggestionsSpinner_8b6c8586 .ms-Spinner-circle{display:inline-block;vertical-align:middle}.suggestionsSpinner_8b6c8586 .ms-Spinner-label{display:inline-block;margin:0 10px 0 16px;vertical-align:middle}html[dir=rtl] .suggestionsSpinner_8b6c8586 .ms-Spinner-label{margin:0 16px 0 10px}.itemButton_8b6c8586{height:100%;width:100%;padding:7px 12px}@media screen and (-ms-high-contrast:active){.itemButton_8b6c8586{color:WindowText}}.screenReaderOnly_8b6c8586{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"}]);var By,Ny="root_8b6c8586",Fy="actionButton_8b6c8586",Ay="buttonSelected_8b6c8586",Ly="suggestionsTitle_8b6c8586",Hy="suggestionsSpinner_8b6c8586",Oy="itemButton_8b6c8586",zy="screenReaderOnly_8b6c8586",Wy=l;!function(e){e[e.header=0]="header",e[e.suggestion=1]="suggestion",e[e.footer=2]="footer"}(By||(By={}));var Vy=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){var e,t=this.props,o=t.renderItem,n=t.onExecute,r=t.isSelected,i=t.id,s=t.className;return n?b.createElement("div",{id:i,onClick:n,className:Sr("ms-Suggestions-sectionButton",s,Wy.actionButton,(e={},e["is-selected "+Wy.buttonSelected]=r,e))},o()):b.createElement("div",{id:i,className:Sr("ms-Suggestions-section",s,Wy.suggestionsTitle)},o())},t}(b.Component),Ky=function(e){function t(t){var o=e.call(this,t)||this;return o._selectedElement=b.createRef(),o._suggestions=b.createRef(),o.SuggestionsOfProperType=Ry,si(o),o.state={selectedHeaderIndex:-1,selectedFooterIndex:-1,suggestions:t.suggestions},o}return p(t,e),t.prototype.componentDidMount=function(){this.resetSelectedItem()},t.prototype.componentDidUpdate=function(){this.scrollSelected()},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=this;e.suggestions&&this.setState({suggestions:e.suggestions},(function(){t.resetSelectedItem()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this._suggestions.current)||void 0===e||e.deselectAllSuggestions()},t.prototype.render=function(){var e=this.props,t=e.className,o=e.headerItemsProps,n=e.footerItemsProps,r=e.suggestionsAvailableAlertText,i=Q(yo),s=this.state.suggestions&&this.state.suggestions.length>0&&r;return b.createElement("div",{className:Sr("ms-Suggestions",t||"",Wy.root)},o&&this.renderHeaderItems(),this._renderSuggestions(),n&&this.renderFooterItems(),s?b.createElement("span",{role:"alert","aria-live":"polite",className:i},r):null)},Object.defineProperty(t.prototype,"currentSuggestion",{get:function(){var e;return(null===(e=this._suggestions.current)||void 0===e?void 0:e.getCurrentItem())||void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentSuggestionIndex",{get:function(){return this._suggestions.current?this._suggestions.current.currentIndex:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedElement",{get:function(){var e;return this._selectedElement.current?this._selectedElement.current:null===(e=this._suggestions.current)||void 0===e?void 0:e.selectedElement},enumerable:!0,configurable:!0}),t.prototype.hasSuggestionSelected=function(){var e;return(null===(e=this._suggestions.current)||void 0===e?void 0:e.hasSuggestionSelected())||!1},t.prototype.hasSelection=function(){var e=this.state,t=e.selectedHeaderIndex,o=e.selectedFooterIndex;return-1!==t||this.hasSuggestionSelected()||-1!==o},t.prototype.executeSelectedAction=function(){var e,t=this.props,o=t.headerItemsProps,n=t.footerItemsProps,r=this.state,i=r.selectedHeaderIndex,s=r.selectedFooterIndex;if(o&&-1!==i&&i<o.length){var a=o[i];a.onExecute&&a.onExecute()}else if(null===(e=this._suggestions.current)||void 0===e?void 0:e.hasSuggestionSelected())this.props.completeSuggestion();else if(n&&-1!==s&&s<n.length){var l=n[s];l.onExecute&&l.onExecute()}},t.prototype.removeSuggestion=function(e){var t,o;null===(t=this._suggestions.current)||void 0===t||t.removeSuggestion(e||(null===(o=this._suggestions.current)||void 0===o?void 0:o.currentIndex))},t.prototype.handleKeyDown=function(e){var t,o,n,r,i=this.state,s=i.selectedHeaderIndex,a=i.selectedFooterIndex,l=!1;return e===wn.down?-1!==s||(null===(t=this._suggestions.current)||void 0===t?void 0:t.hasSuggestionSelected())||-1!==a?-1!==s?(this.selectNextItem(By.header),l=!0):(null===(o=this._suggestions.current)||void 0===o?void 0:o.hasSuggestionSelected())?(this.selectNextItem(By.suggestion),l=!0):-1!==a&&(this.selectNextItem(By.footer),l=!0):this.selectFirstItem():e===wn.up?-1!==s||(null===(n=this._suggestions.current)||void 0===n?void 0:n.hasSuggestionSelected())||-1!==a?-1!==s?(this.selectPreviousItem(By.header),l=!0):(null===(r=this._suggestions.current)||void 0===r?void 0:r.hasSuggestionSelected())?(this.selectPreviousItem(By.suggestion),l=!0):-1!==a&&(this.selectPreviousItem(By.footer),l=!0):this.selectLastItem():e!==wn.enter&&e!==wn.tab||this.hasSelection()&&(this.executeSelectedAction(),l=!0),l},t.prototype.scrollSelected=function(){this._selectedElement.current&&this._selectedElement.current.scrollIntoView(!1)},t.prototype.renderHeaderItems=function(){var e=this,t=this.props,o=t.headerItemsProps,n=t.suggestionsHeaderContainerAriaLabel,r=this.state.selectedHeaderIndex;return o?b.createElement("div",{className:Sr("ms-Suggestions-headerContainer",Wy.suggestionsContainer),id:"suggestionHeader-list",role:"list","aria-label":n},o.map((function(t,o){var n=-1!==r&&r===o;return t.shouldShow()?b.createElement("div",{ref:n?e._selectedElement:void 0,id:"sug-header"+o,key:"sug-header"+o,role:"listitem","aria-label":t.ariaLabel},b.createElement(Vy,{id:"sug-header-item"+o,isSelected:n,renderItem:t.renderItem,onExecute:t.onExecute,className:t.className})):null}))):null},t.prototype.renderFooterItems=function(){var e=this,t=this.props,o=t.footerItemsProps,n=t.suggestionsFooterContainerAriaLabel,r=this.state.selectedFooterIndex;return o?b.createElement("div",{className:Sr("ms-Suggestions-footerContainer",Wy.suggestionsContainer),id:"suggestionFooter-list",role:"list","aria-label":n},o.map((function(t,o){var n=-1!==r&&r===o;return t.shouldShow()?b.createElement("div",{ref:n?e._selectedElement:void 0,id:"sug-footer"+o,key:"sug-footer"+o,role:"listitem","aria-label":t.ariaLabel},b.createElement(Vy,{id:"sug-footer-item"+o,isSelected:n,renderItem:t.renderItem,onExecute:t.onExecute,className:t.className})):null}))):null},t.prototype._renderSuggestions=function(){var e=this.SuggestionsOfProperType;return b.createElement(e,h({ref:this._suggestions},this.props,{suggestions:this.state.suggestions}))},t.prototype.selectNextItem=function(e,t){if(e!==t){var o=void 0!==t?t:e;this._selectNextItemOfItemType(e,o===e?this._getCurrentIndexForType(e):void 0)||this.selectNextItem(this._getNextItemSectionType(e),o)}else this._selectNextItemOfItemType(e)},t.prototype.selectPreviousItem=function(e,t){if(e!==t){var o=void 0!==t?t:e;this._selectPreviousItemOfItemType(e,o===e?this._getCurrentIndexForType(e):void 0)||this.selectPreviousItem(this._getPreviousItemSectionType(e),o)}else this._selectPreviousItemOfItemType(e)},t.prototype.resetSelectedItem=function(){var e;this.setState({selectedHeaderIndex:-1,selectedFooterIndex:-1}),null===(e=this._suggestions.current)||void 0===e||e.deselectAllSuggestions(),(void 0===this.props.shouldSelectFirstItem||this.props.shouldSelectFirstItem())&&this.selectFirstItem()},t.prototype.selectFirstItem=function(){this._selectNextItemOfItemType(By.header)||this._selectNextItemOfItemType(By.suggestion)||this._selectNextItemOfItemType(By.footer)},t.prototype.selectLastItem=function(){this._selectPreviousItemOfItemType(By.footer)||this._selectPreviousItemOfItemType(By.suggestion)||this._selectPreviousItemOfItemType(By.header)},t.prototype._selectNextItemOfItemType=function(e,t){var o,n;if(void 0===t&&(t=-1),e===By.suggestion){if(this.state.suggestions.length>t+1)return null===(o=this._suggestions.current)||void 0===o||o.setSelectedSuggestion(t+1),this.setState({selectedHeaderIndex:-1,selectedFooterIndex:-1}),!0}else{var r=e===By.header,i=r?this.props.headerItemsProps:this.props.footerItemsProps;if(i&&i.length>t+1)for(var s=t+1;s<i.length;s++){var a=i[s];if(a.onExecute&&a.shouldShow())return this.setState({selectedHeaderIndex:r?s:-1}),this.setState({selectedFooterIndex:r?-1:s}),null===(n=this._suggestions.current)||void 0===n||n.deselectAllSuggestions(),!0}}return!1},t.prototype._selectPreviousItemOfItemType=function(e,t){var o,n;if(e===By.suggestion){if((r=void 0!==t?t:this.state.suggestions.length)>0)return null===(o=this._suggestions.current)||void 0===o||o.setSelectedSuggestion(r-1),this.setState({selectedHeaderIndex:-1,selectedFooterIndex:-1}),!0}else{var r,i=e===By.header,s=i?this.props.headerItemsProps:this.props.footerItemsProps;if(s)if((r=void 0!==t?t:s.length)>0)for(var a=r-1;a>=0;a--){var l=s[a];if(l.onExecute&&l.shouldShow())return this.setState({selectedHeaderIndex:i?a:-1}),this.setState({selectedFooterIndex:i?-1:a}),null===(n=this._suggestions.current)||void 0===n||n.deselectAllSuggestions(),!0}}return!1},t.prototype._getCurrentIndexForType=function(e){switch(e){case By.header:return this.state.selectedHeaderIndex;case By.suggestion:return this._suggestions.current.currentIndex;case By.footer:return this.state.selectedFooterIndex}},t.prototype._getNextItemSectionType=function(e){switch(e){case By.header:return By.suggestion;case By.suggestion:return By.footer;case By.footer:return By.header}},t.prototype._getPreviousItemSectionType=function(e){switch(e){case By.header:return By.footer;case By.suggestion:return By.header;case By.footer:return By.suggestion}},t}(b.Component),Uy=i,Gy=function(e){function t(t){var o=e.call(this,t)||this;return o.root=b.createRef(),o.suggestionsControl=b.createRef(),o.SuggestionsControlOfProperType=Ky,o.isComponentMounted=!1,o.onQueryStringChanged=function(e){e!==o.state.queryString&&(o.setState({queryString:e}),o.props.onInputChanged&&o.props.onInputChanged(e),o.updateValue(e))},o.hidePicker=function(){var e=o.isSuggestionsShown;o.setState({suggestionsVisible:!1}),o.props.onSuggestionsHidden&&e&&o.props.onSuggestionsHidden()},o.showPicker=function(e){void 0===e&&(e=!1);var t=o.isSuggestionsShown;o.setState({suggestionsVisible:!0});var n=o.props.inputElement?o.props.inputElement.value:"";e&&o.updateValue(n),o.props.onSuggestionsShown&&!t&&o.props.onSuggestionsShown()},o.completeSuggestion=function(){o.suggestionsControl.current&&o.suggestionsControl.current.hasSuggestionSelected()&&o.onChange(o.suggestionsControl.current.currentSuggestion.item)},o.onSuggestionClick=function(e,t,n){o.onChange(t),o._updateSuggestionsVisible(!1)},o.onSuggestionRemove=function(e,t,n){o.props.onRemoveSuggestion&&o.props.onRemoveSuggestion(t),o.suggestionsControl.current&&o.suggestionsControl.current.removeSuggestion(n)},o.onKeyDown=function(e){if(o.state.suggestionsVisible&&(!o.props.inputElement||o.props.inputElement.contains(e.target))){var t=e.which;switch(t){case wn.escape:o.hidePicker(),e.preventDefault(),e.stopPropagation();break;case wn.tab:case wn.enter:!e.shiftKey&&!e.ctrlKey&&o.suggestionsControl.current&&o.suggestionsControl.current.handleKeyDown(t)?(e.preventDefault(),e.stopPropagation()):o._onValidateInput();break;case wn.del:o.props.onRemoveSuggestion&&o.suggestionsControl.current&&o.suggestionsControl.current.hasSuggestionSelected&&o.suggestionsControl.current.currentSuggestion&&e.shiftKey&&(o.props.onRemoveSuggestion(o.suggestionsControl.current.currentSuggestion.item),o.suggestionsControl.current.removeSuggestion(),o.forceUpdate(),e.stopPropagation());break;case wn.up:case wn.down:o.suggestionsControl.current&&o.suggestionsControl.current.handleKeyDown(t)&&(e.preventDefault(),e.stopPropagation(),o._updateActiveDescendant())}}},o._onValidateInput=function(){if(o.state.queryString&&o.props.onValidateInput&&o.props.createGenericItem){var e=o.props.createGenericItem(o.state.queryString,o.props.onValidateInput(o.state.queryString)),t=o.suggestionStore.convertSuggestionsToSuggestionItems([e]);o.onChange(t[0].item)}},o._async=new di(o),si(o),o.suggestionStore=t.suggestionsStore,o.state={queryString:"",didBind:!1},o}return p(t,e),Object.defineProperty(t.prototype,"inputText",{get:function(){return this.state.queryString},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"suggestions",{get:function(){return this.suggestionStore.suggestions},enumerable:!0,configurable:!0}),t.prototype.forceResolveSuggestion=function(){this.suggestionsControl.current&&this.suggestionsControl.current.hasSuggestionSelected()?this.completeSuggestion():this._onValidateInput()},Object.defineProperty(t.prototype,"currentSelectedSuggestionIndex",{get:function(){return this.suggestionsControl.current?this.suggestionsControl.current.currentSuggestionIndex:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSuggestionsShown",{get:function(){return void 0!==this.state.suggestionsVisible&&this.state.suggestionsVisible},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this._bindToInputElement(),this.isComponentMounted=!0,this._onResolveSuggestions=this._async.debounce(this._onResolveSuggestions,this.props.resolveDelay)},t.prototype.componentDidUpdate=function(){this._bindToInputElement()},t.prototype.componentWillUnmount=function(){this._unbindFromInputElement(),this.isComponentMounted=!1},t.prototype.UNSAFE_componentWillReceiveProps=function(e){e.suggestionItems&&this.updateSuggestions(e.suggestionItems)},t.prototype.updateSuggestions=function(e,t){void 0===t&&(t=!1),this.suggestionStore.updateSuggestions(e),t&&this.forceUpdate()},t.prototype.render=function(){var e=this.props.className;return b.createElement("div",{ref:this.root,className:Sr("ms-BasePicker ms-BaseFloatingPicker",e||"")},this.renderSuggestions())},t.prototype.renderSuggestions=function(){var e=this.SuggestionsControlOfProperType;return this.state.suggestionsVisible?b.createElement(uc,h({className:Uy.callout,isBeakVisible:!1,gapSpace:5,target:this.props.inputElement,onDismiss:this.hidePicker,directionalHint:ya.bottomLeftEdge,directionalHintForRTL:ya.bottomRightEdge,calloutWidth:this.props.calloutWidth?this.props.calloutWidth:0},this.props.pickerCalloutProps),b.createElement(e,h({onRenderSuggestion:this.props.onRenderSuggestionsItem,onSuggestionClick:this.onSuggestionClick,onSuggestionRemove:this.onSuggestionRemove,suggestions:this.suggestionStore.getSuggestions(),componentRef:this.suggestionsControl,completeSuggestion:this.completeSuggestion,shouldLoopSelection:!1},this.props.pickerSuggestionsProps))):null},t.prototype.onSelectionChange=function(){this.forceUpdate()},t.prototype.updateValue=function(e){""===e?this.updateSuggestionWithZeroState():this._onResolveSuggestions(e)},t.prototype.updateSuggestionWithZeroState=function(){if(this.props.onZeroQuerySuggestion){var e=(0,this.props.onZeroQuerySuggestion)(this.props.selectedItems);this.updateSuggestionsList(e)}else this.hidePicker()},t.prototype.updateSuggestionsList=function(e){var t=this,o=e,n=e;if(Array.isArray(o))this.updateSuggestions(o,!0);else if(n&&n.then){var r=this.currentPromise=n;r.then((function(e){r===t.currentPromise&&t.isComponentMounted&&t.updateSuggestions(e,!0)}))}},t.prototype.onChange=function(e){this.props.onChange&&this.props.onChange(e)},t.prototype._updateActiveDescendant=function(){if(this.props.inputElement&&this.suggestionsControl.current&&this.suggestionsControl.current.selectedElement){var e=this.suggestionsControl.current.selectedElement.getAttribute("id");e&&this.props.inputElement.setAttribute("aria-activedescendant",e)}},t.prototype._onResolveSuggestions=function(e){var t=this.props.onResolveSuggestions(e,this.props.selectedItems);this._updateSuggestionsVisible(!0),null!==t&&this.updateSuggestionsList(t)},t.prototype._updateSuggestionsVisible=function(e){e?this.showPicker():this.hidePicker()},t.prototype._bindToInputElement=function(){this.props.inputElement&&!this.state.didBind&&(this.props.inputElement.addEventListener("keydown",this.onKeyDown),this.setState({didBind:!0}))},t.prototype._unbindFromInputElement=function(){this.props.inputElement&&this.state.didBind&&(this.props.inputElement.removeEventListener("keydown",this.onKeyDown),this.setState({didBind:!1}))},t}(b.Component);Object(Dt.a)([{rawString:".resultContent_e97e40b6{display:table-row}.resultContent_e97e40b6 .resultItem_e97e40b6{display:table-cell;vertical-align:bottom}.peoplePickerPersona_e97e40b6{width:180px}.peoplePickerPersona_e97e40b6 .ms-Persona-details{width:100%}.peoplePicker_e97e40b6 .ms-BasePicker-text{min-height:40px}.peoplePickerPersonaContent_e97e40b6{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:7px 12px}"}]);var jy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(Gy),Yy=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.defaultProps={onRenderSuggestionsItem:function(e,t){return o=h({},e),h({},t),b.createElement("div",{className:Sr("ms-PeoplePicker-personaContent","peoplePickerPersonaContent_e97e40b6")},b.createElement(cy,h({presence:void 0!==o.presence?o.presence:kr.none,size:xr.size40,className:Sr("ms-PeoplePicker-Persona","peoplePickerPersona_e97e40b6"),showSecondaryText:!0},o)));var o},createGenericItem:qy},t}(jy);function qy(e,t){var o={key:e,primaryText:e,imageInitials:"!",isValid:t};return t||(o.imageInitials=On(e,In())),o}var Zy=function(){function e(e){var t=this;this._isSuggestionModel=function(e){return void 0!==e.item},this._ensureSuggestionModel=function(e){return t._isSuggestionModel(e)?e:{item:e,selected:!1,ariaLabel:void 0!==t.getAriaLabel?t.getAriaLabel(e):e.name||e.text||e.primaryText}},this.suggestions=[],this.getAriaLabel=e&&e.getAriaLabel}return e.prototype.updateSuggestions=function(e){e&&e.length>0?this.suggestions=this.convertSuggestionsToSuggestionItems(e):this.suggestions=[]},e.prototype.getSuggestions=function(){return this.suggestions},e.prototype.getSuggestionAtIndex=function(e){return this.suggestions[e]},e.prototype.removeSuggestion=function(e){this.suggestions.splice(e,1)},e.prototype.convertSuggestionsToSuggestionItems=function(e){return Array.isArray(e)?e.map(this._ensureSuggestionModel):[]},e}();Object(gn.a)("@fluentui/react-focus","7.17.5");var Xy,Qy,Jy={host:"ms-HoverCard-host"};!function(e){e[e.hover=0]="hover",e[e.hotKey=1]="hotKey"}(Xy||(Xy={})),function(e){e.plain="PlainCard",e.expanding="ExpandingCard"}(Qy||(Qy={}));var $y,eC={root:"ms-ExpandingCard-root",compactCard:"ms-ExpandingCard-compactCard",expandedCard:"ms-ExpandingCard-expandedCard",expandedCardScroll:"ms-ExpandingCard-expandedCardScrollRegion"};!function(e){e[e.compact=0]="compact",e[e.expanded=1]="expanded"}($y||($y={}));var tC=function(e){var t=e.gapSpace,o=void 0===t?0:t,n=e.directionalHint,r=void 0===n?ya.bottomLeftEdge:n,i=e.directionalHintFixed,s=e.targetElement,a=e.firstFocus,l=e.trapFocus,c=e.onLeave,u=e.className,d=e.finalHeight,p=e.content,m=e.calloutProps,g=h(h(h({},fr(e,gr)),{className:u,target:s,isBeakVisible:!1,directionalHint:r,directionalHintFixed:i,finalHeight:d,minPagePadding:24,onDismiss:c,gapSpace:o}),m);return b.createElement(b.Fragment,null,l?b.createElement(Dh,h({},g,{focusTrapProps:{forceFocusInsideTrap:!1,isClickableOutsideFocusTrap:!0,disableFirstFocus:!a}}),p):b.createElement(uc,h({},g),p))},oC=Mn(),nC=function(e){function t(t){var o=e.call(this,t)||this;return o._expandedElem=b.createRef(),o._onKeyDown=function(e){e.which===wn.escape&&o.props.onLeave&&o.props.onLeave(e)},o._onRenderCompactCard=function(){return b.createElement("div",{className:o._classNames.compactCard},o.props.onRenderCompactCard(o.props.renderData))},o._onRenderExpandedCard=function(){return!o.state.firstFrameRendered&&o._async.requestAnimationFrame((function(){o.setState({firstFrameRendered:!0})})),b.createElement("div",{className:o._classNames.expandedCard,ref:o._expandedElem},b.createElement("div",{className:o._classNames.expandedCardScroll},o.props.onRenderExpandedCard&&o.props.onRenderExpandedCard(o.props.renderData)))},o._checkNeedsScroll=function(){var e=o.props.expandedCardHeight;o._async.requestAnimationFrame((function(){o._expandedElem.current&&o._expandedElem.current.scrollHeight>=e&&o.setState({needsScroll:!0})}))},o._async=new di(o),si(o),o.state={firstFrameRendered:!1,needsScroll:!1},o}return p(t,e),t.prototype.componentDidMount=function(){this._checkNeedsScroll()},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.styles,o=e.compactCardHeight,n=e.expandedCardHeight,r=e.theme,i=e.mode,s=e.className,a=this.state,l=a.needsScroll,c=a.firstFrameRendered,u=o+n;this._classNames=oC(t,{theme:r,compactCardHeight:o,className:s,expandedCardHeight:n,needsScroll:l,expandedCardFirstFrameRendered:i===$y.expanded&&c});var d=b.createElement("div",{onMouseEnter:this.props.onEnter,onMouseLeave:this.props.onLeave,onKeyDown:this._onKeyDown},this._onRenderCompactCard(),this._onRenderExpandedCard());return b.createElement(tC,h({},this.props,{content:d,finalHeight:u,className:this._classNames.root}))},t.defaultProps={compactCardHeight:156,expandedCardHeight:384,directionalHintFixed:!0},t}(b.Component),rC=xn(nC,(function(e){var t,o=e.theme,n=e.needsScroll,r=e.expandedCardFirstFrameRendered,i=e.compactCardHeight,s=e.expandedCardHeight,a=e.className,l=o.palette,c=Oo(eC,o);return{root:[c.root,{width:320,pointerEvents:"none",selectors:(t={},t[jt]={border:"1px solid WindowText"},t)},a],compactCard:[c.compactCard,{pointerEvents:"auto",position:"relative",height:i}],expandedCard:[c.expandedCard,{height:1,overflowY:"hidden",pointerEvents:"auto",transition:"height 0.467s cubic-bezier(0.5, 0, 0, 1)",selectors:{":before":{content:'""',position:"relative",display:"block",top:0,left:24,width:272,height:1,backgroundColor:l.neutralLighter}}},r&&{height:s}],expandedCardScroll:[c.expandedCardScroll,n&&{height:"100%",boxSizing:"border-box",overflowY:"auto"}]}}),void 0,{scope:"ExpandingCard"}),iC={root:"ms-PlainCard-root"};var sC=Mn(),aC=function(e){function t(t){var o=e.call(this,t)||this;return o._onKeyDown=function(e){e.which===wn.escape&&o.props.onLeave&&o.props.onLeave(e)},si(o),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme,n=e.className;this._classNames=sC(t,{theme:o,className:n});var r=b.createElement("div",{onMouseEnter:this.props.onEnter,onMouseLeave:this.props.onLeave,onKeyDown:this._onKeyDown},this.props.onRenderPlainCard(this.props.renderData));return b.createElement(tC,h({},this.props,{content:r,className:this._classNames.root}))},t}(b.Component),lC=xn(aC,(function(e){var t,o=e.theme,n=e.className;return{root:[Oo(iC,o).root,{pointerEvents:"auto",selectors:(t={},t[jt]={border:"1px solid WindowText"},t)},n]}}),void 0,{scope:"PlainCard"}),cC=Mn(),uC=function(e){function t(t){var o=e.call(this,t)||this;return o._hoverCard=b.createRef(),o.dismiss=function(e){o._async.clearTimeout(o._openTimerId),o._async.clearTimeout(o._dismissTimerId),e?o._dismissTimerId=o._async.setTimeout((function(){o._setDismissedState()}),o.props.cardDismissDelay):o._setDismissedState()},o._cardOpen=function(e){o._shouldBlockHoverCard()||"keydown"===e.type&&e.which!==o.props.openHotKey||(o._async.clearTimeout(o._dismissTimerId),"mouseenter"===e.type&&(o._currentMouseTarget=e.currentTarget),o._executeCardOpen(e))},o._executeCardOpen=function(e){o._async.clearTimeout(o._openTimerId),o._openTimerId=o._async.setTimeout((function(){o.setState((function(t){return t.isHoverCardVisible?t:{isHoverCardVisible:!0,mode:$y.compact,openMode:"keydown"===e.type?Xy.hotKey:Xy.hover}}))}),o.props.cardOpenDelay)},o._cardDismiss=function(e,t){if(e){if(!(t instanceof MouseEvent))return;if("keydown"===t.type&&t.which!==wn.escape)return;o.props.sticky||o._currentMouseTarget!==t.currentTarget&&t.which!==wn.escape||o.dismiss(!0)}else{if(o.props.sticky&&!(t instanceof MouseEvent)&&t.nativeEvent instanceof MouseEvent&&"mouseleave"===t.type)return;o.dismiss(!0)}},o._setDismissedState=function(){o.setState({isHoverCardVisible:!1,mode:$y.compact,openMode:Xy.hover})},o._instantOpenAsExpanded=function(e){o._async.clearTimeout(o._dismissTimerId),o.setState((function(e){return e.isHoverCardVisible?e:{isHoverCardVisible:!0,mode:$y.expanded}}))},o._setEventListeners=function(){var e=o.props,t=e.trapFocus,n=e.instantOpenOnClick,r=e.eventListenerTarget,i=r?o._getTargetElement(r):o._getTargetElement(o.props.target),s=o._nativeDismissEvent;i&&(o._events.on(i,"mouseenter",o._cardOpen),o._events.on(i,"mouseleave",s),t?o._events.on(i,"keydown",o._cardOpen):(o._events.on(i,"focus",o._cardOpen),o._events.on(i,"blur",s)),n?o._events.on(i,"click",o._instantOpenAsExpanded):(o._events.on(i,"mousedown",s),o._events.on(i,"keydown",s)))},si(o),o._async=new di(o),o._events=new Ws(o),o._nativeDismissEvent=o._cardDismiss.bind(o,!0),o._childDismissEvent=o._cardDismiss.bind(o,!1),o.state={isHoverCardVisible:!1,mode:$y.compact,openMode:Xy.hover},o}return p(t,e),t.prototype.componentDidMount=function(){this._setEventListeners()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.componentDidUpdate=function(e,t){var o=this;e.target!==this.props.target&&(this._events.off(),this._setEventListeners()),t.isHoverCardVisible!==this.state.isHoverCardVisible&&(this.state.isHoverCardVisible?(this._async.setTimeout((function(){o.setState({mode:$y.expanded},(function(){o.props.onCardExpand&&o.props.onCardExpand()}))}),this.props.expandedCardOpenDelay),this.props.onCardVisible&&this.props.onCardVisible()):(this.setState({mode:$y.compact}),this.props.onCardHide&&this.props.onCardHide()))},t.prototype.render=function(){var e=this.props,t=e.expandingCardProps,o=e.children,n=e.id,r=e.setAriaDescribedBy,i=void 0===r||r,s=e.styles,a=e.theme,l=e.className,c=e.type,u=e.plainCardProps,d=e.trapFocus,p=e.setInitialFocus,m=this.state,g=m.isHoverCardVisible,f=m.mode,v=m.openMode,_=n||ts("hoverCard");this._classNames=cC(s,{theme:a,className:l});var y=h(h({},fr(this.props,gr)),{id:_,trapFocus:!!d,firstFocus:p||v===Xy.hotKey,targetElement:this._getTargetElement(this.props.target),onEnter:this._cardOpen,onLeave:this._childDismissEvent}),C=h(h(h({},t),y),{mode:f}),S=h(h({},u),y);return b.createElement("div",{className:this._classNames.host,ref:this._hoverCard,"aria-describedby":i&&g?_:void 0,"data-is-focusable":!this.props.target},o,g&&(c===Qy.expanding?b.createElement(rC,h({},C)):b.createElement(lC,h({},S))))},t.prototype._getTargetElement=function(e){switch(typeof e){case"string":return tt().querySelector(e);case"object":return e;default:return this._hoverCard.current||void 0}},t.prototype._shouldBlockHoverCard=function(){return!(!this.props.shouldBlockHoverCard||!this.props.shouldBlockHoverCard())},t.defaultProps={cardOpenDelay:500,cardDismissDelay:100,expandedCardOpenDelay:1500,instantOpenOnClick:!1,setInitialFocus:!1,openHotKey:wn.c,type:Qy.expanding},t}(b.Component),dC=xn(uC,(function(e){var t=e.className,o=e.theme;return{host:[Oo(Jy,o).host,t]}}),void 0,{scope:"HoverCard"});function pC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons"',src:"url('"+e+"fabric-icons-a13498cf.woff') format('woff')"},icons:{GlobalNavButton:"",ChevronDown:"",ChevronUp:"",Edit:"",Add:"",Cancel:"",More:"",Settings:"",Mail:"",Filter:"",Search:"",Share:"",BlockedSite:"",FavoriteStar:"",FavoriteStarFill:"",CheckMark:"",Delete:"",ChevronLeft:"",ChevronRight:"",Calendar:"",Megaphone:"",Undo:"",Flag:"",Page:"",Pinned:"",View:"",Clear:"",Download:"",Upload:"",Folder:"",Sort:"",AlignRight:"",AlignLeft:"",Tag:"",AddFriend:"",Info:"",SortLines:"",List:"",CircleRing:"",Heart:"",HeartFill:"",Tiles:"",Embed:"",Glimmer:"",Ascending:"",Descending:"",SortUp:"",SortDown:"",SyncToPC:"",LargeGrid:"",SkypeCheck:"",SkypeClock:"",SkypeMinus:"",ClearFilter:"",Flow:"",StatusCircleCheckmark:"",MoreVertical:""}},t)}function hC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-0"',src:"url('"+e+"fabric-icons-0-467ee27f.woff') format('woff')"},icons:{PageLink:"",CommentSolid:"",ChangeEntitlements:"",Installation:"",WebAppBuilderModule:"",WebAppBuilderFragment:"",WebAppBuilderSlot:"",BullseyeTargetEdit:"",WebAppBuilderFragmentCreate:"",PageData:"",PageHeaderEdit:"",ProductList:"",UnpublishContent:"",DependencyAdd:"",DependencyRemove:"",EntitlementPolicy:"",EntitlementRedemption:"",SchoolDataSyncLogo:"",PinSolid12:"",PinSolidOff12:"",AddLink:"",SharepointAppIcon16:"",DataflowsLink:"",TimePicker:"",UserWarning:"",ComplianceAudit:"",InternetSharing:"",Brightness:"",MapPin:"",Airplane:"",Tablet:"",QuickNote:"",Video:"",People:"",Phone:"",Pin:"",Shop:"",Stop:"",Link:"",AllApps:"",Zoom:"",ZoomOut:"",Microphone:"",Camera:"",Attach:"",Send:"",FavoriteList:"",PageSolid:"",Forward:"",Back:"",Refresh:"",Lock:"",ReportHacked:"",EMI:"",MiniLink:"",Blocked:"",ReadingMode:"",Favicon:"",Remove:"",Checkbox:"",CheckboxComposite:"",CheckboxFill:"",CheckboxIndeterminate:"",CheckboxCompositeReversed:"",BackToWindow:"",FullScreen:"",Print:"",Up:"",Down:"",OEM:"",Save:"",ReturnKey:"",Cloud:"",Flashlight:"",CommandPrompt:"",Sad:"",RealEstate:"",SIPMove:"",EraseTool:"",GripperTool:"",Dialpad:"",PageLeft:"",PageRight:"",MultiSelect:"",KeyboardClassic:"",Play:"",Pause:"",InkingTool:"",Emoji2:"",GripperBarHorizontal:"",System:"",Personalize:"",SearchAndApps:"",Globe:"",EaseOfAccess:"",ContactInfo:"",Unpin:"",Contact:"",Memo:"",IncomingCall:""}},t)}function mC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-1"',src:"url('"+e+"fabric-icons-1-4d521695.woff') format('woff')"},icons:{Paste:"",WindowsLogo:"",Error:"",GripperBarVertical:"",Unlock:"",Slideshow:"",Trim:"",AutoEnhanceOn:"",AutoEnhanceOff:"",Color:"",SaveAs:"",Light:"",Filters:"",AspectRatio:"",Contrast:"",Redo:"",Crop:"",PhotoCollection:"",Album:"",Rotate:"",PanoIndicator:"",Translate:"",RedEye:"",ViewOriginal:"",ThumbnailView:"",Package:"",Telemarketer:"",Warning:"",Financial:"",Education:"",ShoppingCart:"",Train:"",Move:"",TouchPointer:"",Merge:"",TurnRight:"",Ferry:"",Highlight:"",PowerButton:"",Tab:"",Admin:"",TVMonitor:"",Speakers:"",Game:"",HorizontalTabKey:"",UnstackSelected:"",StackIndicator:"",Nav2DMapView:"",StreetsideSplitMinimize:"",Car:"",Bus:"",EatDrink:"",SeeDo:"",LocationCircle:"",Home:"",SwitcherStartEnd:"",ParkingLocation:"",IncidentTriangle:"",Touch:"",MapDirections:"",CaretHollow:"",CaretSolid:"",History:"",Location:"",MapLayers:"",SearchNearby:"",Work:"",Recent:"",Hotel:"",Bank:"",LocationDot:"",Dictionary:"",ChromeBack:"",FolderOpen:"",PinnedFill:"",RevToggleKey:"",USB:"",Previous:"",Next:"",Sync:"",Help:"",Emoji:"",MailForward:"",ClosePane:"",OpenPane:"",PreviewLink:"",ZoomIn:"",Bookmarks:"",Document:"",ProtectedDocument:"",OpenInNewWindow:"",MailFill:"",ViewAll:"",Switch:"",Rename:"",Go:"",Remote:"",SelectAll:"",Orientation:"",Import:""}},t)}function gC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-2"',src:"url('"+e+"fabric-icons-2-63c99abf.woff') format('woff')"},icons:{Picture:"",ChromeClose:"",ShowResults:"",Message:"",CalendarDay:"",CalendarWeek:"",MailReplyAll:"",Read:"",Cut:"",PaymentCard:"",Copy:"",Important:"",MailReply:"",GotoToday:"",Font:"",FontColor:"",FolderFill:"",Permissions:"",DisableUpdates:"",Unfavorite:"",Italic:"",Underline:"",Bold:"",MoveToFolder:"",Dislike:"",Like:"",AlignCenter:"",OpenFile:"",ClearSelection:"",FontDecrease:"",FontIncrease:"",FontSize:"",CellPhone:"",RepeatOne:"",RepeatAll:"",Calculator:"",Library:"",PostUpdate:"",NewFolder:"",CalendarReply:"",UnsyncFolder:"",SyncFolder:"",BlockContact:"",Accept:"",BulletedList:"",Preview:"",News:"",Chat:"",Group:"",World:"",Comment:"",DockLeft:"",DockRight:"",Repair:"",Accounts:"",Street:"",RadioBullet:"",Stopwatch:"",Clock:"",WorldClock:"",AlarmClock:"",Photo:"",ActionCenter:"",Hospital:"",Timer:"",FullCircleMask:"",LocationFill:"",ChromeMinimize:"",ChromeRestore:"",Annotation:"",Fingerprint:"",Handwriting:"",ChromeFullScreen:"",Completed:"",Label:"",FlickDown:"",FlickUp:"",FlickLeft:"",FlickRight:"",MiniExpand:"",MiniContract:"",Streaming:"",MusicInCollection:"",OneDriveLogo:"",CompassNW:"",Code:"",LightningBolt:"",CalculatorMultiply:"",CalculatorAddition:"",CalculatorSubtract:"",CalculatorPercentage:"",CalculatorEqualTo:"",PrintfaxPrinterFile:"",StorageOptical:"",Communications:"",Headset:"",Health:"",Webcam2:"",FrontCamera:"",ChevronUpSmall:""}},t)}function fC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-3"',src:"url('"+e+"fabric-icons-3-089e217a.woff') format('woff')"},icons:{ChevronDownSmall:"",ChevronLeftSmall:"",ChevronRightSmall:"",ChevronUpMed:"",ChevronDownMed:"",ChevronLeftMed:"",ChevronRightMed:"",Devices2:"",PC1:"",PresenceChickletVideo:"",Reply:"",HalfAlpha:"",ConstructionCone:"",DoubleChevronLeftMed:"",Volume0:"",Volume1:"",Volume2:"",Volume3:"",Chart:"",Robot:"",Manufacturing:"",LockSolid:"",FitPage:"",FitWidth:"",BidiLtr:"",BidiRtl:"",RightDoubleQuote:"",Sunny:"",CloudWeather:"",Cloudy:"",PartlyCloudyDay:"",PartlyCloudyNight:"",ClearNight:"",RainShowersDay:"",Rain:"",Thunderstorms:"",RainSnow:"",Snow:"",BlowingSnow:"",Frigid:"",Fog:"",Squalls:"",Duststorm:"",Unknown:"",Precipitation:"",Ribbon:"",AreaChart:"",Assign:"",FlowChart:"",CheckList:"",Diagnostic:"",Generate:"",LineChart:"",Equalizer:"",BarChartHorizontal:"",BarChartVertical:"",Freezing:"",FunnelChart:"",Processing:"",Quantity:"",ReportDocument:"",StackColumnChart:"",SnowShowerDay:"",HailDay:"",WorkFlow:"",HourGlass:"",StoreLogoMed20:"",TimeSheet:"",TriangleSolid:"",UpgradeAnalysis:"",VideoSolid:"",RainShowersNight:"",SnowShowerNight:"",Teamwork:"",HailNight:"",PeopleAdd:"",Glasses:"",DateTime2:"",Shield:"",Header1:"",PageAdd:"",NumberedList:"",PowerBILogo:"",Info2:"",MusicInCollectionFill:"",Asterisk:"",ErrorBadge:"",CircleFill:"",Record2:"",AllAppsMirrored:"",BookmarksMirrored:"",BulletedListMirrored:"",CaretHollowMirrored:"",CaretSolidMirrored:"",ChromeBackMirrored:"",ClearSelectionMirrored:"",ClosePaneMirrored:"",DockLeftMirrored:"",DoubleChevronLeftMedMirrored:"",GoMirrored:""}},t)}function vC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-4"',src:"url('"+e+"fabric-icons-4-a656cc0a.woff') format('woff')"},icons:{HelpMirrored:"",ImportMirrored:"",ImportAllMirrored:"",ListMirrored:"",MailForwardMirrored:"",MailReplyMirrored:"",MailReplyAllMirrored:"",MiniContractMirrored:"",MiniExpandMirrored:"",OpenPaneMirrored:"",ParkingLocationMirrored:"",SendMirrored:"",ShowResultsMirrored:"",ThumbnailViewMirrored:"",Media:"",Devices3:"",Focus:"",VideoLightOff:"",Lightbulb:"",StatusTriangle:"",VolumeDisabled:"",Puzzle:"",EmojiNeutral:"",EmojiDisappointed:"",HomeSolid:"",Ringer:"",PDF:"",HeartBroken:"",StoreLogo16:"",MultiSelectMirrored:"",Broom:"",AddToShoppingList:"",Cocktails:"",Wines:"",Articles:"",Cycling:"",DietPlanNotebook:"",Pill:"",ExerciseTracker:"",HandsFree:"",Medical:"",Running:"",Weights:"",Trackers:"",AddNotes:"",AllCurrency:"",BarChart4:"",CirclePlus:"",Coffee:"",Cotton:"",Market:"",Money:"",PieDouble:"",PieSingle:"",RemoveFilter:"",Savings:"",Sell:"",StockDown:"",StockUp:"",Lamp:"",Source:"",MSNVideos:"",Cricket:"",Golf:"",Baseball:"",Soccer:"",MoreSports:"",AutoRacing:"",CollegeHoops:"",CollegeFootball:"",ProFootball:"",ProHockey:"",Rugby:"",SubstitutionsIn:"",Tennis:"",Arrivals:"",Design:"",Website:"",Drop:"",HistoricalWeather:"",SkiResorts:"",Snowflake:"",BusSolid:"",FerrySolid:"",AirplaneSolid:"",TrainSolid:"",Ticket:"",WifiWarning4:"",Devices4:"",AzureLogo:"",BingLogo:"",MSNLogo:"",OutlookLogoInverse:"",OfficeLogo:"",SkypeLogo:"",Door:"",EditMirrored:"",GiftCard:"",DoubleBookmark:"",StatusErrorFull:""}},t)}function bC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-5"',src:"url('"+e+"fabric-icons-5-f95ba260.woff') format('woff')"},icons:{Certificate:"",FastForward:"",Rewind:"",Photo2:"",OpenSource:"",Movers:"",CloudDownload:"",Family:"",WindDirection:"",Bug:"",SiteScan:"",BrowserScreenShot:"",F12DevTools:"",CSS:"",JS:"",DeliveryTruck:"",ReminderPerson:"",ReminderGroup:"",ReminderTime:"",TabletMode:"",Umbrella:"",NetworkTower:"",CityNext:"",CityNext2:"",Section:"",OneNoteLogoInverse:"",ToggleFilled:"",ToggleBorder:"",SliderThumb:"",ToggleThumb:"",Documentation:"",Badge:"",Giftbox:"",VisualStudioLogo:"",HomeGroup:"",ExcelLogoInverse:"",WordLogoInverse:"",PowerPointLogoInverse:"",Cafe:"",SpeedHigh:"",Commitments:"",ThisPC:"",MusicNote:"",MicOff:"",PlaybackRate1x:"",EdgeLogo:"",CompletedSolid:"",AlbumRemove:"",MessageFill:"",TabletSelected:"",MobileSelected:"",LaptopSelected:"",TVMonitorSelected:"",DeveloperTools:"",Shapes:"",InsertTextBox:"",LowerBrightness:"",WebComponents:"",OfflineStorage:"",DOM:"",CloudUpload:"",ScrollUpDown:"",DateTime:"",Event:"",Cake:"",Org:"",PartyLeader:"",DRM:"",CloudAdd:"",AppIconDefault:"",Photo2Add:"",Photo2Remove:"",Calories:"",POI:"",AddTo:"",RadioBtnOff:"",RadioBtnOn:"",ExploreContent:"",Product:"",ProgressLoopInner:"",ProgressLoopOuter:"",Blocked2:"",FangBody:"",Toolbox:"",PageHeader:"",ChatInviteFriend:"",Brush:"",Shirt:"",Crown:"",Diamond:"",ScaleUp:"",QRCode:"",Feedback:"",SharepointLogoInverse:"",YammerLogo:"",Hide:"",Uneditable:"",ReturnToSession:"",OpenFolderHorizontal:"",CalendarMirrored:""}},t)}function _C(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-6"',src:"url('"+e+"fabric-icons-6-ef6fd590.woff') format('woff')"},icons:{SwayLogoInverse:"",OutOfOffice:"",Trophy:"",ReopenPages:"",EmojiTabSymbols:"",AADLogo:"",AccessLogo:"",AdminALogoInverse32:"",AdminCLogoInverse32:"",AdminDLogoInverse32:"",AdminELogoInverse32:"",AdminLLogoInverse32:"",AdminMLogoInverse32:"",AdminOLogoInverse32:"",AdminPLogoInverse32:"",AdminSLogoInverse32:"",AdminYLogoInverse32:"",DelveLogoInverse:"",ExchangeLogoInverse:"",LyncLogo:"",OfficeVideoLogoInverse:"",SocialListeningLogo:"",VisioLogoInverse:"",Balloons:"",Cat:"",MailAlert:"",MailCheck:"",MailLowImportance:"",MailPause:"",MailRepeat:"",SecurityGroup:"",Table:"",VoicemailForward:"",VoicemailReply:"",Waffle:"",RemoveEvent:"",EventInfo:"",ForwardEvent:"",WipePhone:"",AddOnlineMeeting:"",JoinOnlineMeeting:"",RemoveLink:"",PeopleBlock:"",PeopleRepeat:"",PeopleAlert:"",PeoplePause:"",TransferCall:"",AddPhone:"",UnknownCall:"",NoteReply:"",NoteForward:"",NotePinned:"",RemoveOccurrence:"",Timeline:"",EditNote:"",CircleHalfFull:"",Room:"",Unsubscribe:"",Subscribe:"",HardDrive:"",RecurringTask:"",TaskManager:"",TaskManagerMirrored:"",Combine:"",Split:"",DoubleChevronUp:"",DoubleChevronLeft:"",DoubleChevronRight:"",TextBox:"",TextField:"",NumberField:"",Dropdown:"",PenWorkspace:"",BookingsLogo:"",ClassNotebookLogoInverse:"",DelveAnalyticsLogo:"",DocsLogoInverse:"",Dynamics365Logo:"",DynamicSMBLogo:"",OfficeAssistantLogo:"",OfficeStoreLogo:"",OneNoteEduLogoInverse:"",PlannerLogo:"",PowerApps:"",Suitcase:"",ProjectLogoInverse:"",CaretLeft8:"",CaretRight8:"",CaretUp8:"",CaretDown8:"",CaretLeftSolid8:"",CaretRightSolid8:"",CaretUpSolid8:"",CaretDownSolid8:"",ClearFormatting:"",Superscript:"",Subscript:"",Strikethrough:"",Export:"",ExportMirrored:""}},t)}function yC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-7"',src:"url('"+e+"fabric-icons-7-2b97bb99.woff') format('woff')"},icons:{SingleBookmark:"",SingleBookmarkSolid:"",DoubleChevronDown:"",FollowUser:"",ReplyAll:"",WorkforceManagement:"",RecruitmentManagement:"",Questionnaire:"",ManagerSelfService:"",ProductionFloorManagement:"",ProductRelease:"",ProductVariant:"",ReplyMirrored:"",ReplyAllMirrored:"",Medal:"",AddGroup:"",QuestionnaireMirrored:"",CloudImportExport:"",TemporaryUser:"",CaretSolid16:"",GroupedDescending:"",GroupedAscending:"",AwayStatus:"",MyMoviesTV:"",GenericScan:"",AustralianRules:"",WifiEthernet:"",TrackersMirrored:"",DateTimeMirrored:"",StopSolid:"",DoubleChevronUp12:"",DoubleChevronDown12:"",DoubleChevronLeft12:"",DoubleChevronRight12:"",CalendarAgenda:"",ConnectVirtualMachine:"",AddEvent:"",AssetLibrary:"",DataConnectionLibrary:"",DocLibrary:"",FormLibrary:"",FormLibraryMirrored:"",ReportLibrary:"",ReportLibraryMirrored:"",ContactCard:"",CustomList:"",CustomListMirrored:"",IssueTracking:"",IssueTrackingMirrored:"",PictureLibrary:"",OfficeAddinsLogo:"",OfflineOneDriveParachute:"",OfflineOneDriveParachuteDisabled:"",TriangleSolidUp12:"",TriangleSolidDown12:"",TriangleSolidLeft12:"",TriangleSolidRight12:"",TriangleUp12:"",TriangleDown12:"",TriangleLeft12:"",TriangleRight12:"",ArrowUpRight8:"",ArrowDownRight8:"",DocumentSet:"",GoToDashboard:"",DelveAnalytics:"",ArrowUpRightMirrored8:"",ArrowDownRightMirrored8:"",CompanyDirectory:"",OpenEnrollment:"",CompanyDirectoryMirrored:"",OneDriveAdd:"",ProfileSearch:"",Header2:"",Header3:"",Header4:"",RingerSolid:"",Eyedropper:"",MarketDown:"",CalendarWorkWeek:"",SidePanel:"",GlobeFavorite:"",CaretTopLeftSolid8:"",CaretTopRightSolid8:"",ViewAll2:"",DocumentReply:"",PlayerSettings:"",ReceiptForward:"",ReceiptReply:"",ReceiptCheck:"",Fax:"",RecurringEvent:"",ReplyAlt:"",ReplyAllAlt:"",EditStyle:"",EditMail:"",Lifesaver:"",LifesaverLock:"",InboxCheck:"",FolderSearch:""}},t)}function CC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-8"',src:"url('"+e+"fabric-icons-8-6fdf1528.woff') format('woff')"},icons:{CollapseMenu:"",ExpandMenu:"",Boards:"",SunAdd:"",SunQuestionMark:"",LandscapeOrientation:"",DocumentSearch:"",PublicCalendar:"",PublicContactCard:"",PublicEmail:"",PublicFolder:"",WordDocument:"",PowerPointDocument:"",ExcelDocument:"",GroupedList:"",ClassroomLogo:"",Sections:"",EditPhoto:"",Starburst:"",ShareiOS:"",AirTickets:"",PencilReply:"",Tiles2:"",SkypeCircleCheck:"",SkypeCircleClock:"",SkypeCircleMinus:"",SkypeMessage:"",ClosedCaption:"",ATPLogo:"",OfficeFormsLogoInverse:"",RecycleBin:"",EmptyRecycleBin:"",Hide2:"",Breadcrumb:"",BirthdayCake:"",TimeEntry:"",CRMProcesses:"",PageEdit:"",PageArrowRight:"",PageRemove:"",Database:"",DataManagementSettings:"",CRMServices:"",EditContact:"",ConnectContacts:"",AppIconDefaultAdd:"",AppIconDefaultList:"",ActivateOrders:"",DeactivateOrders:"",ProductCatalog:"",ScatterChart:"",AccountActivity:"",DocumentManagement:"",CRMReport:"",KnowledgeArticle:"",Relationship:"",HomeVerify:"",ZipFolder:"",SurveyQuestions:"",TextDocument:"",TextDocumentShared:"",PageCheckedOut:"",PageShared:"",SaveAndClose:"",Script:"",Archive:"",ActivityFeed:"",Compare:"",EventDate:"",ArrowUpRight:"",CaretRight:"",SetAction:"",ChatBot:"",CaretSolidLeft:"",CaretSolidDown:"",CaretSolidRight:"",CaretSolidUp:"",PowerAppsLogo:"",PowerApps2Logo:"",SearchIssue:"",SearchIssueMirrored:"",FabricAssetLibrary:"",FabricDataConnectionLibrary:"",FabricDocLibrary:"",FabricFormLibrary:"",FabricFormLibraryMirrored:"",FabricReportLibrary:"",FabricReportLibraryMirrored:"",FabricPublicFolder:"",FabricFolderSearch:"",FabricMovetoFolder:"",FabricUnsyncFolder:"",FabricSyncFolder:"",FabricOpenFolderHorizontal:"",FabricFolder:"",FabricFolderFill:"",FabricNewFolder:"",FabricPictureLibrary:"",PhotoVideoMedia:"",AddFavorite:""}},t)}function SC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-9"',src:"url('"+e+"fabric-icons-9-c6162b42.woff') format('woff')"},icons:{AddFavoriteFill:"",BufferTimeBefore:"",BufferTimeAfter:"",BufferTimeBoth:"",PublishContent:"",ClipboardList:"",ClipboardListMirrored:"",CannedChat:"",SkypeForBusinessLogo:"",TabCenter:"",PageCheckedin:"",PageList:"",ReadOutLoud:"",CaretBottomLeftSolid8:"",CaretBottomRightSolid8:"",FolderHorizontal:"",MicrosoftStaffhubLogo:"",GiftboxOpen:"",StatusCircleOuter:"",StatusCircleInner:"",StatusCircleRing:"",StatusTriangleOuter:"",StatusTriangleInner:"",StatusTriangleExclamation:"",StatusCircleExclamation:"",StatusCircleErrorX:"",StatusCircleInfo:"",StatusCircleBlock:"",StatusCircleBlock2:"",StatusCircleQuestionMark:"",StatusCircleSync:"",Toll:"",ExploreContentSingle:"",CollapseContent:"",CollapseContentSingle:"",InfoSolid:"",GroupList:"",ProgressRingDots:"",CaloriesAdd:"",BranchFork:"",MuteChat:"",AddHome:"",AddWork:"",MobileReport:"",ScaleVolume:"",HardDriveGroup:"",FastMode:"",ToggleLeft:"",ToggleRight:"",TriangleShape:"",RectangleShape:"",CubeShape:"",Trophy2:"",BucketColor:"",BucketColorFill:"",Taskboard:"",SingleColumn:"",DoubleColumn:"",TripleColumn:"",ColumnLeftTwoThirds:"",ColumnRightTwoThirds:"",AccessLogoFill:"",AnalyticsLogo:"",AnalyticsQuery:"",NewAnalyticsQuery:"",AnalyticsReport:"",WordLogo:"",WordLogoFill:"",ExcelLogo:"",ExcelLogoFill:"",OneNoteLogo:"",OneNoteLogoFill:"",OutlookLogo:"",OutlookLogoFill:"",PowerPointLogo:"",PowerPointLogoFill:"",PublisherLogo:"",PublisherLogoFill:"",ScheduleEventAction:"",FlameSolid:"",ServerProcesses:"",Server:"",SaveAll:"",LinkedInLogo:"",Decimals:"",SidePanelMirrored:"",ProtectRestrict:"",Blog:"",UnknownMirrored:"",PublicContactCardMirrored:"",GridViewSmall:"",GridViewMedium:"",GridViewLarge:"",Step:"",StepInsert:"",StepShared:"",StepSharedAdd:"",StepSharedInsert:"",ViewDashboard:"",ViewList:""}},t)}function xC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-10"',src:"url('"+e+"fabric-icons-10-c4ded8e4.woff') format('woff')"},icons:{ViewListGroup:"",ViewListTree:"",TriggerAuto:"",TriggerUser:"",PivotChart:"",StackedBarChart:"",StackedLineChart:"",BuildQueue:"",BuildQueueNew:"",UserFollowed:"",ContactLink:"",Stack:"",Bullseye:"",VennDiagram:"",FiveTileGrid:"",FocalPoint:"",Insert:"",RingerRemove:"",TeamsLogoInverse:"",TeamsLogo:"",TeamsLogoFill:"",SkypeForBusinessLogoFill:"",SharepointLogo:"",SharepointLogoFill:"",DelveLogo:"",DelveLogoFill:"",OfficeVideoLogo:"",OfficeVideoLogoFill:"",ExchangeLogo:"",ExchangeLogoFill:"",Signin:"",DocumentApproval:"",CloneToDesktop:"",InstallToDrive:"",Blur:"",Build:"",ProcessMetaTask:"",BranchFork2:"",BranchLocked:"",BranchCommit:"",BranchCompare:"",BranchMerge:"",BranchPullRequest:"",BranchSearch:"",BranchShelveset:"",RawSource:"",MergeDuplicate:"",RowsGroup:"",RowsChild:"",Deploy:"",Redeploy:"",ServerEnviroment:"",VisioDiagram:"",HighlightMappedShapes:"",TextCallout:"",IconSetsFlag:"",VisioLogo:"",VisioLogoFill:"",VisioDocument:"",TimelineProgress:"",TimelineDelivery:"",Backlog:"",TeamFavorite:"",TaskGroup:"",TaskGroupMirrored:"",ScopeTemplate:"",AssessmentGroupTemplate:"",NewTeamProject:"",CommentAdd:"",CommentNext:"",CommentPrevious:"",ShopServer:"",LocaleLanguage:"",QueryList:"",UserSync:"",UserPause:"",StreamingOff:"",ArrowTallUpLeft:"",ArrowTallUpRight:"",ArrowTallDownLeft:"",ArrowTallDownRight:"",FieldEmpty:"",FieldFilled:"",FieldChanged:"",FieldNotChanged:"",RingerOff:"",PlayResume:"",BulletedList2:"",BulletedList2Mirrored:"",ImageCrosshair:"",GitGraph:"",Repo:"",RepoSolid:"",FolderQuery:"",FolderList:"",FolderListMirrored:"",LocationOutline:"",POISolid:"",CalculatorNotEqualTo:"",BoxSubtractSolid:""}},t)}function kC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-11"',src:"url('"+e+"fabric-icons-11-2a8393d6.woff') format('woff')"},icons:{BoxAdditionSolid:"",BoxMultiplySolid:"",BoxPlaySolid:"",BoxCheckmarkSolid:"",CirclePauseSolid:"",CirclePause:"",MSNVideosSolid:"",CircleStopSolid:"",CircleStop:"",NavigateBack:"",NavigateBackMirrored:"",NavigateForward:"",NavigateForwardMirrored:"",UnknownSolid:"",UnknownMirroredSolid:"",CircleAddition:"",CircleAdditionSolid:"",FilePDB:"",FileTemplate:"",FileSQL:"",FileJAVA:"",FileASPX:"",FileCSS:"",FileSass:"",FileLess:"",FileHTML:"",JavaScriptLanguage:"",CSharpLanguage:"",CSharp:"",VisualBasicLanguage:"",VB:"",CPlusPlusLanguage:"",CPlusPlus:"",FSharpLanguage:"",FSharp:"",TypeScriptLanguage:"",PythonLanguage:"",PY:"",CoffeeScript:"",MarkDownLanguage:"",FullWidth:"",FullWidthEdit:"",Plug:"",PlugSolid:"",PlugConnected:"",PlugDisconnected:"",UnlockSolid:"",Variable:"",Parameter:"",CommentUrgent:"",Storyboard:"",DiffInline:"",DiffSideBySide:"",ImageDiff:"",ImagePixel:"",FileBug:"",FileCode:"",FileComment:"",BusinessHoursSign:"",FileImage:"",FileSymlink:"",AutoFillTemplate:"",WorkItem:"",WorkItemBug:"",LogRemove:"",ColumnOptions:"",Packages:"",BuildIssue:"",AssessmentGroup:"",VariableGroup:"",FullHistory:"",Wheelchair:"",SingleColumnEdit:"",DoubleColumnEdit:"",TripleColumnEdit:"",ColumnLeftTwoThirdsEdit:"",ColumnRightTwoThirdsEdit:"",StreamLogo:"",PassiveAuthentication:"",AlertSolid:"",MegaphoneSolid:"",TaskSolid:"",ConfigurationSolid:"",BugSolid:"",CrownSolid:"",Trophy2Solid:"",QuickNoteSolid:"",ConstructionConeSolid:"",PageListSolid:"",PageListMirroredSolid:"",StarburstSolid:"",ReadingModeSolid:"",SadSolid:"",HealthSolid:"",ShieldSolid:"",GiftBoxSolid:"",ShoppingCartSolid:"",MailSolid:"",ChatSolid:"",RibbonSolid:""}},t)}function wC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-12"',src:"url('"+e+"fabric-icons-12-7e945a1e.woff') format('woff')"},icons:{FinancialSolid:"",FinancialMirroredSolid:"",HeadsetSolid:"",PermissionsSolid:"",ParkingSolid:"",ParkingMirroredSolid:"",DiamondSolid:"",AsteriskSolid:"",OfflineStorageSolid:"",BankSolid:"",DecisionSolid:"",Parachute:"",ParachuteSolid:"",FiltersSolid:"",ColorSolid:"",ReviewSolid:"",ReviewRequestSolid:"",ReviewRequestMirroredSolid:"",ReviewResponseSolid:"",FeedbackRequestSolid:"",FeedbackRequestMirroredSolid:"",FeedbackResponseSolid:"",WorkItemBar:"",WorkItemBarSolid:"",Separator:"",NavigateExternalInline:"",PlanView:"",TimelineMatrixView:"",EngineeringGroup:"",ProjectCollection:"",CaretBottomRightCenter8:"",CaretBottomLeftCenter8:"",CaretTopRightCenter8:"",CaretTopLeftCenter8:"",DonutChart:"",ChevronUnfold10:"",ChevronFold10:"",DoubleChevronDown8:"",DoubleChevronUp8:"",DoubleChevronLeft8:"",DoubleChevronRight8:"",ChevronDownEnd6:"",ChevronUpEnd6:"",ChevronLeftEnd6:"",ChevronRightEnd6:"",ContextMenu:"",AzureAPIManagement:"",AzureServiceEndpoint:"",VSTSLogo:"",VSTSAltLogo1:"",VSTSAltLogo2:"",FileTypeSolution:"",WordLogoInverse16:"",WordLogo16:"",WordLogoFill16:"",PowerPointLogoInverse16:"",PowerPointLogo16:"",PowerPointLogoFill16:"",ExcelLogoInverse16:"",ExcelLogo16:"",ExcelLogoFill16:"",OneNoteLogoInverse16:"",OneNoteLogo16:"",OneNoteLogoFill16:"",OutlookLogoInverse16:"",OutlookLogo16:"",OutlookLogoFill16:"",PublisherLogoInverse16:"",PublisherLogo16:"",PublisherLogoFill16:"",VisioLogoInverse16:"",VisioLogo16:"",VisioLogoFill16:"",TestBeaker:"",TestBeakerSolid:"",TestExploreSolid:"",TestAutoSolid:"",TestUserSolid:"",TestImpactSolid:"",TestPlan:"",TestStep:"",TestParameter:"",TestSuite:"",TestCase:"",Sprint:"",SignOut:"",TriggerApproval:"",Rocket:"",AzureKeyVault:"",Onboarding:"",Transition:"",LikeSolid:"",DislikeSolid:"",CRMCustomerInsightsApp:"",EditCreate:"",PlayReverseResume:"",PlayReverse:"",SearchData:"",UnSetColor:"",DeclineCall:""}},t)}function IC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-13"',src:"url('"+e+"fabric-icons-13-c3989a02.woff') format('woff')"},icons:{RectangularClipping:"",TeamsLogo16:"",TeamsLogoFill16:"",Spacer:"",SkypeLogo16:"",SkypeForBusinessLogo16:"",SkypeForBusinessLogoFill16:"",FilterSolid:"",MailUndelivered:"",MailTentative:"",MailTentativeMirrored:"",MailReminder:"",ReceiptUndelivered:"",ReceiptTentative:"",ReceiptTentativeMirrored:"",Inbox:"",IRMReply:"",IRMReplyMirrored:"",IRMForward:"",IRMForwardMirrored:"",VoicemailIRM:"",EventAccepted:"",EventTentative:"",EventTentativeMirrored:"",EventDeclined:"",IDBadge:"",BackgroundColor:"",OfficeFormsLogoInverse16:"",OfficeFormsLogo:"",OfficeFormsLogoFill:"",OfficeFormsLogo16:"",OfficeFormsLogoFill16:"",OfficeFormsLogoInverse24:"",OfficeFormsLogo24:"",OfficeFormsLogoFill24:"",PageLock:"",NotExecuted:"",NotImpactedSolid:"",FieldReadOnly:"",FieldRequired:"",BacklogBoard:"",ExternalBuild:"",ExternalTFVC:"",ExternalXAML:"",IssueSolid:"",DefectSolid:"",LadybugSolid:"",NugetLogo:"",TFVCLogo:"",ProjectLogo32:"",ProjectLogoFill32:"",ProjectLogo16:"",ProjectLogoFill16:"",SwayLogo32:"",SwayLogoFill32:"",SwayLogo16:"",SwayLogoFill16:"",ClassNotebookLogo32:"",ClassNotebookLogoFill32:"",ClassNotebookLogo16:"",ClassNotebookLogoFill16:"",ClassNotebookLogoInverse32:"",ClassNotebookLogoInverse16:"",StaffNotebookLogo32:"",StaffNotebookLogoFill32:"",StaffNotebookLogo16:"",StaffNotebookLogoFill16:"",StaffNotebookLogoInverted32:"",StaffNotebookLogoInverted16:"",KaizalaLogo:"",TaskLogo:"",ProtectionCenterLogo32:"",GallatinLogo:"",Globe2:"",Guitar:"",Breakfast:"",Brunch:"",BeerMug:"",Vacation:"",Teeth:"",Taxi:"",Chopsticks:"",SyncOccurence:"",UnsyncOccurence:"",GIF:"",PrimaryCalendar:"",SearchCalendar:"",VideoOff:"",MicrosoftFlowLogo:"",BusinessCenterLogo:"",ToDoLogoBottom:"",ToDoLogoTop:"",EditSolid12:"",EditSolidMirrored12:"",UneditableSolid12:"",UneditableSolidMirrored12:"",UneditableMirrored:"",AdminALogo32:"",AdminALogoFill32:"",ToDoLogoInverse:""}},t)}function DC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-14"',src:"url('"+e+"fabric-icons-14-5cf58db8.woff') format('woff')"},icons:{Snooze:"",WaffleOffice365:"",ImageSearch:"",NewsSearch:"",VideoSearch:"",R:"",FontColorA:"",FontColorSwatch:"",LightWeight:"",NormalWeight:"",SemiboldWeight:"",GroupObject:"",UngroupObject:"",AlignHorizontalLeft:"",AlignHorizontalCenter:"",AlignHorizontalRight:"",AlignVerticalTop:"",AlignVerticalCenter:"",AlignVerticalBottom:"",HorizontalDistributeCenter:"",VerticalDistributeCenter:"",Ellipse:"",Line:"",Octagon:"",Hexagon:"",Pentagon:"",RightTriangle:"",HalfCircle:"",QuarterCircle:"",ThreeQuarterCircle:"","6PointStar":"","12PointStar":"",ArrangeBringToFront:"",ArrangeSendToBack:"",ArrangeSendBackward:"",ArrangeBringForward:"",BorderDash:"",BorderDot:"",LineStyle:"",LineThickness:"",WindowEdit:"",HintText:"",MediaAdd:"",AnchorLock:"",AutoHeight:"",ChartSeries:"",ChartXAngle:"",ChartYAngle:"",Combobox:"",LineSpacing:"",Padding:"",PaddingTop:"",PaddingBottom:"",PaddingLeft:"",PaddingRight:"",NavigationFlipper:"",AlignJustify:"",TextOverflow:"",VisualsFolder:"",VisualsStore:"",PictureCenter:"",PictureFill:"",PicturePosition:"",PictureStretch:"",PictureTile:"",Slider:"",SliderHandleSize:"",DefaultRatio:"",NumberSequence:"",GUID:"",ReportAdd:"",DashboardAdd:"",MapPinSolid:"",WebPublish:"",PieSingleSolid:"",BlockedSolid:"",DrillDown:"",DrillDownSolid:"",DrillExpand:"",DrillShow:"",SpecialEvent:"",OneDriveFolder16:"",FunctionalManagerDashboard:"",BIDashboard:"",CodeEdit:"",RenewalCurrent:"",RenewalFuture:"",SplitObject:"",BulkUpload:"",DownloadDocument:"",GreetingCard:"",Flower:"",WaitlistConfirm:"",WaitlistConfirmMirrored:"",LaptopSecure:"",DragObject:"",EntryView:"",EntryDecline:"",ContactCardSettings:"",ContactCardSettingsMirrored:""}},t)}function PC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-15"',src:"url('"+e+"fabric-icons-15-3807251b.woff') format('woff')"},icons:{CalendarSettings:"",CalendarSettingsMirrored:"",HardDriveLock:"",HardDriveUnlock:"",AccountManagement:"",ReportWarning:"",TransitionPop:"",TransitionPush:"",TransitionEffect:"",LookupEntities:"",ExploreData:"",AddBookmark:"",SearchBookmark:"",DrillThrough:"",MasterDatabase:"",CertifiedDatabase:"",MaximumValue:"",MinimumValue:"",VisualStudioIDELogo32:"",PasteAsText:"",PasteAsCode:"",BrowserTab:"",BrowserTabScreenshot:"",DesktopScreenshot:"",FileYML:"",ClipboardSolid:"",FabricUserFolder:"",FabricNetworkFolder:"",BullseyeTarget:"",AnalyticsView:"",Video360Generic:"",Untag:"",Leave:"",Trending12:"",Blocked12:"",Warning12:"",CheckedOutByOther12:"",CheckedOutByYou12:"",CircleShapeSolid:"",SquareShapeSolid:"",TriangleShapeSolid:"",DropShapeSolid:"",RectangleShapeSolid:"",ZoomToFit:"",InsertColumnsLeft:"",InsertColumnsRight:"",InsertRowsAbove:"",InsertRowsBelow:"",DeleteColumns:"",DeleteRows:"",DeleteRowsMirrored:"",DeleteTable:"",AccountBrowser:"",VersionControlPush:"",StackedColumnChart2:"",TripleColumnWide:"",QuadColumn:"",WhiteBoardApp16:"",WhiteBoardApp32:"",PinnedSolid:"",InsertSignatureLine:"",ArrangeByFrom:"",Phishing:"",CreateMailRule:"",PublishCourse:"",DictionaryRemove:"",UserRemove:"",UserEvent:"",Encryption:"",PasswordField:"",OpenInNewTab:"",Hide3:"",VerifiedBrandSolid:"",MarkAsProtected:"",AuthenticatorApp:"",WebTemplate:"",DefenderTVM:"",MedalSolid:"",D365TalentLearn:"",D365TalentInsight:"",D365TalentHRCore:"",BacklogList:"",ButtonControl:"",TableGroup:"",MountainClimbing:"",TagUnknown:"",TagUnknownMirror:"",TagUnknown12:"",TagUnknown12Mirror:"",Link12:"",Presentation:"",Presentation12:"",Lock12:"",BuildDefinition:"",ReleaseDefinition:"",SaveTemplate:"",UserGauge:"",BlockedSiteSolid12:"",TagSolid:"",OfficeChat:""}},t)}function TC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-16"',src:"url('"+e+"fabric-icons-16-9cf93f3b.woff') format('woff')"},icons:{OfficeChatSolid:"",MailSchedule:"",WarningSolid:"",Blocked2Solid:"",SkypeCircleArrow:"",SkypeArrow:"",SyncStatus:"",SyncStatusSolid:"",ProjectDocument:"",ToDoLogoOutline:"",VisioOnlineLogoFill32:"",VisioOnlineLogo32:"",VisioOnlineLogoCloud32:"",VisioDiagramSync:"",Event12:"",EventDateMissed12:"",UserOptional:"",ResponsesMenu:"",DoubleDownArrow:"",DistributeDown:"",BookmarkReport:"",FilterSettings:"",GripperDotsVertical:"",MailAttached:"",AddIn:"",LinkedDatabase:"",TableLink:"",PromotedDatabase:"",BarChartVerticalFilter:"",BarChartVerticalFilterSolid:"",MicOff2:"",MicrosoftTranslatorLogo:"",ShowTimeAs:"",FileRequest:"",WorkItemAlert:"",PowerBILogo16:"",PowerBILogoBackplate16:"",BulletedListText:"",BulletedListBullet:"",BulletedListTextMirrored:"",BulletedListBulletMirrored:"",NumberedListText:"",NumberedListNumber:"",NumberedListTextMirrored:"",NumberedListNumberMirrored:"",RemoveLinkChain:"",RemoveLinkX:"",FabricTextHighlight:"",ClearFormattingA:"",ClearFormattingEraser:"",Photo2Fill:"",IncreaseIndentText:"",IncreaseIndentArrow:"",DecreaseIndentText:"",DecreaseIndentArrow:"",IncreaseIndentTextMirrored:"",IncreaseIndentArrowMirrored:"",DecreaseIndentTextMirrored:"",DecreaseIndentArrowMirrored:"",CheckListText:"",CheckListCheck:"",CheckListTextMirrored:"",CheckListCheckMirrored:"",NumberSymbol:"",Coupon:"",VerifiedBrand:"",ReleaseGate:"",ReleaseGateCheck:"",ReleaseGateError:"",M365InvoicingLogo:"",RemoveFromShoppingList:"",ShieldAlert:"",FabricTextHighlightComposite:"",Dataflows:"",GenericScanFilled:"",DiagnosticDataBarTooltip:"",SaveToMobile:"",Orientation2:"",ScreenCast:"",ShowGrid:"",SnapToGrid:"",ContactList:"",NewMail:"",EyeShadow:"",FabricFolderConfirm:"",InformationBarriers:"",CommentActive:"",ColumnVerticalSectionEdit:"",WavingHand:"",ShakeDevice:"",SmartGlassRemote:"",Rotate90Clockwise:"",Rotate90CounterClockwise:"",CampaignTemplate:"",ChartTemplate:"",PageListFilter:"",SecondaryNav:"",ColumnVerticalSection:"",SkypeCircleSlash:"",SkypeSlash:""}},t)}function EC(e,t){void 0===e&&(e=""),en({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-17"',src:"url('"+e+"fabric-icons-17-0c4ed701.woff') format('woff')"},icons:{CustomizeToolbar:"",DuplicateRow:"",RemoveFromTrash:"",MailOptions:"",Childof:"",Footer:"",Header:"",BarChartVerticalFill:"",StackedColumnChart2Fill:"",PlainText:"",AccessibiltyChecker:"",DatabaseSync:"",ReservationOrders:"",TabOneColumn:"",TabTwoColumn:"",TabThreeColumn:"",BulletedTreeList:"",MicrosoftTranslatorLogoGreen:"",MicrosoftTranslatorLogoBlue:"",InternalInvestigation:"",AddReaction:"",ContactHeart:"",VisuallyImpaired:"",EventToDoLogo:"",Variable2:"",ModelingView:"",DisconnectVirtualMachine:"",ReportLock:"",Uneditable2:"",Uneditable2Mirrored:"",BarChartVerticalEdit:"",GlobalNavButtonActive:"",PollResults:"",Rerun:"",QandA:"",QandAMirror:"",BookAnswers:"",AlertSettings:"",TrimStart:"",TrimEnd:"",TableComputed:"",DecreaseIndentLegacy:"",IncreaseIndentLegacy:"",SizeLegacy:""}},t)}var MC=function(){on("trash","delete"),on("onedrive","onedrivelogo"),on("alertsolid12","eventdatemissed12"),on("sixpointstar","6pointstar"),on("twelvepointstar","12pointstar"),on("toggleon","toggleleft"),on("toggleoff","toggleright")};Object(gn.a)("@uifabric/icons","7.5.22");function RC(e,t){void 0===e&&(e="https://spoprod-a.akamaihd.net/files/fabric/assets/icons/"),[pC,hC,mC,gC,fC,vC,bC,_C,yC,CC,SC,xC,kC,wC,IC,DC,PC,TC,EC].forEach((function(o){return o(e,t)})),MC()}var BC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.content,o=e.styles,n=e.theme,r=e.disabled,i=e.visible,s=Mn()(o,{theme:n,disabled:r,visible:i});return b.createElement("div",{className:s.container},b.createElement("span",{className:s.root},t))},t}(b.Component),NC=function(e){return{container:[],root:[{border:"none",boxShadow:"none"}],beak:[],beakCurtain:[],calloutMain:[{backgroundColor:"transparent"}]}},FC=function(e){return function(t){return hn({container:[],root:[{border:"none",boxShadow:"none"}],beak:[],beakCurtain:[],calloutMain:[{backgroundColor:"transparent"}]},{root:[{marginLeft:e.left||e.x,marginTop:e.top||e.y}]})}},AC=xn(BC,(function(e){var t,o=e.theme,n=e.disabled,r=e.visible;return{container:[{backgroundColor:o.palette.neutralDark},n&&{opacity:.5,selectors:(t={},t[jt]={color:"GrayText",opacity:1},t)},!r&&{visibility:"hidden"}],root:[o.fonts.medium,{textAlign:"center",paddingLeft:"3px",paddingRight:"3px",backgroundColor:o.palette.neutralDark,color:o.palette.neutralLight,minWidth:"11px",lineHeight:"17px",height:"17px",display:"inline-block"},n&&{color:o.palette.neutralTertiaryAlt}]}}),void 0,{scope:"KeytipContent"}),LC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e,t=this.props,o=t.keySequences,n=t.offset,r=t.overflowSetSequence,i=this.props.calloutProps;return e=Gs(r?Us(o,r):o),n&&(i=h(h({},i),{coverTarget:!0,directionalHint:ya.topLeftEdge})),i&&void 0!==i.directionalHint||(i=h(h({},i),{directionalHint:ya.bottomCenter})),b.createElement(uc,h({},i,{isBeakVisible:!1,doNotLayer:!0,minPagePadding:0,styles:n?FC(n):NC,preventDismissOnScroll:!0,target:e}),b.createElement(AC,h({},this.props)))},t}(b.Component);function HC(e){var t=qs(e),o=t.keytipId,n=t.ariaDescribedBy;return function(e){if(e){var t=zC(e,Ps)||e,r=zC(e,Ts)||t,i=zC(e,Es)||r;OC(t,Ps,o),OC(r,Ts,o),OC(i,"aria-describedby",n,!0)}}}function OC(e,t,o,n){if(void 0===n&&(n=!1),e&&o){var r=o;if(n){var i=e.getAttribute(t);i&&-1===i.indexOf(o)&&(r=i+" "+o)}e.setAttribute(t,r)}}function zC(e,t){return e.querySelector("["+t+"]")}var WC=function(e){return{root:[{zIndex:po.KeytipLayer}]}},VC=function(){function e(){this.nodeMap={},this.root={id:Ms,children:[],parent:"",keySequences:[]},this.nodeMap[this.root.id]=this.root}return e.prototype.addNode=function(e,t,o){var n=this._getFullSequence(e),r=Ks(n);n.pop();var i=this._getParentID(n),s=this._createNode(r,i,[],e,o);this.nodeMap[t]=s;var a=this.getNode(i);a&&a.children.push(r)},e.prototype.updateNode=function(e,t){var o=this._getFullSequence(e),n=Ks(o);o.pop();var r=this._getParentID(o),i=this.nodeMap[t],s=i.parent,a=this.getNode(s),l=this.getNode(r);if(i){if(a&&s!==r){var c=a.children.indexOf(i.id);c>=0&&a.children.splice(c,1)}if(l&&i.id!==n){var u=l.children.indexOf(i.id);u>=0?l.children[u]=n:l.children.push(n)}i.id=n,i.keySequences=e.keySequences,i.overflowSetSequence=e.overflowSetSequence,i.onExecute=e.onExecute,i.onReturn=e.onReturn,i.hasDynamicChildren=e.hasDynamicChildren,i.hasMenu=e.hasMenu,i.parent=r,i.disabled=e.disabled}},e.prototype.removeNode=function(e,t){var o=this._getFullSequence(e),n=Ks(o);o.pop();var r=this._getParentID(o),i=this.getNode(r);i&&i.children.splice(i.children.indexOf(n),1),this.nodeMap[t]&&delete this.nodeMap[t]},e.prototype.getExactMatchedNode=function(e,t){var o=this;return _i(this.getNodes(t.children),(function(t){return o._getNodeSequence(t)===e&&!t.disabled}))},e.prototype.getPartiallyMatchedNodes=function(e,t){var o=this;return this.getNodes(t.children).filter((function(t){return 0===o._getNodeSequence(t).indexOf(e)&&!t.disabled}))},e.prototype.getChildren=function(e){var t=this;if(!e&&!(e=this.currentKeytip))return[];var o=e.children;return Object.keys(this.nodeMap).reduce((function(e,n){return o.indexOf(t.nodeMap[n].id)>=0&&!t.nodeMap[n].persisted&&e.push(t.nodeMap[n].id),e}),[])},e.prototype.getNodes=function(e){var t=this;return Object.keys(this.nodeMap).reduce((function(o,n){return e.indexOf(t.nodeMap[n].id)>=0&&o.push(t.nodeMap[n]),o}),[])},e.prototype.getNode=function(e){return _i(Os(this.nodeMap),(function(t){return t.id===e}))},e.prototype.isCurrentKeytipParent=function(e){if(this.currentKeytip){var t=f(e.keySequences);e.overflowSetSequence&&(t=Us(t,e.overflowSetSequence)),t.pop();var o=0===t.length?this.root.id:Ks(t),n=!1;if(this.currentKeytip.overflowSetSequence)n=Ks(this.currentKeytip.keySequences)===o;return n||this.currentKeytip.id===o}return!1},e.prototype._getParentID=function(e){return 0===e.length?this.root.id:Ks(e)},e.prototype._getFullSequence=function(e){var t=f(e.keySequences);return e.overflowSetSequence&&(t=Us(t,e.overflowSetSequence)),t},e.prototype._getNodeSequence=function(e){var t=f(e.keySequences);return e.overflowSetSequence&&(t=Us(t,e.overflowSetSequence)),t[t.length-1]},e.prototype._createNode=function(e,t,o,n,r){var i=this,s=n.keySequences,a=n.hasDynamicChildren,l=n.overflowSetSequence,c=n.hasMenu,u=n.onExecute,d=n.onReturn,p=n.disabled,h={id:e,keySequences:s,overflowSetSequence:l,parent:t,children:o,onExecute:u,onReturn:d,hasDynamicChildren:a,hasMenu:c,disabled:p,persisted:r};return h.children=Object.keys(this.nodeMap).reduce((function(t,o){return i.nodeMap[o].parent===e&&t.push(i.nodeMap[o].id),t}),[]),h},e}();function KC(e,t){if(e.key!==t.key)return!1;var o=e.modifierKeys,n=t.modifierKeys;if(!o&&n||o&&!n)return!1;if(o&&n){if(o.length!==n.length)return!1;o=o.sort(),n=n.sort();for(var r=0;r<o.length;r++)if(o[r]!==n[r])return!1}return!0}function UC(e,t){return!!_i(e,(function(e){return KC(e,t)}))}var GC={key:Ca()?"Control":"Meta",modifierKeys:[wn.alt]},jC=GC,YC={key:"Escape"},qC=Mn(),ZC=function(e){function t(t,o){var n=e.call(this,t,o)||this;n._keytipManager=Vs.getInstance(),n._delayedKeytipQueue=[],n._keyHandled=!1,n._onDismiss=function(e){n.state.inKeytipMode&&n._exitKeytipMode(e)},n._onKeyDown=function(e){n._keyHandled=!1;var t=e.key;switch(t){case"Tab":case"Enter":case"Spacebar":case" ":case"ArrowUp":case"Up":case"ArrowDown":case"Down":case"ArrowLeft":case"Left":case"ArrowRight":case"Right":n.state.inKeytipMode&&(n._keyHandled=!0,n._exitKeytipMode(e));break;default:"Esc"===t?t="Escape":"OS"!==t&&"Win"!==t||(t="Meta");var o={key:t};o.modifierKeys=n._getModifierKey(t,e),n.processTransitionInput(o,e)}},n._onKeyPress=function(e){n.state.inKeytipMode&&!n._keyHandled&&(n.processInput(e.key.toLocaleLowerCase(),e),e.preventDefault(),e.stopPropagation())},n._onKeytipAdded=function(e){var t,o=e.keytip,r=e.uniqueID;if(n._keytipTree.addNode(o,r),n._setKeytips(),n._keytipTree.isCurrentKeytipParent(o)&&(n._delayedKeytipQueue=n._delayedKeytipQueue.concat((null===(t=n._keytipTree.currentKeytip)||void 0===t?void 0:t.children)||[]),n._addKeytipToQueue(Ks(o.keySequences)),n._keytipTree.currentKeytip&&n._keytipTree.currentKeytip.hasDynamicChildren&&n._keytipTree.currentKeytip.children.indexOf(o.id)<0)){var i=n._keytipTree.getNode(n._keytipTree.currentKeytip.id);i&&(n._keytipTree.currentKeytip=i)}n._persistedKeytipChecks(o)},n._onKeytipUpdated=function(e){var t,o=e.keytip,r=e.uniqueID;n._keytipTree.updateNode(o,r),n._setKeytips(),n._keytipTree.isCurrentKeytipParent(o)&&(n._delayedKeytipQueue=n._delayedKeytipQueue.concat((null===(t=n._keytipTree.currentKeytip)||void 0===t?void 0:t.children)||[]),n._addKeytipToQueue(Ks(o.keySequences))),n._persistedKeytipChecks(o)},n._persistedKeytipChecks=function(e){if(n._newCurrentKeytipSequences&&Ii(e.keySequences,n._newCurrentKeytipSequences)&&n._triggerKeytipImmediately(e),n._isCurrentKeytipAnAlias(e)){var t=e.keySequences;e.overflowSetSequence&&(t=Us(t,e.overflowSetSequence)),n._keytipTree.currentKeytip=n._keytipTree.getNode(Ks(t))}},n._onKeytipRemoved=function(e){var t=e.keytip,o=e.uniqueID;n._removeKeytipFromQueue(Ks(t.keySequences)),n._keytipTree.removeNode(t,o),n._setKeytips()},n._onPersistedKeytipAdded=function(e){var t=e.keytip,o=e.uniqueID;n._keytipTree.addNode(t,o,!0)},n._onPersistedKeytipRemoved=function(e){var t=e.keytip,o=e.uniqueID;n._keytipTree.removeNode(t,o)},n._onPersistedKeytipExecute=function(e){n._persistedKeytipExecute(e.overflowButtonSequences,e.keytipSequences)},n._setInKeytipMode=function(e){n.setState({inKeytipMode:e}),n._keytipManager.inKeytipMode=e},n._warnIfDuplicateKeytips=function(){var e=n._getDuplicateIds(n._keytipTree.getChildren());e.length&&Zo("Duplicate keytips found for "+e.join(", "))},n._getDuplicateIds=function(e){var t={};return e.filter((function(e){return t[e]=t[e]?t[e]+1:1,2===t[e]}))},si(n),n._events=new Ws(n),n._async=new di(n);var r=f(n._keytipManager.getKeytips());return n.state={inKeytipMode:!1,keytips:r,visibleKeytips:n._getVisibleKeytips(r)},n._buildTree(),n._currentSequence="",n._events.on(n._keytipManager,ys.KEYTIP_ADDED,n._onKeytipAdded),n._events.on(n._keytipManager,ys.KEYTIP_UPDATED,n._onKeytipUpdated),n._events.on(n._keytipManager,ys.KEYTIP_REMOVED,n._onKeytipRemoved),n._events.on(n._keytipManager,ys.PERSISTED_KEYTIP_ADDED,n._onPersistedKeytipAdded),n._events.on(n._keytipManager,ys.PERSISTED_KEYTIP_REMOVED,n._onPersistedKeytipRemoved),n._events.on(n._keytipManager,ys.PERSISTED_KEYTIP_EXECUTE,n._onPersistedKeytipExecute),n}return p(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.content,n=t.styles,r=this.state,i=r.keytips,s=r.visibleKeytips;return this._classNames=qC(n,{}),b.createElement(cc,{styles:WC},b.createElement("span",{id:Ms,className:this._classNames.innerContent},""+o+Rs),i&&i.map((function(t,o){return b.createElement("span",{key:o,id:Ks(t.keySequences),className:e._classNames.innerContent},t.keySequences.join(Rs))})),s&&s.map((function(e){return b.createElement(LC,h({key:Ks(e.keySequences)},e))})))},t.prototype.componentDidMount=function(){this._events.on(window,"mouseup",this._onDismiss,!0),this._events.on(window,"pointerup",this._onDismiss,!0),this._events.on(window,"resize",this._onDismiss),this._events.on(window,"keydown",this._onKeyDown,!0),this._events.on(window,"keypress",this._onKeyPress,!0),this._events.on(window,"scroll",this._onDismiss,!0),this._events.on(this._keytipManager,ys.ENTER_KEYTIP_MODE,this._enterKeytipMode),this._events.on(this._keytipManager,ys.EXIT_KEYTIP_MODE,this._exitKeytipMode)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.getCurrentSequence=function(){return this._currentSequence},t.prototype.getKeytipTree=function(){return this._keytipTree},t.prototype.processTransitionInput=function(e,t){var o=this._keytipTree.currentKeytip;UC(this.props.keytipExitSequences,e)&&o?(this._keyHandled=!0,this._exitKeytipMode(t)):UC(this.props.keytipReturnSequences,e)?o&&(this._keyHandled=!0,o.id===this._keytipTree.root.id?this._exitKeytipMode(t):(o.onReturn&&o.onReturn(this._getKtpExecuteTarget(o),this._getKtpTarget(o)),this._currentSequence="",this._keytipTree.currentKeytip=this._keytipTree.getNode(o.parent),this.showKeytips(this._keytipTree.getChildren()),this._warnIfDuplicateKeytips())):UC(this.props.keytipStartSequences,e)&&!o&&(this._keyHandled=!0,this._enterKeytipMode(),this._warnIfDuplicateKeytips())},t.prototype.processInput=function(e,t){var o=this._currentSequence+e,n=this._keytipTree.currentKeytip;if(n){var r=this._keytipTree.getExactMatchedNode(o,n);if(r){this._keytipTree.currentKeytip=n=r;var i=this._keytipTree.getChildren();return n.onExecute&&(n.onExecute(this._getKtpExecuteTarget(n),this._getKtpTarget(n)),n=this._keytipTree.currentKeytip),0!==i.length||n.hasDynamicChildren||n.hasMenu?(this.showKeytips(i),this._warnIfDuplicateKeytips()):this._exitKeytipMode(t),void(this._currentSequence="")}var s=this._keytipTree.getPartiallyMatchedNodes(o,n);if(s.length>0){var a=s.filter((function(e){return!e.persisted})).map((function(e){return e.id}));this.showKeytips(a),this._currentSequence=o}}},t.prototype.showKeytips=function(e){for(var t=0,o=this._keytipManager.getKeytips();t<o.length;t++){var n=o[t],r=Ks(n.keySequences);n.overflowSetSequence&&(r=Ks(Us(n.keySequences,n.overflowSetSequence))),e.indexOf(r)>=0?n.visible=!0:n.visible=!1}this._setKeytips()},t.prototype._enterKeytipMode=function(){this._keytipManager.shouldEnterKeytipMode&&(this._keytipManager.delayUpdatingKeytipChange&&(this._buildTree(),this._setKeytips()),this._keytipTree.currentKeytip=this._keytipTree.root,this.showKeytips(this._keytipTree.getChildren()),this._setInKeytipMode(!0),this.props.onEnterKeytipMode&&this.props.onEnterKeytipMode())},t.prototype._buildTree=function(){this._keytipTree=new VC;for(var e=0,t=Object.keys(this._keytipManager.keytips);e<t.length;e++){var o=t[e],n=this._keytipManager.keytips[o];this._keytipTree.addNode(n.keytip,n.uniqueID)}for(var r=0,i=Object.keys(this._keytipManager.persistedKeytips);r<i.length;r++){o=i[r],n=this._keytipManager.persistedKeytips[o];this._keytipTree.addNode(n.keytip,n.uniqueID)}},t.prototype._exitKeytipMode=function(e){this._keytipTree.currentKeytip=void 0,this._currentSequence="",this.showKeytips([]),this._delayedQueueTimeout&&this._async.clearTimeout(this._delayedQueueTimeout),this._delayedKeytipQueue=[],this._setInKeytipMode(!1),this.props.onExitKeytipMode&&this.props.onExitKeytipMode(e)},t.prototype._setKeytips=function(e){void 0===e&&(e=this._keytipManager.getKeytips()),this.setState({keytips:e,visibleKeytips:this._getVisibleKeytips(e)})},t.prototype._persistedKeytipExecute=function(e,t){this._newCurrentKeytipSequences=t;var o=this._keytipTree.getNode(Ks(e));o&&o.onExecute&&o.onExecute(this._getKtpExecuteTarget(o),this._getKtpTarget(o))},t.prototype._getVisibleKeytips=function(e){var t={};return e.filter((function(e){var o=Ks(e.keySequences);return e.overflowSetSequence&&(o=Ks(Us(e.keySequences,e.overflowSetSequence))),t[o]=t[o]?t[o]+1:1,e.visible&&1===t[o]}))},t.prototype._getModifierKey=function(e,t){var o=[];return t.altKey&&"Alt"!==e&&o.push(wn.alt),t.ctrlKey&&"Control"!==e&&o.push(wn.ctrl),t.shiftKey&&"Shift"!==e&&o.push(wn.shift),t.metaKey&&"Meta"!==e&&o.push(wn.leftWindow),o.length?o:void 0},t.prototype._triggerKeytipImmediately=function(e){var t=f(e.keySequences);if(e.overflowSetSequence&&(t=Us(t,e.overflowSetSequence)),this._keytipTree.currentKeytip=this._keytipTree.getNode(Ks(t)),this._keytipTree.currentKeytip){var o=this._keytipTree.getChildren();o.length&&this.showKeytips(o),this._keytipTree.currentKeytip.onExecute&&this._keytipTree.currentKeytip.onExecute(this._getKtpExecuteTarget(this._keytipTree.currentKeytip),this._getKtpTarget(this._keytipTree.currentKeytip))}this._newCurrentKeytipSequences=void 0},t.prototype._addKeytipToQueue=function(e){var t=this;this._delayedKeytipQueue.push(e),this._delayedQueueTimeout&&this._async.clearTimeout(this._delayedQueueTimeout),this._delayedQueueTimeout=this._async.setTimeout((function(){t._delayedKeytipQueue.length&&(t.showKeytips(t._delayedKeytipQueue),t._delayedKeytipQueue=[])}),300)},t.prototype._removeKeytipFromQueue=function(e){var t=this,o=this._delayedKeytipQueue.indexOf(e);o>=0&&(this._delayedKeytipQueue.splice(o,1),this._delayedQueueTimeout&&this._async.clearTimeout(this._delayedQueueTimeout),this._delayedQueueTimeout=this._async.setTimeout((function(){t._delayedKeytipQueue.length&&(t.showKeytips(t._delayedKeytipQueue),t._delayedKeytipQueue=[])}),300))},t.prototype._getKtpExecuteTarget=function(e){return tt().querySelector(js(e.id))},t.prototype._getKtpTarget=function(e){return tt().querySelector(Gs(e.keySequences))},t.prototype._isCurrentKeytipAnAlias=function(e){var t=this._keytipTree.currentKeytip;return!(!t||!t.overflowSetSequence&&!t.persisted||!Ii(e.keySequences,t.keySequences))},t.defaultProps={keytipStartSequences:[GC],keytipExitSequences:[jC],keytipReturnSequences:[YC],content:""},t}(b.Component),XC=xn(ZC,(function(e){return{innerContent:[{position:"absolute",width:0,height:0,margin:0,padding:0,border:0,overflow:"hidden",visibility:"hidden"}]}}),void 0,{scope:"KeytipLayer"});function QC(e){for(var t={},o=0,n=e.keytips;o<n.length;o++){JC(t,[],n[o])}return t}function JC(e,t,o){var n=o.sequence?o.sequence:o.content.toLocaleLowerCase(),r=t.concat(n),i=h(h({},o.optionalProps),{keySequences:r,content:o.content});if(e[o.id]=i,o.children)for(var s=0,a=o.children;s<a.length;s++){JC(e,r,a[s])}}Object(gn.a)("office-ui-fabric-react","7.162.1");var $C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.componentDidMount=function(){nc(this.props.id)},t.prototype.componentWillUnmount=function(){nc(this.props.id)},t.prototype.render=function(){return b.createElement("div",h({},this.props,{className:Sr("ms-LayerHost",this.props.className)}))},t}(b.Component),eS=function(){function e(e){this._events=new Ws(this),this._scrollableParent=hs(e),this._incrementScroll=this._incrementScroll.bind(this),this._scrollRect=Wv(this._scrollableParent),this._scrollableParent===window&&(this._scrollableParent=document.body),this._scrollableParent&&(this._events.on(window,"mousemove",this._onMouseMove,!0),this._events.on(window,"touchmove",this._onTouchMove,!0))}return e.prototype.dispose=function(){this._events.dispose(),this._stopScroll()},e.prototype._onMouseMove=function(e){this._computeScrollVelocity(e)},e.prototype._onTouchMove=function(e){e.touches.length>0&&this._computeScrollVelocity(e)},e.prototype._computeScrollVelocity=function(e){if(this._scrollRect){var t,o;"clientX"in e?(t=e.clientX,o=e.clientY):(t=e.touches[0].clientX,o=e.touches[0].clientY);var n,r,i,s=this._scrollRect.top,a=this._scrollRect.left,l=s+this._scrollRect.height-100,c=a+this._scrollRect.width-100;o<s+100||o>l?(r=o,n=s,i=l,this._isVerticalScroll=!0):(r=t,n=a,i=c,this._isVerticalScroll=!1),this._scrollVelocity=r<n+100?Math.max(-15,(100-(r-n))/100*-15):r>i?Math.min(15,(r-i)/100*15):0,this._scrollVelocity?this._startScroll():this._stopScroll()}},e.prototype._startScroll=function(){this._timeoutId||this._incrementScroll()},e.prototype._incrementScroll=function(){this._scrollableParent&&(this._isVerticalScroll?this._scrollableParent.scrollTop+=Math.round(this._scrollVelocity):this._scrollableParent.scrollLeft+=Math.round(this._scrollVelocity)),this._timeoutId=setTimeout(this._incrementScroll,16)},e.prototype._stopScroll=function(){this._timeoutId&&(clearTimeout(this._timeoutId),delete this._timeoutId)},e}();function tS(e,t){var o=e.left||e.x||0,n=e.top||e.y||0,r=t.left||t.x||0,i=t.top||t.y||0;return Math.sqrt(Math.pow(o-r,2)+Math.pow(n-i,2))}function oS(e){var t,o=e.contentSize,n=e.boundsSize,r=e.mode,i=void 0===r?"contain":r,s=e.maxScale,a=void 0===s?1:s,l=o.width/o.height,c=n.width/n.height;t=("contain"===i?l>c:l<c)?n.width/o.width:n.height/o.height;var u=Math.min(a,t);return{width:o.width*u,height:o.height*u}}function nS(e){var t=/[1-9]([0]+$)|\.([0-9]*)/.exec(String(e));return t?t[1]?-t[1].length:t[2]?t[2].length:0:0}function rS(e,t,o){void 0===o&&(o=10);var n=Math.pow(o,t);return Math.round(e*n)/n}var iS,sS=Mn(),aS=xn(function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._onMouseDown=function(e){var t=o.props,n=t.isEnabled,r=t.onShouldStartSelection;o._isMouseEventOnScrollbar(e)||o._isInSelectionToggle(e)||o._isTouch||!n||o._isDragStartInSelection(e)||r&&!r(e)||o._scrollableSurface&&0===e.button&&o._root.current&&(o._selectedIndicies={},o._preservedIndicies=void 0,o._events.on(window,"mousemove",o._onAsyncMouseMove,!0),o._events.on(o._scrollableParent,"scroll",o._onAsyncMouseMove),o._events.on(window,"click",o._onMouseUp,!0),o._autoScroll=new eS(o._root.current),o._scrollTop=o._scrollableSurface.scrollTop,o._scrollLeft=o._scrollableSurface.scrollLeft,o._rootRect=o._root.current.getBoundingClientRect(),o._onMouseMove(e))},o._onTouchStart=function(e){o._isTouch=!0,o._async.setTimeout((function(){o._isTouch=!1}),0)},o._onPointerDown=function(e){"touch"===e.pointerType&&(o._isTouch=!0,o._async.setTimeout((function(){o._isTouch=!1}),0))},si(o),o._async=new di(o),o._events=new Ws(o),o.state={dragRect:void 0},o}return p(t,e),t.prototype.componentDidMount=function(){this._scrollableParent=hs(this._root.current),this._scrollableSurface=this._scrollableParent===window?document.body:this._scrollableParent;var e=this.props.isDraggingConstrainedToRoot?this._root.current:this._scrollableSurface;this._events.on(e,"mousedown",this._onMouseDown),this._events.on(e,"touchstart",this._onTouchStart,!0),this._events.on(e,"pointerdown",this._onPointerDown,!0)},t.prototype.componentWillUnmount=function(){this._autoScroll&&this._autoScroll.dispose(),delete this._scrollableParent,delete this._scrollableSurface,this._events.dispose(),this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.rootProps,o=e.children,n=e.theme,r=e.className,i=e.styles,s=this.state.dragRect,a=sS(i,{theme:n,className:r});return b.createElement("div",h({},t,{className:a.root,ref:this._root}),o,s&&b.createElement("div",{className:a.dragMask}),s&&b.createElement("div",{className:a.box,style:s},b.createElement("div",{className:a.boxFill})))},t.prototype._isMouseEventOnScrollbar=function(e){var t=e.target,o=t.offsetWidth-t.clientWidth;if(o){var n=t.getBoundingClientRect();if(In(this.props.theme)){if(e.clientX<n.left+o)return!0}else if(e.clientX>n.left+t.clientWidth)return!0;if(e.clientY>n.top+t.clientHeight)return!0}return!1},t.prototype._getRootRect=function(){return{left:this._rootRect.left+(this._scrollLeft-this._scrollableSurface.scrollLeft),top:this._rootRect.top+(this._scrollTop-this._scrollableSurface.scrollTop),width:this._rootRect.width,height:this._rootRect.height}},t.prototype._onAsyncMouseMove=function(e){var t=this;this._async.requestAnimationFrame((function(){t._onMouseMove(e)})),e.stopPropagation(),e.preventDefault()},t.prototype._onMouseMove=function(e){if(this._autoScroll){void 0!==e.clientX&&(this._lastMouseEvent=e);var t=this._getRootRect(),o={left:e.clientX-t.left,top:e.clientY-t.top};if(this._dragOrigin||(this._dragOrigin=o),void 0!==e.buttons&&0===e.buttons)this._onMouseUp(e);else if(this.state.dragRect||tS(this._dragOrigin,o)>5){if(!this.state.dragRect){var n=this.props.selection;e.shiftKey||n.setAllSelected(!1),this._preservedIndicies=n&&n.getSelectedIndices&&n.getSelectedIndices()}var r=this.props.isDraggingConstrainedToRoot?{left:Math.max(0,Math.min(t.width,this._lastMouseEvent.clientX-t.left)),top:Math.max(0,Math.min(t.height,this._lastMouseEvent.clientY-t.top))}:{left:this._lastMouseEvent.clientX-t.left,top:this._lastMouseEvent.clientY-t.top},i={left:Math.min(this._dragOrigin.left||0,r.left),top:Math.min(this._dragOrigin.top||0,r.top),width:Math.abs(r.left-(this._dragOrigin.left||0)),height:Math.abs(r.top-(this._dragOrigin.top||0))};this._evaluateSelection(i,t),this.setState({dragRect:i})}return!1}},t.prototype._onMouseUp=function(e){this._events.off(window),this._events.off(this._scrollableParent,"scroll"),this._autoScroll&&this._autoScroll.dispose(),this._autoScroll=this._dragOrigin=this._lastMouseEvent=void 0,this._selectedIndicies=this._itemRectCache=void 0,this.state.dragRect&&(this.setState({dragRect:void 0}),e.preventDefault(),e.stopPropagation())},t.prototype._isPointInRectangle=function(e,t){return!!t.top&&e.top<t.top&&e.bottom>t.top&&!!t.left&&e.left<t.left&&e.right>t.left},t.prototype._isDragStartInSelection=function(e){var t=this.props.selection;if(!this._root.current||t&&0===t.getSelectedCount())return!1;for(var o=this._root.current.querySelectorAll("[data-selection-index]"),n=0;n<o.length;n++){var r=o[n],i=Number(r.getAttribute("data-selection-index"));if(t.isIndexSelected(i)){var s=r.getBoundingClientRect();if(this._isPointInRectangle(s,{left:e.clientX,top:e.clientY}))return!0}}return!1},t.prototype._isInSelectionToggle=function(e){for(var t=e.target;t&&t!==this._root.current;){if("true"===t.getAttribute("data-selection-toggle"))return!0;t=t.parentElement}return!1},t.prototype._evaluateSelection=function(e,t){if(e&&this._root.current){var o=this.props.selection,n=this._root.current.querySelectorAll("[data-selection-index]");this._itemRectCache||(this._itemRectCache={});for(var r=0;r<n.length;r++){var i=n[r],s=i.getAttribute("data-selection-index"),a=this._itemRectCache[s];a||(a={left:(a=i.getBoundingClientRect()).left-t.left,top:a.top-t.top,width:a.width,height:a.height,right:a.left-t.left+a.width,bottom:a.top-t.top+a.height}).width>0&&a.height>0&&(this._itemRectCache[s]=a),a.top<e.top+e.height&&a.bottom>e.top&&a.left<e.left+e.width&&a.right>e.left?this._selectedIndicies[s]=!0:delete this._selectedIndicies[s]}var l=this._allSelectedIndices||{};for(var s in this._allSelectedIndices={},this._selectedIndicies)this._selectedIndicies.hasOwnProperty(s)&&(this._allSelectedIndices[s]=!0);if(this._preservedIndicies)for(var c=0,u=this._preservedIndicies;c<u.length;c++){s=u[c];this._allSelectedIndices[s]=!0}var d=!1;for(var s in this._allSelectedIndices)if(this._allSelectedIndices[s]!==l[s]){d=!0;break}if(!d)for(var s in l)if(this._allSelectedIndices[s]!==l[s]){d=!0;break}if(d){o.setChangeEvents(!1),o.setAllSelected(!1);for(var p=0,h=Object.keys(this._allSelectedIndices);p<h.length;p++){s=h[p];o.setIndexSelected(Number(s),!0,!1)}o.setChangeEvents(!0)}}},t.defaultProps={rootTagName:"div",rootProps:{},isEnabled:!0},t}(b.Component),(function(e){var t,o,n,r=e.theme,i=e.className,s=r.palette;return{root:[i,{position:"relative",cursor:"default"}],dragMask:[{position:"absolute",background:"rgba(255, 0, 0, 0)",left:0,top:0,right:0,bottom:0,selectors:(t={},t[jt]={background:"none",backgroundColor:"transparent"},t)}],box:[{position:"absolute",boxSizing:"border-box",border:"1px solid "+s.themePrimary,pointerEvents:"none",zIndex:10,selectors:(o={},o[jt]={borderColor:"Highlight"},o)}],boxFill:[{position:"absolute",boxSizing:"border-box",backgroundColor:s.themePrimary,opacity:.1,left:0,top:0,right:0,bottom:0,selectors:(n={},n[jt]={background:"none",backgroundColor:"transparent"},n)}]}}),void 0,{scope:"MarqueeSelection"});!function(e){e[e.info=0]="info",e[e.error=1]="error",e[e.blocked=2]="blocked",e[e.severeWarning=3]="severeWarning",e[e.success=4]="success",e[e.warning=5]="warning"}(iS||(iS={}));var lS,cS,uS,dS,pS=Mn(),hS=function(e){function t(t){var o,n=e.call(this,t)||this;return n.ICON_MAP=((o={})[iS.info]="Info",o[iS.warning]="Info",o[iS.error]="ErrorBadge",o[iS.blocked]="Blocked2",o[iS.severeWarning]="Warning",o[iS.success]="Completed",o),n._getRegionProps=function(){var e=!!n._getActionsDiv()||!!n._getDismissDiv(),t={"aria-describedby":n.state.labelId,role:"region"};return e?t:{}},n._onClick=function(e){n.setState({expandSingleLine:!n.state.expandSingleLine})},si(n),n.state={labelId:ts("MessageBar"),showContent:!1,expandSingleLine:!1},n}return p(t,e),t.prototype.render=function(){var e=this.props.isMultiline;return this._classNames=this._getClassNames(),e?this._renderMultiLine():this._renderSingleLine()},t.prototype._getActionsDiv=function(){return this.props.actions?b.createElement("div",{className:this._classNames.actions},this.props.actions):null},t.prototype._getDismissDiv=function(){var e=this.props,t=e.onDismiss,o=e.dismissIconProps;return t?b.createElement(eu,{disabled:!1,className:this._classNames.dismissal,onClick:t,iconProps:o||{iconName:"Clear"},title:this.props.dismissButtonAriaLabel,ariaLabel:this.props.dismissButtonAriaLabel}):null},t.prototype._getDismissSingleLine=function(){return this.props.onDismiss?b.createElement("div",{className:this._classNames.dismissSingleLine},this._getDismissDiv()):null},t.prototype._getExpandSingleLine=function(){return!this.props.actions&&this.props.truncated?b.createElement("div",{className:this._classNames.expandSingleLine},b.createElement(eu,{disabled:!1,className:this._classNames.expand,onClick:this._onClick,iconProps:{iconName:this.state.expandSingleLine?"DoubleChevronUp":"DoubleChevronDown"},ariaLabel:this.props.overflowButtonAriaLabel,"aria-expanded":this.state.expandSingleLine})):null},t.prototype._getIconSpan=function(){var e=this.props.messageBarIconProps;return b.createElement("div",{className:this._classNames.iconContainer,"aria-hidden":!0},e?b.createElement(Fr,h({},e,{className:Sr(this._classNames.icon,e.className)})):b.createElement(Fr,{iconName:this.ICON_MAP[this.props.messageBarType],className:this._classNames.icon}))},t.prototype._renderMultiLine=function(){return b.createElement("div",h({className:this._classNames.root},this._getRegionProps()),b.createElement("div",{className:this._classNames.content},this._getIconSpan(),this._renderInnerText(),this._getDismissDiv()),this._getActionsDiv())},t.prototype._renderSingleLine=function(){return b.createElement("div",h({className:this._classNames.root},this._getRegionProps()),b.createElement("div",{className:this._classNames.content},this._getIconSpan(),this._renderInnerText(),this._getExpandSingleLine(),this._getActionsDiv(),this._getDismissSingleLine()))},t.prototype._renderInnerText=function(){var e=fr(this.props,Yn,["className"]);return b.createElement("div",{className:this._classNames.text,id:this.state.labelId,role:"status","aria-live":this._getAnnouncementPriority()},b.createElement("span",h({className:this._classNames.innerText},e),b.createElement(mi,null,b.createElement("span",null,this.props.children))))},t.prototype._getClassNames=function(){var e=this.props,t=e.theme,o=e.className,n=e.messageBarType,r=e.onDismiss,i=e.actions,s=e.truncated,a=e.isMultiline,l=this.state.expandSingleLine;return pS(this.props.styles,{theme:t,messageBarType:n||iS.info,onDismiss:void 0!==r,actions:void 0!==i,truncated:s,isMultiline:a,expandSingleLine:l,className:o})},t.prototype._getAnnouncementPriority=function(){switch(this.props.messageBarType){case iS.blocked:case iS.error:case iS.severeWarning:return"assertive"}return"polite"},t.defaultProps={messageBarType:iS.info,onDismiss:void 0,isMultiline:!0},t}(b.Component),mS={root:"ms-MessageBar",error:"ms-MessageBar--error",blocked:"ms-MessageBar--blocked",severeWarning:"ms-MessageBar--severeWarning",success:"ms-MessageBar--success",warning:"ms-MessageBar--warning",multiline:"ms-MessageBar-multiline",singleline:"ms-MessageBar-singleline",dismissalSingleLine:"ms-MessageBar-dismissalSingleLine",expandingSingleLine:"ms-MessageBar-expandingSingleLine",content:"ms-MessageBar-content",iconContainer:"ms-MessageBar-icon",text:"ms-MessageBar-text",innerText:"ms-MessageBar-innerText",dismissSingleLine:"ms-MessageBar-dismissSingleLine",expandSingleLine:"ms-MessageBar-expandSingleLine",dismissal:"ms-MessageBar-dismissal",expand:"ms-MessageBar-expand",actions:"ms-MessageBar-actions",actionsSingleline:"ms-MessageBar-actionsSingleLine"},gS=((lS={})[iS.error]="errorBackground",lS[iS.blocked]="errorBackground",lS[iS.success]="successBackground",lS[iS.warning]="warningBackground",lS[iS.severeWarning]="severeWarningBackground",lS[iS.info]="infoBackground",lS),fS=((cS={})[iS.error]="rgba(255, 0, 0, 0.3)",cS[iS.blocked]="rgba(255, 0, 0, 0.3)",cS[iS.success]="rgba(48, 241, 73, 0.3)",cS[iS.warning]="rgba(255, 254, 57, 0.3)",cS[iS.severeWarning]="rgba(255, 0, 0, 0.3)",cS[iS.info]="Window",cS),vS=((uS={})[iS.error]="errorIcon",uS[iS.blocked]="errorIcon",uS[iS.success]="successIcon",uS[iS.warning]="warningIcon",uS[iS.severeWarning]="severeWarningIcon",uS[iS.info]="infoIcon",uS),bS=xn(hS,(function(e){var t,o,n,r,i,s=e.theme,a=e.className,l=e.onDismiss,c=e.truncated,u=e.isMultiline,d=e.expandSingleLine,p=e.messageBarType,m=void 0===p?iS.info:p,g=s.semanticColors,f=s.fonts,v=lo(0,oo),b=Oo(mS,s),_={fontSize:je.xSmall,height:10,lineHeight:"10px",color:g.messageText,selectors:(t={},t[jt]=h(h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{color:"WindowText"}),t)},y=[go(s,{inset:1,highContrastStyle:{outlineOffset:"-6px",outline:"1px solid Highlight"},borderColor:"transparent"}),{flexShrink:0,width:32,height:32,padding:"8px 12px",selectors:{"& .ms-Button-icon":_,":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}}];return{root:[b.root,f.medium,m===iS.error&&b.error,m===iS.blocked&&b.blocked,m===iS.severeWarning&&b.severeWarning,m===iS.success&&b.success,m===iS.warning&&b.warning,u?b.multiline:b.singleline,!u&&l&&b.dismissalSingleLine,!u&&c&&b.expandingSingleLine,{background:g[gS[m]],color:g.messageText,minHeight:32,width:"100%",display:"flex",wordBreak:"break-word",selectors:(o={".ms-Link":{color:g.messageLink,selectors:{":hover":{color:g.messageLinkHovered}}}},o[jt]=h(h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{background:fS[m],border:"1px solid WindowText",color:"WindowText"}),o)},u&&{flexDirection:"column"},a],content:[b.content,{display:"flex",width:"100%",lineHeight:"normal"}],iconContainer:[b.iconContainer,{fontSize:je.medium,minWidth:16,minHeight:16,display:"flex",flexShrink:0,margin:"8px 0 8px 12px"}],icon:{color:g[vS[m]],selectors:(n={},n[jt]=h(h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{color:"WindowText"}),n)},text:[b.text,h(h({minWidth:0,display:"flex",flexGrow:1,margin:8},f.small),{selectors:(r={},r[jt]=h({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)}),!l&&{marginRight:12}],innerText:[b.innerText,{lineHeight:16,selectors:{"& span a":{paddingLeft:4}}},c&&{overflow:"visible",whiteSpace:"pre-wrap"},!u&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},!u&&!c&&{selectors:(i={},i[v]={overflow:"visible",whiteSpace:"pre-wrap"},i)},d&&{overflow:"visible",whiteSpace:"pre-wrap"}],dismissSingleLine:b.dismissSingleLine,expandSingleLine:b.expandSingleLine,dismissal:[b.dismissal,y],expand:[b.expand,y],actions:[u?b.actions:b.actionsSingleline,{display:"flex",flexGrow:0,flexShrink:0,flexBasis:"auto",flexDirection:"row-reverse",alignItems:"center",margin:"0 12px 0 8px",selectors:{"& button:nth-child(n+2)":{marginLeft:8}}},u&&{marginBottom:8},l&&!u&&{marginRight:0}]}}),void 0,{scope:"MessageBar"}),_S={root:"ms-Nav",linkText:"ms-Nav-linkText",compositeLink:"ms-Nav-compositeLink",link:"ms-Nav-link",chevronButton:"ms-Nav-chevronButton",chevronIcon:"ms-Nav-chevron",navItem:"ms-Nav-navItem",navItems:"ms-Nav-navItems",group:"ms-Nav-group",groupContent:"ms-Nav-groupContent"},yS={textContainer:{overflow:"hidden"},label:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}};function CS(e){return!!e&&!/^[a-z0-9+-.]+:\/\//i.test(e)}var SS,xS=Mn(),kS=function(e){function t(t){var o=e.call(this,t)||this;return o._focusZone=b.createRef(),o._onRenderLink=function(e){var t=o.props,n=t.styles,r=t.groups,i=t.theme,s=xS(n,{theme:i,groups:r});return b.createElement("div",{className:s.linkText},e.name)},o._renderGroup=function(e,t){var n=o.props,r=n.styles,i=n.groups,s=n.theme,a=n.onRenderGroupHeader,l=void 0===a?o._renderGroupHeader:a,c=o._isGroupExpanded(e),u=xS(r,{theme:s,isGroup:!0,isExpanded:c,groups:i}),d=h(h({},e),{isExpanded:c,onHeaderClick:function(t,n){o._onGroupHeaderClicked(e,t)}});return b.createElement("div",{key:t,className:u.group},d.name?l(d,o._renderGroupHeader):null,b.createElement("div",{className:u.groupContent},o._renderLinks(d.links,0)))},o._renderGroupHeader=function(e){var t=o.props,n=t.styles,r=t.groups,i=t.theme,s=t.expandButtonAriaLabel,a=e.isExpanded,l=xS(n,{theme:i,isGroup:!0,isExpanded:a,groups:r}),c=(a?e.collapseAriaLabel:e.expandAriaLabel)||s,u=e.onHeaderClick,d=u?function(e){u(e,a)}:void 0;return b.createElement("button",{className:l.chevronButton,onClick:d,"aria-label":c,"aria-expanded":a},b.createElement(Fr,{className:l.chevronIcon,iconName:"ChevronDown"}),e.name)},si(o),o.state={isGroupCollapsed:{},isLinkExpandStateChanged:!1,selectedKey:t.initialSelectedKey||t.selectedKey},o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.groups,n=e.className,r=e.isOnTop,i=e.theme;if(!o)return null;var s=o.map(this._renderGroup),a=xS(t,{theme:i,className:n,isOnTop:r,groups:o});return b.createElement(ks,{direction:vs.vertical,componentRef:this._focusZone},b.createElement("nav",{role:"navigation",className:a.root,"aria-label":this.props.ariaLabel},s))},Object.defineProperty(t.prototype,"selectedKey",{get:function(){return this.state.selectedKey},enumerable:!0,configurable:!0}),t.prototype.focus=function(e){return void 0===e&&(e=!1),!(!this._focusZone||!this._focusZone.current)&&this._focusZone.current.focus(e)},t.prototype._renderNavLink=function(e,t,o){var n=this.props,r=n.styles,i=n.groups,s=n.theme,a=e.icon||e.iconProps,l=this._isLinkSelected(e),c=e.ariaCurrent,u=void 0===c?"page":c,d=xS(r,{theme:s,isSelected:l,isDisabled:e.disabled,isButtonEntry:e.onClick&&!e.forceAnchor,leftPadding:14*o+3+(a?0:24),groups:i}),p=e.url&&e.target&&!CS(e.url)?"noopener noreferrer":void 0,h=this.props.linkAs?sf(this.props.linkAs,zu):zu,m=this.props.onRenderLink?Wh(this.props.onRenderLink,this._onRenderLink):this._onRenderLink;return b.createElement(h,{className:d.link,styles:yS,href:e.url||(e.forceAnchor?"#":void 0),iconProps:e.iconProps||{iconName:e.icon},onClick:e.onClick?this._onNavButtonLinkClicked.bind(this,e):this._onNavAnchorLinkClicked.bind(this,e),title:void 0!==e.title?e.title:e.name,target:e.target,rel:p,disabled:e.disabled,"aria-current":l?u:void 0,"aria-label":e.ariaLabel?e.ariaLabel:void 0,link:e},m(e))},t.prototype._renderCompositeLink=function(e,t,o){var n=h({},fr(e,gr,["onClick"])),r=this.props,i=r.expandButtonAriaLabel,s=r.styles,a=r.groups,l=r.theme,c=xS(s,{theme:l,isExpanded:!!e.isExpanded,isSelected:this._isLinkSelected(e),isLink:!0,isDisabled:e.disabled,position:14*o+1,groups:a}),u="";return e.links&&e.links.length>0&&(u=e.collapseAriaLabel||e.expandAriaLabel?e.isExpanded?e.collapseAriaLabel:e.expandAriaLabel:i?e.name+" "+i:e.name),b.createElement("div",h({},n,{key:e.key||t,className:c.compositeLink}),e.links&&e.links.length>0?b.createElement("button",{className:c.chevronButton,onClick:this._onLinkExpandClicked.bind(this,e),"aria-label":u,"aria-expanded":e.isExpanded?"true":"false"},b.createElement(Fr,{className:c.chevronIcon,iconName:"ChevronDown"})):null,this._renderNavLink(e,t,o))},t.prototype._renderLink=function(e,t,o){var n=this.props,r=n.styles,i=n.groups,s=n.theme,a=xS(r,{theme:s,groups:i});return b.createElement("li",{key:e.key||t,role:"listitem",className:a.navItem},this._renderCompositeLink(e,t,o),e.isExpanded?this._renderLinks(e.links,++o):null)},t.prototype._renderLinks=function(e,t){var o=this;if(!e||!e.length)return null;var n=e.map((function(e,n){return o._renderLink(e,n,t)})),r=this.props,i=r.styles,s=r.groups,a=r.theme,l=xS(i,{theme:a,groups:s});return b.createElement("ul",{role:"list",className:l.navItems},n)},t.prototype._onGroupHeaderClicked=function(e,t){e.onHeaderClick&&e.onHeaderClick(t,this._isGroupExpanded(e)),this._toggleCollapsed(e),t&&(t.preventDefault(),t.stopPropagation())},t.prototype._onLinkExpandClicked=function(e,t){var o=this.props.onLinkExpandClick;o&&o(t,e),t.defaultPrevented||(e.isExpanded=!e.isExpanded,this.setState({isLinkExpandStateChanged:!0})),t.preventDefault(),t.stopPropagation()},t.prototype._preventBounce=function(e,t){!e.url&&e.forceAnchor&&t.preventDefault()},t.prototype._onNavAnchorLinkClicked=function(e,t){this._preventBounce(e,t),this.props.onLinkClick&&this.props.onLinkClick(t,e),!e.url&&e.links&&e.links.length>0&&this._onLinkExpandClicked(e,t),this.setState({selectedKey:e.key})},t.prototype._onNavButtonLinkClicked=function(e,t){this._preventBounce(e,t),e.onClick&&e.onClick(t,e),!e.url&&e.links&&e.links.length>0&&this._onLinkExpandClicked(e,t),this.setState({selectedKey:e.key})},t.prototype._isLinkSelected=function(e){if(void 0!==this.props.selectedKey)return e.key===this.props.selectedKey;if(void 0!==this.state.selectedKey)return e.key===this.state.selectedKey;if(void 0===rt()||!e.url)return!1;(dS=dS||document.createElement("a")).href=e.url||"";var t=dS.href;return location.href===t||(location.protocol+"//"+location.host+location.pathname===t||!!location.hash&&(location.hash===e.url||(dS.href=location.hash.substring(1),dS.href===t)))},t.prototype._isGroupExpanded=function(e){return e.name&&this.state.isGroupCollapsed.hasOwnProperty(e.name)?!this.state.isGroupCollapsed[e.name]:void 0===e.collapseByDefault||!e.collapseByDefault},t.prototype._toggleCollapsed=function(e){var t;if(e.name){var o=h(h({},this.state.isGroupCollapsed),((t={})[e.name]=this._isGroupExpanded(e),t));this.setState({isGroupCollapsed:o})}},t.defaultProps={groups:null},t}(b.Component),wS=xn(kS,(function(e){var t,o=e.className,n=e.theme,r=e.isOnTop,i=e.isExpanded,s=e.isGroup,a=e.isLink,l=e.isSelected,c=e.isDisabled,u=e.isButtonEntry,d=e.navHeight,p=void 0===d?44:d,h=e.position,m=e.leftPadding,g=void 0===m?20:m,f=e.leftPaddingExpanded,v=void 0===f?28:f,b=e.rightPadding,_=void 0===b?20:b,y=n.palette,C=n.semanticColors,S=n.fonts,x=Oo(_S,n);return{root:[x.root,o,S.medium,{overflowY:"auto",userSelect:"none",WebkitOverflowScrolling:"touch"},r&&[{position:"absolute"},Ye.slideRightIn40]],linkText:[x.linkText,{margin:"0 4px",overflow:"hidden",verticalAlign:"middle",textAlign:"left",textOverflow:"ellipsis"}],compositeLink:[x.compositeLink,{display:"block",position:"relative",color:C.bodyText},i&&"is-expanded",l&&"is-selected",c&&"is-disabled",c&&{color:C.disabledText}],link:[x.link,go(n),{display:"block",position:"relative",height:p,width:"100%",lineHeight:p+"px",textDecoration:"none",cursor:"pointer",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",paddingLeft:g,paddingRight:_,color:C.bodyText,selectors:(t={},t[jt]={border:0,selectors:{":focus":{border:"1px solid WindowText"}}},t)},!c&&{selectors:{".ms-Nav-compositeLink:hover &":{backgroundColor:C.bodyBackgroundHovered}}},l&&{color:C.bodyTextChecked,fontWeight:Ge.semibold,backgroundColor:C.bodyBackgroundChecked,selectors:{"&:after":{borderLeft:"2px solid "+y.themePrimary,content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none"}}},c&&{color:C.disabledText},u&&{color:y.themePrimary}],chevronButton:[x.chevronButton,go(n),S.small,{display:"block",textAlign:"left",lineHeight:p+"px",margin:"5px 0",padding:"0px, "+_+"px, 0px, "+v+"px",border:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"pointer",color:C.bodyText,backgroundColor:"transparent",selectors:{"&:visited":{color:C.bodyText}}},s&&{fontSize:S.large.fontSize,width:"100%",height:p,borderBottom:"1px solid "+C.bodyDivider},a&&{display:"block",width:v-2,height:p-2,position:"absolute",top:"1px",left:h+"px",zIndex:po.Nav,padding:0,margin:0},l&&{color:y.themePrimary,backgroundColor:y.neutralLighterAlt,selectors:{"&:after":{borderLeft:"2px solid "+y.themePrimary,content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none"}}}],chevronIcon:[x.chevronIcon,{position:"absolute",left:"8px",height:p,lineHeight:p+"px",fontSize:S.small.fontSize,transition:"transform .1s linear"},i&&{transform:"rotate(-180deg)"},a&&{top:0}],navItem:[x.navItem,{padding:0}],navItems:[x.navItems,{listStyleType:"none",padding:0,margin:0}],group:[x.group,i&&"is-expanded"],groupContent:[x.groupContent,{display:"none",marginBottom:"40px"},Ye.slideDownIn20,i&&{display:"block"}]}}),void 0,{scope:"Nav"});!function(e){e[e.none=0]="none",e[e.forceResolve=1]="forceResolve",e[e.searchMore=2]="searchMore"}(SS||(SS={}));var IS={root:"ms-Suggestions-item",itemButton:"ms-Suggestions-itemButton",closeButton:"ms-Suggestions-closeButton",isSuggested:"is-suggested"};var DS,PS=s,TS=Mn(),ES=xn(Ty,(function(e){var t,o,n,r=e.className,i=e.theme,s=e.suggested,a=i.palette,l=i.semanticColors,c=Oo(IS,i);return{root:[c.root,{display:"flex",alignItems:"stretch",boxSizing:"border-box",width:"100%",position:"relative",selectors:{"&:hover":{background:l.menuItemBackgroundHovered},"&:hover .ms-Suggestions-closeButton":{display:"block"}}},s&&{selectors:{":after":{pointerEvents:"none",content:'""',position:"absolute",left:0,top:0,bottom:0,right:0,border:"1px solid "+i.semanticColors.focusBorder}}},r],itemButton:[c.itemButton,{width:"100%",padding:0,border:"none",height:"100%",minWidth:0,overflow:"hidden",selectors:(t={},t[jt]={color:"WindowText",selectors:{":hover":h({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"})}},t[":hover"]={color:l.menuItemTextHovered},t)},s&&[c.isSuggested,{background:l.menuItemBackgroundPressed,selectors:(o={":hover":{background:l.menuDivider}},o[jt]=h({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)}]],closeButton:[c.closeButton,{display:"none",color:a.neutralSecondary,padding:"0 4px",height:"auto",width:32,selectors:(n={":hover, :active":{background:a.neutralTertiaryAlt,color:a.neutralDark}},n[jt]={color:"WindowText"},n)},s&&{selectors:{":hover, :active":{background:a.neutralTertiary,color:a.neutralPrimary}}}]}}),void 0,{scope:"SuggestionItem"}),MS=function(e){function t(t){var o=e.call(this,t)||this;return o._forceResolveButton=b.createRef(),o._searchForMoreButton=b.createRef(),o._selectedElement=b.createRef(),o.tryHandleKeyDown=function(e,t){var n=!1,r=null,i=o.state.selectedActionType,s=o.props.suggestions.length;if(e===wn.down)switch(i){case SS.forceResolve:s>0?(o._refocusOnSuggestions(e),r=SS.none):r=o._searchForMoreButton.current?SS.searchMore:SS.forceResolve;break;case SS.searchMore:o._forceResolveButton.current?r=SS.forceResolve:s>0?(o._refocusOnSuggestions(e),r=SS.none):r=SS.searchMore;break;case SS.none:-1===t&&o._forceResolveButton.current&&(r=SS.forceResolve)}else if(e===wn.up)switch(i){case SS.forceResolve:o._searchForMoreButton.current?r=SS.searchMore:s>0&&(o._refocusOnSuggestions(e),r=SS.none);break;case SS.searchMore:s>0?(o._refocusOnSuggestions(e),r=SS.none):o._forceResolveButton.current&&(r=SS.forceResolve);break;case SS.none:-1===t&&o._searchForMoreButton.current&&(r=SS.searchMore)}return null!==r&&(o.setState({selectedActionType:r}),n=!0),n},o._getAlertText=function(){var e=o.props,t=e.isLoading,n=e.isSearching,r=e.suggestions,i=e.suggestionsAvailableAlertText,s=e.noResultsFoundText;if(!t&&!n){if(r.length>0)return i||"";if(s)return s}return""},o._getMoreResults=function(){o.props.onGetMoreResults&&o.props.onGetMoreResults()},o._forceResolve=function(){o.props.createGenericItem&&o.props.createGenericItem()},o._shouldShowForceResolve=function(){return!!o.props.showForceResolve&&o.props.showForceResolve()},o._onClickTypedSuggestionsItem=function(e,t){return function(n){o.props.onSuggestionClick(n,e,t)}},o._refocusOnSuggestions=function(e){"function"==typeof o.props.refocusSuggestions&&o.props.refocusSuggestions(e)},o._onRemoveTypedSuggestionsItem=function(e,t){return function(n){(0,o.props.onSuggestionRemove)(n,e,t),n.stopPropagation()}},si(o),o.state={selectedActionType:SS.none},o}return p(t,e),t.prototype.componentDidMount=function(){this.scrollSelected(),this.activeSelectedElement=this._selectedElement?this._selectedElement.current:null},t.prototype.componentDidUpdate=function(){this._selectedElement.current&&this.activeSelectedElement!==this._selectedElement.current&&(this.scrollSelected(),this.activeSelectedElement=this._selectedElement.current)},t.prototype.render=function(){var e,t,o=this,n=this.props,r=n.forceResolveText,i=n.mostRecentlyUsedHeaderText,s=n.searchForMoreText,a=n.className,l=n.moreSuggestionsAvailable,c=n.noResultsFoundText,u=n.suggestions,d=n.isLoading,p=n.isSearching,m=n.loadingText,g=n.onRenderNoResultFound,f=n.searchingText,v=n.isMostRecentlyUsedVisible,_=n.resultsMaximumNumber,y=n.resultsFooterFull,C=n.resultsFooter,S=n.isResultsFooterVisible,x=void 0===S||S,k=n.suggestionsHeaderText,w=n.suggestionsClassName,I=n.theme,D=n.styles,P=n.suggestionsListId;this._classNames=D?TS(D,{theme:I,className:a,suggestionsClassName:w,forceResolveButtonSelected:this.state.selectedActionType===SS.forceResolve,searchForMoreButtonSelected:this.state.selectedActionType===SS.searchMore}):{root:Sr("ms-Suggestions",a,PS.root),title:Sr("ms-Suggestions-title",PS.suggestionsTitle),searchForMoreButton:Sr("ms-SearchMore-button",PS.actionButton,(e={},e["is-selected "+PS.buttonSelected]=this.state.selectedActionType===SS.searchMore,e)),forceResolveButton:Sr("ms-forceResolve-button",PS.actionButton,(t={},t["is-selected "+PS.buttonSelected]=this.state.selectedActionType===SS.forceResolve,t)),suggestionsAvailable:Sr("ms-Suggestions-suggestionsAvailable",PS.suggestionsAvailable),suggestionsContainer:Sr("ms-Suggestions-container",PS.suggestionsContainer,w),noSuggestions:Sr("ms-Suggestions-none",PS.suggestionsNone)};var T=this._classNames.subComponentStyles?this._classNames.subComponentStyles.spinner:void 0,E=D?{styles:T}:{className:Sr("ms-Suggestions-spinner",PS.suggestionsSpinner)},M=function(){return c?b.createElement("div",{className:o._classNames.noSuggestions},c):null},R=k;v&&i&&(R=i);var B=void 0;x&&(B=u.length>=_?y:C);var N=!(u&&u.length||d),F=N||d?{role:"dialog",id:P}:{},A=this.state.selectedActionType===SS.forceResolve?"sug-selectedAction":void 0,L=this.state.selectedActionType===SS.searchMore?"sug-selectedAction":void 0;return b.createElement("div",h({className:this._classNames.root},F),b.createElement(vi,{message:this._getAlertText(),"aria-live":"polite"}),R?b.createElement("div",{className:this._classNames.title},R):null,r&&this._shouldShowForceResolve()&&b.createElement(Yu,{componentRef:this._forceResolveButton,className:this._classNames.forceResolveButton,id:A,onClick:this._forceResolve,"data-automationid":"sug-forceResolve"},r),d&&b.createElement(kv,h({},E,{label:m})),N?g?g(void 0,M):M():this._renderSuggestions(),s&&l&&b.createElement(Yu,{componentRef:this._searchForMoreButton,className:this._classNames.searchForMoreButton,iconProps:{iconName:"Search"},id:L,onClick:this._getMoreResults,"data-automationid":"sug-searchForMore"},s),p?b.createElement(kv,h({},E,{label:f})):null,!B||l||v||p?null:b.createElement("div",{className:this._classNames.title},B(this.props)))},t.prototype.hasSuggestedAction=function(){return!!this._searchForMoreButton.current||!!this._forceResolveButton.current},t.prototype.hasSuggestedActionSelected=function(){return this.state.selectedActionType!==SS.none},t.prototype.executeSelectedAction=function(){switch(this.state.selectedActionType){case SS.forceResolve:this._forceResolve();break;case SS.searchMore:this._getMoreResults()}},t.prototype.focusAboveSuggestions=function(){this._forceResolveButton.current?this.setState({selectedActionType:SS.forceResolve}):this._searchForMoreButton.current&&this.setState({selectedActionType:SS.searchMore})},t.prototype.focusBelowSuggestions=function(){this._searchForMoreButton.current?this.setState({selectedActionType:SS.searchMore}):this._forceResolveButton.current&&this.setState({selectedActionType:SS.forceResolve})},t.prototype.focusSearchForMoreButton=function(){this._searchForMoreButton.current&&this._searchForMoreButton.current.focus()},t.prototype.scrollSelected=function(){this._selectedElement.current&&void 0!==this._selectedElement.current.scrollIntoView&&this._selectedElement.current.scrollIntoView(!1)},t.prototype._renderSuggestions=function(){var e=this,t=this.props,o=t.onRenderSuggestion,n=t.removeSuggestionAriaLabel,r=t.suggestionsItemClassName,i=t.resultsMaximumNumber,s=t.showRemoveButtons,a=t.suggestionsContainerAriaLabel,l=t.suggestionsListId,c=this.props.suggestions,u=ES,d=-1;return c.some((function(e,t){return!!e.selected&&(d=t,!0)})),i&&(c=d>=i?c.slice(d-i+1,d+1):c.slice(0,i)),0===c.length?null:b.createElement("div",{className:this._classNames.suggestionsContainer,id:l,role:"listbox","aria-label":a},c.map((function(t,i){return b.createElement("div",{ref:t.selected?e._selectedElement:void 0,key:t.item.key?t.item.key:i},b.createElement(u,{suggestionModel:t,RenderSuggestion:o,onClick:e._onClickTypedSuggestionsItem(t.item,i),className:r,showRemoveButton:s,removeButtonAriaLabel:n,onRemoveItem:e._onRemoveTypedSuggestionsItem(t.item,i),id:"sug-"+i}))})))},t}(b.Component),RS=function(){function e(){var e=this;this._isSuggestionModel=function(e){return void 0!==e.item},this._ensureSuggestionModel=function(t){return e._isSuggestionModel(t)?t:{item:t,selected:!1,ariaLabel:t.name||t.primaryText}},this.suggestions=[],this.currentIndex=-1}return e.prototype.updateSuggestions=function(e,t){e&&e.length>0?(this.suggestions=this.convertSuggestionsToSuggestionItems(e),this.currentIndex=t||0,-1===t?this.currentSuggestion=void 0:void 0!==t&&(this.suggestions[t].selected=!0,this.currentSuggestion=this.suggestions[t])):(this.suggestions=[],this.currentIndex=-1,this.currentSuggestion=void 0)},e.prototype.nextSuggestion=function(){if(this.suggestions&&this.suggestions.length){if(this.currentIndex<this.suggestions.length-1)return this.setSelectedSuggestion(this.currentIndex+1),!0;if(this.currentIndex===this.suggestions.length-1)return this.setSelectedSuggestion(0),!0}return!1},e.prototype.previousSuggestion=function(){if(this.suggestions&&this.suggestions.length){if(this.currentIndex>0)return this.setSelectedSuggestion(this.currentIndex-1),!0;if(0===this.currentIndex)return this.setSelectedSuggestion(this.suggestions.length-1),!0}return!1},e.prototype.getSuggestions=function(){return this.suggestions},e.prototype.getCurrentItem=function(){return this.currentSuggestion},e.prototype.getSuggestionAtIndex=function(e){return this.suggestions[e]},e.prototype.hasSelectedSuggestion=function(){return!!this.currentSuggestion},e.prototype.removeSuggestion=function(e){this.suggestions.splice(e,1)},e.prototype.createGenericSuggestion=function(e){var t=this.convertSuggestionsToSuggestionItems([e])[0];this.currentSuggestion=t},e.prototype.convertSuggestionsToSuggestionItems=function(e){return Array.isArray(e)?e.map(this._ensureSuggestionModel):[]},e.prototype.deselectAllSuggestions=function(){this.currentIndex>-1&&(this.suggestions[this.currentIndex].selected=!1,this.currentIndex=-1)},e.prototype.setSelectedSuggestion=function(e){e>this.suggestions.length-1||e<0?(this.currentIndex=0,this.currentSuggestion.selected=!1,this.currentSuggestion=this.suggestions[0],this.currentSuggestion.selected=!0):(this.currentIndex>-1&&(this.suggestions[this.currentIndex].selected=!1),this.suggestions[e].selected=!0,this.currentIndex=e,this.currentSuggestion=this.suggestions[e])},e}(),BS={root:"ms-Suggestions",suggestionsContainer:"ms-Suggestions-container",title:"ms-Suggestions-title",forceResolveButton:"ms-forceResolve-button",searchForMoreButton:"ms-SearchMore-button",spinner:"ms-Suggestions-spinner",noSuggestions:"ms-Suggestions-none",suggestionsAvailable:"ms-Suggestions-suggestionsAvailable",isSelected:"is-selected"};function NS(e){var t,o=e.className,n=e.suggestionsClassName,r=e.theme,i=e.forceResolveButtonSelected,s=e.searchForMoreButtonSelected,a=r.palette,l=r.semanticColors,c=r.fonts,u=Oo(BS,r),d={backgroundColor:"transparent",border:0,cursor:"pointer",margin:0,paddingLeft:8,position:"relative",borderTop:"1px solid "+a.neutralLight,height:40,textAlign:"left",width:"100%",fontSize:c.small.fontSize,selectors:{":hover":{backgroundColor:l.menuItemBackgroundPressed,cursor:"pointer"},":focus, :active":{backgroundColor:a.themeLight},".ms-Button-icon":{fontSize:c.mediumPlus.fontSize,width:25},".ms-Button-label":{margin:"0 4px 0 9px"}}},p={backgroundColor:a.themeLight,selectors:(t={},t[jt]=h({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)};return{root:[u.root,{minWidth:260},o],suggestionsContainer:[u.suggestionsContainer,{overflowY:"auto",overflowX:"hidden",maxHeight:300,transform:"translate3d(0,0,0)"},n],title:[u.title,{padding:"0 12px",fontSize:c.small.fontSize,color:a.themePrimary,lineHeight:40,borderBottom:"1px solid "+l.menuItemBackgroundPressed}],forceResolveButton:[u.forceResolveButton,d,i&&[u.isSelected,p]],searchForMoreButton:[u.searchForMoreButton,d,s&&[u.isSelected,p]],noSuggestions:[u.noSuggestions,{textAlign:"center",color:a.neutralSecondary,fontSize:c.small.fontSize,lineHeight:30}],suggestionsAvailable:[u.suggestionsAvailable,yo],subComponentStyles:{spinner:{root:[u.spinner,{margin:"5px 0",paddingLeft:14,textAlign:"left",whiteSpace:"nowrap",lineHeight:20,fontSize:c.small.fontSize}],circle:{display:"inline-block",verticalAlign:"middle"},label:{display:"inline-block",verticalAlign:"middle",margin:"0 10px 0 16px"}}}}}!function(e){e[e.valid=0]="valid",e[e.warning=1]="warning",e[e.invalid=2]="invalid"}(DS||(DS={})),Object(Dt.a)([{rawString:".pickerText_c34f1d5d{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid "},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:";min-width:180px;min-height:30px}.pickerText_c34f1d5d:hover{border-color:"},{theme:"inputBorderHovered",defaultValue:"#323130"},{rawString:"}.pickerText_c34f1d5d.inputFocused_c34f1d5d{position:relative;border-color:"},{theme:"inputFocusBorderAlt",defaultValue:"#0078d4"},{rawString:"}.pickerText_c34f1d5d.inputFocused_c34f1d5d:after{pointer-events:none;content:'';position:absolute;left:-1px;top:-1px;bottom:-1px;right:-1px;border:2px solid "},{theme:"inputFocusBorderAlt",defaultValue:"#0078d4"},{rawString:"}.pickerInput_c34f1d5d{height:34px;border:none;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;outline:0;padding:0 6px 0;-ms-flex-item-align:end;align-self:flex-end}.pickerItems_c34f1d5d{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%}.screenReaderOnly_c34f1d5d{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"}]);var FS="pickerText_c34f1d5d",AS="inputFocused_c34f1d5d",LS="pickerInput_c34f1d5d",HS="pickerItems_c34f1d5d",OS="screenReaderOnly_c34f1d5d",zS=c,WS=Mn();var VS=function(e){function t(t){var o=e.call(this,t)||this;o.root=b.createRef(),o.input=b.createRef(),o.focusZone=b.createRef(),o.suggestionElement=b.createRef(),o.SuggestionOfProperType=MS,o._styledSuggestions=xn(o.SuggestionOfProperType,NS,void 0,{scope:"Suggestions"}),o.dismissSuggestions=function(e){var t=function(){var t=!0;o.props.onDismiss&&(t=o.props.onDismiss(e,o.suggestionStore.currentSuggestion?o.suggestionStore.currentSuggestion.item:void 0)),(!e||e&&!e.defaultPrevented)&&!1!==t&&o.canAddItems()&&o.suggestionStore.hasSelectedSuggestion()&&o.state.suggestedDisplayValue&&o.addItemByIndex(0)};o.currentPromise?o.currentPromise.then((function(){return t()})):t(),o.setState({suggestionsVisible:!1})},o.refocusSuggestions=function(e){o.resetFocus(),o.suggestionStore.suggestions&&o.suggestionStore.suggestions.length>0&&(e===wn.up?o.suggestionStore.setSelectedSuggestion(o.suggestionStore.suggestions.length-1):e===wn.down&&o.suggestionStore.setSelectedSuggestion(0))},o.onInputChange=function(e){o.updateValue(e),o.setState({moreSuggestionsAvailable:!0,isMostRecentlyUsedVisible:!1})},o.onSuggestionClick=function(e,t,n){o.addItemByIndex(n)},o.onSuggestionRemove=function(e,t,n){o.props.onRemoveSuggestion&&o.props.onRemoveSuggestion(t),o.suggestionStore.removeSuggestion(n)},o.onInputFocus=function(e){o.selection.setAllSelected(!1),o.state.isFocused||(o.setState({isFocused:!0}),o._userTriggeredSuggestions(),o.props.inputProps&&o.props.inputProps.onFocus&&o.props.inputProps.onFocus(e))},o.onInputBlur=function(e){o.props.inputProps&&o.props.inputProps.onBlur&&o.props.inputProps.onBlur(e)},o.onBlur=function(e){if(o.state.isFocused){var t=e.relatedTarget;null===e.relatedTarget&&(t=document.activeElement),t&&!Ni(o.root.current,t)&&(o.setState({isFocused:!1}),o.props.onBlur&&o.props.onBlur(e))}},o.onClick=function(e){void 0!==o.props.inputProps&&void 0!==o.props.inputProps.onClick&&o.props.inputProps.onClick(e),0===e.button&&o._userTriggeredSuggestions()},o.onKeyDown=function(e){var t=e.which;switch(t){case wn.escape:o.state.suggestionsVisible&&(o.setState({suggestionsVisible:!1}),e.preventDefault(),e.stopPropagation());break;case wn.tab:case wn.enter:o.suggestionElement.current&&o.suggestionElement.current.hasSuggestedActionSelected()?o.suggestionElement.current.executeSelectedAction():!e.shiftKey&&o.suggestionStore.hasSelectedSuggestion()&&o.state.suggestionsVisible?(o.completeSuggestion(),e.preventDefault(),e.stopPropagation()):o._completeGenericSuggestion();break;case wn.backspace:o.props.disabled||o.onBackspace(e),e.stopPropagation();break;case wn.del:o.props.disabled||(o.input.current&&e.target===o.input.current.inputElement&&o.state.suggestionsVisible&&-1!==o.suggestionStore.currentIndex?(o.props.onRemoveSuggestion&&o.props.onRemoveSuggestion(o.suggestionStore.currentSuggestion.item),o.suggestionStore.removeSuggestion(o.suggestionStore.currentIndex),o.forceUpdate()):o.onBackspace(e)),e.stopPropagation();break;case wn.up:o.input.current&&e.target===o.input.current.inputElement&&o.state.suggestionsVisible&&(o.suggestionElement.current&&o.suggestionElement.current.tryHandleKeyDown(t,o.suggestionStore.currentIndex)?(e.preventDefault(),e.stopPropagation(),o.forceUpdate()):o.suggestionElement.current&&o.suggestionElement.current.hasSuggestedAction()&&0===o.suggestionStore.currentIndex?(e.preventDefault(),e.stopPropagation(),o.suggestionElement.current.focusAboveSuggestions(),o.suggestionStore.deselectAllSuggestions(),o.forceUpdate()):o.suggestionStore.previousSuggestion()&&(e.preventDefault(),e.stopPropagation(),o.onSuggestionSelect()));break;case wn.down:o.input.current&&e.target===o.input.current.inputElement&&o.state.suggestionsVisible&&(o.suggestionElement.current&&o.suggestionElement.current.tryHandleKeyDown(t,o.suggestionStore.currentIndex)?(e.preventDefault(),e.stopPropagation(),o.forceUpdate()):o.suggestionElement.current&&o.suggestionElement.current.hasSuggestedAction()&&o.suggestionStore.currentIndex+1===o.suggestionStore.suggestions.length?(e.preventDefault(),e.stopPropagation(),o.suggestionElement.current.focusBelowSuggestions(),o.suggestionStore.deselectAllSuggestions(),o.forceUpdate()):o.suggestionStore.nextSuggestion()&&(e.preventDefault(),e.stopPropagation(),o.onSuggestionSelect()))}},o.onItemChange=function(e,t){var n=o.state.items;if(t>=0){var r=n;r[t]=e,o._updateSelectedItems(r)}},o.onGetMoreResults=function(){o.setState({isSearching:!0},(function(){if(o.props.onGetMoreResults&&o.input.current){var e=o.props.onGetMoreResults(o.input.current.value,o.state.items),t=e,n=e;Array.isArray(t)?(o.updateSuggestions(t),o.setState({isSearching:!1})):n.then&&n.then((function(e){o.updateSuggestions(e),o.setState({isSearching:!1})}))}else o.setState({isSearching:!1});o.input.current&&o.input.current.focus(),o.setState({moreSuggestionsAvailable:!1,isResultsFooterVisible:!0})}))},o.completeSelection=function(e){o.addItem(e),o.updateValue(""),o.input.current&&o.input.current.clear(),o.setState({suggestionsVisible:!1})},o.addItemByIndex=function(e){o.completeSelection(o.suggestionStore.getSuggestionAtIndex(e).item)},o.addItem=function(e){var t=o.props.onItemSelected?o.props.onItemSelected(e):e;if(null!==t){var n=t,r=t;if(r&&r.then)r.then((function(e){var t=o.state.items.concat([e]);o._updateSelectedItems(t)}));else{var i=o.state.items.concat([n]);o._updateSelectedItems(i)}o.setState({suggestedDisplayValue:""})}},o.removeItem=function(e,t){var n=o.state.items,r=n.indexOf(e);if(r>=0){var i=n.slice(0,r).concat(n.slice(r+1));o._updateSelectedItems(i)}},o.removeItems=function(e){var t=o.state.items.filter((function(t){return-1===e.indexOf(t)}));o._updateSelectedItems(t)},o._shouldFocusZoneEnterInnerZone=function(e){if(o.state.suggestionsVisible)switch(e.which){case wn.up:case wn.down:return!0}return e.which===wn.enter},o._onResolveSuggestions=function(e){var t=o.props.onResolveSuggestions(e,o.state.items);null!==t&&o.updateSuggestionsList(t,e)},o._completeGenericSuggestion=function(){if(o.props.onValidateInput&&o.input.current&&o.props.onValidateInput(o.input.current.value)!==DS.invalid&&o.props.createGenericItem){var e=o.props.createGenericItem(o.input.current.value,o.props.onValidateInput(o.input.current.value));o.suggestionStore.createGenericSuggestion(e),o.completeSuggestion()}},o._userTriggeredSuggestions=function(){if(!o.state.suggestionsVisible){var e=o.input.current?o.input.current.value:"";e?0===o.suggestionStore.suggestions.length?o._onResolveSuggestions(e):o.setState({isMostRecentlyUsedVisible:!1,suggestionsVisible:!0}):o.onEmptyInputFocus()}},si(o),o._async=new di(o);var n=t.selectedItems||t.defaultSelectedItems||[];return o._id=ts(),o._ariaMap={selectedItems:"selected-items-"+o._id,selectedSuggestionAlert:"selected-suggestion-alert-"+o._id,suggestionList:"suggestion-list-"+o._id,combobox:"combobox-"+o._id},o.suggestionStore=new RS,o.selection=new xf({onSelectionChanged:function(){return o.onSelectionChange()}}),o.selection.setItems(n),o.state={items:n,suggestedDisplayValue:"",isMostRecentlyUsedVisible:!1,moreSuggestionsAvailable:!1,isFocused:!1,isSearching:!1,selectedIndices:[]},o}return p(t,e),t.getDerivedStateFromProps=function(e){return e.selectedItems?{items:e.selectedItems}:null},Object.defineProperty(t.prototype,"items",{get:function(){return this.state.items},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this.selection.setItems(this.state.items),this._onResolveSuggestions=this._async.debounce(this._onResolveSuggestions,this.props.resolveDelay)},t.prototype.componentDidUpdate=function(e,t){if(this.state.items&&this.state.items!==t.items){var o=this.selection.getSelectedIndices()[0];this.selection.setItems(this.state.items),this.state.isFocused&&this.state.items.length<t.items.length&&(this.selection.setIndexSelected(o,!0,!0),this.resetFocus(o))}},t.prototype.componentWillUnmount=function(){this.currentPromise&&(this.currentPromise=void 0),this._async.dispose()},t.prototype.focus=function(){this.focusZone.current&&this.focusZone.current.focus()},t.prototype.focusInput=function(){this.input.current&&this.input.current.focus()},t.prototype.completeSuggestion=function(e){this.suggestionStore.hasSelectedSuggestion()&&this.input.current?this.completeSelection(this.suggestionStore.currentSuggestion.item):e&&this._completeGenericSuggestion()},t.prototype.render=function(){var e=this.state,t=e.suggestedDisplayValue,o=e.isFocused,n=e.items,r=this.props,i=r.className,s=r.inputProps,a=r.disabled,l=r.theme,c=r.styles,u=this.props.enableSelectedSuggestionAlert?this._ariaMap.selectedSuggestionAlert:"",d=this.state.suggestionsVisible?this._ariaMap.suggestionList:"",p=this.canAddItems(),m=c?WS(c,{theme:l,className:i,isFocused:o,disabled:a,inputClassName:s&&s.className}):{root:Sr("ms-BasePicker",i||""),text:Sr("ms-BasePicker-text",zS.pickerText,this.state.isFocused&&zS.inputFocused),itemsWrapper:zS.pickerItems,input:Sr("ms-BasePicker-input",zS.pickerInput,s&&s.className),screenReaderText:zS.screenReaderOnly};return b.createElement("div",{ref:this.root,className:m.root,onKeyDown:this.onKeyDown,onBlur:this.onBlur},b.createElement(ks,{componentRef:this.focusZone,direction:vs.bidirectional,shouldEnterInnerZone:this._shouldFocusZoneEnterInnerZone,role:p?"combobox":void 0,id:p?this._ariaMap.combobox:void 0,"aria-label":p?this.props["aria-label"]:void 0,"aria-expanded":p?!!this.state.suggestionsVisible:void 0,"aria-owns":p&&d||void 0,"aria-haspopup":d&&this.suggestionStore.suggestions.length>0?"listbox":"dialog"},this.getSuggestionsAlert(m.screenReaderText),b.createElement(Mf,{selection:this.selection,selectionMode:af.multiple},b.createElement("div",{className:m.text},n.length>0&&b.createElement("span",{id:this._ariaMap.selectedItems,className:m.itemsWrapper,role:"list"},this.renderItems()),this.canAddItems()&&b.createElement(pi,h({spellCheck:!1},s,{className:m.input,componentRef:this.input,onClick:this.onClick,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onInputValueChange:this.onInputChange,suggestedDisplayValue:t,"arial-labelledby":this.props["aria-label"]?this._ariaMap.combobox:void 0,"aria-describedby":n.length>0?this._ariaMap.selectedItems:void 0,"aria-controls":d+" "+u||void 0,"aria-activedescendant":this.getActiveDescendant(),role:"textbox",disabled:a,onInputChange:this.props.onInputChange}))))),this.renderSuggestions())},t.prototype.canAddItems=function(){var e=this.state.items,t=this.props.itemLimit;return void 0===t||e.length<t},t.prototype.renderSuggestions=function(){var e=this._styledSuggestions;return this.state.suggestionsVisible&&this.input?b.createElement(uc,h({isBeakVisible:!1,gapSpace:5,target:this.input.current?this.input.current.inputElement:void 0,onDismiss:this.dismissSuggestions,directionalHint:ya.bottomLeftEdge,directionalHintForRTL:ya.bottomRightEdge},this.props.pickerCalloutProps),b.createElement(e,h({onRenderSuggestion:this.props.onRenderSuggestionsItem,onSuggestionClick:this.onSuggestionClick,onSuggestionRemove:this.onSuggestionRemove,suggestions:this.suggestionStore.getSuggestions(),componentRef:this.suggestionElement,onGetMoreResults:this.onGetMoreResults,moreSuggestionsAvailable:this.state.moreSuggestionsAvailable,isLoading:this.state.suggestionsLoading,isSearching:this.state.isSearching,isMostRecentlyUsedVisible:this.state.isMostRecentlyUsedVisible,isResultsFooterVisible:this.state.isResultsFooterVisible,refocusSuggestions:this.refocusSuggestions,removeSuggestionAriaLabel:this.props.removeButtonAriaLabel,suggestionsListId:this._ariaMap.suggestionList,createGenericItem:this._completeGenericSuggestion},this.props.pickerSuggestionsProps))):null},t.prototype.renderItems=function(){var e=this,t=this.props,o=t.disabled,n=t.removeButtonAriaLabel,r=this.props.onRenderItem,i=this.state,s=i.items,a=i.selectedIndices;return s.map((function(t,i){return r({item:t,index:i,key:t.key?t.key:i,selected:-1!==a.indexOf(i),onRemoveItem:function(){return e.removeItem(t,!0)},disabled:o,onItemChange:e.onItemChange,removeButtonAriaLabel:n})}))},t.prototype.resetFocus=function(e){var t=this.state.items;if(t.length&&e>=0){var o=this.root.current&&this.root.current.querySelectorAll("[data-selection-index]")[Math.min(e,t.length-1)];o&&this.focusZone.current&&this.focusZone.current.focusElement(o)}else this.canAddItems()?this.input.current&&this.input.current.focus():this.resetFocus(t.length-1)},t.prototype.onSuggestionSelect=function(){if(this.suggestionStore.currentSuggestion){var e=this.input.current?this.input.current.value:"",t=this._getTextFromItem(this.suggestionStore.currentSuggestion.item,e);this.setState({suggestedDisplayValue:t})}},t.prototype.onSelectionChange=function(){this.setState({selectedIndices:this.selection.getSelectedIndices()})},t.prototype.updateSuggestions=function(e){this.suggestionStore.updateSuggestions(e,0),this.forceUpdate()},t.prototype.onEmptyInputFocus=function(){var e=this.props.onEmptyResolveSuggestions?this.props.onEmptyResolveSuggestions:this.props.onEmptyInputFocus;if(e){var t=e(this.state.items);this.updateSuggestionsList(t),this.setState({isMostRecentlyUsedVisible:!0,suggestionsVisible:!0,moreSuggestionsAvailable:!1})}},t.prototype.updateValue=function(e){this._onResolveSuggestions(e)},t.prototype.updateSuggestionsList=function(e,t){var o=this,n=e,r=e;if(Array.isArray(n))this._updateAndResolveValue(t,n);else if(r&&r.then){this.setState({suggestionsLoading:!0}),this.suggestionStore.updateSuggestions([]),void 0!==t?this.setState({suggestionsVisible:this._getShowSuggestions()}):this.setState({suggestionsVisible:this.input.current&&this.input.current.inputElement===document.activeElement});var i=this.currentPromise=r;i.then((function(e){i===o.currentPromise&&o._updateAndResolveValue(t,e)}))}},t.prototype.resolveNewValue=function(e,t){var o=this;this.updateSuggestions(t);var n=void 0;this.suggestionStore.currentSuggestion&&(n=this._getTextFromItem(this.suggestionStore.currentSuggestion.item,e)),this.setState({suggestedDisplayValue:n,suggestionsVisible:this._getShowSuggestions()},(function(){return o.setState({suggestionsLoading:!1})}))},t.prototype.onChange=function(e){this.props.onChange&&this.props.onChange(e)},t.prototype.onBackspace=function(e){(this.state.items.length&&!this.input.current||this.input.current&&!this.input.current.isValueSelected&&0===this.input.current.cursorLocation)&&(this.selection.getSelectedCount()>0?this.removeItems(this.selection.getSelection()):this.removeItem(this.state.items[this.state.items.length-1]))},t.prototype.getActiveDescendant=function(){if(!this.state.suggestionsLoading){var e=this.suggestionStore.currentIndex;return e<0&&this.suggestionElement.current&&this.suggestionElement.current.hasSuggestedAction()?"sug-selectedAction":e>-1&&!this.state.suggestionsLoading?"sug-"+e:void 0}},t.prototype.getSuggestionsAlert=function(e){void 0===e&&(e=zS.screenReaderOnly);var t=this.suggestionStore.currentIndex;if(this.props.enableSelectedSuggestionAlert){var o=t>-1?this.suggestionStore.getSuggestionAtIndex(this.suggestionStore.currentIndex):void 0,n=o?o.ariaLabel:void 0;return b.createElement("div",{className:e,role:"alert",id:this._ariaMap.selectedSuggestionAlert,"aria-live":"assertive"},n," ")}},t.prototype._updateAndResolveValue=function(e,t){void 0!==e?this.resolveNewValue(e,t):(this.suggestionStore.updateSuggestions(t,-1),this.state.suggestionsLoading&&this.setState({suggestionsLoading:!1}))},t.prototype._updateSelectedItems=function(e){var t=this;this.props.selectedItems?this.onChange(e):this.setState({items:e},(function(){t._onSelectedItemsUpdated(e)}))},t.prototype._onSelectedItemsUpdated=function(e){this.onChange(e)},t.prototype._getShowSuggestions=function(){return void 0!==this.input.current&&null!==this.input.current&&this.input.current.inputElement===document.activeElement&&""!==this.input.current.value},t.prototype._getTextFromItem=function(e,t){return this.props.getTextFromItem?this.props.getTextFromItem(e,t):""},t}(b.Component),KS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.render=function(){var e=this.state,t=e.suggestedDisplayValue,o=e.isFocused,n=this.props,r=n.className,i=n.inputProps,s=n.disabled,a=n.theme,l=n.styles,c=this.props.enableSelectedSuggestionAlert?this._ariaMap.selectedSuggestionAlert:"",u=this.state.suggestionsVisible?this._ariaMap.suggestionList:"",d=l?WS(l,{theme:a,className:r,isFocused:o,inputClassName:i&&i.className}):{root:Sr("ms-BasePicker",r||""),text:Sr("ms-BasePicker-text",zS.pickerText,this.state.isFocused&&zS.inputFocused),input:Sr("ms-BasePicker-input",zS.pickerInput,i&&i.className),screenReaderText:zS.screenReaderOnly};return b.createElement("div",{ref:this.root,onBlur:this.onBlur},b.createElement("div",{className:d.root,onKeyDown:this.onKeyDown},this.getSuggestionsAlert(d.screenReaderText),b.createElement("div",{className:d.text,"aria-owns":u||void 0,"aria-expanded":!!this.state.suggestionsVisible,"aria-haspopup":u&&this.suggestionStore.suggestions.length>0?"listbox":"dialog",role:"combobox"},b.createElement(pi,h({},i,{className:d.input,componentRef:this.input,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onClick:this.onClick,onInputValueChange:this.onInputChange,suggestedDisplayValue:t,"aria-activedescendant":this.getActiveDescendant(),role:"textbox",disabled:s,"aria-controls":u+" "+c||void 0,onInputChange:this.props.onInputChange})))),this.renderSuggestions(),b.createElement(Mf,{selection:this.selection,selectionMode:af.single},b.createElement(ks,{componentRef:this.focusZone,className:"ms-BasePicker-selectedItems",isCircularNavigation:!0,direction:vs.bidirectional,shouldEnterInnerZone:this._shouldFocusZoneEnterInnerZone,id:this._ariaMap.selectedItems,role:"list"},this.renderItems())))},t.prototype.onBackspace=function(e){},t}(VS),US={root:"ms-PickerPersona-container",itemContent:"ms-PickerItem-content",removeButton:"ms-PickerItem-removeButton",isSelected:"is-selected",isInvalid:"is-invalid"};var GS=Mn(),jS=function(e){var t=e.item,o=e.onRemoveItem,n=e.index,r=e.selected,i=e.removeButtonAriaLabel,s=e.styles,a=e.theme,l=e.className,c=e.disabled,u=ts(),d=GS(s,{theme:a,className:l,selected:r,disabled:c,invalid:t.ValidationState===DS.warning}),p=d.subComponentStyles?d.subComponentStyles.persona:void 0,m=d.subComponentStyles?d.subComponentStyles.personaCoin:void 0;return b.createElement("div",{className:d.root,"data-is-focusable":!c,"data-is-sub-focuszone":!0,"data-selection-index":n,role:"listitem","aria-labelledby":"selectedItemPersona-"+u},b.createElement("div",{className:d.itemContent,id:"selectedItemPersona-"+u},b.createElement(cy,h({size:xr.size24,styles:p,coinProps:{styles:m}},t))),b.createElement(eu,{onClick:o,disabled:c,iconProps:{iconName:"Cancel",styles:{root:{fontSize:"12px"}}},className:d.removeButton,ariaLabel:i}))},YS=xn(jS,(function(e){var t,o,n,r,i,s,a,l=e.className,c=e.theme,u=e.selected,d=e.invalid,p=e.disabled,m=c.palette,g=c.semanticColors,f=c.fonts,v=Oo(US,c),b=[u&&!d&&!p&&{color:m.white,selectors:(t={":hover":{color:m.white}},t[jt]={color:"HighlightText"},t)},(d&&!u||d&&u&&p)&&{color:m.redDark,borderBottom:"2px dotted "+m.redDark,selectors:(o={},o["."+v.root+":hover &"]={color:m.redDark},o)},d&&u&&!p&&{color:m.white,borderBottom:"2px dotted "+m.white},p&&{selectors:(n={},n[jt]={color:"GrayText"},n)}],_=[d&&{fontSize:f.xLarge.fontSize}];return{root:[v.root,go(c,{inset:-2}),{borderRadius:15,display:"inline-flex",alignItems:"center",background:m.neutralLighter,margin:"1px 2px",cursor:"default",userSelect:"none",maxWidth:300,verticalAlign:"middle",minWidth:0,selectors:(r={":hover":{background:u||p?"":m.neutralLight}},r[jt]=[{border:"1px solid WindowText"},p&&{borderColor:"GrayText"}],r)},u&&!p&&[v.isSelected,{background:m.themePrimary,selectors:(i={},i[jt]=h({borderColor:"HighLight",background:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)}],d&&[v.isInvalid],d&&u&&!p&&{background:m.redDark},l],itemContent:[v.itemContent,{flex:"0 1 auto",minWidth:0,maxWidth:"100%",overflow:"hidden"}],removeButton:[v.removeButton,{borderRadius:15,color:m.neutralPrimary,flex:"0 0 auto",width:24,height:24,selectors:{":hover":{background:m.neutralTertiaryAlt,color:m.neutralDark}}},u&&[{color:m.white,selectors:(s={":hover":{color:m.white,background:m.themeDark},":active":{color:m.white,background:m.themeDarker}},s[jt]={color:"HighlightText"},s)},d&&{selectors:{":hover":{background:m.red},":active":{background:m.redDark}}}],p&&{selectors:(a={},a["."+Gc.msButtonIcon]={color:g.buttonText},a)}],subComponentStyles:{persona:{primaryText:b},personaCoin:{initials:_}}}}),void 0,{scope:"PeoplePickerItem"}),qS={root:"ms-PeoplePicker-personaContent",personaWrapper:"ms-PeoplePicker-Persona"};var ZS=Mn(),XS=function(e){var t=e.personaProps,o=e.suggestionsProps,n=e.compact,r=e.styles,i=e.theme,s=e.className,a=ZS(r,{theme:i,className:o&&o.suggestionsItemClassName||s}),l=a.subComponentStyles&&a.subComponentStyles.persona?a.subComponentStyles.persona:void 0;return b.createElement("div",{className:a.root},b.createElement(cy,h({size:xr.size24,styles:l,className:a.personaWrapper,showSecondaryText:!n},t)))},QS=xn(XS,(function(e){var t,o,n,r=e.className,i=e.theme,s=Oo(qS,i),a={selectors:(t={},t["."+IS.isSuggested+" &"]={selectors:(o={},o[jt]={color:"HighlightText"},o)},t["."+s.root+":hover &"]={selectors:(n={},n[jt]={color:"HighlightText"},n)},t)};return{root:[s.root,{width:"100%",padding:"4px 12px"},r],personaWrapper:[s.personaWrapper,{width:180}],subComponentStyles:{persona:{primaryText:a,secondaryText:a}}}}),void 0,{scope:"PeoplePickerItemSuggestion"}),JS={root:"ms-BasePicker",text:"ms-BasePicker-text",itemsWrapper:"ms-BasePicker-itemsWrapper",input:"ms-BasePicker-input"};function $S(e){var t,o=e.className,n=e.theme,r=e.isFocused,i=e.inputClassName,s=e.disabled;if(!n)throw new Error("theme is undefined or null in base BasePicker getStyles function.");var a=n.semanticColors,l=n.effects,c=n.fonts,u=a.inputBorder,d=a.inputBorderHovered,p=a.inputFocusBorderAlt,h=Oo(JS,n);return{root:[h.root,o],text:[h.text,{display:"flex",position:"relative",flexWrap:"wrap",alignItems:"center",boxSizing:"border-box",minWidth:180,minHeight:30,border:"1px solid "+u,borderRadius:l.roundedCorner2},!r&&!s&&{selectors:{":hover":{borderColor:d}}},r&&!s&&_o(p,l.roundedCorner2),s&&{borderColor:"rgba(218, 218, 218, 0.29)",selectors:(t={":after":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,background:"rgba(218, 218, 218, 0.29)"}},t[jt]={borderColor:"GrayText",selectors:{":after":{background:"none"}}},t)}],itemsWrapper:[h.itemsWrapper,{display:"flex",flexWrap:"wrap",maxWidth:"100%"}],input:[h.input,c.medium,{height:30,border:"none",flexGrow:1,outline:"none",padding:"0 6px 0",alignSelf:"flex-end",borderRadius:l.roundedCorner2,backgroundColor:"transparent",color:a.inputText,selectors:{"::-ms-clear":{display:"none"}}},i],screenReaderText:yo}}var ex=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(VS),tx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(KS),ox=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.defaultProps={onRenderItem:function(e){return b.createElement(YS,h({},e))},onRenderSuggestionsItem:function(e,t){return b.createElement(QS,{personaProps:e,suggestionsProps:t})},createGenericItem:ix},t}(ex),nx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.defaultProps={onRenderItem:function(e){return b.createElement(YS,h({},e))},onRenderSuggestionsItem:function(e,t){return b.createElement(QS,{personaProps:e,suggestionsProps:t,compact:!0})},createGenericItem:ix},t}(ex),rx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.defaultProps={onRenderItem:function(e){return b.createElement(YS,h({},e))},onRenderSuggestionsItem:function(e,t){return b.createElement(QS,{personaProps:e,suggestionsProps:t})},createGenericItem:ix},t}(tx);function ix(e,t){var o={key:e,primaryText:e,imageInitials:"!",ValidationState:t};return t!==DS.warning&&(o.imageInitials=On(e,In())),o}var sx=xn(ox,$S,void 0,{scope:"NormalPeoplePicker"}),ax=xn(nx,$S,void 0,{scope:"CompactPeoplePicker"}),lx=xn(rx,$S,void 0,{scope:"ListPeoplePickerBase"}),cx={root:"ms-TagItem",text:"ms-TagItem-text",close:"ms-TagItem-close",isSelected:"is-selected"};var ux=Mn(),dx=function(e){var t=e.theme,o=e.styles,n=e.selected,r=e.disabled,i=e.enableTagFocusInDisabledPicker,s=e.children,a=e.className,l=e.index,c=e.onRemoveItem,u=e.removeButtonAriaLabel,d=e.title,p=void 0===d?"string"==typeof e.children?e.children:e.item.name:d,h=ux(o,{theme:t,className:a,selected:n,disabled:r});return b.createElement("div",{className:h.root,role:"listitem",key:l,"data-selection-index":l,"data-is-focusable":(i||!r)&&!0},b.createElement("span",{className:h.text,"aria-label":p,title:p},s),b.createElement(eu,{onClick:c,disabled:r,iconProps:{iconName:"Cancel",styles:{root:{fontSize:"12px"}}},className:h.close,ariaLabel:u}))},px=xn(dx,(function(e){var t,o,n,r,i=e.className,s=e.theme,a=e.selected,l=e.disabled,c=s.palette,u=s.effects,d=s.fonts,p=s.semanticColors,h=Oo(cx,s);return{root:[h.root,d.medium,go(s),{boxSizing:"content-box",flexShrink:"1",margin:2,height:26,lineHeight:26,cursor:"default",userSelect:"none",display:"flex",flexWrap:"nowrap",maxWidth:300,minWidth:0,borderRadius:u.roundedCorner2,color:p.inputText,background:!a||l?c.neutralLighter:c.themePrimary,selectors:(t={":hover":[!l&&!a&&{color:c.neutralDark,background:c.neutralLight,selectors:{".ms-TagItem-close":{color:c.neutralPrimary}}},l&&{background:c.neutralLighter},a&&!l&&{background:c.themePrimary}]},t[jt]={border:"1px solid "+(a?"WindowFrame":"WindowText")},t)},l&&{selectors:(o={},o[jt]={borderColor:"GrayText"},o)},a&&!l&&[h.isSelected,{color:c.white}],i],text:[h.text,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:30,margin:"0 8px"},l&&{selectors:(n={},n[jt]={color:"GrayText"},n)}],close:[h.close,{color:c.neutralSecondary,width:30,height:"100%",flex:"0 0 auto",borderRadius:In(s)?u.roundedCorner2+" 0 0 "+u.roundedCorner2:"0 "+u.roundedCorner2+" "+u.roundedCorner2+" 0",selectors:{":hover":{background:c.neutralQuaternaryAlt,color:c.neutralPrimary},":active":{color:c.white,backgroundColor:c.themeDark}}},a&&{color:c.white,selectors:{":hover":{color:c.white,background:c.themeDark}}},l&&{selectors:(r={},r["."+Gc.msButtonIcon]={color:c.neutralSecondary},r)}]}}),void 0,{scope:"TagItem"}),hx={suggestionTextOverflow:"ms-TagItem-TextOverflow"};var mx,gx,fx=Mn(),vx=function(e){var t=e.styles,o=e.theme,n=e.children,r=fx(t,{theme:o});return b.createElement("div",{className:r.suggestionTextOverflow}," ",n," ")},bx=xn(vx,(function(e){var t=e.className,o=e.theme;return{suggestionTextOverflow:[Oo(hx,o).suggestionTextOverflow,{overflow:"hidden",textOverflow:"ellipsis",maxWidth:"60vw",padding:"6px 12px 7px",whiteSpace:"nowrap"},t]}}),void 0,{scope:"TagItemSuggestion"}),_x=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.defaultProps={onRenderItem:function(e){return b.createElement(px,h({},e),e.item.name)},onRenderSuggestionsItem:function(e){return b.createElement(bx,null,e.name)}},t}(VS),yx=xn(_x,$S,void 0,{scope:"TagPicker"}),Cx=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o}return p(t,e),t.prototype.render=function(){return b.createElement("div",h({},fr(this.props,gr)),this.props.children)},t}(b.Component);!function(e){e[e.links=0]="links",e[e.tabs=1]="tabs"}(mx||(mx={})),function(e){e[e.normal=0]="normal",e[e.large=1]="large"}(gx||(gx={}));var Sx=Mn(),xx=function(e){function t(t){var o=e.call(this,t)||this;o._focusZone=b.createRef(),o._renderPivotLink=function(e,t,n){var r,i=t.itemKey,s=t.headerButtonProps,a=e.keyToTabIdMapping[i],l=t.onRenderItemLink,c=n===i;r=l?l(t,o._renderLinkContent):o._renderLinkContent(t);var u=t.headerText||"";return u+=t.itemCount?" ("+t.itemCount+")":"",u+=t.itemIcon?" xx":"",b.createElement(Yu,h({},s,{id:a,key:i,className:c?o._classNames.linkIsSelected:o._classNames.link,onClick:o._onLinkClick.bind(o,i),onKeyDown:o._onKeyDown.bind(o,i),"aria-label":t.ariaLabel,role:"tab","aria-selected":c,name:t.headerText,keytipProps:t.keytipProps,"data-content":u}),r)},o._renderLinkContent=function(e){var t=e.itemCount,n=e.itemIcon,r=e.headerText,i=o._classNames;return b.createElement("span",{className:i.linkContent},void 0!==n&&b.createElement("span",{className:i.icon},b.createElement(Fr,{iconName:n})),void 0!==r&&b.createElement("span",{className:i.text}," ",e.headerText),void 0!==t&&b.createElement("span",{className:i.count}," (",t,")"))},si(o),o._pivotId=ts("Pivot");var n,r=o._getPivotLinks(t).links,i=t.defaultSelectedKey,s=void 0===i?t.initialSelectedKey:i,a=t.defaultSelectedIndex,l=void 0===a?t.initialSelectedIndex:a;return s?n=s:"number"==typeof l?n=r[l].itemKey:r.length&&(n=r[0].itemKey),o.state={selectedKey:n},o}return p(t,e),t.prototype.focus=function(){this._focusZone.current&&this._focusZone.current.focus()},t.prototype.render=function(){var e=this,t=this._getPivotLinks(this.props),o=this._getSelectedKey(t),n=fr(this.props,gr);return this._classNames=this._getClassNames(this.props),b.createElement("div",h({role:"toolbar"},n),this._renderPivotLinks(t,o),o&&t.links.map((function(n){return(!0===n.alwaysRender||o===n.itemKey)&&e._renderPivotItem(t,n.itemKey,o===n.itemKey)})))},t.prototype._getSelectedKey=function(e){var t=this.props.selectedKey;if(this._isKeyValid(e,t)||null===t)return t;var o=this.state.selectedKey;return this._isKeyValid(e,o)?o:e.links.length?e.links[0].itemKey:void 0},t.prototype._renderPivotLinks=function(e,t){var o=this,n=e.links.map((function(n){return o._renderPivotLink(e,n,t)}));return b.createElement(ks,{className:this._classNames.root,role:"tablist",componentRef:this._focusZone,direction:vs.horizontal},n)},t.prototype._renderPivotItem=function(e,t,o){if(this.props.headersOnly||!t)return null;var n=e.keyToIndexMapping[t],r=e.keyToTabIdMapping[t];return b.createElement("div",{role:"tabpanel",hidden:!o,key:t,"aria-hidden":!o,"aria-labelledby":r,className:this._classNames.itemContainer},b.Children.toArray(this.props.children)[n])},t.prototype._getPivotLinks=function(e){var t=this,o={links:[],keyToIndexMapping:{},keyToTabIdMapping:{}};return b.Children.map(b.Children.toArray(e.children),(function(e,n){if(kx(e)){var r=e,i=r.props,s=i.linkText,a=m(i,["linkText"]),l=r.props.itemKey||n.toString();o.links.push(h(h({headerText:s},a),{itemKey:l})),o.keyToIndexMapping[l]=n,o.keyToTabIdMapping[l]=t._getTabId(l,n)}else Zo("The children of a Pivot component must be of type PivotItem to be rendered.")})),o},t.prototype._getTabId=function(e,t){return this.props.getTabId?this.props.getTabId(e,t):this._pivotId+"-Tab"+t},t.prototype._isKeyValid=function(e,t){return null!=t&&void 0!==e.keyToIndexMapping[t]},t.prototype._onLinkClick=function(e,t){t.preventDefault(),this._updateSelectedItem(e,t)},t.prototype._onKeyDown=function(e,t){t.which===wn.enter&&(t.preventDefault(),this._updateSelectedItem(e))},t.prototype._updateSelectedItem=function(e,t){this.setState({selectedKey:e});var o=this._getPivotLinks(this.props);if(this.props.onLinkClick&&o.keyToIndexMapping[e]>=0){var n=o.keyToIndexMapping[e],r=b.Children.toArray(this.props.children)[n];kx(r)&&this.props.onLinkClick(r,t)}},t.prototype._getClassNames=function(e){var t=e.theme,o=e.linkSize===gx.large,n=e.linkFormat===mx.tabs;return Sx(e.styles,{theme:t,rootIsLarge:o,rootIsTabs:n})},t}(b.Component);function kx(e){return!!e&&"object"==typeof e&&!!e.type&&e.type.name===Cx.name}var wx,Ix={count:"ms-Pivot-count",icon:"ms-Pivot-icon",linkIsSelected:"is-selected",link:"ms-Pivot-link",linkContent:"ms-Pivot-linkContent",root:"ms-Pivot",rootIsLarge:"ms-Pivot--large",rootIsTabs:"ms-Pivot--tabs",text:"ms-Pivot-text"},Dx=function(e){var t,o,n=e.rootIsLarge,r=e.rootIsTabs,i=e.theme,s=i.semanticColors,a=i.fonts;return[a.medium,{color:s.actionLink,display:"inline-block",lineHeight:44,height:44,marginRight:8,padding:"0 8px",textAlign:"center",position:"relative",backgroundColor:"transparent",border:0,borderRadius:0,selectors:(t={":before":{backgroundColor:"transparent",bottom:0,content:'""',height:2,left:8,position:"absolute",right:8,transition:"left "+Fe.durationValue2+" "+Fe.easeFunction2+",\n right "+Fe.durationValue2+" "+Fe.easeFunction2},":after":{color:"transparent",content:"attr(data-content)",display:"block",fontWeight:Ge.bold,height:1,overflow:"hidden",visibility:"hidden"},":hover":{backgroundColor:s.buttonBackgroundHovered,color:s.buttonTextHovered,cursor:"pointer"},":active":{backgroundColor:s.buttonBackgroundPressed,color:s.buttonTextHovered},":focus":{outline:"none"}},t["."+ho+" &:focus"]={outline:"1px solid "+s.focusBorder},t["."+ho+" &:focus:after"]={content:"attr(data-content)",position:"relative",border:0},t)},n&&{fontSize:a.large.fontSize},r&&[{marginRight:0,height:44,lineHeight:44,backgroundColor:s.buttonBackground,padding:"0 10px",verticalAlign:"top",selectors:(o={":focus":{outlineOffset:"-1px"}},o["."+ho+" &:focus::before"]={height:"auto",background:"transparent",transition:"none"},o)}]]},Px=xn(xx,(function(e){var t,o,n,r=e.className,i=e.rootIsLarge,s=e.rootIsTabs,a=e.theme,l=a.semanticColors,c=a.fonts,u=Oo(Ix,a);return{root:[u.root,c.medium,Uo,{position:"relative",color:l.link,whiteSpace:"nowrap"},i&&u.rootIsLarge,s&&u.rootIsTabs,r],itemContainer:{selectors:{"&[hidden]":{display:"none"}}},link:f([u.link],Dx(e),[s&&{selectors:{"&:hover, &:focus":{color:l.buttonTextCheckedHovered},"&:active, &:hover":{color:l.primaryButtonText,backgroundColor:l.primaryButtonBackground}}}]),linkIsSelected:f([u.link,u.linkIsSelected],Dx(e),[{fontWeight:Ge.semibold,selectors:(t={":before":{backgroundColor:l.inputBackgroundChecked,selectors:(o={},o[jt]={backgroundColor:"Highlight"},o)},":hover::before":{left:0,right:0}},t[jt]={color:"Highlight"},t)},s&&{backgroundColor:l.primaryButtonBackground,color:l.primaryButtonText,fontWeight:Ge.regular,selectors:(n={":before":{backgroundColor:"transparent",transition:"none",position:"absolute",top:0,left:0,right:0,bottom:0,content:'""',height:0},":hover":{backgroundColor:l.primaryButtonBackgroundHovered,color:l.primaryButtonText},"&:active":{backgroundColor:l.primaryButtonBackgroundPressed,color:l.primaryButtonText}},n[jt]=h({fontWeight:Ge.semibold,color:"HighlightText",background:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)}]),linkContent:[u.linkContent,{flex:"0 1 100%",selectors:{"& > * ":{marginLeft:4},"& > *:first-child":{marginLeft:0}}}],text:[u.text,{display:"inline-block",verticalAlign:"top"}],count:[u.count,{display:"inline-block",verticalAlign:"top"}],icon:u.icon}}),void 0,{scope:"Pivot"}),Tx=Mn(),Ex=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onRenderProgress=function(e){var o=t.props,n=o.ariaValueText,r=o.barHeight,i=o.className,s=o.styles,a=o.theme,l="number"==typeof t.props.percentComplete?Math.min(100,Math.max(0,100*t.props.percentComplete)):void 0,c=Tx(s,{theme:a,className:i,barHeight:r,indeterminate:void 0===l}),u={width:void 0!==l?l+"%":void 0,transition:void 0!==l&&l<.01?"none":void 0},d=void 0!==l?0:void 0,p=void 0!==l?100:void 0,h=void 0!==l?Math.floor(l):void 0;return b.createElement("div",{className:c.itemProgress},b.createElement("div",{className:c.progressTrack}),b.createElement("div",{className:c.progressBar,style:u,role:"progressbar","aria-valuemin":d,"aria-valuemax":p,"aria-valuenow":h,"aria-valuetext":n}))},t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.barHeight,o=e.className,n=e.label,r=void 0===n?this.props.title:n,i=e.description,s=e.styles,a=e.theme,l=e.progressHidden,c=e.onRenderProgress,u=void 0===c?this._onRenderProgress:c,d="number"==typeof this.props.percentComplete?Math.min(100,Math.max(0,100*this.props.percentComplete)):void 0,p=Tx(s,{theme:a,className:o,barHeight:t,indeterminate:void 0===d});return b.createElement("div",{className:p.root},r?b.createElement("div",{className:p.itemName},r):null,l?null:u(h(h({},this.props),{percentComplete:d}),this._onRenderProgress),i?b.createElement("div",{className:p.itemDescription},i):null)},t.defaultProps={label:"",description:"",width:180},t}(b.Component),Mx={root:"ms-ProgressIndicator",itemName:"ms-ProgressIndicator-itemName",itemDescription:"ms-ProgressIndicator-itemDescription",itemProgress:"ms-ProgressIndicator-itemProgress",progressTrack:"ms-ProgressIndicator-progressTrack",progressBar:"ms-ProgressIndicator-progressBar"},Rx=No((function(){return ee({"0%":{left:"-30%"},"100%":{left:"100%"}})})),Bx=No((function(){return ee({"100%":{right:"-30%"},"0%":{right:"100%"}})})),Nx=xn(Ex,(function(e){var t,o,n,r=In(e.theme),i=e.className,s=e.indeterminate,a=e.theme,l=e.barHeight,c=void 0===l?2:l,u=a.palette,d=a.semanticColors,p=a.fonts,m=Oo(Mx,a),g=u.neutralLight;return{root:[m.root,p.medium,i],itemName:[m.itemName,Go,{color:d.bodyText,paddingTop:4,lineHeight:20}],itemDescription:[m.itemDescription,{color:d.bodySubtext,fontSize:p.small.fontSize,lineHeight:18}],itemProgress:[m.itemProgress,{position:"relative",overflow:"hidden",height:c,padding:"8px 0"}],progressTrack:[m.progressTrack,{position:"absolute",width:"100%",height:c,backgroundColor:g,selectors:(t={},t[jt]={borderBottom:"1px solid WindowText"},t)}],progressBar:[{backgroundColor:u.themePrimary,height:c,position:"absolute",transition:"width .3s ease",width:0,selectors:(o={},o[jt]=h({backgroundColor:"highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)},s?{position:"absolute",minWidth:"33%",background:"linear-gradient(to right, "+g+" 0%, "+u.themePrimary+" 50%, "+g+" 100%)",animation:(r?Bx():Rx())+" 3s infinite",selectors:(n={},n[jt]={background:"highlight"},n)}:{transition:"width .15s linear"},m.progressBar]}}),void 0,{scope:"ProgressIndicator"}),Fx={root:"ms-RatingStar-root",rootIsSmall:"ms-RatingStar-root--small",rootIsLarge:"ms-RatingStar-root--large",ratingStar:"ms-RatingStar-container",ratingStarBack:"ms-RatingStar-back",ratingStarFront:"ms-RatingStar-front",ratingButton:"ms-Rating-button",ratingStarIsSmall:"ms-Rating--small",ratingStartIsLarge:"ms-Rating--large",labelText:"ms-Rating-labelText",ratingFocusZone:"ms-Rating-focuszone"};function Ax(e,t){var o;return{color:e,selectors:(o={},o[jt]={color:t},o)}}!function(e){e[e.Small=0]="Small",e[e.Large=1]="Large"}(wx||(wx={}));var Lx=Mn(),Hx=function(e){var t=e.icon||"FavoriteStarFill";return b.createElement("div",{className:e.classNames.ratingStar,key:e.id},b.createElement(Fr,{className:e.classNames.ratingStarBack,iconName:t}),!e.disabled&&b.createElement(Fr,{className:e.classNames.ratingStarFront,iconName:t,style:{width:e.fillPercentage+"%"}}))},Ox=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o._id=ts("Rating"),o._min=o.props.allowZeroStars?0:1,void 0!==o.props.min&&1!==o.props.min&&(o._min=o.props.min),o._labelId=ts("RatingLabel"),o.state={rating:o._getInitialValue(t)},o}return p(t,e),t.prototype.render=function(){var e,t,o,n=this.props,r=n.disabled,i=n.getAriaLabel,s=n.styles,a=n.max,l=n.readOnly,c=n.size,u=n.theme,d=n.icon,p=void 0===d?"FavoriteStarFill":d,m=n.unselectedIcon,g=void 0===m?"FavoriteStar":m,f=n.onRenderStar,v=this._id,_=[],y=[],C=this._getRating(),S=fr(this.props,gr);this._classNames=Lx(s,{disabled:r,readOnly:l,theme:u});for(var x,k,w=this._min;w<=a;w++)if(0!==w){var I=this._getFillingPercentage(w),D={fillPercentage:I,disabled:r,classNames:this._classNames,icon:I>0?p:g,starNum:w};y.push(this._getStarId(w-1)),_.push(b.createElement("button",h({className:Sr(this._classNames.ratingButton,(e={},e[this._classNames.ratingStarIsLarge]=c===wx.Large,e[this._classNames.ratingStarIsSmall]=c!==wx.Large,e)),id:y[w-1],key:w},w===Math.ceil(C)?{"data-is-current":!0}:{},{onFocus:this._onFocus.bind(this,w),onClick:this._onFocus.bind(this,w),disabled:!(!r&&!l),role:"presentation",type:"button"}),this._getLabel(w),(x=D,(k=f)?k(x):b.createElement(Hx,h({key:x.starNum+"rating"},x)))))}var P=i?i(C||0,a):void 0,T=l?{allowFocusRoot:!0,disabled:!0,"aria-label":P,"aria-readonly":!0,"data-is-focusable":!0,tabIndex:0}:void 0;return b.createElement("div",h({className:Sr("ms-Rating-star",this._classNames.root,(t={},t[this._classNames.rootIsLarge]=c===wx.Large,t[this._classNames.rootIsSmall]=c!==wx.Large,t)),"aria-label":l?"":P,id:v},S),b.createElement(ks,h({direction:vs.horizontal,className:Sr(this._classNames.ratingFocusZone,(o={},o[this._classNames.rootIsLarge]=c===wx.Large,o[this._classNames.rootIsSmall]=c!==wx.Large,o)),defaultActiveElement:C?y[Math.ceil(C)-1]&&"#"+y[Math.ceil(C)-1]:void 0},T),_))},t.prototype._getStarId=function(e){return this._id+"-star-"+e},t.prototype._onFocus=function(e,t){if(Math.ceil(this.state.rating)!==e){this.setState({rating:e});var o=this.props,n=o.onChange,r=o.onChanged;n&&n(t,e),r&&r(e)}},t.prototype._getLabel=function(e){var t=this.props.ariaLabelFormat||"";return b.createElement("span",{id:this._labelId+"-"+e,className:this._classNames.labelText},id(t,e,this.props.max))},t.prototype._getInitialValue=function(e){return void 0===e.rating?this._min:null!==e.rating?this._getClampedRating(e.rating):void 0},t.prototype._getClampedRating=function(e){return Math.min(Math.max(e,this._min),this.props.max)},t.prototype._getRating=function(){return void 0!==this.props.rating?this._getClampedRating(this.props.rating):void 0!==this.state.rating&&null!==this.state.rating?this._getClampedRating(this.state.rating):0},t.prototype._getFillingPercentage=function(e){var t=this._getRating(),o=Math.ceil(t),n=100;return e===t?n=100:e===o?n=t%1*100:e>o&&(n=0),n},t.defaultProps={min:1,max:5},t}(b.Component),zx=xn(Ox,(function(e){var t=e.disabled,o=e.readOnly,n=e.theme,r=n.semanticColors,i=n.palette,s=Oo(Fx,n),a=i.neutralSecondary,l=i.themePrimary,c=i.themeDark,u=i.neutralPrimary,d=r.disabledBodySubtext;return{root:[s.root,n.fonts.medium,!t&&!o&&{selectors:{"&:hover":{selectors:{".ms-RatingStar-back":Ax(u,"Highlight")}}}}],rootIsSmall:[s.rootIsSmall,{height:"32px"}],rootIsLarge:[s.rootIsLarge,{height:"36px"}],ratingStar:[s.ratingStar,{display:"inline-block",position:"relative",height:"inherit"}],ratingStarBack:[s.ratingStarBack,{color:a,width:"100%"},t&&Ax(d,"GrayText")],ratingStarFront:[s.ratingStarFront,{position:"absolute",height:"100 %",left:"0",top:"0",textAlign:"center",verticalAlign:"middle",overflow:"hidden"},Ax(u,"Highlight")],ratingButton:[go(n),s.ratingButton,{backgroundColor:"transparent",padding:"8px 2px",boxSizing:"content-box",margin:"0px",border:"none",cursor:"pointer",selectors:{"&:disabled":{cursor:"default"},"&[disabled]":{cursor:"default"}}},!t&&!o&&{selectors:{"&:hover ~ .ms-Rating-button":{selectors:{".ms-RatingStar-back":Ax(a,"WindowText"),".ms-RatingStar-front":Ax(a,"WindowText")}},"&:hover":{selectors:{".ms-RatingStar-back":{color:l},".ms-RatingStar-front":{color:c}}}}},t&&{cursor:"default"}],ratingStarIsSmall:[s.ratingStarIsSmall,{fontSize:"16px",lineHeight:"16px",height:"16px"}],ratingStarIsLarge:[s.ratingStartIsLarge,{fontSize:"20px",lineHeight:"20px",height:"20px"}],labelText:[s.labelText,yo],ratingFocusZone:[go(n),s.ratingFocusZone,{display:"inline-block"}]}}),void 0,{scope:"Rating"}),Wx={root:"ms-ScrollablePane",contentContainer:"ms-ScrollablePane--contentContainer"},Vx={auto:"auto",always:"always"},Kx=b.createContext({scrollablePane:void 0}),Ux=Mn(),Gx=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._stickyAboveRef=b.createRef(),o._stickyBelowRef=b.createRef(),o._contentContainer=b.createRef(),o.subscribe=function(e){o._subscribers.add(e)},o.unsubscribe=function(e){o._subscribers.delete(e)},o.addSticky=function(e){o._stickies.add(e),o.contentContainer&&(e.setDistanceFromTop(o.contentContainer),o.sortSticky(e))},o.removeSticky=function(e){o._stickies.delete(e),o._removeStickyFromContainers(e),o.notifySubscribers()},o.sortSticky=function(e,t){o.stickyAbove&&o.stickyBelow&&(t&&o._removeStickyFromContainers(e),e.canStickyTop&&e.stickyContentTop&&o._addToStickyContainer(e,o.stickyAbove,e.stickyContentTop),e.canStickyBottom&&e.stickyContentBottom&&o._addToStickyContainer(e,o.stickyBelow,e.stickyContentBottom))},o.updateStickyRefHeights=function(){var e=o._stickies,t=0,n=0;e.forEach((function(e){var r=e.state,i=r.isStickyTop,s=r.isStickyBottom;e.nonStickyContent&&(i&&(t+=e.nonStickyContent.offsetHeight),s&&(n+=e.nonStickyContent.offsetHeight),o._checkStickyStatus(e))})),o.setState({stickyTopHeight:t,stickyBottomHeight:n})},o.notifySubscribers=function(){o.contentContainer&&o._subscribers.forEach((function(e){e(o.contentContainer,o.stickyBelow)}))},o.getScrollPosition=function(){return o.contentContainer?o.contentContainer.scrollTop:0},o.syncScrollSticky=function(e){e&&o.contentContainer&&e.syncScroll(o.contentContainer)},o._getScrollablePaneContext=function(){return{scrollablePane:{subscribe:o.subscribe,unsubscribe:o.unsubscribe,addSticky:o.addSticky,removeSticky:o.removeSticky,updateStickyRefHeights:o.updateStickyRefHeights,sortSticky:o.sortSticky,notifySubscribers:o.notifySubscribers,syncScrollSticky:o.syncScrollSticky}}},o._addToStickyContainer=function(e,t,n){if(t.children.length){if(!t.contains(n)){var r=[].slice.call(t.children),i=[];o._stickies.forEach((function(n){(t===o.stickyAbove&&e.canStickyTop||e.canStickyBottom)&&i.push(n)}));for(var s=void 0,a=0,l=i.sort((function(e,t){return(e.state.distanceFromTop||0)-(t.state.distanceFromTop||0)})).filter((function(e){var n=t===o.stickyAbove?e.stickyContentTop:e.stickyContentBottom;return!!n&&r.indexOf(n)>-1}));a<l.length;a++){var c=l[a];if((c.state.distanceFromTop||0)>=(e.state.distanceFromTop||0)){s=c;break}}var u=null;s&&(u=t===o.stickyAbove?s.stickyContentTop:s.stickyContentBottom),t.insertBefore(n,u)}}else t.appendChild(n)},o._removeStickyFromContainers=function(e){o.stickyAbove&&e.stickyContentTop&&o.stickyAbove.contains(e.stickyContentTop)&&o.stickyAbove.removeChild(e.stickyContentTop),o.stickyBelow&&e.stickyContentBottom&&o.stickyBelow.contains(e.stickyContentBottom)&&o.stickyBelow.removeChild(e.stickyContentBottom)},o._onWindowResize=function(){var e=o._getScrollbarWidth(),t=o._getScrollbarHeight();o.setState({scrollbarWidth:e,scrollbarHeight:t}),o.notifySubscribers()},o._getStickyContainerStyle=function(e,t){return h(h({height:e},In(o.props.theme)?{right:"0",left:(o.state.scrollbarWidth||o._getScrollbarWidth()||0)+"px"}:{left:"0",right:(o.state.scrollbarWidth||o._getScrollbarWidth()||0)+"px"}),t?{top:"0"}:{bottom:(o.state.scrollbarHeight||o._getScrollbarHeight()||0)+"px"})},o._onScroll=function(){var e=o.contentContainer;e&&o._stickies.forEach((function(t){t.syncScroll(e)})),o._notifyThrottled()},o._subscribers=new Set,o._stickies=new Set,si(o),o._async=new di(o),o._events=new Ws(o),o.state={stickyTopHeight:0,stickyBottomHeight:0,scrollbarWidth:0,scrollbarHeight:0},o._notifyThrottled=o._async.throttle(o.notifySubscribers,50),o}return p(t,e),Object.defineProperty(t.prototype,"root",{get:function(){return this._root.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stickyAbove",{get:function(){return this._stickyAboveRef.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stickyBelow",{get:function(){return this._stickyBelowRef.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentContainer",{get:function(){return this._contentContainer.current},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){var e=this,t=this.props.initialScrollPosition;this._events.on(this.contentContainer,"scroll",this._onScroll),this._events.on(window,"resize",this._onWindowResize),this.contentContainer&&t&&(this.contentContainer.scrollTop=t),this.setStickiesDistanceFromTop(),this._stickies.forEach((function(t){e.sortSticky(t)})),this.notifySubscribers(),"MutationObserver"in window&&(this._mutationObserver=new MutationObserver((function(t){var o=e._getScrollbarHeight();if(o!==e.state.scrollbarHeight&&e.setState({scrollbarHeight:o}),e.notifySubscribers(),t.some(function(e){return null!==this.stickyAbove&&null!==this.stickyBelow&&(this.stickyAbove.contains(e.target)||this.stickyBelow.contains(e.target))}.bind(e)))e.updateStickyRefHeights();else{var n=[];e._stickies.forEach((function(e){e.root&&e.root.contains(t[0].target)&&n.push(e)})),n.length&&n.forEach((function(e){e.forceUpdate()}))}})),this.root&&this._mutationObserver.observe(this.root,{childList:!0,attributes:!0,subtree:!0,characterData:!0}))},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose(),this._mutationObserver&&this._mutationObserver.disconnect()},t.prototype.shouldComponentUpdate=function(e,t){return this.props.children!==e.children||this.props.initialScrollPosition!==e.initialScrollPosition||this.props.className!==e.className||this.state.stickyTopHeight!==t.stickyTopHeight||this.state.stickyBottomHeight!==t.stickyBottomHeight||this.state.scrollbarWidth!==t.scrollbarWidth||this.state.scrollbarHeight!==t.scrollbarHeight},t.prototype.componentDidUpdate=function(e,t){var o=this.props.initialScrollPosition;this.contentContainer&&"number"==typeof o&&e.initialScrollPosition!==o&&(this.contentContainer.scrollTop=o),t.stickyTopHeight===this.state.stickyTopHeight&&t.stickyBottomHeight===this.state.stickyBottomHeight||this.notifySubscribers(),this._async.setTimeout(this._onWindowResize,0)},t.prototype.render=function(){var e=this.props,t=e.className,o=e.theme,n=e.styles,r=this.state,i=r.stickyTopHeight,s=r.stickyBottomHeight,a=Ux(n,{theme:o,className:t,scrollbarVisibility:this.props.scrollbarVisibility});return b.createElement("div",h({},fr(this.props,gr),{ref:this._root,className:a.root}),b.createElement("div",{ref:this._stickyAboveRef,className:a.stickyAbove,style:this._getStickyContainerStyle(i,!0)}),b.createElement("div",{ref:this._contentContainer,className:a.contentContainer,"data-is-scrollable":!0},b.createElement(Kx.Provider,{value:this._getScrollablePaneContext()},this.props.children)),b.createElement("div",{className:a.stickyBelow,style:this._getStickyContainerStyle(s,!1)},b.createElement("div",{ref:this._stickyBelowRef,className:a.stickyBelowItems})))},t.prototype.setStickiesDistanceFromTop=function(){var e=this;this.contentContainer&&this._stickies.forEach((function(t){t.setDistanceFromTop(e.contentContainer)}))},t.prototype.forceLayoutUpdate=function(){this._onWindowResize()},t.prototype._checkStickyStatus=function(e){this.stickyAbove&&this.stickyBelow&&this.contentContainer&&e.nonStickyContent&&(e.state.isStickyTop||e.state.isStickyBottom?(e.state.isStickyTop&&!this.stickyAbove.contains(e.nonStickyContent)&&e.stickyContentTop&&e.addSticky(e.stickyContentTop),e.state.isStickyBottom&&!this.stickyBelow.contains(e.nonStickyContent)&&e.stickyContentBottom&&e.addSticky(e.stickyContentBottom)):this.contentContainer.contains(e.nonStickyContent)||e.resetSticky())},t.prototype._getScrollbarWidth=function(){var e=this.contentContainer;return e?e.offsetWidth-e.clientWidth:0},t.prototype._getScrollbarHeight=function(){var e=this.contentContainer;return e?e.offsetHeight-e.clientHeight:0},t}(b.Component),jx=xn(Gx,(function(e){var t,o,n=e.className,r=e.theme,i=Oo(Wx,r),s={position:"absolute",pointerEvents:"none"},a={position:"absolute",top:0,right:0,bottom:0,left:0,WebkitOverflowScrolling:"touch"};return{root:[i.root,r.fonts.medium,a,n],contentContainer:[i.contentContainer,{overflowY:"always"===e.scrollbarVisibility?"scroll":"auto"},a],stickyAbove:[{top:0,zIndex:1,selectors:(t={},t[jt]={borderBottom:"1px solid WindowText"},t)},s],stickyBelow:[{bottom:0,selectors:(o={},o[jt]={borderTop:"1px solid WindowText"},o)},s],stickyBelowItems:[{bottom:0},s,{width:"100%"}]}}),void 0,{scope:"ScrollablePane"}),Yx=Mn(),qx=function(e){function t(t){var o=e.call(this,t)||this;return o._rootElement=b.createRef(),o._inputElement=b.createRef(),o._onClickFocus=function(){var e=o._inputElement.current;e&&(o.focus(),e.selectionStart=e.selectionEnd=0)},o._onFocusCapture=function(e){o.setState({hasFocus:!0}),o.props.onFocus&&o.props.onFocus(e)},o._onClearClick=function(e){var t=o.props.clearButtonProps;t&&t.onClick&&t.onClick(e),e.defaultPrevented||o._onClear(e)},o._onKeyDown=function(e){switch(e.which){case wn.escape:o.props.onEscape&&o.props.onEscape(e),o.state.value&&!e.defaultPrevented&&o._onClear(e);break;case wn.enter:o.props.onSearch&&(o.props.onSearch(o.state.value),e.preventDefault(),e.stopPropagation());break;default:o.props.onKeyDown&&o.props.onKeyDown(e),e.defaultPrevented&&e.stopPropagation()}},o._onBlur=function(e){o.setState({hasFocus:!1}),o.props.onBlur&&o.props.onBlur(e)},o._onInputChange=function(e){var t=e.target.value;t!==o._latestValue&&(o._latestValue=t,o.setState({value:t}),o._callOnChange(e,t))},si(o),o._latestValue=t.value||"",o._fallbackId=ts("SearchBox"),o.state={value:o._latestValue,hasFocus:!1},o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){void 0!==e.value&&(this._latestValue=e.value,this.setState({value:e.value||""}))},t.prototype.render=function(){var e=this.props,t=e.ariaLabel,o=e.placeholder,n=e.className,r=e.disabled,i=e.underlined,s=e.styles,a=e.labelText,l=e.theme,c=e.clearButtonProps,u=e.disableAnimation,d=e.iconProps,p=e.role,m=e.id,g=void 0===m?this._fallbackId:m,f=this.state,v=f.value,_=f.hasFocus,y=void 0!==o?o:a,C=Yx(s,{theme:l,className:n,underlined:i,hasFocus:_,disabled:r,hasInput:v.length>0,disableAnimation:u}),S=fr(this.props,tr,["className","placeholder","onFocus","onBlur","value","role"]);return b.createElement("div",{role:p,ref:this._rootElement,className:C.root,onFocusCapture:this._onFocusCapture},b.createElement("div",{className:C.iconContainer,onClick:this._onClickFocus,"aria-hidden":!0},b.createElement(Fr,h({iconName:"Search"},d,{className:C.icon}))),b.createElement("input",h({},S,{id:g,className:C.field,placeholder:y,onChange:this._onInputChange,onInput:this._onInputChange,onBlur:this._onBlur,onKeyDown:this._onKeyDown,value:v,disabled:r,role:"searchbox","aria-label":t,ref:this._inputElement})),v.length>0&&b.createElement("div",{className:C.clearButton},b.createElement(eu,h({onBlur:this._onBlur,styles:{root:{height:"auto"},icon:{fontSize:"12px"}},iconProps:{iconName:"Clear"}},c,{onClick:this._onClearClick}))))},t.prototype.focus=function(){this._inputElement.current&&this._inputElement.current.focus()},t.prototype.hasFocus=function(){return!!this.state.hasFocus},t.prototype._onClear=function(e){this.props.onClear&&this.props.onClear(e),e.defaultPrevented||(this._latestValue="",this.setState({value:""}),this._callOnChange(void 0,""),e.stopPropagation(),e.preventDefault(),this.focus())},t.prototype._callOnChange=function(e,t){var o=this.props,n=o.onChange,r=o.onChanged;r&&r(t),n&&n(e,t)},t.defaultProps={disableAnimation:!1,clearButtonProps:{ariaLabel:"Clear text"}},t}(b.Component),Zx={root:"ms-SearchBox",iconContainer:"ms-SearchBox-iconContainer",icon:"ms-SearchBox-icon",clearButton:"ms-SearchBox-clearButton",field:"ms-SearchBox-field"};var Xx=xn(qx,(function(e){var t,o,n,r,i=e.theme,s=e.underlined,a=e.disabled,l=e.hasFocus,c=e.className,u=e.hasInput,d=e.disableAnimation,p=i.palette,h=i.fonts,m=i.semanticColors,g=i.effects,f=Oo(Zx,i),v={color:m.inputPlaceholderText,opacity:1},b=p.neutralSecondary,_=p.neutralPrimary,y=p.neutralLighter,C=p.neutralLighter,S=p.neutralLighter;return{root:[f.root,h.medium,Uo,{color:m.inputText,backgroundColor:m.inputBackground,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"stretch",padding:"1px 0 1px 4px",borderRadius:g.roundedCorner2,border:"1px solid "+m.inputBorder,height:32,selectors:(t={},t[jt]={borderColor:"WindowText"},t[":hover"]={borderColor:m.inputBorderHovered,selectors:(o={},o[jt]={borderColor:"Highlight"},o)},t[":hover ."+f.iconContainer]={color:m.inputIconHovered},t)},!l&&u&&{selectors:(n={},n[":hover ."+f.iconContainer]={width:4},n[":hover ."+f.icon]={opacity:0},n)},l&&["is-active",{position:"relative"},_o(m.inputFocusBorderAlt,s?0:g.roundedCorner2,s?"borderBottom":"border")],a&&["is-disabled",{borderColor:y,backgroundColor:S,pointerEvents:"none",cursor:"default",selectors:(r={},r[jt]={borderColor:"GrayText"},r)}],s&&["is-underlined",{borderWidth:"0 0 1px 0",borderRadius:0,padding:"1px 0 1px 8px"}],s&&a&&{backgroundColor:"transparent"},u&&"can-clear",c],iconContainer:[f.iconContainer,{display:"flex",flexDirection:"column",justifyContent:"center",flexShrink:0,fontSize:16,width:32,textAlign:"center",color:m.inputIcon,cursor:"text"},l&&{width:4},a&&{color:m.inputIconDisabled},!d&&{transition:"width "+Fe.durationValue1}],icon:[f.icon,{opacity:1},l&&{opacity:0},!d&&{transition:"opacity "+Fe.durationValue1+" 0s"}],clearButton:[f.clearButton,{display:"flex",flexDirection:"row",alignItems:"stretch",cursor:"pointer",flexBasis:"32px",flexShrink:0,padding:0,margin:"-1px 0px",selectors:{"&:hover .ms-Button":{backgroundColor:C},"&:hover .ms-Button-icon":{color:_},".ms-Button":{borderRadius:In(i)?"1px 0 0 1px":"0 1px 1px 0"},".ms-Button-icon":{color:b}}}],field:[f.field,Uo,qo(v),{backgroundColor:"transparent",border:"none",outline:"none",fontWeight:"inherit",fontFamily:"inherit",fontSize:"inherit",color:m.inputText,flex:"1 1 0px",minWidth:"0px",overflow:"hidden",textOverflow:"ellipsis",paddingBottom:.5,selectors:{"::-ms-clear":{display:"none"}}},a&&{color:m.disabledText}]}}),void 0,{scope:"SearchBox"}),Qx=function(e){function t(t){var o=e.call(this,t)||this;o.addItems=function(e){var t=o.props.onItemSelected?o.props.onItemSelected(e):e,n=t,r=t;if(r&&r.then)r.then((function(e){var t=o.state.items.concat(e);o.updateItems(t)}));else{var i=o.state.items.concat(n);o.updateItems(i)}},o.removeItemAt=function(e){var t=o.state.items;if(o._canRemoveItem(t[e])&&e>-1){o.props.onItemsDeleted&&o.props.onItemsDeleted([t[e]]);var n=t.slice(0,e).concat(t.slice(e+1));o.updateItems(n)}},o.removeItem=function(e){var t=o.state.items.indexOf(e);o.removeItemAt(t)},o.replaceItem=function(e,t){var n=o.state.items,r=n.indexOf(e);if(r>-1){var i=n.slice(0,r).concat(t).concat(n.slice(r+1));o.updateItems(i)}},o.removeItems=function(e){var t=o.state.items,n=e.filter((function(e){return o._canRemoveItem(e)})),r=t.filter((function(e){return-1===n.indexOf(e)})),i=n[0],s=t.indexOf(i);o.props.onItemsDeleted&&o.props.onItemsDeleted(n),o.updateItems(r,s)},o.onCopy=function(e){if(o.props.onCopyItems&&o.selection.getSelectedCount()>0){var t=o.selection.getSelection();o.copyItems(t)}},o.renderItems=function(){var e=o.props.removeButtonAriaLabel,t=o.props.onRenderItem;return o.state.items.map((function(n,r){return t({item:n,index:r,key:n.key?n.key:r,selected:o.selection.isIndexSelected(r),onRemoveItem:function(){return o.removeItem(n)},onItemChange:o.onItemChange,removeButtonAriaLabel:e,onCopyItem:function(e){return o.copyItems([e])}})}))},o.onSelectionChanged=function(){o.forceUpdate()},o.onItemChange=function(e,t){var n=o.state.items;if(t>=0){var r=n;r[t]=e,o.updateItems(r)}},si(o);var n=t.selectedItems||t.defaultSelectedItems||[];return o.state={items:n},o.selection=o.props.selection?o.props.selection:new xf({onSelectionChanged:o.onSelectionChanged}),o}return p(t,e),Object.defineProperty(t.prototype,"items",{get:function(){return this.state.items},enumerable:!0,configurable:!0}),t.prototype.removeSelectedItems=function(){this.state.items.length&&this.selection.getSelectedCount()>0&&this.removeItems(this.selection.getSelection())},t.prototype.updateItems=function(e,t){var o=this;this.props.selectedItems?this.onChange(e):this.setState({items:e},(function(){o._onSelectedItemsUpdated(e,t)}))},t.prototype.hasSelectedItems=function(){return this.selection.getSelectedCount()>0},t.prototype.unselectAll=function(){this.selection.setAllSelected(!1)},t.prototype.highlightedItems=function(){return this.selection.getSelection()},t.prototype.UNSAFE_componentWillUpdate=function(e,t){t.items&&t.items!==this.state.items&&this.selection.setItems(t.items)},t.prototype.componentDidMount=function(){this.selection.setItems(this.state.items)},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=e.selectedItems;t&&this.setState({items:t}),e.selection&&(this.selection=e.selection)},t.prototype.render=function(){return this.renderItems()},t.prototype.onChange=function(e){this.props.onChange&&this.props.onChange(e)},t.prototype.copyItems=function(e){if(this.props.onCopyItems){var t=this.props.onCopyItems(e),o=document.createElement("input");document.body.appendChild(o);try{if(o.value=t,o.select(),!document.execCommand("copy"))throw new Error}catch(e){}finally{document.body.removeChild(o)}}},t.prototype._onSelectedItemsUpdated=function(e,t){this.onChange(e)},t.prototype._canRemoveItem=function(e){return!this.props.canRemoveItem||this.props.canRemoveItem(e)},t}(b.Component);Object(Dt.a)([{rawString:".personaContainer_1e945a16{border-radius:15px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:"},{theme:"themeLighterAlt",defaultValue:"#eff6fc"},{rawString:";margin:4px;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;position:relative}.personaContainer_1e945a16::-moz-focus-inner{border:0}.personaContainer_1e945a16{outline:transparent}.personaContainer_1e945a16{position:relative}.ms-Fabric--isFocusVisible .personaContainer_1e945a16:focus:after{content:'';position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;pointer-events:none;border:1px solid "},{theme:"focusBorder",defaultValue:"#605e5c"},{rawString:"}.personaContainer_1e945a16 .ms-Persona-primaryText{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:";font-size:14px;font-weight:400}.personaContainer_1e945a16 .ms-Persona-primaryText.hover_1e945a16{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16 .ms-Persona-primaryText{color:HighlightText}}.personaContainer_1e945a16 .actionButton_1e945a16:hover{background:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.personaContainer_1e945a16 .actionButton_1e945a16 .ms-Button-icon{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16 .actionButton_1e945a16 .ms-Button-icon{color:HighlightText}}.personaContainer_1e945a16:hover{background:"},{theme:"themeLighter",defaultValue:"#deecf9"},{rawString:"}.personaContainer_1e945a16:hover .ms-Persona-primaryText{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:";font-size:14px;font-weight:400}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16:hover .ms-Persona-primaryText{color:HighlightText}}.personaContainer_1e945a16.personaContainerIsSelected_1e945a16{background:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:"}.personaContainer_1e945a16.personaContainerIsSelected_1e945a16 .ms-Persona-primaryText{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16.personaContainerIsSelected_1e945a16 .ms-Persona-primaryText{color:HighlightText}}.personaContainer_1e945a16.personaContainerIsSelected_1e945a16 .actionButton_1e945a16{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:"}.personaContainer_1e945a16.personaContainerIsSelected_1e945a16 .actionButton_1e945a16 .ms-Button-icon{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}.personaContainer_1e945a16.personaContainerIsSelected_1e945a16 .actionButton_1e945a16 .ms-Button-icon:hover{background:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16.personaContainerIsSelected_1e945a16 .actionButton_1e945a16 .ms-Button-icon{color:HighlightText}}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16.personaContainerIsSelected_1e945a16{border-color:Highlight;background:Highlight;-ms-high-contrast-adjust:none}}.personaContainer_1e945a16.validationError_1e945a16 .ms-Persona-primaryText{color:"},{theme:"red",defaultValue:"#e81123"},{rawString:"}.personaContainer_1e945a16.validationError_1e945a16 .ms-Persona-initials{font-size:20px}@media screen and (-ms-high-contrast:active){.personaContainer_1e945a16{border:1px solid WindowText}}.personaContainer_1e945a16 .itemContent_1e945a16{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;min-width:0;max-width:100%}.personaContainer_1e945a16 .removeButton_1e945a16{border-radius:15px;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:33px;height:33px;-ms-flex-preferred-size:32px;flex-basis:32px}.personaContainer_1e945a16 .expandButton_1e945a16{border-radius:15px 0 0 15px;height:33px;width:44px;padding-right:16px;position:inherit;display:-webkit-box;display:-ms-flexbox;display:flex;margin-right:-17px}.personaContainer_1e945a16 .personaWrapper_1e945a16{position:relative;display:inherit}.personaContainer_1e945a16 .personaWrapper_1e945a16 .ms-Persona-details{padding:0 8px}.personaContainer_1e945a16 .personaDetails_1e945a16{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.itemContainer_1e945a16{display:inline-block;vertical-align:top}"}]);var Jx="personaContainer_1e945a16",$x="hover_1e945a16",ek="actionButton_1e945a16",tk="personaContainerIsSelected_1e945a16",ok="validationError_1e945a16",nk="itemContent_1e945a16",rk="removeButton_1e945a16",ik="expandButton_1e945a16",sk="personaWrapper_1e945a16",ak="personaDetails_1e945a16",lk="itemContainer_1e945a16",ck=u,uk=function(e){function t(t){var o=e.call(this,t)||this;return o.persona=b.createRef(),si(o),o.state={contextualMenuVisible:!1},o}return p(t,e),t.prototype.render=function(){var e,t,o=this.props,n=o.item,r=o.onExpandItem,i=o.onRemoveItem,s=o.removeButtonAriaLabel,a=o.index,l=o.selected,c=ts();return b.createElement("div",{ref:this.persona,className:Sr("ms-PickerPersona-container",ck.personaContainer,(e={},e["is-selected "+ck.personaContainerIsSelected]=l,e),(t={},t["is-invalid "+ck.validationError]=!n.isValid,t)),"data-is-focusable":!0,"data-is-sub-focuszone":!0,"data-selection-index":a,role:"listitem","aria-labelledby":"selectedItemPersona-"+c},b.createElement("div",{hidden:!n.canExpand||void 0===r},b.createElement(eu,{onClick:this._onClickIconButton(r),iconProps:{iconName:"Add",style:{fontSize:"14px"}},className:Sr("ms-PickerItem-removeButton",ck.expandButton,ck.actionButton),ariaLabel:s})),b.createElement("div",{className:Sr(ck.personaWrapper)},b.createElement("div",{className:Sr("ms-PickerItem-content",ck.itemContent),id:"selectedItemPersona-"+c},b.createElement(cy,h({},n,{onRenderCoin:this.props.renderPersonaCoin,onRenderPrimaryText:this.props.renderPrimaryText,size:xr.size32}))),b.createElement(eu,{onClick:this._onClickIconButton(i),iconProps:{iconName:"Cancel",style:{fontSize:"14px"}},className:Sr("ms-PickerItem-removeButton",ck.removeButton,ck.actionButton),ariaLabel:s})))},t.prototype._onClickIconButton=function(e){return function(t){t.stopPropagation(),t.preventDefault(),e&&e()}},t}(b.Component),dk=function(e){function t(t){var o=e.call(this,t)||this;return o.itemElement=b.createRef(),o._onClick=function(e){e.preventDefault(),o.props.beginEditing&&!o.props.item.isValid?o.props.beginEditing(o.props.item):o.setState({contextualMenuVisible:!0})},o._onCloseContextualMenu=function(e){o.setState({contextualMenuVisible:!1})},si(o),o.state={contextualMenuVisible:!1},o}return p(t,e),t.prototype.render=function(){return b.createElement("div",{ref:this.itemElement,onContextMenu:this._onClick},this.props.renderedItem,this.state.contextualMenuVisible?b.createElement(Uc,{items:this.props.menuItems,shouldFocusOnMount:!0,target:this.itemElement.current,onDismiss:this._onCloseContextualMenu,directionalHint:ya.bottomLeftEdge}):null)},t}(b.Component),pk={root:"ms-EditingItem",input:"ms-EditingItem-input"},hk=function(e){var t=Ot();if(!t)throw new Error("theme is undefined or null in Editing item getStyles function.");var o=t.semanticColors,n=Oo(pk,t);return{root:[n.root,{margin:"4px"}],input:[n.input,{border:"0px",outline:"none",width:"100%",backgroundColor:o.inputBackground,color:o.inputText,selectors:{"::-ms-clear":{display:"none"}}}]}},mk=function(e){function t(t){var o=e.call(this,t)||this;return o._editingFloatingPicker=b.createRef(),o._renderEditingSuggestions=function(){var e=o.props.onRenderFloatingPicker,t=o.props.floatingPickerProps;return e&&t?b.createElement(e,h({componentRef:o._editingFloatingPicker,onChange:o._onSuggestionSelected,inputElement:o._editingInput,selectedItems:[]},t)):b.createElement(b.Fragment,null)},o._resolveInputRef=function(e){o._editingInput=e,o.forceUpdate((function(){o._editingInput.focus()}))},o._onInputClick=function(){o._editingFloatingPicker.current&&o._editingFloatingPicker.current.showPicker(!0)},o._onInputBlur=function(e){if(o._editingFloatingPicker.current&&null!==e.relatedTarget){var t=e.relatedTarget;-1===t.className.indexOf("ms-Suggestions-itemButton")&&-1===t.className.indexOf("ms-Suggestions-sectionButton")&&o._editingFloatingPicker.current.forceResolveSuggestion()}},o._onInputChange=function(e){var t=e.target.value;""===t?o.props.onRemoveItem&&o.props.onRemoveItem():o._editingFloatingPicker.current&&o._editingFloatingPicker.current.onQueryStringChanged(t)},o._onSuggestionSelected=function(e){o.props.onEditingComplete(o.props.item,e)},si(o),o.state={contextualMenuVisible:!1},o}return p(t,e),t.prototype.componentDidMount=function(){var e=(0,this.props.getEditingItemText)(this.props.item);this._editingFloatingPicker.current&&this._editingFloatingPicker.current.onQueryStringChanged(e),this._editingInput.value=e,this._editingInput.focus()},t.prototype.render=function(){var e=ts(),t=fr(this.props,tr),o=Mn()(hk);return b.createElement("div",{"aria-labelledby":"editingItemPersona-"+e,className:o.root},b.createElement("input",h({autoCapitalize:"off",autoComplete:"off"},t,{ref:this._resolveInputRef,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onBlur:this._onInputBlur,onClick:this._onInputClick,"data-lpignore":!0,className:o.input,id:e})),this._renderEditingSuggestions())},t.prototype._onInputKeyDown=function(e){e.which!==wn.backspace&&e.which!==wn.del||e.stopPropagation()},t}(b.Component),gk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(Qx),fk=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.renderItems=function(){return t.state.items.map((function(e,o){return t._renderItem(e,o)}))},t._beginEditing=function(e){e.isEditing=!0,t.forceUpdate()},t._completeEditing=function(e,o){e.isEditing=!1,t.replaceItem(e,o)},t}return p(t,e),t.prototype._renderItem=function(e,t){var o=this,n=this.props.removeButtonAriaLabel,r=this.props.onExpandGroup,i={item:e,index:t,key:e.key?e.key:t,selected:this.selection.isIndexSelected(t),onRemoveItem:function(){return o.removeItem(e)},onItemChange:this.onItemChange,removeButtonAriaLabel:n,onCopyItem:function(e){return o.copyItems([e])},onExpandItem:r?function(){return r(e)}:void 0,menuItems:this._createMenuItems(e)},s=i.menuItems.length>0;if(e.isEditing&&s)return b.createElement(mk,h({},i,{onRenderFloatingPicker:this.props.onRenderFloatingPicker,floatingPickerProps:this.props.floatingPickerProps,onEditingComplete:this._completeEditing,getEditingItemText:this.props.getEditingItemText}));var a=(0,this.props.onRenderItem)(i);return s?b.createElement(dk,{key:i.key,renderedItem:a,beginEditing:this._beginEditing,menuItems:this._createMenuItems(i.item),item:i.item}):a},t.prototype._createMenuItems=function(e){var t=this,o=[];return this.props.editMenuItemText&&this.props.getEditingItemText&&o.push({key:"Edit",text:this.props.editMenuItemText,onClick:function(e,o){t._beginEditing(o.data)},data:e}),this.props.removeMenuItemText&&o.push({key:"Remove",text:this.props.removeMenuItemText,onClick:function(e,o){t.removeItem(o.data)},data:e}),this.props.copyMenuItemText&&o.push({key:"Copy",text:this.props.copyMenuItemText,onClick:function(e,o){t.props.onCopyItems&&t.copyItems([o.data])},data:e}),o},t.defaultProps={onRenderItem:function(e){return b.createElement(uk,h({},e))}},t}(gk),vk=Mn(),bk=function(e){var t=e.styles,o=e.theme,n=e.className,r=e.vertical,i=e.alignContent,s=vk(t,{theme:o,className:n,alignContent:i,vertical:r});return b.createElement("div",{className:s.root},b.createElement("div",{className:s.content,role:"separator","aria-orientation":r?"vertical":"horizontal"},e.children))},_k=xn(bk,(function(e){var t,o,n=e.theme,r=e.alignContent,i=e.vertical,s=e.className,a="start"===r,l="center"===r,c="end"===r;return{root:[n.fonts.medium,{position:"relative"},r&&{textAlign:r},!r&&{textAlign:"center"},i&&(l||!r)&&{verticalAlign:"middle"},i&&a&&{verticalAlign:"top"},i&&c&&{verticalAlign:"bottom"},i&&{padding:"0 4px",height:"inherit",display:"table-cell",zIndex:1,selectors:{":after":(t={backgroundColor:n.palette.neutralLighter,width:"1px",content:'""',position:"absolute",top:"0",bottom:"0",left:"50%",right:"0",zIndex:-1},t[jt]={backgroundColor:"WindowText"},t)}},!i&&{padding:"4px 0",selectors:{":before":(o={backgroundColor:n.palette.neutralLighter,height:"1px",content:'""',display:"block",position:"absolute",top:"50%",bottom:"0",left:"0",right:"0"},o[jt]={backgroundColor:"WindowText"},o)}},s],content:[{position:"relative",display:"inline-block",padding:"0 12px",color:n.semanticColors.bodyText,background:n.semanticColors.bodyBackground},i&&{padding:"12px 0"}]}}),void 0,{scope:"Separator"});_k.displayName="Separator";var yk,Ck,Sk={root:"ms-Shimmer-container",shimmerWrapper:"ms-Shimmer-shimmerWrapper",shimmerGradient:"ms-Shimmer-shimmerGradient",dataWrapper:"ms-Shimmer-dataWrapper"},xk=No((function(){return ee({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}})})),kk=No((function(){return ee({"100%":{transform:"translateX(-100%)"},"0%":{transform:"translateX(100%)"}})}));!function(e){e[e.line=1]="line",e[e.circle=2]="circle",e[e.gap=3]="gap"}(yk||(yk={})),function(e){e[e.line=16]="line",e[e.gap=16]="gap",e[e.circle=24]="circle"}(Ck||(Ck={}));var wk=Mn(),Ik=function(e){var t=e.height,o=e.styles,n=e.width,r=void 0===n?"100%":n,i=e.borderStyle,s=e.theme,a=wk(o,{theme:s,height:t,borderStyle:i});return b.createElement("div",{style:{width:r,minWidth:"number"==typeof r?r+"px":"auto"},className:a.root},b.createElement("svg",{width:"2",height:"2",className:a.topLeftCorner},b.createElement("path",{d:"M0 2 A 2 2, 0, 0, 1, 2 0 L 0 0 Z"})),b.createElement("svg",{width:"2",height:"2",className:a.topRightCorner},b.createElement("path",{d:"M0 0 A 2 2, 0, 0, 1, 2 2 L 2 0 Z"})),b.createElement("svg",{width:"2",height:"2",className:a.bottomRightCorner},b.createElement("path",{d:"M2 0 A 2 2, 0, 0, 1, 0 2 L 2 2 Z"})),b.createElement("svg",{width:"2",height:"2",className:a.bottomLeftCorner},b.createElement("path",{d:"M2 2 A 2 2, 0, 0, 1, 0 0 L 0 2 Z"})))},Dk={root:"ms-ShimmerLine-root",topLeftCorner:"ms-ShimmerLine-topLeftCorner",topRightCorner:"ms-ShimmerLine-topRightCorner",bottomLeftCorner:"ms-ShimmerLine-bottomLeftCorner",bottomRightCorner:"ms-ShimmerLine-bottomRightCorner"};var Pk=xn(Ik,(function(e){var t,o=e.height,n=e.borderStyle,r=e.theme,i=r.semanticColors,s=Oo(Dk,r),a=n||{},l={position:"absolute",fill:i.bodyBackground};return{root:[s.root,r.fonts.medium,{height:o+"px",boxSizing:"content-box",position:"relative",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:i.bodyBackground,borderWidth:0,selectors:(t={},t[jt]={borderColor:"Window",selectors:{"> *":{fill:"Window"}}},t)},a],topLeftCorner:[s.topLeftCorner,{top:"0",left:"0"},l],topRightCorner:[s.topRightCorner,{top:"0",right:"0"},l],bottomRightCorner:[s.bottomRightCorner,{bottom:"0",right:"0"},l],bottomLeftCorner:[s.bottomLeftCorner,{bottom:"0",left:"0"},l]}}),void 0,{scope:"ShimmerLine"}),Tk=Mn(),Ek=function(e){var t=e.height,o=e.styles,n=e.width,r=void 0===n?"10px":n,i=e.borderStyle,s=e.theme,a=Tk(o,{theme:s,height:t,borderStyle:i});return b.createElement("div",{style:{width:r,minWidth:"number"==typeof r?r+"px":"auto"},className:a.root})},Mk={root:"ms-ShimmerGap-root"};var Rk=xn(Ek,(function(e){var t,o=e.height,n=e.borderStyle,r=e.theme,i=r.semanticColors,s=n||{};return{root:[Oo(Mk,r).root,r.fonts.medium,{backgroundColor:i.bodyBackground,height:o+"px",boxSizing:"content-box",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:i.bodyBackground,selectors:(t={},t[jt]={backgroundColor:"Window",borderColor:"Window"},t)},s]}}),void 0,{scope:"ShimmerGap"}),Bk={root:"ms-ShimmerCircle-root",svg:"ms-ShimmerCircle-svg"};var Nk=Mn(),Fk=function(e){var t=e.height,o=e.styles,n=e.borderStyle,r=e.theme,i=Nk(o,{theme:r,height:t,borderStyle:n});return b.createElement("div",{className:i.root},b.createElement("svg",{viewBox:"0 0 10 10",width:t,height:t,className:i.svg},b.createElement("path",{d:"M0,0 L10,0 L10,10 L0,10 L0,0 Z M0,5 C0,7.76142375 2.23857625,10 5,10 C7.76142375,10 10,7.76142375 10,5 C10,2.23857625 7.76142375,2.22044605e-16 5,0 C2.23857625,-2.22044605e-16 0,2.23857625 0,5 L0,5 Z"})))},Ak=xn(Fk,(function(e){var t,o,n=e.height,r=e.borderStyle,i=e.theme,s=i.semanticColors,a=Oo(Bk,i),l=r||{};return{root:[a.root,i.fonts.medium,{width:n+"px",height:n+"px",minWidth:n+"px",boxSizing:"content-box",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:s.bodyBackground,selectors:(t={},t[jt]={borderColor:"Window"},t)},l],svg:[a.svg,{display:"block",fill:s.bodyBackground,selectors:(o={},o[jt]={fill:"Window"},o)}]}}),void 0,{scope:"ShimmerCircle"}),Lk=Mn(),Hk=function(e){var t=e.styles,o=e.width,n=void 0===o?"auto":o,r=e.shimmerElements,i=e.rowHeight,s=void 0===i?function(e){return e.map((function(e){switch(e.type){case yk.circle:e.height||(e.height=Ck.circle);break;case yk.line:e.height||(e.height=Ck.line);break;case yk.gap:e.height||(e.height=Ck.gap)}return e})).reduce((function(e,t){return t.height&&t.height>e?t.height:e}),0)}(r||[]):i,a=e.flexWrap,l=void 0!==a&&a,c=e.theme,u=e.backgroundColor,d=Lk(t,{theme:c,flexWrap:l});return b.createElement("div",{style:{width:n},className:d.root},function(e,t,o){return e?e.map((function(e,n){var r=e.type,i=m(e,["type"]),s=i.verticalAlign,a=i.height,l=Ok(s,r,a,t,o);switch(e.type){case yk.circle:return b.createElement(Ak,h({key:n},i,{styles:l}));case yk.gap:return b.createElement(Rk,h({key:n},i,{styles:l}));case yk.line:return b.createElement(Pk,h({key:n},i,{styles:l}))}})):b.createElement(Pk,{height:Ck.line})}(r,u,s))};var Ok=No((function(e,t,o,n,r){var i,s=r&&o?r-o:0;if(e&&"center"!==e?e&&"top"===e?i={borderBottomWidth:s+"px",borderTopWidth:"0px"}:e&&"bottom"===e&&(i={borderBottomWidth:"0px",borderTopWidth:s+"px"}):i={borderBottomWidth:(s?Math.floor(s/2):0)+"px",borderTopWidth:(s?Math.ceil(s/2):0)+"px"},n)switch(t){case yk.circle:return{root:h(h({},i),{borderColor:n}),svg:{fill:n}};case yk.gap:return{root:h(h({},i),{borderColor:n,backgroundColor:n})};case yk.line:return{root:h(h({},i),{borderColor:n}),topLeftCorner:{fill:n},topRightCorner:{fill:n},bottomLeftCorner:{fill:n},bottomRightCorner:{fill:n}}}return{root:i}}));var zk={root:"ms-ShimmerElementsGroup-root"};var Wk,Vk=xn(Hk,(function(e){var t=e.flexWrap,o=e.theme;return{root:[Oo(zk,o).root,o.fonts.medium,{display:"flex",alignItems:"center",flexWrap:t?"wrap":"nowrap",position:"relative"}]}}),void 0,{scope:"ShimmerElementsGroup"}),Kk=Mn(),Uk=function(e){function t(t){var o=e.call(this,t)||this;return si(o),o.state={contentLoaded:t.isDataLoaded},o._async=new di(o),o}return p(t,e),t.prototype.componentDidUpdate=function(e){var t=this,o=this.props.isDataLoaded;o!==e.isDataLoaded&&(this._async.clearTimeout(this._lastTimeoutId),o?this._lastTimeoutId=this._async.setTimeout((function(){t.setState({contentLoaded:o})}),200):this.setState({contentLoaded:o}))},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.styles,o=e.shimmerElements,n=e.children,r=e.isDataLoaded,i=e.width,s=e.className,a=e.customElementsGroup,l=e.theme,c=e.ariaLabel,u=e.shimmerColors,d=this.state.contentLoaded;this._classNames=Kk(t,{theme:l,isDataLoaded:r,className:s,transitionAnimationInterval:200,shimmerColor:u&&u.shimmer,shimmerWaveColor:u&&u.shimmerWave});var p=fr(this.props,gr);return b.createElement("div",h({},p,{className:this._classNames.root}),!d&&b.createElement("div",{style:{width:i||"100%"},className:this._classNames.shimmerWrapper},b.createElement("div",{className:this._classNames.shimmerGradient}),a||b.createElement(Vk,{shimmerElements:o,backgroundColor:u&&u.background})),n&&b.createElement("div",{className:this._classNames.dataWrapper},n),c&&!r&&b.createElement("div",{role:"status","aria-live":"polite"},b.createElement(mi,null,b.createElement("div",{className:this._classNames.screenReaderText},c))))},t.defaultProps={isDataLoaded:!1},t}(b.Component),Gk=xn(Uk,(function(e){var t,o=e.isDataLoaded,n=e.className,r=e.theme,i=e.transitionAnimationInterval,s=e.shimmerColor,a=e.shimmerWaveColor,l=r.semanticColors,c=Oo(Sk,r),u=In(r);return{root:[c.root,r.fonts.medium,{position:"relative",height:"auto"},n],shimmerWrapper:[c.shimmerWrapper,{position:"relative",overflow:"hidden",transform:"translateZ(0)",backgroundColor:s||l.disabledBackground,transition:"opacity "+i+"ms",selectors:(t={"> *":{transform:"translateZ(0)"}},t[jt]=h({background:"WindowText\n linear-gradient(\n to right,\n transparent 0%,\n Window 50%,\n transparent 100%)\n 0 0 / 90% 100%\n no-repeat"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},o&&{opacity:"0",position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}],shimmerGradient:[c.shimmerGradient,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:(s||l.disabledBackground)+"\n linear-gradient(\n to right,\n "+(s||l.disabledBackground)+" 0%,\n "+(a||l.bodyDivider)+" 50%,\n "+(s||l.disabledBackground)+" 100%)\n 0 0 / 90% 100%\n no-repeat",transform:"translateX(-100%)",animationDuration:"2s",animationTimingFunction:"ease-in-out",animationDirection:"normal",animationIterationCount:"infinite",animationName:u?kk():xk()}],dataWrapper:[c.dataWrapper,{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",opacity:"0",background:"none",backgroundColor:"transparent",border:"none",transition:"opacity "+i+"ms"},o&&{opacity:"1",position:"static"}],screenReaderText:yo}}),void 0,{scope:"Shimmer"}),jk=Mn(),Yk=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderShimmerPlaceholder=function(e,t){var n=o.props.onRenderCustomPlaceholder,r=n?n(t,e,o._renderDefaultShimmerPlaceholder):o._renderDefaultShimmerPlaceholder(t);return b.createElement(Gk,{customElementsGroup:r})},o._renderDefaultShimmerPlaceholder=function(e){var t=e.columns,o=e.compact,n=e.selectionMode,r=e.checkboxVisibility,i=e.cellStyleProps,s=void 0===i?Nf:i,a=Ff.rowHeight,l=Ff.compactRowHeight,c=o?l:a+1,u=[];return n!==af.none&&r!==Ef.hidden&&u.push(b.createElement(Vk,{key:"checkboxGap",shimmerElements:[{type:yk.gap,width:"40px",height:c}]})),t.forEach((function(e,t){var o=[],n=s.cellLeftPadding+s.cellRightPadding+e.calculatedWidth+(e.isPadded?s.cellExtraRightPadding:0);o.push({type:yk.gap,width:s.cellLeftPadding,height:c}),e.isIconOnly?(o.push({type:yk.line,width:e.calculatedWidth,height:e.calculatedWidth}),o.push({type:yk.gap,width:s.cellRightPadding,height:c})):(o.push({type:yk.line,width:.95*e.calculatedWidth,height:7}),o.push({type:yk.gap,width:s.cellRightPadding+(e.calculatedWidth-.95*e.calculatedWidth)+(e.isPadded?s.cellExtraRightPadding:0),height:c})),u.push(b.createElement(Vk,{key:t,width:n+"px",shimmerElements:o}))})),u.push(b.createElement(Vk,{key:"endGap",width:"100%",shimmerElements:[{type:yk.gap,width:"100%",height:c}]})),b.createElement("div",{style:{display:"flex"}},u)},o._shimmerItems=t.shimmerLines?new Array(t.shimmerLines):new Array(10),o}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.detailsListStyles,o=e.enableShimmer,n=e.items,r=e.listProps,i=(e.onRenderCustomPlaceholder,e.removeFadingOverlay),s=(e.shimmerLines,e.styles),a=e.theme,l=e.ariaLabelForGrid,c=e.ariaLabelForShimmer,u=m(e,["detailsListStyles","enableShimmer","items","listProps","onRenderCustomPlaceholder","removeFadingOverlay","shimmerLines","styles","theme","ariaLabelForGrid","ariaLabelForShimmer"]),d=r&&r.className;this._classNames=jk(s,{theme:a});var p=h(h({},r),{className:o&&!i?Sr(this._classNames.root,d):d});return b.createElement(Xv,h({},u,{styles:t,items:o?this._shimmerItems:n,isPlaceholderData:o,ariaLabelForGrid:o&&c||l,onRenderMissingItem:this._onRenderShimmerPlaceholder,listProps:p}))},t}(b.Component),qk=xn(Yk,(function(e){var t=e.theme.palette;return{root:{position:"relative",selectors:{":after":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,backgroundImage:"linear-gradient(to bottom, transparent 30%, "+t.whiteTranslucent40+" 65%,"+t.white+" 100%)"}}}}}),void 0,{scope:"ShimmeredDetailsList"}),Zk=Mn(),Xk=1e3,Qk=function(e){function t(t){var o=e.call(this,t)||this;o._disposables=[],o._sliderLine=b.createRef(),o._thumb=b.createRef(),o._onKeyDownTimer=-1,o._getAriaValueText=function(e){var t=o.props.ariaValueText;if(void 0!==e)return t?t(e):e.toString()},o._onMouseDownOrTouchStart=function(e){"mousedown"===e.type?o._disposables.push(Ga(window,"mousemove",o._onMouseMoveOrTouchMove,!0),Ga(window,"mouseup",o._onMouseUpOrTouchEnd,!0)):"touchstart"===e.type&&o._disposables.push(Ga(window,"touchmove",o._onMouseMoveOrTouchMove,!0),Ga(window,"touchend",o._onMouseUpOrTouchEnd,!0)),o._onMouseMoveOrTouchMove(e,!0)},o._onMouseMoveOrTouchMove=function(e,t){if(o._sliderLine.current){var n,r,i,s=o.props,a=s.max,l=s.min,c=s.step,u=(a-l)/c,d=o._sliderLine.current.getBoundingClientRect(),p=(o.props.vertical?d.height:d.width)/u;if(o.props.vertical){var h=o._getPosition(e,o.props.vertical);n=(d.bottom-h)/p}else{var m=o._getPosition(e,o.props.vertical);n=(In(o.props.theme)?d.right-m:m-d.left)/p}n>Math.floor(u)?i=r=a:n<0?i=r=l:(i=l+c*n,r=l+c*Math.round(n)),o._updateValue(r,i),t||(e.preventDefault(),e.stopPropagation())}},o._onMouseUpOrTouchEnd=function(e){o.setState({renderedValue:void 0}),o.props.onChanged&&o.props.onChanged(e,o.state.value),o._disposeListeners()},o._disposeListeners=function(){o._disposables.forEach((function(e){return e()})),o._disposables=[]},o._onKeyDown=function(e){var t=o.props.value,n=void 0===t?o.state.value:t,r=o.props,i=r.max,s=r.min,a=r.step,l=0;switch(e.which){case Pn(wn.left,o.props.theme):case wn.down:l=-a,o._clearOnKeyDownTimer(),o._setOnKeyDownTimer(e);break;case Pn(wn.right,o.props.theme):case wn.up:l=a,o._clearOnKeyDownTimer(),o._setOnKeyDownTimer(e);break;case wn.home:n=s;break;case wn.end:n=i;break;default:return}var c=Math.min(i,Math.max(s,n+l));o._updateValue(c,c),e.preventDefault(),e.stopPropagation(),o.setState({renderedValue:void 0})},o._clearOnKeyDownTimer=function(){o._async.clearTimeout(o._onKeyDownTimer)},o._setOnKeyDownTimer=function(e){o._onKeyDownTimer=o._async.setTimeout((function(){o.props.onChanged&&o.props.onChanged(e,o.state.value)}),Xk)},o._async=new di(o),si(o),o.props,o._id=ts("Slider");var n=void 0!==t.value?t.value:void 0!==t.defaultValue?t.defaultValue:t.min;return o.state={value:n,renderedValue:void 0},o}return p(t,e),t.prototype.componentWillUnmount=function(){this._async.dispose(),this._disposeListeners()},t.prototype.render=function(){var e,t,o,n,r,i=this.props,s=i.ariaLabel,a=i.className,l=i.disabled,c=i.label,u=i.max,d=i.min,p=i.showValue,m=i.buttonProps,g=i.vertical,f=i.valueFormat,v=i.styles,_=i.theme,y=i.originFromZero,C=this.value,S=this.renderedValue,x=d===u?0:(S-d)/(u-d)*100,k=d>=0?0:-d/(u-d)*100,w=g?"height":"width",I=l?{}:{onMouseDown:this._onMouseDownOrTouchStart},D=l?{}:{onTouchStart:this._onMouseDownOrTouchStart},P=l?{}:{onKeyDown:this._onKeyDown},T=Zk(v,{className:a,disabled:l,vertical:g,showTransitions:S===C,showValue:p,theme:_}),E=m?fr(m,gr):void 0;return b.createElement("div",{className:T.root},c&&b.createElement(Hh,h({className:T.titleLabel},s?{}:{htmlFor:this._id},{disabled:l}),c),b.createElement("div",{className:T.container},b.createElement("div",h({id:this._id,"aria-valuenow":C,"aria-valuemin":d,"aria-valuemax":u,"aria-valuetext":this._getAriaValueText(C),"aria-label":s||c,"aria-disabled":l},I,D,P,E,{className:Sr(T.slideBox,m.className),role:"slider",tabIndex:l?void 0:0,"data-is-focusable":!l}),b.createElement("div",{ref:this._sliderLine,className:T.line},y&&b.createElement("span",{className:Sr(T.zeroTick),style:this._getStyleUsingOffsetPercent(g,k)}),b.createElement("span",{ref:this._thumb,className:T.thumb,style:this._getStyleUsingOffsetPercent(g,x)}),y?b.createElement(b.Fragment,null,b.createElement("span",{className:Sr(T.lineContainer,T.inactiveSection),style:(e={},e[w]=Math.min(x,k)+"%",e)}),b.createElement("span",{className:Sr(T.lineContainer,T.activeSection),style:(t={},t[w]=Math.abs(k-x)+"%",t)}),b.createElement("span",{className:Sr(T.lineContainer,T.inactiveSection),style:(o={},o[w]=Math.min(100-x,100-k)+"%",o)})):b.createElement(b.Fragment,null,b.createElement("span",{className:Sr(T.lineContainer,T.activeSection),style:(n={},n[w]=x+"%",n)}),b.createElement("span",{className:Sr(T.lineContainer,T.inactiveSection),style:(r={},r[w]=100-x+"%",r)})))),p&&b.createElement(Hh,{className:T.valueLabel,disabled:l},f?f(C):C)),b.createElement(ha,null))},t.prototype.focus=function(){this._thumb.current&&this._thumb.current.focus()},Object.defineProperty(t.prototype,"value",{get:function(){var e=this.props.value,t=void 0===e?this.state.value:e;return void 0===this.props.min||void 0===this.props.max||void 0===t?void 0:Math.max(this.props.min,Math.min(this.props.max,t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderedValue",{get:function(){var e=this.state.renderedValue;return void 0===e?this.value:e},enumerable:!0,configurable:!0}),t.prototype._getStyleUsingOffsetPercent=function(e,t){var o;return(o={})[e?"bottom":In(this.props.theme)?"right":"left"]=t+"%",o},t.prototype._getPosition=function(e,t){var o;switch(e.type){case"mousedown":case"mousemove":o=t?e.clientY:e.clientX;break;case"touchstart":case"touchmove":o=t?e.touches[0].clientY:e.touches[0].clientX}return o},t.prototype._updateValue=function(e,t){var o=this,n=this.props,r=n.step,i=n.snapToStep,s=0;if(isFinite(r))for(;Math.round(r*Math.pow(10,s))/Math.pow(10,s)!==r;)s++;var a=parseFloat(e.toFixed(s)),l=a!==this.state.value;i&&(t=a),this.setState({value:a,renderedValue:t},(function(){l&&o.props.onChange&&o.props.onChange(o.state.value)}))},t.defaultProps={step:1,min:0,max:10,showValue:!0,disabled:!1,vertical:!1,buttonProps:{},originFromZero:!1},t}(b.Component),Jk={root:"ms-Slider",enabled:"ms-Slider-enabled",disabled:"ms-Slider-disabled",row:"ms-Slider-row",column:"ms-Slider-column",container:"ms-Slider-container",slideBox:"ms-Slider-slideBox",line:"ms-Slider-line",thumb:"ms-Slider-thumb",activeSection:"ms-Slider-active",inactiveSection:"ms-Slider-inactive",valueLabel:"ms-Slider-value",showValue:"ms-Slider-showValue",showTransitions:"ms-Slider-showTransitions",zeroTick:"ms-Slider-zeroTick"},$k=xn(Qk,(function(e){var t,o,n,r,i,s,a,l,c,u,d,p,h,m=e.className,g=e.titleLabelClassName,v=e.theme,b=e.vertical,_=e.disabled,y=e.showTransitions,C=e.showValue,S=v.semanticColors,x=Oo(Jk,v),k=S.inputBackgroundCheckedHovered,w=S.inputBackgroundChecked,I=S.inputPlaceholderBackgroundChecked,D=S.smallInputBorder,P=S.disabledBorder,T=S.disabledText,E=S.disabledBackground,M=S.inputBackground,R=S.smallInputBorder,B=S.disabledBorder,N=!_&&{backgroundColor:k,selectors:(t={},t[jt]={backgroundColor:"Highlight"},t)},F=!_&&{backgroundColor:I,selectors:(o={},o[jt]={borderColor:"Highlight"},o)},A=!_&&{backgroundColor:w,selectors:(n={},n[jt]={backgroundColor:"Highlight"},n)},L=!_&&{border:"2px solid "+k,selectors:(r={},r[jt]={borderColor:"Highlight"},r)},H=!e.disabled&&{backgroundColor:S.inputPlaceholderBackgroundChecked,selectors:(i={},i[jt]={backgroundColor:"Highlight"},i)};return{root:f([x.root,v.fonts.medium,{userSelect:"none"},b&&{marginRight:8}],[_?void 0:x.enabled],[_?x.disabled:void 0],[b?void 0:x.row],[b?x.column:void 0],[m]),titleLabel:[{padding:0},g],container:[x.container,{display:"flex",flexWrap:"nowrap",alignItems:"center"},b&&{flexDirection:"column",height:"100%",textAlign:"center",margin:"8px 0"}],slideBox:f([x.slideBox,go(v),{background:"transparent",border:"none",flexGrow:1,lineHeight:28,display:"flex",alignItems:"center",selectors:(s={},s[":active ."+x.activeSection]=N,s[":hover ."+x.activeSection]=A,s[":active ."+x.inactiveSection]=F,s[":hover ."+x.inactiveSection]=F,s[":active ."+x.thumb]=L,s[":hover ."+x.thumb]=L,s[":active ."+x.zeroTick]=H,s[":hover ."+x.zeroTick]=H,s[jt]={forcedColorAdjust:"none"},s)},b?{height:"100%",width:28,padding:"8px 0"}:{height:28,width:"auto",padding:"0 8px"}],[C?x.showValue:void 0],[y?x.showTransitions:void 0]),thumb:[x.thumb,{borderWidth:2,borderStyle:"solid",borderColor:R,borderRadius:10,boxSizing:"border-box",background:M,display:"block",width:16,height:16,position:"absolute"},b?{left:-6,margin:"0 auto",transform:"translateY(8px)"}:{top:-6,transform:In(v)?"translateX(50%)":"translateX(-50%)"},y&&{transition:"left "+Fe.durationValue3+" "+Fe.easeFunction1},_&&{borderColor:B,selectors:(a={},a[jt]={borderColor:"GrayText"},a)}],line:[x.line,{display:"flex",position:"relative"},b?{height:"100%",width:4,margin:"0 auto",flexDirection:"column-reverse"}:{width:"100%"}],lineContainer:[{borderRadius:4,boxSizing:"border-box"},b?{width:4,height:"100%"}:{height:4,width:"100%"}],activeSection:[x.activeSection,{background:D,selectors:(l={},l[jt]={backgroundColor:"WindowText"},l)},y&&{transition:"width "+Fe.durationValue3+" "+Fe.easeFunction1},_&&{background:T,selectors:(c={},c[jt]={backgroundColor:"GrayText",borderColor:"GrayText"},c)}],inactiveSection:[x.inactiveSection,{background:P,selectors:(u={},u[jt]={border:"1px solid WindowText"},u)},y&&{transition:"width "+Fe.durationValue3+" "+Fe.easeFunction1},_&&{background:E,selectors:(d={},d[jt]={borderColor:"GrayText"},d)}],zeroTick:[x.zeroTick,{position:"absolute",background:S.disabledBorder,selectors:(p={},p[jt]={backgroundColor:"WindowText"},p)},e.disabled&&{background:S.disabledBackground,selectors:(h={},h[jt]={backgroundColor:"GrayText"},h)},e.vertical?{width:"16px",height:"1px",transform:In(v)?"translateX(6px)":"translateX(-6px)"}:{width:"1px",height:"16px",transform:"translateY(-6px)"}],valueLabel:[x.valueLabel,{flexShrink:1,width:30,lineHeight:"1"},b?{margin:"0 auto",whiteSpace:"nowrap",width:40}:{margin:"0 8px",whiteSpace:"nowrap",width:40}]}}),void 0,{scope:"Slider"}),ew=No((function(e){var t,o=e.semanticColors,n=o.disabledText,r=o.disabledBackground;return{backgroundColor:r,pointerEvents:"none",cursor:"default",color:n,selectors:(t={":after":{borderColor:r}},t[jt]={color:"GrayText"},t)}})),tw=No((function(e,t,o){var n,r,i,s=e.palette,a=e.semanticColors,l=e.effects,c=s.neutralSecondary,u=a.buttonText,d=a.buttonText,p=a.buttonBackgroundHovered,h=a.buttonBackgroundPressed;return dn({root:{outline:"none",display:"block",height:"50%",width:23,padding:0,backgroundColor:"transparent",textAlign:"center",cursor:"default",color:c,selectors:{"&.ms-DownButton":{borderRadius:"0 0 "+l.roundedCorner2+" 0"},"&.ms-UpButton":{borderRadius:"0 "+l.roundedCorner2+" 0 0"}}},rootHovered:{backgroundColor:p,color:u},rootChecked:{backgroundColor:h,color:d,selectors:(n={},n[jt]={backgroundColor:"Highlight",color:"HighlightText"},n)},rootPressed:{backgroundColor:h,color:d,selectors:(r={},r[jt]={backgroundColor:"Highlight",color:"HighlightText"},r)},rootDisabled:{opacity:.5,selectors:(i={},i[jt]={color:"GrayText",opacity:1},i)},icon:{fontSize:8,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}},{},o)})),ow=No((function(e,t){var o,n,r=e.palette,i=e.semanticColors,s=e.effects,a=e.fonts,l=i.inputBorder,c=i.inputBackground,u=i.inputBorderHovered,d=i.inputFocusBorderAlt,p=i.inputText,h=r.white,m=i.inputBackgroundChecked,g=i.disabledText;return dn({root:[a.medium,{outline:"none",width:"100%",minWidth:86}],labelWrapper:{display:"inline-flex",alignItems:"center"},labelWrapperStart:{height:32,float:"left",marginRight:10},labelWrapperEnd:{height:32,float:"right",marginLeft:10},labelWrapperTop:{marginBottom:-1},labelWrapperBottom:{},icon:{padding:"0 5px",fontSize:je.large},iconDisabled:{color:g},label:{pointerEvents:"none",lineHeight:je.large},labelDisabled:{},spinButtonWrapper:{display:"flex",position:"relative",boxSizing:"border-box",height:32,minWidth:86,selectors:{":after":{pointerEvents:"none",content:"''",position:"absolute",left:0,top:0,bottom:0,right:0,borderWidth:"1px",borderStyle:"solid",borderColor:l,borderRadius:s.roundedCorner2}}},spinButtonWrapperTopBottom:{width:"100%"},spinButtonWrapperHovered:{selectors:(o={":after":{borderColor:u}},o[jt]={selectors:{":after":{borderColor:"Highlight"}}},o)},spinButtonWrapperFocused:_o(d,s.roundedCorner2),spinButtonWrapperDisabled:ew(e),input:{boxSizing:"border-box",boxShadow:"none",borderStyle:"none",flex:1,margin:0,fontSize:a.medium.fontSize,fontFamily:"inherit",color:p,backgroundColor:c,height:"100%",padding:"0 8px 0 9px",outline:0,display:"block",minWidth:61,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",cursor:"text",userSelect:"text",borderRadius:s.roundedCorner2+" 0 0 "+s.roundedCorner2},inputTextSelected:{backgroundColor:m,color:h,selectors:(n={},n[jt]={backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},n)},inputDisabled:ew(e),arrowButtonsContainer:{display:"block",height:"100%",cursor:"default"},arrowButtonsContainerDisabled:ew(e)},t)})),nw=No((function(e,t,o,n,r,i){return void 0===r&&(r=za.start),void 0===i&&(i=void 0),{root:Q(e.root,i),labelWrapper:Q(e.labelWrapper,rw(r,e)),icon:Q(e.icon,t&&e.iconDisabled),label:Q(e.label),spinButtonWrapper:Q(e.spinButtonWrapper,iw(r,e),!t&&[{selectors:{":hover":e.spinButtonWrapperHovered}},o&&{selectors:{"&&":e.spinButtonWrapperFocused}}],t&&e.spinButtonWrapperDisabled),input:Q("ms-spinButton-input",e.input,!t&&{selectors:{"::selection":e.inputTextSelected}},t&&e.inputDisabled),arrowBox:Q(e.arrowButtonsContainer,t&&e.arrowButtonsContainerDisabled)}}));function rw(e,t){switch(e){case za.start:return t.labelWrapperStart;case za.end:return t.labelWrapperEnd;case za.top:return t.labelWrapperTop;case za.bottom:return t.labelWrapperBottom}}function iw(e,t){switch(e){case za.top:case za.bottom:return t.spinButtonWrapperTopBottom;default:return{}}}!function(e){e[e.down=-1]="down",e[e.notSpinning=0]="notSpinning",e[e.up=1]="up"}(Wk||(Wk={}));var sw=function(e){function t(t){var o=e.call(this,t)||this;o._input=b.createRef(),o._initialStepDelay=400,o._stepDelay=75,o._onFocus=function(e){o._input.current&&((o._spinningByMouse||o.state.keyboardSpinDirection!==Wk.notSpinning)&&o._stop(),o._input.current.select(),o.setState({isFocused:!0}),o.props.onFocus&&o.props.onFocus(e))},o._onBlur=function(e){o._validate(e),o.setState({isFocused:!1}),o.props.onBlur&&o.props.onBlur(e)},o._onValidate=function(e,t){return o.props.onValidate?o.props.onValidate(e,t):o._defaultOnValidate(e)},o._calculatePrecision=function(e){var t=e.precision;return void 0===t?Math.max(nS(e.step),0):t},o._defaultOnValidate=function(e){if(null===e||0===e.trim().length||isNaN(Number(e)))return o._lastValidValue;var t=Math.min(o.props.max,Math.max(o.props.min,Number(e)));return String(t)},o._onIncrement=function(e,t){return o.props.onIncrement?o.props.onIncrement(e,t):o._defaultOnIncrement(e)},o._defaultOnIncrement=function(e){var t=o.props,n=t.max,r=t.step,i=Math.min(Number(e)+Number(r),n);return i=rS(i,o._precision),String(i)},o._onDecrement=function(e,t){return o.props.onDecrement?o.props.onDecrement(e,t):o._defaultOnDecrement(e)},o._defaultOnDecrement=function(e){var t=o.props,n=t.min,r=t.step,i=Math.max(Number(e)-Number(r),n);return i=rS(i,o._precision),String(i)},o._validate=function(e){if(void 0!==o.value&&void 0!==o._valueToValidate&&o._valueToValidate!==o._lastValidValue){var t=o._onValidate(o._valueToValidate,e);o._valueToValidate=void 0,void 0!==t?(o._lastValidValue=t,o.setState({value:t})):o.setState({value:o._lastValidValue})}},o._onInputChange=function(e){var t=e.target.value;o._valueToValidate=t,o.setState({value:t})},o._updateValue=function(e,t,n,r){var i=n(o.value||"",r);void 0!==i&&(o._lastValidValue=i,o.setState({value:i})),o._spinningByMouse!==e&&(o._spinningByMouse=e),e&&(o._currentStepFunctionHandle=o._async.setTimeout((function(){o._updateValue(e,o._stepDelay,n,r)}),t))},o._stop=function(){o._currentStepFunctionHandle>=0&&(o._async.clearTimeout(o._currentStepFunctionHandle),o._currentStepFunctionHandle=-1),(o._spinningByMouse||o.state.keyboardSpinDirection!==Wk.notSpinning)&&(o._spinningByMouse=!1,o.setState({keyboardSpinDirection:Wk.notSpinning}))},o._handleKeyDown=function(e){if(e.which!==wn.up&&e.which!==wn.down&&e.which!==wn.enter||(e.preventDefault(),e.stopPropagation()),o.props.disabled)o._stop();else{var t=Wk.notSpinning;switch(e.which){case wn.up:t=Wk.up,o._updateValue(!1,o._initialStepDelay,o._onIncrement,e);break;case wn.down:t=Wk.down,o._updateValue(!1,o._initialStepDelay,o._onDecrement,e);break;case wn.enter:o._validate(e);break;case wn.escape:o.value!==o._lastValidValue&&o.setState({value:o._lastValidValue})}o.state.keyboardSpinDirection!==t&&o.setState({keyboardSpinDirection:t})}},o._handleKeyUp=function(e){(o.props.disabled||e.which===wn.up||e.which===wn.down)&&o._stop()},o._onIncrementMouseDown=function(e){o._updateValue(!0,o._initialStepDelay,o._onIncrement,e)},o._onDecrementMouseDown=function(e){o._updateValue(!0,o._initialStepDelay,o._onDecrement,e)},si(o);var n=t.value,r=void 0===n?t.defaultValue:n;return void 0===r&&(r="number"==typeof t.min?String(t.min):"0"),o._lastValidValue=r,o._precision=o._calculatePrecision(t),o.state={isFocused:!1,value:r,keyboardSpinDirection:Wk.notSpinning},o._async=new di(o),o._currentStepFunctionHandle=-1,o._labelId=ts("Label"),o._inputId=ts("input"),o._spinningByMouse=!1,o._valueToValidate=void 0,o}return p(t,e),t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.UNSAFE_componentWillReceiveProps=function(e){void 0!==e.value&&(this._lastValidValue=e.value,this.setState({value:e.value})),this._precision=this._calculatePrecision(e)},t.prototype.render=function(){var e=this,t=this.props,o=t.disabled,n=t.label,r=t.min,i=t.max,s=t.labelPosition,a=t.iconProps,l=t.incrementButtonIcon,c=t.incrementButtonAriaLabel,u=t.decrementButtonIcon,d=t.decrementButtonAriaLabel,p=t.ariaLabel,m=t.ariaDescribedBy,g=t.styles,f=t.upArrowButtonStyles,v=t.downArrowButtonStyles,_=t.theme,y=t.ariaPositionInSet,C=t.ariaSetSize,S=t.ariaValueNow,x=t.ariaValueText,k=t.keytipProps,w=t.className,I=t.inputProps,D=t.iconButtonProps,P=this.state,T=P.isFocused,E=P.keyboardSpinDirection,M=this.value,R=this.props.getClassNames?this.props.getClassNames(_,o,T,E,s,w):nw(ow(_,g),o,T,E,s,w),B=fr(this.props,gr,["onBlur","onFocus","className"]);return b.createElement("div",{className:R.root},s!==za.bottom&&(a||n)&&b.createElement("div",{className:R.labelWrapper},a&&b.createElement(Fr,h({},a,{className:R.icon,"aria-hidden":"true"})),n&&b.createElement(Hh,{id:this._labelId,htmlFor:this._inputId,className:R.label,disabled:o},n)),b.createElement(Zs,{keytipProps:k,disabled:o},(function(t){return b.createElement("div",h({},B,{className:R.spinButtonWrapper,"aria-label":p&&p,"aria-posinset":y,"aria-setsize":C,"data-ktp-target":t["data-ktp-target"]}),b.createElement("input",h({value:M,id:e._inputId,onChange:e._onChange,onInput:e._onInputChange,className:R.input,type:"text",autoComplete:"off",role:"spinbutton","aria-labelledby":n&&e._labelId,"aria-valuenow":"number"==typeof S?S:M&&!isNaN(Number(M))?Number(M):void 0,"aria-valuetext":"string"==typeof x?x:!M||isNaN(Number(M))?M:void 0,"aria-valuemin":r,"aria-valuemax":i,"aria-describedby":Ns(m,t["aria-describedby"]),onBlur:e._onBlur,ref:e._input,onFocus:e._onFocus,onKeyDown:e._handleKeyDown,onKeyUp:e._handleKeyUp,disabled:o,"aria-disabled":o,"data-lpignore":!0,"data-ktp-execute-target":t["data-ktp-execute-target"]},I)),b.createElement("span",{className:R.arrowBox},b.createElement(eu,h({styles:tw(_,!0,f),className:"ms-UpButton",checked:E===Wk.up,disabled:o,iconProps:l,onMouseDown:e._onIncrementMouseDown,onMouseLeave:e._stop,onMouseUp:e._stop,tabIndex:-1,ariaLabel:c,"data-is-focusable":!1},D)),b.createElement(eu,h({styles:tw(_,!1,v),className:"ms-DownButton",checked:E===Wk.down,disabled:o,iconProps:u,onMouseDown:e._onDecrementMouseDown,onMouseLeave:e._stop,onMouseUp:e._stop,tabIndex:-1,ariaLabel:d,"data-is-focusable":!1},D))))})),s===za.bottom&&(a||n)&&b.createElement("div",{className:R.labelWrapper},a&&b.createElement(Fr,{iconName:a.iconName,className:R.icon,"aria-hidden":"true"}),n&&b.createElement(Hh,{id:this._labelId,htmlFor:this._inputId,className:R.label,disabled:o},n)))},t.prototype.focus=function(){this._input.current&&this._input.current.focus()},Object.defineProperty(t.prototype,"value",{get:function(){return this.state.value},enumerable:!0,configurable:!0}),t.prototype._onChange=function(){},t.defaultProps={step:1,min:0,max:100,disabled:!1,labelPosition:za.start,label:"",incrementButtonIcon:{iconName:"ChevronUpSmall"},decrementButtonIcon:{iconName:"ChevronDownSmall"}},t=g([ec("SpinButton",["theme","styles"],!0)],t)}(b.Component),aw=h;function lw(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];var r=e;return r.isSlot?0===(o=b.Children.toArray(o)).length?r(t):r(h(h({},t),{children:o})):b.createElement.apply(b,f([e,t],o))}function cw(e,t){void 0===t&&(t={});var o=t.defaultProp,n=void 0===o?"children":o;return function(t,o,r,i,s){if(b.isValidElement(o))return o;var a=function(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];for(var r={},i=[],s=0,a=o;s<a.length;s++){var l=a[s];i.push(l&&l.className),aw(r,l)}return r.className=J([e,i],{rtl:In(t)}),r}(i,s,t,function(e,t){var o,n;"string"==typeof t||"number"==typeof t||"boolean"==typeof t?((o={})[e]=t,n=o):n=t;return n}(n,o));if(r){if(r.component){var l=r.component;return b.createElement(l,h({},a))}if(r.render)return r.render(a,e)}return b.createElement(e,h({},a))}}var uw=No((function(e){return cw(e)}));function dw(e,t){var o={},n=e,r=function(e){if(t.hasOwnProperty(e)){var r=function(o){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(r.length>0)throw new Error("Any module using getSlots must use withSlots. Please see withSlots javadoc for more info.");return pw(t[e],o,n[e],n.slots&&n.slots[e],n._defaultStyles&&n._defaultStyles[e],n.theme)};r.isSlot=!0,o[e]=r}};for(var i in t)r(i);return o}function pw(e,t,o,n,r,i){return void 0!==e.create?e.create(t,o,n,r):uw(e)(t,o,n,r,i)}function hw(e,t){void 0===t&&(t={});var o=t.factoryOptions,n=(void 0===o?{}:o).defaultProp,r=function(o){var n,r,i,s=(n=t.displayName,r=b.useContext(yn),i=t.fields,It.getSettings(i||["theme","styles","tokens"],n,r.customizations)),a=t.state;a&&(o=h(h({},o),a(o)));var l=o.theme||s.theme,c=function e(t,o){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];for(var i={},s=0,a=n;s<a.length;s++){var l=a[s];l&&(l="function"==typeof l?l(t,o):l,Array.isArray(l)&&(l=e.apply(void 0,f([t,o],l))),aw(i,l))}return i}(o,l,t.tokens,s.tokens,o.tokens),u=function(e,t,o){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];return dn.apply(void 0,n.map((function(n){return"function"==typeof n?n(e,t,o):n})))}(o,l,c,t.styles,s.styles,o.styles),d=h(h({},o),{styles:u,tokens:c,_defaultStyles:u,theme:l});return e(d)};return r.displayName=t.displayName||e.name,n&&(r.create=cw(r,{defaultProp:n})),aw(r,t.statics),r}var mw={root:"ms-StackItem"},gw={start:"flex-start",end:"flex-end"},fw=hw((function(e){var t=e.children,o=fr(e,Yn);return b.Children.count(t)<1?null:lw(dw(e,{root:"div"}).root,h({},o),t)}),{displayName:"StackItem",styles:function(e,t,o){var n=e.grow,r=e.shrink,i=e.disableShrink,s=e.align,a=e.verticalFill,l=e.order,c=e.className,u=Oo(mw,t);return{root:[t.fonts.medium,u.root,{margin:o.margin,padding:o.padding,height:a?"100%":"auto",width:"auto"},n&&{flexGrow:!0===n?1:n},(i||!n&&!r)&&{flexShrink:0},r&&!i&&{flexShrink:1},s&&{alignSelf:gw[s]||s},l&&{order:l},c]}}}),vw=function(e,t){return t.spacing.hasOwnProperty(e)?t.spacing[e]:e},bw=function(e){var t=parseFloat(e),o=isNaN(t)?0:t,n=isNaN(t)?"":t.toString();return{value:o,unit:e.substring(n.toString().length)||"px"}},_w=function(e,t){if(void 0===e||"number"==typeof e||""===e)return e;var o=e.split(" ");return o.length<2?vw(e,t):o.reduce((function(e,o){return vw(e,t)+" "+vw(o,t)}))},yw={start:"flex-start",end:"flex-end"},Cw={root:"ms-Stack",inner:"ms-Stack-inner"};var Sw,xw=hw((function(e){var t=e.as,o=void 0===t?"div":t,n=e.disableShrink,r=e.wrap,i=m(e,["as","disableShrink","wrap"]),s=b.Children.map(e.children,(function(e,t){if(!e)return null;if((r=e)&&"object"==typeof r&&r.type&&r.type.displayName===fw.displayName){var o={shrink:!n};return b.cloneElement(e,h(h({},o),e.props))}var r;return e})),a=fr(i,Yn),l=dw(e,{root:o,inner:"div"});return lw(l.root,h({},a),r?lw(l.inner,null,s):s)}),{displayName:"Stack",styles:function(e,t,o){var n,r,i,s,a,l,c,u=e.verticalFill,d=e.horizontal,p=e.reversed,m=e.grow,g=e.wrap,f=e.horizontalAlign,v=e.verticalAlign,b=e.disableShrink,_=e.className,y=Oo(Cw,t),C=o&&o.childrenGap?o.childrenGap:e.gap,S=o&&o.maxHeight?o.maxHeight:e.maxHeight,x=o&&o.maxWidth?o.maxWidth:e.maxWidth,k=o&&o.padding?o.padding:e.padding,w=function(e,t){if(void 0===e||""===e)return{rowGap:{value:0,unit:"px"},columnGap:{value:0,unit:"px"}};if("number"==typeof e)return{rowGap:{value:e,unit:"px"},columnGap:{value:e,unit:"px"}};var o=e.split(" ");if(o.length>2)return{rowGap:{value:0,unit:"px"},columnGap:{value:0,unit:"px"}};if(2===o.length)return{rowGap:bw(vw(o[0],t)),columnGap:bw(vw(o[1],t))};var n=bw(vw(e,t));return{rowGap:n,columnGap:n}}(C,t),I=w.rowGap,D=w.columnGap,P=""+-.5*D.value+D.unit,T=""+-.5*I.value+I.unit,E={textOverflow:"ellipsis"},M={"> *:not(.ms-StackItem)":{flexShrink:b?0:1}};return g?{root:[y.root,{flexWrap:"wrap",maxWidth:x,maxHeight:S,width:"auto",overflow:"visible",height:"100%"},f&&(n={},n[d?"justifyContent":"alignItems"]=yw[f]||f,n),v&&(r={},r[d?"alignItems":"justifyContent"]=yw[v]||v,r),_,{display:"flex"},d&&{height:u?"100%":"auto"}],inner:[y.inner,{display:"flex",flexWrap:"wrap",marginLeft:P,marginRight:P,marginTop:T,marginBottom:T,overflow:"visible",boxSizing:"border-box",padding:_w(k,t),width:0===D.value?"100%":"calc(100% + "+D.value+D.unit+")",maxWidth:"100vw",selectors:h({"> *":h({margin:""+.5*I.value+I.unit+" "+.5*D.value+D.unit},E)},M)},f&&(i={},i[d?"justifyContent":"alignItems"]=yw[f]||f,i),v&&(s={},s[d?"alignItems":"justifyContent"]=yw[v]||v,s),d&&{flexDirection:p?"row-reverse":"row",height:0===I.value?"100%":"calc(100% + "+I.value+I.unit+")",selectors:{"> *":{maxWidth:0===D.value?"100%":"calc(100% - "+D.value+D.unit+")"}}},!d&&{flexDirection:p?"column-reverse":"column",height:"calc(100% + "+I.value+I.unit+")",selectors:{"> *":{maxHeight:0===I.value?"100%":"calc(100% - "+I.value+I.unit+")"}}}]}:{root:[y.root,{display:"flex",flexDirection:d?p?"row-reverse":"row":p?"column-reverse":"column",flexWrap:"nowrap",width:"auto",height:u?"100%":"auto",maxWidth:x,maxHeight:S,padding:_w(k,t),boxSizing:"border-box",selectors:h((a={"> *":E},a[p?"> *:not(:last-child)":"> *:not(:first-child)"]=[d&&{marginLeft:""+D.value+D.unit},!d&&{marginTop:""+I.value+I.unit}],a),M)},m&&{flexGrow:!0===m?1:m},f&&(l={},l[d?"justifyContent":"alignItems"]=yw[f]||f,l),v&&(c={},c[d?"alignItems":"justifyContent"]=yw[v]||v,c),_]}},statics:{Item:fw}});!function(e){e[e.Both=0]="Both",e[e.Header=1]="Header",e[e.Footer=2]="Footer"}(Sw||(Sw={}));var kw=function(e){function t(t){var o=e.call(this,t)||this;return o._root=b.createRef(),o._stickyContentTop=b.createRef(),o._stickyContentBottom=b.createRef(),o._nonStickyContent=b.createRef(),o._placeHolder=b.createRef(),o.syncScroll=function(e){var t=o.nonStickyContent;t&&o.props.isScrollSynced&&(t.scrollLeft=e.scrollLeft)},o._getContext=function(){return o.context},o._onScrollEvent=function(e,t){if(o.root&&o.nonStickyContent){var n=o._getNonStickyDistanceFromTop(e),r=!1,i=!1;if(o.canStickyTop)r=n-o._getStickyDistanceFromTop()<e.scrollTop;o.canStickyBottom&&e.clientHeight-t.offsetHeight<=n&&(i=n-Math.floor(e.scrollTop)>=o._getStickyDistanceFromTopForFooter(e,t)),document.activeElement&&o.nonStickyContent.contains(document.activeElement)&&(o.state.isStickyTop!==r||o.state.isStickyBottom!==i)?o._activeElement=document.activeElement:o._activeElement=void 0,o.setState({isStickyTop:o.canStickyTop&&r,isStickyBottom:i,distanceFromTop:n})}},o._getStickyDistanceFromTop=function(){var e=0;return o.stickyContentTop&&(e=o.stickyContentTop.offsetTop),e},o._getStickyDistanceFromTopForFooter=function(e,t){var n=0;return o.stickyContentBottom&&(n=e.clientHeight-t.offsetHeight+o.stickyContentBottom.offsetTop),n},o._getNonStickyDistanceFromTop=function(e){var t=0,n=o.root;if(n){for(;n&&n.offsetParent!==e;)t+=n.offsetTop,n=n.offsetParent;n&&n.offsetParent===e&&(t+=n.offsetTop)}return t},si(o),o.state={isStickyTop:!1,isStickyBottom:!1,distanceFromTop:void 0},o._activeElement=void 0,o}return p(t,e),Object.defineProperty(t.prototype,"root",{get:function(){return this._root.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeHolder.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stickyContentTop",{get:function(){return this._stickyContentTop.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stickyContentBottom",{get:function(){return this._stickyContentBottom.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonStickyContent",{get:function(){return this._nonStickyContent.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canStickyTop",{get:function(){return this.props.stickyPosition===Sw.Both||this.props.stickyPosition===Sw.Header},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canStickyBottom",{get:function(){return this.props.stickyPosition===Sw.Both||this.props.stickyPosition===Sw.Footer},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){var e=this._getContext().scrollablePane;e&&(e.subscribe(this._onScrollEvent),e.addSticky(this))},t.prototype.componentWillUnmount=function(){var e=this._getContext().scrollablePane;e&&(e.unsubscribe(this._onScrollEvent),e.removeSticky(this))},t.prototype.componentDidUpdate=function(e,t){var o=this._getContext().scrollablePane;if(o){var n=this.state,r=n.isStickyBottom,i=n.isStickyTop,s=n.distanceFromTop,a=!1;t.distanceFromTop!==s&&(o.sortSticky(this,!0),a=!0),t.isStickyTop===i&&t.isStickyBottom===r||(this._activeElement&&this._activeElement.focus(),o.updateStickyRefHeights(),a=!0),a&&o.syncScrollSticky(this)}},t.prototype.shouldComponentUpdate=function(e,t){if(!this.context.scrollablePane)return!0;var o=this.state,n=o.isStickyTop,r=o.isStickyBottom,i=o.distanceFromTop;return n!==t.isStickyTop||r!==t.isStickyBottom||this.props.stickyPosition!==e.stickyPosition||this.props.children!==e.children||i!==t.distanceFromTop||ww(this._nonStickyContent,this._stickyContentTop)||ww(this._nonStickyContent,this._stickyContentBottom)||ww(this._nonStickyContent,this._placeHolder)},t.prototype.render=function(){var e=this.state,t=e.isStickyTop,o=e.isStickyBottom,n=this.props,r=n.stickyClassName,i=n.children;return this.context.scrollablePane?b.createElement("div",{ref:this._root},this.canStickyTop&&b.createElement("div",{ref:this._stickyContentTop,style:{pointerEvents:t?"auto":"none"}},b.createElement("div",{style:this._getStickyPlaceholderHeight(t)})),this.canStickyBottom&&b.createElement("div",{ref:this._stickyContentBottom,style:{pointerEvents:o?"auto":"none"}},b.createElement("div",{style:this._getStickyPlaceholderHeight(o)})),b.createElement("div",{style:this._getNonStickyPlaceholderHeightAndWidth(),ref:this._placeHolder},(t||o)&&b.createElement("span",{style:yo},i),b.createElement("div",{ref:this._nonStickyContent,className:t||o?r:void 0,style:this._getContentStyles(t||o)},i))):b.createElement("div",null,this.props.children)},t.prototype.addSticky=function(e){this.nonStickyContent&&e.appendChild(this.nonStickyContent)},t.prototype.resetSticky=function(){this.nonStickyContent&&this.placeholder&&this.placeholder.appendChild(this.nonStickyContent)},t.prototype.setDistanceFromTop=function(e){var t=this._getNonStickyDistanceFromTop(e);this.setState({distanceFromTop:t})},t.prototype._getContentStyles=function(e){return{backgroundColor:this.props.stickyBackgroundColor||this._getBackground(),overflow:e?"hidden":""}},t.prototype._getStickyPlaceholderHeight=function(e){var t=this.nonStickyContent?this.nonStickyContent.offsetHeight:0;return{visibility:e?"hidden":"visible",height:e?0:t}},t.prototype._getNonStickyPlaceholderHeightAndWidth=function(){var e=this.state,t=e.isStickyTop,o=e.isStickyBottom;if(t||o){var n=0,r=0;return this.nonStickyContent&&this.nonStickyContent.firstElementChild&&(n=this.nonStickyContent.offsetHeight,r=this.nonStickyContent.firstElementChild.scrollWidth+(this.nonStickyContent.firstElementChild.offsetWidth-this.nonStickyContent.firstElementChild.clientWidth)),{height:n,width:r}}return{}},t.prototype._getBackground=function(){if(this.root){for(var e=this.root;"rgba(0, 0, 0, 0)"===window.getComputedStyle(e).getPropertyValue("background-color")||"transparent"===window.getComputedStyle(e).getPropertyValue("background-color");){if("HTML"===e.tagName)return;e.parentElement&&(e=e.parentElement)}return window.getComputedStyle(e).getPropertyValue("background-color")}},t.defaultProps={stickyPosition:Sw.Both,isScrollSynced:!0},t.contextType=Kx,t}(b.Component);function ww(e,t){return e&&t&&e.current&&t.current&&e.current.offsetHeight!==t.current.offsetHeight}var Iw=No((function(e,t,o,n,r,i,s,a,l){var c=Ou(e);return hn({root:["ms-Button",c.root,o,t,s&&["is-checked",c.rootChecked],i&&["is-disabled",c.rootDisabled],!i&&!s&&{selectors:{":hover":c.rootHovered,":focus":c.rootFocused,":active":c.rootPressed}},i&&s&&[c.rootCheckedDisabled],!i&&s&&{selectors:{":hover":c.rootCheckedHovered,":active":c.rootCheckedPressed}}],flexContainer:["ms-Button-flexContainer",c.flexContainer]})})),Dw=Mn(),Pw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t}(ed),Tw=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onRenderColorOption=function(e){return b.createElement("svg",{className:t._classNames.svg,viewBox:"0 0 20 20",fill:Hm(e.color).str},t.props.circle?b.createElement("circle",{cx:"50%",cy:"50%",r:"50%"}):b.createElement("rect",{width:"100%",height:"100%"}))},t}return p(t,e),t.prototype.render=function(){var e=this.props,t=e.item,o=e.idPrefix,n=void 0===o?this.props.id:o,r=e.selected,i=e.disabled,s=e.styles,a=e.theme,l=e.circle,c=e.color,u=e.onClick,d=e.onHover,p=e.onFocus,h=e.onMouseEnter,m=e.onMouseMove,g=e.onMouseLeave,f=e.onWheel,v=e.onKeyDown,_=e.height,y=e.width,C=e.borderWidth;return this._classNames=Dw(s,{theme:a,disabled:i,selected:r,circle:l,isWhite:this._isWhiteCell(c),height:_,width:y,borderWidth:C}),b.createElement(Pw,{item:t,id:n+"-"+t.id+"-"+t.index,key:t.id,disabled:i,role:"gridcell",onRenderItem:this._onRenderColorOption,selected:r,onClick:u,onHover:d,onFocus:p,label:t.label,className:this._classNames.colorCell,getClassNames:Iw,index:t.index,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onWheel:f,onKeyDown:v})},t.prototype._isWhiteCell=function(e){return"ffffff"===Hm(e).hex},t.defaultProps={circle:!0,disabled:!1,selected:!1},t}(b.PureComponent),Ew={left:-2,top:-2,bottom:-2,right:-2,border:"none",outlineColor:"ButtonText"},Mw=xn(Tw,(function(e){var t,o,n,r,i,s=e.theme,a=e.disabled,l=e.selected,c=e.circle,u=e.isWhite,d=e.height,p=void 0===d?20:d,h=e.width,m=void 0===h?20:h,g=e.borderWidth,f=s.semanticColors,v=s.palette,b=v.neutralLighter,_=v.neutralLight,y=v.neutralSecondary,C=v.neutralTertiary,S=g||(m<24?2:4);return{colorCell:[go(s,{inset:-1,position:"relative",highContrastStyle:Ew}),{backgroundColor:f.bodyBackground,padding:0,position:"relative",boxSizing:"border-box",display:"inline-block",cursor:"pointer",userSelect:"none",borderRadius:0,border:"none",height:p,width:m},!c&&{selectors:(t={},t["."+ho+" &:focus::after"]={outlineOffset:S-1+"px"},t)},c&&{borderRadius:"50%",selectors:(o={},o["."+ho+" &:focus::after"]={outline:"none",borderColor:f.focusBorder,borderRadius:"50%",left:-S,right:-S,top:-S,bottom:-S,selectors:(n={},n[jt]={outline:"1px solid ButtonText"},n)},o)},l&&{padding:2,border:S+"px solid "+_,selectors:(r={},r["&:hover::before"]={content:'""',height:p,width:m,position:"absolute",top:-S,left:-S,borderRadius:c?"50%":"default",boxShadow:"inset 0 0 0 1px "+y},r)},!l&&{selectors:(i={},i["&:hover, &:active, &:focus"]={backgroundColor:f.bodyBackground,padding:2,border:S+"px solid "+b},i["&:focus"]={borderColor:f.bodyBackground,padding:0,selectors:{":hover":{borderColor:s.palette.neutralLight,padding:2}}},i)},a&&{color:f.disabledBodyText,pointerEvents:"none",opacity:.3},u&&!l&&{backgroundColor:C,padding:1}],svg:[{width:"100%",height:"100%"},c&&{borderRadius:"50%"}]}}),void 0,{scope:"ColorPickerGridCell"},!0),Rw=Mn(),Bw=function(e){function t(t){var o,n=e.call(this,t)||this;return n.navigationIdleDelay=250,n._getItemsWithIndex=No((function(e){return e.map((function(e,t){return h(h({},e),{index:t})}))})),n._onRenderItem=function(e,t){var o=n.props.onRenderColorCell;return(void 0===o?n._renderOption:o)(e,n._renderOption)},n._onSwatchColorPickerBlur=function(){n.props.onCellFocused&&(n._cellFocused=!1,n.props.onCellFocused())},n._renderOption=function(e){var t=n.props,o=n._id;return b.createElement(Mw,{item:e,idPrefix:o,color:e.color,styles:t.getColorGridCellStyles,disabled:t.disabled,onClick:n._onCellClick,onHover:n._onGridCellHovered,onFocus:n._onGridCellFocused,selected:void 0!==n.state.selectedIndex&&n.state.selectedIndex===e.index,circle:"circle"===t.cellShape,label:e.label,onMouseEnter:n._onMouseEnter,onMouseMove:n._onMouseMove,onMouseLeave:n._onMouseLeave,onWheel:n._onWheel,onKeyDown:n._onKeyDown,height:t.cellHeight,width:t.cellWidth,borderWidth:t.cellBorderWidth})},n._onMouseEnter=function(e){return n.props.focusOnHover?(n.isNavigationIdle&&!n.props.disabled&&e.currentTarget.focus(),!0):!n.isNavigationIdle||!!n.props.disabled},n._onMouseMove=function(e){if(!n.props.focusOnHover)return!n.isNavigationIdle||!!n.props.disabled;var t=e.currentTarget;return!n.isNavigationIdle||document&&t===document.activeElement||t.focus(),!0},n._onMouseLeave=function(e){var t=n.props.mouseLeaveParentSelector;if(n.props.focusOnHover&&t&&n.isNavigationIdle&&!n.props.disabled)for(var o=document.querySelectorAll(t),r=0;r<o.length;r+=1)if(o[r].contains(e.currentTarget)){if(o[r].setActive)try{o[r].setActive()}catch(e){}else o[r].focus();break}},n._onWheel=function(){n._setNavigationTimeout()},n._onKeyDown=function(e){e.which!==wn.up&&e.which!==wn.down&&e.which!==wn.left&&e.which!==wn.right||n._setNavigationTimeout()},n._setNavigationTimeout=function(){n.isNavigationIdle||void 0===n.navigationIdleTimeoutId?n.isNavigationIdle=!1:(n.async.clearTimeout(n.navigationIdleTimeoutId),n.navigationIdleTimeoutId=void 0),n.navigationIdleTimeoutId=n.async.setTimeout((function(){n.isNavigationIdle=!0}),n.navigationIdleDelay)},n._onGridCellHovered=function(e){var t=n.props.onCellHovered;if(t)return e?t(e.id,e.color):t()},n._onGridCellFocused=function(e){var t=n.props.onCellFocused;if(t)return e?(n._cellFocused=!0,t(e.id,e.color)):(n._cellFocused=!1,t())},n._onCellClick=function(e){if(!n.props.disabled){var t=e.index;t>=0&&t!==n.state.selectedIndex&&(n.props.onCellFocused&&n._cellFocused&&(n._cellFocused=!1,n.props.onCellFocused()),n.props.onColorChanged&&n.props.onColorChanged(e.id,e.color),!0!==n.props.isControlled&&n.setState({selectedIndex:t}))}},n._id=t.id||ts("swatchColorPicker"),n.isNavigationIdle=!0,n.async=new di(n),t.selectedId&&(o=Nw(t.colorCells,t.selectedId)),n.state={selectedIndex:o},n}return p(t,e),t.getDerivedStateFromProps=function(e,t){var o=e.selectedId?Nw(e.colorCells,e.selectedId):void 0;return(e.isControlled||void 0!==o)&&o!==t.selectedIndex?{selectedIndex:o}:null},t.prototype.componentWillUnmount=function(){this.props.onCellFocused&&this._cellFocused&&(this._cellFocused=!1,this.props.onCellFocused()),this.async.dispose()},t.prototype.render=function(){var e=this.props,t=e.colorCells,o=e.columnCount,n=e.ariaPosInSet,r=void 0===n?this.props.positionInSet:n,i=e.ariaSetSize,s=void 0===i?this.props.setSize:i,a=e.shouldFocusCircularNavigate,l=e.className,c=e.doNotContainWithinFocusZone,u=e.styles,d=e.cellMargin,p=Rw(u,{theme:this.props.theme,className:l,cellMargin:d});return t.length<1||o<1?null:b.createElement(Ju,h({},this.props,{id:this._id,items:this._getItemsWithIndex(t),columnCount:o,onRenderItem:this._onRenderItem,ariaPosInSet:r,ariaSetSize:s,shouldFocusCircularNavigate:a,doNotContainWithinFocusZone:c,onBlur:this._onSwatchColorPickerBlur,theme:this.props.theme,styles:{root:p.root,tableCell:p.tableCell,focusedContainer:p.focusedContainer}}))},t.defaultProps={cellShape:"circle",disabled:!1,shouldFocusCircularNavigate:!0,cellMargin:10},t}(b.Component);function Nw(e,t){var o=bi(e,(function(e){return e.id===t}));return o>=0?o:void 0}var Fw={focusedContainer:"ms-swatchColorPickerBodyContainer"},Aw=xn(Bw,(function(e){var t=e.className,o=e.theme;return{root:{margin:"8px 0",borderCollapse:"collapse"},tableCell:{padding:e.cellMargin/2},focusedContainer:[Oo(Fw,o).focusedContainer,{clear:"both",display:"block",minWidth:"180px"},t]}}),void 0,{scope:"SwatchColorPicker"}),Lw=Mn(),Hw=function(e){function t(t){var o=e.call(this,t)||this;return o.rootElement=b.createRef(),o._onKeyDown=function(e){o.props.onDismiss&&e.which===wn.escape&&o.props.onDismiss()},si(o),o.state={},o}return p(t,e),t.prototype.componentDidMount=function(){this.props.onDismiss&&document.addEventListener("keydown",this._onKeyDown,!1)},t.prototype.componentWillUnmount=function(){this.props.onDismiss&&document.removeEventListener("keydown",this._onKeyDown)},t.prototype.focus=function(){this.rootElement.current&&this.rootElement.current.focus()},t.prototype.render=function(){var e,t,o,n,r,i=this.props,s=i.children,a=i.illustrationImage,l=i.primaryButtonProps,c=i.secondaryButtonProps,u=i.headline,d=i.hasCondensedHeadline,p=i.hasCloseButton,m=void 0===p?this.props.hasCloseIcon:p,g=i.onDismiss,f=i.closeButtonAriaLabel,v=i.hasSmallHeadline,_=i.isWide,y=i.styles,C=i.theme,S=i.ariaDescribedBy,x=i.ariaLabelledBy,k=i.footerContent,w=i.focusTrapZoneProps,I=Lw(y,{theme:C,hasCondensedHeadline:d,hasSmallHeadline:v,hasCloseButton:m,hasHeadline:!!u,isWide:_,primaryButtonClassName:l?l.className:void 0,secondaryButtonClassName:c?c.className:void 0});if(a&&a.src&&(e=b.createElement("div",{className:I.imageContent},b.createElement(yr,h({},a)))),u){var D="string"==typeof u?"p":"div";t=b.createElement("div",{className:I.header},b.createElement(D,{role:"heading",className:I.headline,id:x},u))}if(s){var P="string"==typeof s?"p":"div";o=b.createElement("div",{className:I.body},b.createElement(P,{className:I.subText,id:S},s))}return(l||c||k)&&(n=b.createElement(xw,{className:I.footer,horizontal:!0,horizontalAlign:k?"space-between":"end"},b.createElement(xw.Item,{align:"center"},b.createElement("span",null,k)),b.createElement(xw.Item,null,c&&b.createElement(Hu,h({},c,{className:I.secondaryButton})),l&&b.createElement(Ku,h({},l,{className:I.primaryButton}))))),m&&(r=b.createElement(eu,{className:I.closeButton,iconProps:{iconName:"Cancel"},title:f,ariaLabel:f,onClick:g})),b.createElement("div",{className:I.content,ref:this.rootElement,role:"dialog",tabIndex:-1,"aria-labelledby":x,"aria-describedby":S,"data-is-focusable":!0},e,b.createElement(Ih,h({isClickableOutsideFocusTrap:!0},w),b.createElement("div",{className:I.bodyContent},t,o,n,r)))},t}(b.Component),Ow={root:"ms-TeachingBubble",body:"ms-TeachingBubble-body",bodyContent:"ms-TeachingBubble-bodycontent",closeButton:"ms-TeachingBubble-closebutton",content:"ms-TeachingBubble-content",footer:"ms-TeachingBubble-footer",header:"ms-TeachingBubble-header",headerIsCondensed:"ms-TeachingBubble-header--condensed",headerIsSmall:"ms-TeachingBubble-header--small",headerIsLarge:"ms-TeachingBubble-header--large",headline:"ms-TeachingBubble-headline",image:"ms-TeachingBubble-image",primaryButton:"ms-TeachingBubble-primaryButton",secondaryButton:"ms-TeachingBubble-secondaryButton",subText:"ms-TeachingBubble-subText",button:"ms-Button",buttonLabel:"ms-Button-label"},zw=No((function(){return ee({"0%":{opacity:0,animationTimingFunction:Fe.easeFunction1,transform:"scale3d(.90,.90,.90)"},"100%":{opacity:1,transform:"scale3d(1,1,1)"}})})),Ww=function(e,t){var o=t||{},n=o.calloutWidth,r=o.calloutMaxWidth;return[{display:"block",maxWidth:364,border:0,outline:"transparent",width:n||"calc(100% + 1px)",animationName:""+zw(),animationDuration:"300ms",animationTimingFunction:"linear",animationFillMode:"both"},e&&{maxWidth:r||456}]},Vw=function(e,t,o){return t?[e.headerIsCondensed,{marginBottom:14}]:[o&&e.headerIsSmall,!o&&e.headerIsLarge,{selectors:{":not(:last-child)":{marginBottom:14}}}]},Kw=function(e){var t,o,n,r=e.hasCondensedHeadline,i=e.hasSmallHeadline,s=e.hasCloseButton,a=e.hasHeadline,l=e.isWide,c=e.primaryButtonClassName,u=e.secondaryButtonClassName,d=e.theme,p=e.calloutProps,h=void 0===p?{className:void 0,theme:d}:p,m=!r&&!i,g=d.palette,v=d.semanticColors,b=d.fonts,_=Oo(Ow,d);return{root:[_.root,b.medium,h.className],body:[_.body,s&&!a&&{marginRight:24},{selectors:{":not(:last-child)":{marginBottom:20}}}],bodyContent:[_.bodyContent,{padding:"20px 24px 20px 24px"}],closeButton:[_.closeButton,{position:"absolute",right:0,top:0,margin:"15px 15px 0 0",borderRadius:0,color:g.white,fontSize:b.small.fontSize,selectors:{":hover":{background:g.themeDarkAlt,color:g.white},":active":{background:g.themeDark,color:g.white},":focus":{border:"1px solid "+v.variantBorder}}}],content:f([_.content],Ww(l),[l&&{display:"flex"}]),footer:[_.footer,{display:"flex",flex:"auto",alignItems:"center",color:g.white,selectors:(t={},t["."+_.button+":not(:first-child)"]={marginLeft:10},t)}],header:f([_.header],Vw(_,r,i),[s&&{marginRight:24},(r||i)&&[b.medium,{fontWeight:Ge.semibold}]]),headline:[_.headline,{margin:0,color:g.white,fontWeight:Ge.semibold},m&&[{fontSize:b.xLarge.fontSize}]],imageContent:[_.header,_.image,l&&{display:"flex",alignItems:"center",maxWidth:154}],primaryButton:[_.primaryButton,c,{backgroundColor:g.white,borderColor:g.white,color:g.themePrimary,whiteSpace:"nowrap",selectors:(o={},o["."+_.buttonLabel]=b.medium,o[":hover"]={backgroundColor:g.themeLighter,borderColor:g.themeLighter,color:g.themePrimary},o[":focus"]={backgroundColor:g.themeLighter,borderColor:g.white},o[":active"]={backgroundColor:g.white,borderColor:g.white,color:g.themePrimary},o)}],secondaryButton:[_.secondaryButton,u,{backgroundColor:g.themePrimary,borderColor:g.white,whiteSpace:"nowrap",selectors:(n={},n["."+_.buttonLabel]=[b.medium,{color:g.white}],n["&:hover, &:focus"]={backgroundColor:g.themeDarkAlt,borderColor:g.white},n[":active"]={backgroundColor:g.themePrimary,borderColor:g.white},n)}],subText:[_.subText,{margin:0,fontSize:b.medium.fontSize,color:g.white,fontWeight:Ge.regular}],subComponentStyles:{callout:{root:f(Ww(l,h),[b.medium]),beak:[{background:g.themePrimary}],calloutMain:[{background:g.themePrimary}]}}}},Uw=xn(Hw,Kw,void 0,{scope:"TeachingBubbleContent"}),Gw=Mn(),jw=function(e){function t(t){var o=e.call(this,t)||this;return o.rootElement=b.createRef(),si(o),o.state={},o._defaultCalloutProps={beakWidth:16,gapSpace:0,setInitialFocus:!0,doNotLayer:!1,directionalHint:ya.rightCenter},o}return p(t,e),t.prototype.focus=function(){this.rootElement.current&&this.rootElement.current.focus()},t.prototype.render=function(){var e=this.props,t=e.calloutProps,o=e.targetElement,n=e.onDismiss,r=e.hasCloseButton,i=void 0===r?this.props.hasCloseIcon:r,s=e.isWide,a=e.styles,l=e.theme,c=e.target,u=h(h({},this._defaultCalloutProps),t),d={theme:l,isWide:s,calloutProps:h(h({},u),{theme:u.theme}),hasCloseButton:i},p=Gw(a,d),m=p.subComponentStyles?p.subComponentStyles.callout:void 0;return b.createElement(uc,h({target:c||o,onDismiss:n},u,{className:p.root,styles:m,hideOverflow:!0}),b.createElement("div",{ref:this.rootElement},b.createElement(Uw,h({},this.props))))},t.defaultProps={calloutProps:{beakWidth:16,gapSpace:0,setInitialFocus:!0,doNotLayer:!1,directionalHint:ya.rightCenter}},t}(b.Component),Yw=xn(jw,Kw,void 0,{scope:"TeachingBubble"}),qw=function(e){if(0===b.Children.count(e.children))return null;e.block,e.className;var t=e.as,o=void 0===t?"span":t,n=(e.variant,e.nowrap,m(e,["block","className","as","variant","nowrap"]));return lw(dw(e,{root:o}).root,h({},fr(n,Yn)))},Zw=function(e,t){var o=e.as,n=e.className,r=e.block,i=e.nowrap,s=e.variant,a=t.fonts[s||"medium"];return{root:[t.fonts.medium,{display:r?"td"===o?"table-cell":"block":"inline",fontFamily:a.fontFamily,fontSize:a.fontSize,fontWeight:a.fontWeight,color:a.color,mozOsxFontSmoothing:a.MozOsxFontSmoothing,webkitFontSmoothing:a.WebkitFontSmoothing},i&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},n]}},Xw=hw(qw,{displayName:"Text",styles:Zw}),Qw={9:/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/};function Jw(e,t){if(void 0===t&&(t=Qw),!e)return[];for(var o=[],n=0,r=0;r+n<e.length;r++){var i=e.charAt(r+n);if("\\"===i)n++;else{var s=t[i];s&&o.push({displayIndex:r,format:s})}}return o}function $w(e,t,o){var n=e;if(!n)return"";n=n.replace(/\\/g,"");var r=0;t.length>0&&(r=t[0].displayIndex-1);for(var i=0,s=t;i<s.length;i++){var a=s[i],l=" ";a.value?(l=a.value,a.displayIndex>r&&(r=a.displayIndex)):o&&(l=o),n=n.slice(0,a.displayIndex)+l+n.slice(a.displayIndex+1)}return o||(n=n.slice(0,r+1)),n}function eI(e,t){for(var o=0;o<e.length;o++)if(e[o].displayIndex>=t)return e[o].displayIndex;return e[e.length-1].displayIndex}function tI(e,t,o){for(var n=0;n<e.length;n++)if(e[n].displayIndex>=t){if(e[n].displayIndex>=t+o)break;e[n].value=void 0}return e}function oI(e,t,o){for(var n=0,r=0,i=!1,s=0;s<e.length&&n<o.length;s++)if(e[s].displayIndex>=t)for(i=!0,r=e[s].displayIndex;n<o.length;){if(e[s].format.test(o.charAt(n))){e[s].value=o.charAt(n++),s+1<e.length?r=e[s+1].displayIndex:r++;break}n++}return i?r:t}var nI,rI,iI,sI="_",aI=function(e){function t(t){var o=e.call(this,t)||this;return o._textField=b.createRef(),o._onFocus=function(e){o.props.onFocus&&o.props.onFocus(e),o._isFocused=!0;for(var t=0;t<o._maskCharData.length;t++)if(!o._maskCharData[t].value){o.setState({maskCursorPosition:o._maskCharData[t].displayIndex});break}},o._onBlur=function(e){o.props.onBlur&&o.props.onBlur(e),o._isFocused=!1,o._moveCursorOnMouseUp=!0},o._onMouseDown=function(e){o.props.onMouseDown&&o.props.onMouseDown(e),o._isFocused||(o._moveCursorOnMouseUp=!0)},o._onMouseUp=function(e){if(o.props.onMouseUp&&o.props.onMouseUp(e),o._moveCursorOnMouseUp){o._moveCursorOnMouseUp=!1;for(var t=0;t<o._maskCharData.length;t++)if(!o._maskCharData[t].value){o.setState({maskCursorPosition:o._maskCharData[t].displayIndex});break}}},o._onInputChange=function(e,t){var n=o._textField.current;if(null===o._changeSelectionData&&n&&(o._changeSelectionData={changeType:"default",selectionStart:null!==n.selectionStart?n.selectionStart:-1,selectionEnd:null!==n.selectionEnd?n.selectionEnd:-1}),o._changeSelectionData){var r=o.state.displayValue,i=0,s=o._changeSelectionData,a=s.changeType,l=s.selectionStart,c=s.selectionEnd;if("textPasted"===a){var u=c-l,d=t.length+u-r.length,p=l,h=t.substr(p,d);u&&(o._maskCharData=tI(o._maskCharData,l,u)),i=oI(o._maskCharData,p,h)}else if("delete"===a||"backspace"===a){var m="delete"===a;(d=c-l)?(o._maskCharData=tI(o._maskCharData,l,d),i=eI(o._maskCharData,l)):m?(o._maskCharData=function(e,t){for(var o=0;o<e.length;o++)if(e[o].displayIndex>=t){e[o].value=void 0;break}return e}(o._maskCharData,l),i=eI(o._maskCharData,l)):(o._maskCharData=function(e,t){for(var o=e.length-1;o>=0;o--)if(e[o].displayIndex<t){e[o].value=void 0;break}return e}(o._maskCharData,l),i=function(e,t){for(var o=e.length-1;o>=0;o--)if(e[o].displayIndex<t)return e[o].displayIndex;return e[0].displayIndex}(o._maskCharData,l))}else if(t.length>r.length){p=c-(d=t.length-r.length);var g=t.substr(p,d);i=oI(o._maskCharData,p,g)}else if(t.length<=r.length){d=1;var f=r.length+d-t.length;p=c-d,g=t.substr(p,d);o._maskCharData=tI(o._maskCharData,p,f),i=oI(o._maskCharData,p,g)}o._changeSelectionData=null;var v=$w(o.props.mask,o._maskCharData,o.props.maskChar);o.setState({displayValue:v,maskCursorPosition:i}),o.props.onChange&&o.props.onChange(e,v)}},o._onKeyDown=function(e){var t=o._textField.current;if(o.props.onKeyDown&&o.props.onKeyDown(e),o._changeSelectionData=null,t&&t.value){var n=e.keyCode,r=e.ctrlKey,i=e.metaKey;if(r||i)return;if(n===wn.backspace||n===wn.del){var s=e.target.selectionStart,a=e.target.selectionEnd;if(!(n===wn.backspace&&a&&a>0||n===wn.del&&null!==s&&s<t.value.length))return;o._changeSelectionData={changeType:n===wn.backspace?"backspace":"delete",selectionStart:null!==s?s:-1,selectionEnd:null!==a?a:-1}}}},o._onPaste=function(e){o.props.onPaste&&o.props.onPaste(e);var t=e.target.selectionStart,n=e.target.selectionEnd;o._changeSelectionData={changeType:"textPasted",selectionStart:null!==t?t:-1,selectionEnd:null!==n?n:-1}},si(o),o._maskCharData=Jw(t.mask,t.maskFormat),void 0!==t.value&&o.setValue(t.value),o._isFocused=!1,o._moveCursorOnMouseUp=!1,o.state={displayValue:$w(t.mask,o._maskCharData,t.maskChar)},o}return p(t,e),t.prototype.UNSAFE_componentWillReceiveProps=function(e){e.mask===this.props.mask&&e.value===this.props.value||(this._maskCharData=Jw(e.mask,e.maskFormat),void 0!==e.value&&this.setValue(e.value),this.setState({displayValue:$w(e.mask,this._maskCharData,e.maskChar)}))},t.prototype.componentDidUpdate=function(){this._isFocused&&void 0!==this.state.maskCursorPosition&&this._textField.current&&this._textField.current.setSelectionRange(this.state.maskCursorPosition,this.state.maskCursorPosition)},t.prototype.render=function(){return b.createElement(yg,h({},this.props,{onFocus:this._onFocus,onBlur:this._onBlur,onMouseDown:this._onMouseDown,onMouseUp:this._onMouseUp,onChange:this._onInputChange,onKeyDown:this._onKeyDown,onPaste:this._onPaste,value:this.state.displayValue||"",componentRef:this._textField}))},Object.defineProperty(t.prototype,"value",{get:function(){for(var e="",t=0;t<this._maskCharData.length;t++){if(!this._maskCharData[t].value)return;e+=this._maskCharData[t].value}return e},enumerable:!0,configurable:!0}),t.prototype.setValue=function(e){for(var t=0,o=0;t<e.length&&o<this._maskCharData.length;){var n=e[t];this._maskCharData[o].format.test(n)&&(this._maskCharData[o].value=n,o++),t++}},t.prototype.focus=function(){var e=this._textField.current;e&&e.focus()},t.prototype.blur=function(){var e=this._textField.current;e&&e.blur()},t.prototype.select=function(){var e=this._textField.current;e&&e.select()},t.prototype.setSelectionStart=function(e){var t=this._textField.current;t&&t.setSelectionStart(e)},t.prototype.setSelectionEnd=function(e){var t=this._textField.current;t&&t.setSelectionEnd(e)},t.prototype.setSelectionRange=function(e,t){var o=this._textField.current;o&&o.setSelectionRange(e,t)},Object.defineProperty(t.prototype,"selectionStart",{get:function(){var e=this._textField.current;return e&&null!==e.selectionStart?e.selectionStart:-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){var e=this._textField.current;return e&&e.selectionEnd?e.selectionEnd:-1},enumerable:!0,configurable:!0}),t.defaultProps={maskChar:sI,maskFormat:Qw},t}(b.Component),lI=function(){function e(){}return e.setSlot=function(t,o,n,r,i){if(void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!0),t.color||!t.value)if(i){var s=void 0;if("string"==typeof o){if(!(s=Hm(o)))throw new Error("color is invalid in setSlot(): "+o)}else s=o;e._setSlot(t,s,n,r,i)}else t.color&&e._setSlot(t,t.color,n,r,i)},e.insureSlots=function(t,o){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(!r.inherits&&!r.value){if(!r.color)throw new Error("A color slot rule that does not inherit must provide its own color.");e._setSlot(r,r.color,o,!1,!1)}}},e.getThemeAsJson=function(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var n=e[o];t[n.name]=n.color?n.color.str:n.value||""}return t},e.getThemeAsCode=function(t){return e._makeRemainingCode("loadTheme({\n palette: {\n",t)},e.getThemeAsCodeWithCreateTheme=function(t){return e._makeRemainingCode("const myTheme = createTheme({\n palette: {\n",t)},e.getThemeAsSass=function(e){var t="";for(var o in e)if(e.hasOwnProperty(o)){var n=e[o],r=n.name.charAt(0).toLowerCase()+n.name.slice(1);t+=id('${0}Color: "[theme: {1}, default: {2}]";\n',r,r,n.color?n.color.str:n.value||"")}return t},e.getThemeForPowerShell=function(e){var t="";for(var o in e)if(e.hasOwnProperty(o)){var n=e[o];if(n.value)continue;var r=n.name.charAt(0).toLowerCase()+n.name.slice(1),i=n.color?"#"+n.color.hex:n.value||"";n.color&&n.color.a&&100!==n.color.a&&(i+=String(n.color.a.toString(16))),t+=id('"{0}" = "{1}";\n',r,i)}return"@{\n"+t+"}"},e._setSlot=function(t,o,n,r,i){if(void 0===i&&(i=!0),(t.color||!t.value)&&(i||!t.color||!t.isCustomized||!t.inherits)){!i&&t.isCustomized||r||!t.inherits||!ng(t.asShade)?(t.color=o,t.isCustomized=!0):(t.isBackgroundShade?t.color=lg(o,t.asShade,n):t.color=ag(o,t.asShade,n),t.isCustomized=!1);for(var s=0,a=t.dependentRules;s<a.length;s++){var l=a[s];e._setSlot(l,t.color,n,!1,i)}}},e._makeRemainingCode=function(e,t){for(var o in t)if(t.hasOwnProperty(o)){var n=t[o];e+=id(" {0}: '{1}',\n",n.name.charAt(0).toLowerCase()+n.name.slice(1),n.color?"#"+n.color.hex:n.value||"")}return e+=" }});"},e}();function cI(){var e={};function t(t,o,n,r){void 0===r&&(r=!1);var i=e[nI[o]],s={name:t,inherits:i,asShade:n,isCustomized:!1,isBackgroundShade:r,dependentRules:[]};e[t]=s,i.dependentRules.push(s)}return Hs(nI,(function(t){e[t]={name:t,isCustomized:!0,dependentRules:[]},Hs(qm,(function(o,n){if(o!==qm[qm.Unshaded]){var r=e[t],i={name:t+o,inherits:e[t],asShade:n,isCustomized:!1,isBackgroundShade:t===nI[nI.backgroundColor],dependentRules:[]};e[t+o]=i,r.dependentRules.push(i)}}))})),e[nI[nI.primaryColor]].color=Hm("#0078d4"),e[nI[nI.backgroundColor]].color=Hm("#ffffff"),e[nI[nI.foregroundColor]].color=Hm("#323130"),t(rI[rI.themePrimary],nI.primaryColor,qm.Unshaded),t(rI[rI.themeLighterAlt],nI.primaryColor,qm.Shade1),t(rI[rI.themeLighter],nI.primaryColor,qm.Shade2),t(rI[rI.themeLight],nI.primaryColor,qm.Shade3),t(rI[rI.themeTertiary],nI.primaryColor,qm.Shade4),t(rI[rI.themeSecondary],nI.primaryColor,qm.Shade5),t(rI[rI.themeDarkAlt],nI.primaryColor,qm.Shade6),t(rI[rI.themeDark],nI.primaryColor,qm.Shade7),t(rI[rI.themeDarker],nI.primaryColor,qm.Shade8),t(rI[rI.neutralLighterAlt],nI.backgroundColor,qm.Shade1,!0),t(rI[rI.neutralLighter],nI.backgroundColor,qm.Shade2,!0),t(rI[rI.neutralLight],nI.backgroundColor,qm.Shade3,!0),t(rI[rI.neutralQuaternaryAlt],nI.backgroundColor,qm.Shade4,!0),t(rI[rI.neutralQuaternary],nI.backgroundColor,qm.Shade5,!0),t(rI[rI.neutralTertiaryAlt],nI.backgroundColor,qm.Shade6,!0),t(rI[rI.neutralTertiary],nI.foregroundColor,qm.Shade3),t(rI[rI.neutralSecondary],nI.foregroundColor,qm.Shade4),t(rI[rI.neutralPrimaryAlt],nI.foregroundColor,qm.Shade5),t(rI[rI.neutralPrimary],nI.foregroundColor,qm.Unshaded),t(rI[rI.neutralDark],nI.foregroundColor,qm.Shade7),t(rI[rI.black],nI.foregroundColor,qm.Shade8),t(rI[rI.white],nI.backgroundColor,qm.Unshaded,!0),e[rI[rI.neutralLighterAlt]].color=Hm("#faf9f8"),e[rI[rI.neutralLighter]].color=Hm("#f3f2f1"),e[rI[rI.neutralLight]].color=Hm("#edebe9"),e[rI[rI.neutralQuaternaryAlt]].color=Hm("#e1dfdd"),e[rI[rI.neutralDark]].color=Hm("#201f1e"),e[rI[rI.neutralTertiaryAlt]].color=Hm("#c8c6c4"),e[rI[rI.black]].color=Hm("#000000"),e[rI[rI.neutralDark]].color=Hm("#201f1e"),e[rI[rI.neutralPrimaryAlt]].color=Hm("#3b3a39"),e[rI[rI.neutralSecondary]].color=Hm("#605e5c"),e[rI[rI.neutralTertiary]].color=Hm("#a19f9d"),e[rI[rI.white]].color=Hm("#ffffff"),e[rI[rI.themeDarker]].color=Hm("#004578"),e[rI[rI.themeDark]].color=Hm("#005a9e"),e[rI[rI.themeDarkAlt]].color=Hm("#106ebe"),e[rI[rI.themeSecondary]].color=Hm("#2b88d8"),e[rI[rI.themeTertiary]].color=Hm("#71afe5"),e[rI[rI.themeLight]].color=Hm("#c7e0f4"),e[rI[rI.themeLighter]].color=Hm("#deecf9"),e[rI[rI.themeLighterAlt]].color=Hm("#eff6fc"),e[rI[rI.neutralLighterAlt]].isCustomized=!0,e[rI[rI.neutralLighter]].isCustomized=!0,e[rI[rI.neutralLight]].isCustomized=!0,e[rI[rI.neutralQuaternaryAlt]].isCustomized=!0,e[rI[rI.neutralDark]].isCustomized=!0,e[rI[rI.neutralTertiaryAlt]].isCustomized=!0,e[rI[rI.black]].isCustomized=!0,e[rI[rI.neutralDark]].isCustomized=!0,e[rI[rI.neutralPrimaryAlt]].isCustomized=!0,e[rI[rI.neutralSecondary]].isCustomized=!0,e[rI[rI.neutralTertiary]].isCustomized=!0,e[rI[rI.white]].isCustomized=!0,e[rI[rI.themeDarker]].isCustomized=!0,e[rI[rI.themeDark]].isCustomized=!0,e[rI[rI.themeDarkAlt]].isCustomized=!0,e[rI[rI.themePrimary]].isCustomized=!0,e[rI[rI.themeSecondary]].isCustomized=!0,e[rI[rI.themeTertiary]].isCustomized=!0,e[rI[rI.themeLight]].isCustomized=!0,e[rI[rI.themeLighter]].isCustomized=!0,e[rI[rI.themeLighterAlt]].isCustomized=!0,e}!function(e){e[e.primaryColor=0]="primaryColor",e[e.backgroundColor=1]="backgroundColor",e[e.foregroundColor=2]="foregroundColor"}(nI||(nI={})),function(e){e[e.themePrimary=0]="themePrimary",e[e.themeLighterAlt=1]="themeLighterAlt",e[e.themeLighter=2]="themeLighter",e[e.themeLight=3]="themeLight",e[e.themeTertiary=4]="themeTertiary",e[e.themeSecondary=5]="themeSecondary",e[e.themeDarkAlt=6]="themeDarkAlt",e[e.themeDark=7]="themeDark",e[e.themeDarker=8]="themeDarker",e[e.neutralLighterAlt=9]="neutralLighterAlt",e[e.neutralLighter=10]="neutralLighter",e[e.neutralLight=11]="neutralLight",e[e.neutralQuaternaryAlt=12]="neutralQuaternaryAlt",e[e.neutralQuaternary=13]="neutralQuaternary",e[e.neutralTertiaryAlt=14]="neutralTertiaryAlt",e[e.neutralTertiary=15]="neutralTertiary",e[e.neutralSecondary=16]="neutralSecondary",e[e.neutralPrimaryAlt=17]="neutralPrimaryAlt",e[e.neutralPrimary=18]="neutralPrimary",e[e.neutralDark=19]="neutralDark",e[e.black=20]="black",e[e.white=21]="white"}(rI||(rI={})),function(e){e[e.bodyBackground=0]="bodyBackground",e[e.bodyText=1]="bodyText",e[e.disabledBackground=2]="disabledBackground",e[e.disabledText=3]="disabledText"}(iI||(iI={}));var uI=Mn(),dI=function(e){function t(t){var o=e.call(this,t)||this;return o._toggleButton=b.createRef(),o._onClick=function(e){var t=o.props,n=t.disabled,r=t.checked,i=t.onChange,s=t.onChanged,a=t.onClick,l=o.state.checked;n||(void 0===r&&o.setState({checked:!l}),i&&i(e,!l),s&&s(!l),a&&a(e))},si(o),o.state={checked:!(!t.checked&&!t.defaultChecked)},o._id=t.id||ts("Toggle"),o}return p(t,e),t.getDerivedStateFromProps=function(e,t){return void 0===e.checked?null:{checked:!!e.checked}},Object.defineProperty(t.prototype,"checked",{get:function(){return this.state.checked},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,o=t.as,n=void 0===o?"div":o,r=t.className,i=t.theme,s=t.disabled,a=t.keytipProps,l=t.label,c=t.ariaLabel,u=t.onAriaLabel,d=t.offAriaLabel,p=t.offText,m=t.onText,g=t.styles,f=t.inlineLabel,v=this.state.checked,_=v?m:p,y=v?u:d,C=fr(this.props,tr,["defaultChecked"]),S=uI(g,{theme:i,className:r,disabled:s,checked:v,inlineLabel:f,onOffMissing:!m&&!p}),x=this._id+"-label",k=this._id+"-stateText",w=void 0;c||y||(l&&(w=x),_&&(w=w?w+" "+k:k));var I=this.props.role?this.props.role:"switch",D=function(t){return void 0===t&&(t={}),b.createElement("button",h({},C,t,{className:S.pill,disabled:s,id:e._id,type:"button",role:I,ref:e._toggleButton,"aria-disabled":s,"aria-checked":v,"aria-label":c||y,"data-is-focusable":!0,onChange:e._noop,onClick:e._onClick,"aria-labelledby":w}),b.createElement("span",{className:S.thumb}))},P=a?b.createElement(Zs,{keytipProps:a,ariaDescribedBy:C["aria-describedby"],disabled:s},(function(e){return D(e)})):D();return b.createElement(n,{className:S.root,hidden:C.hidden},l&&b.createElement(Hh,{htmlFor:this._id,className:S.label,id:x},l),b.createElement("div",{className:S.container},P,_&&b.createElement(Hh,{htmlFor:this._id,className:S.text,id:k},_)),b.createElement(ha,null))},t.prototype.focus=function(){this._toggleButton.current&&this._toggleButton.current.focus()},t.prototype._noop=function(){},t}(b.Component),pI=xn(dI,(function(e){var t,o,n,r,i,s,a,l=e.theme,c=e.className,u=e.disabled,d=e.checked,p=e.inlineLabel,m=e.onOffMissing,g=l.semanticColors,f=l.palette,v=g.bodyBackground,b=g.inputBackgroundChecked,_=g.inputBackgroundCheckedHovered,y=f.neutralDark,C=g.disabledBodySubtext,S=g.smallInputBorder,x=g.inputForegroundChecked,k=g.disabledBodySubtext,w=g.disabledBackground,I=g.smallInputBorder,D=g.inputBorderHovered,P=g.disabledBodySubtext,T=g.disabledText;return{root:["ms-Toggle",d&&"is-checked",!u&&"is-enabled",u&&"is-disabled",l.fonts.medium,{marginBottom:"8px"},p&&{display:"flex",alignItems:"center"},c],label:["ms-Toggle-label",{display:"inline-block"},u&&{color:T,selectors:(t={},t[jt]={color:"GrayText"},t)},p&&!m&&{marginRight:16},m&&p&&{order:1,marginLeft:16},p&&{wordBreak:"break-all"}],container:["ms-Toggle-innerContainer",{display:"flex",position:"relative"}],pill:["ms-Toggle-background",go(l,{inset:-3}),{fontSize:"20px",boxSizing:"border-box",width:40,height:20,borderRadius:10,transition:"all 0.1s ease",border:"1px solid "+I,background:v,cursor:"pointer",display:"flex",alignItems:"center",padding:"0 3px"},!u&&[!d&&{selectors:{":hover":[{borderColor:D}],":hover .ms-Toggle-thumb":[{backgroundColor:y,selectors:(o={},o[jt]={borderColor:"Highlight"},o)}]}},d&&[{background:b,borderColor:"transparent",justifyContent:"flex-end"},{selectors:(n={":hover":[{backgroundColor:_,borderColor:"transparent",selectors:(r={},r[jt]={backgroundColor:"Highlight"},r)}]},n[jt]=h({backgroundColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)}]],u&&[{cursor:"default"},!d&&[{borderColor:P}],d&&[{backgroundColor:C,borderColor:"transparent",justifyContent:"flex-end"}]],!u&&{selectors:{"&:hover":{selectors:(i={},i[jt]={borderColor:"Highlight"},i)}}}],thumb:["ms-Toggle-thumb",{display:"block",width:12,height:12,borderRadius:"50%",transition:"all 0.1s ease",backgroundColor:S,borderColor:"transparent",borderWidth:6,borderStyle:"solid",boxSizing:"border-box"},!u&&d&&[{backgroundColor:x,selectors:(s={},s[jt]={backgroundColor:"Window",borderColor:"Window"},s)}],u&&[!d&&[{backgroundColor:k}],d&&[{backgroundColor:w}]]],text:["ms-Toggle-stateText",{selectors:{"&&":{padding:"0",margin:"0 8px",userSelect:"none",fontWeight:Ge.regular}}},u&&{selectors:{"&&":{color:T,selectors:(a={},a[jt]={color:"GrayText"},a)}}}]}}),void 0,{scope:"Toggle"}),hI=function(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()},mI=function(){function e(){}return e.measure=function(t,o){e._timeoutId&&e.setPeriodicReset();var n=hI();o();var r=hI(),i=e.summary[t]||{totalDuration:0,count:0,all:[]},s=r-n;i.totalDuration+=s,i.count++,i.all.push({duration:s,timeStamp:r}),e.summary[t]=i},e.reset=function(){e.summary={},clearTimeout(e._timeoutId),e._timeoutId=NaN},e.setPeriodicReset=function(){e._timeoutId=setTimeout((function(){return e.reset()}),18e4)},e.summary={},e}(),gI="undefined"!=typeof WeakMap?new WeakMap:void 0;function fI(e){var t=function(t){function o(){var o=null!==t&&t.apply(this,arguments)||this;return o.state={Component:gI?gI.get(e.load):void 0},o}return p(o,t),o.prototype.render=function(){var e=this.props,t=e.forwardedRef,o=e.asyncPlaceholder,n=m(e,["forwardedRef","asyncPlaceholder"]),r=this.state.Component;return r?b.createElement(r,h(h({},n),{ref:t})):o?b.createElement(o,null):null},o.prototype.componentDidMount=function(){var t=this;this.state.Component||e.load().then((function(o){o&&(gI&&gI.set(e.load,o),t.setState({Component:o},e.onLoad))})).catch(e.onError)},o}(b.Component);return b.forwardRef((function(e,o){return b.createElement(t,h({},e,{forwardedRef:o}))}))}function vI(e){throw new Error("Unexpected object: "+e)}function bI(e,t){void 0===t&&(t=!0);var o=[];if(e){for(var n=0;n<e.children.length;n++)o.push(e.children.item(n));t&&Ti(e)&&o.push.apply(o,e._virtual.children)}return o}var _I={label:qn,audio:Zn,video:Xn,ol:Qn,li:Jn,a:$n,button:er,input:tr,textarea:or,select:nr,option:rr,table:ir,tr:sr,th:ar,td:lr,colGroup:cr,col:ur,form:dr,iframe:pr,img:hr};function yI(e,t,o){return fr(t,e&&_I[e]||Yn,o)}function CI(e){var t,o=e||rt();o&&!0!==(null===(t=o.FabricConfig)||void 0===t?void 0:t.disableFocusRects)&&(o.__hasInitializeFocusRects__||(o.__hasInitializeFocusRects__=!0,o.addEventListener("mousedown",SI,!0),o.addEventListener("pointerdown",xI,!0),o.addEventListener("keydown",kI,!0)))}function SI(e){mo(!1,e.target)}function xI(e){"mouse"!==e.pointerType&&mo(!1,e.target)}function kI(e){la(e.which)&&mo(!0,e.target)}var wI="";function II(e){return wI+e}function DI(e){wI=e}var PI=function(e){var t;return function(o,n){t||(t=new Set,ii(e,{componentWillUnmount:function(){t.forEach((function(e){return clearTimeout(e)}))}}));var r=setTimeout((function(){t.delete(r),o()}),n);t.add(r)}};function TI(e,t){for(var o=h({},t),n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];void 0===o[i]&&(o[i]=e[i])}return o}Object(gn.a)("@uifabric/utilities","7.33.5"),RC()},4:function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var n={},r=void 0;try{r=window}catch(e){}function i(e,t){if(void 0!==r){var o=r.__packages__=r.__packages__||{};if(!o[e]||!n[e])n[e]=t,(o[e]=o[e]||[]).push(t)}}i("@uifabric/set-version","6.0.0")}});
//# sourceMappingURL=fluentui-react.min.js.map |
blueocean-material-icons/src/js/components/svg-icons/hardware/power-input.js | jenkinsci/blueocean-plugin | import React from 'react';
import SvgIcon from '../../SvgIcon';
const HardwarePowerInput = (props) => (
<SvgIcon {...props}>
<path d="M2 9v2h19V9H2zm0 6h5v-2H2v2zm7 0h5v-2H9v2zm7 0h5v-2h-5v2z"/>
</SvgIcon>
);
HardwarePowerInput.displayName = 'HardwarePowerInput';
HardwarePowerInput.muiName = 'SvgIcon';
export default HardwarePowerInput;
|
src/index.js | juthatip/authentication-client | import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import reduxThunk from 'redux-thunk'
import reducers from './reducers';
import App from './components/app';
import Signin from './components/auth/signin';
import Signout from './components/auth/signout';
import Signup from './components/auth/signup';
import Feature from './components/feature';
import RequireAuth from './components/auth/require_auth';
import Welcome from './components/welcome';
import { AUTH_USER } from './actions/types';
const createStoreWithMiddleware = applyMiddleware(reduxThunk)(createStore);
const store = createStoreWithMiddleware(reducers);
const token = localStorage.getItem('token');
// If we have a token, consider the user to be signed in
if (token) {
// we need to update application state
store.dispatch({ type: AUTH_USER });
}
ReactDOM.render(
<Provider store={store}>
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Welcome} />
<Route path="signin" component={Signin} />
<Route path="signout" component={Signout} />
<Route path="signup" component={Signup} />
<Route path="feature" component={RequireAuth(Feature)} />
</Route>
</Router>
</Provider>
, document.querySelector('.container'));
|
app/javascript/mastodon/features/standalone/hashtag_timeline/index.js | masto-donte-com-br/mastodon | import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { expandHashtagTimeline } from 'mastodon/actions/timelines';
import Masonry from 'react-masonry-infinite';
import { List as ImmutableList } from 'immutable';
import DetailedStatusContainer from 'mastodon/features/status/containers/detailed_status_container';
import { debounce } from 'lodash';
import LoadingIndicator from 'mastodon/components/loading_indicator';
const mapStateToProps = (state, { hashtag }) => ({
statusIds: state.getIn(['timelines', `hashtag:${hashtag}`, 'items'], ImmutableList()),
isLoading: state.getIn(['timelines', `hashtag:${hashtag}`, 'isLoading'], false),
hasMore: state.getIn(['timelines', `hashtag:${hashtag}`, 'hasMore'], false),
});
export default @connect(mapStateToProps)
class HashtagTimeline extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,
statusIds: ImmutablePropTypes.list.isRequired,
isLoading: PropTypes.bool.isRequired,
hasMore: PropTypes.bool.isRequired,
hashtag: PropTypes.string.isRequired,
local: PropTypes.bool.isRequired,
};
static defaultProps = {
local: false,
};
componentDidMount () {
const { dispatch, hashtag, local } = this.props;
dispatch(expandHashtagTimeline(hashtag, { local }));
}
handleLoadMore = () => {
const { dispatch, hashtag, local, statusIds } = this.props;
const maxId = statusIds.last();
if (maxId) {
dispatch(expandHashtagTimeline(hashtag, { maxId, local }));
}
}
setRef = c => {
this.masonry = c;
}
handleHeightChange = debounce(() => {
if (!this.masonry) {
return;
}
this.masonry.forcePack();
}, 50)
render () {
const { statusIds, hasMore, isLoading } = this.props;
const sizes = [
{ columns: 1, gutter: 0 },
{ mq: '415px', columns: 1, gutter: 10 },
{ mq: '640px', columns: 2, gutter: 10 },
{ mq: '960px', columns: 3, gutter: 10 },
{ mq: '1255px', columns: 3, gutter: 10 },
];
const loader = (isLoading && statusIds.isEmpty()) ? <LoadingIndicator key={0} /> : undefined;
return (
<Masonry ref={this.setRef} className='statuses-grid' hasMore={hasMore} loadMore={this.handleLoadMore} sizes={sizes} loader={loader}>
{statusIds.map(statusId => (
<div className='statuses-grid__item' key={statusId}>
<DetailedStatusContainer
id={statusId}
compact
measureHeight
onHeightChange={this.handleHeightChange}
/>
</div>
)).toArray()}
</Masonry>
);
}
}
|
examples/UnigridExample8.js | yoonka/unigrid | /*
Copyright (c) 2018, Grzegorz Junka
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import React from 'react';
import tableData from './json/tableResp4.json!';
import {Unigrid} from 'src/index';
export class UnigridExample8 extends React.Component {
render() {
return (
<div>
<p>Example 8 : Tree rendering a flat section (JSX - generic components)</p>
<Unigrid cells={['a', 'b']} data={tableData} section={'body'}>
<Unigrid cells={['c', 'd']} >
<Unigrid cells={['e', 'f']} />
<Unigrid cells={['g', 'h']} />
</Unigrid>
</Unigrid>
</div>
);
}
}
|
client/src/common/volumes.box.component.js | Thiht/docktor | // React
import React from 'react';
import HeadingBox from './heading.box.component.js';
import './volumes.box.component.scss';
// VolumesBox is a list of docker volumes
class VolumesBox extends React.Component {
constructor(props) {
super(props);
// Set state of component from the props.
this.state = { volumes: this.props.volumes || [] };
}
componentDidMount() {
$('.volume .ui.dropdown.rights').dropdown();
this.refreshForm();
}
componentDidUpdate() {
$('.volume .ui.dropdown.rights').dropdown();
this.refreshForm();
}
refreshForm() {
const settings = { fields: {} };
this.state.volumes.forEach((volume, index) => {
settings.fields['external' + index] = 'empty';
settings.fields['internal' + index] = 'empty';
settings.fields['rights' + index] = 'empty';
});
$('.volume.ui.form').form(settings);
$('.volume.ui.form').find('.error').removeClass('error').find('.prompt').remove();
}
onAddVolume(event) {
event.preventDefault();
const volumes = this.state.volumes;
volumes.push({
value: '',
internal: '',
rights: 'rw',
description: ''
});
this.forceUpdate();
}
onRemoveVolume(event, index) {
event.preventDefault();
this.state.volumes.splice(index, 1);
this.forceUpdate();
}
onChangeVolume(event, index, property) {
event.preventDefault();
this.state.volumes[index][property] = event.target.value;
this.forceUpdate();
}
isFormValid() {
$('.volume.ui.form').form('validate form');
return $('.volume.ui.form').form('is valid');
}
renderVolume(volume, index) {
const title = '-v ' + volume.value + ':' + volume.internal + ':' + volume.rights;
return (
<div key={'volume' + index} className='fields'>
<div className='five wide field required'>
<label className='hidden'>External Volume</label>
<input title={title} type='text' value={volume.external} placeholder='The default volume on host' autoComplete='off'
onChange={(event) => this.onChangeVolume(event, index, 'external')} data-validate={'external' + index} />
</div>
<div className='five wide field required'>
<label className='hidden'>Internal Volume</label>
<input title={title} type='text' value={volume.internal} placeholder='The volume inside the container' autoComplete='off'
onChange={(event) => this.onChangeVolume(event, index, 'internal')} data-validate={'internal' + index} />
</div>
<div className='three wide field required' title={title}>
<label className='hidden'>Rights</label>
<select value={volume.rights} className='ui fluid dropdown rights'
onChange={(event) => this.onChangeVolume(event, index, 'rights')} data-validate={'rights' + index} >
<option value='' disabled>Select rights</option>
<option value='ro'>Read-only</option>
<option value='rw'>Read-write</option>
</select>
</div>
<div className='three wide field'>
<label className='hidden'>Description</label>
<textarea rows='2' defaultValue={volume.description} placeholder='Describe this volume' autoComplete='off'
onChange={(event) => this.onChangeVolume(event, index, 'description')} />
</div>
<div className='button field'>
<button className='ui red icon button' onClick={(event) => this.onRemoveVolume(event, index)}>
<i className='trash icon'></i>
</button>
</div>
</div>
);
}
render() {
return (
<HeadingBox className='volume ui form' icon='large folder open icon' title='Volumes'>
{this.props.children || <div></div>}
{(nbVolumes => {
if (nbVolumes) {
return (
<div className='fields header'>
<div className='five wide field required'>
<label>External Volume</label>
</div>
<div className='five wide field required'>
<label>Internal Volume</label>
</div>
<div className='three wide field required'>
<label>Rights</label>
</div>
<div className='three wide field'>
<label>Description</label>
</div>
<div className='one wide field'>
<label></label>
</div>
</div>
);
}
})(this.state.volumes.length)}
{
this.state.volumes.map((volume, index) => {
return (
this.renderVolume(volume, index)
);
})}
<div className='ui green small right folder open icon button' onClick={(event) => this.onAddVolume(event)}> <i className='plus icon'></i>Add volume</div>
</HeadingBox>
);
}
};
VolumesBox.propTypes = {
volumes: React.PropTypes.array,
children: React.PropTypes.oneOfType([
React.PropTypes.array,
React.PropTypes.element
])
};
export default VolumesBox;
|
src/icons/VerticalAlignBottomIcon.js | kiloe/ui | import React from 'react';
import Icon from '../Icon';
export default class VerticalAlignBottomIcon extends Icon {
getSVG(){return <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M32 26h-6V6h-4v20h-6l8 8 8-8zM8 38v4h32v-4H8z"/></svg>;}
}; |
src/Parser/Core/Modules/AlwaysBeCasting.js | hasseboulen/WoWAnalyzer | import React from 'react';
import Icon from 'common/Icon';
import { formatMilliseconds, formatPercentage } from 'common/format';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import Abilities from './Abilities';
import GlobalCooldown from './GlobalCooldown';
import Channeling from './Channeling';
import Haste from './Haste';
const debug = false;
class AlwaysBeCasting extends Analyzer {
static dependencies = {
combatants: Combatants,
haste: Haste,
abilities: Abilities,
globalCooldown: GlobalCooldown, // triggers the globalcooldown event
channeling: Channeling, // triggers the channeling-related events
};
// TODO: Should all this props be lower case?
static ABILITIES_ON_GCD = [
// Extend this class and override this property in your spec class to implement this module.
];
static STATIC_GCD_ABILITIES = {
// Abilities which GCD is not affected by haste.
// [spellId]: gcd value in seconds
};
// TODO: Add channels array to fix issues where is channel started pre-combat it doesn't register the `begincast` and considers the finish a GCD adding downtime. This can also be used to automatically add the channelVerifiers.
static BASE_GCD = 1500;
static MINIMUM_GCD = 750;
/**
* The amount of milliseconds not spent casting anything or waiting for the GCD.
* @type {number}
*/
get totalTimeWasted() {
return this.owner.fightDuration - this.activeTime;
}
get downtimePercentage() {
return 1 - this.activeTimePercentage;
}
get activeTimePercentage() {
return this.activeTime / this.owner.fightDuration;
}
activeTime = 0;
_lastGlobalCooldownDuration = 0;
on_globalcooldown(event) {
this._lastGlobalCooldownDuration = event.duration;
if (event.trigger === 'begincast') {
// Only add active time for this channel, we do this when the channel is finished and use the highest of the GCD and channel time
return false;
}
this.activeTime += event.duration;
return true;
}
on_endchannel(event) {
// If the channel was shorter than the GCD then use the GCD as active time
let amount = event.duration;
if (this.globalCooldown.isOnGlobalCooldown(event.ability.guid)) {
amount = Math.max(amount, this._lastGlobalCooldownDuration);
}
this.activeTime += amount;
return true;
}
processCast({ begincast, cast }) {
if (!cast) {
return;
}
const spellId = cast.ability.guid;
const isOnGcd = this.isOnGlobalCooldown(spellId);
// const isFullGcd = this.constructor.FULLGCD_ABILITIES.indexOf(spellId) !== -1;
if (!isOnGcd) {
debug && console.log(formatMilliseconds(this.owner.fightDuration), `%cABC: ${cast.ability.name} (${spellId}) ignored`, 'color: gray');
return;
}
const globalCooldown = this.getCurrentGlobalCooldown(spellId);
// TODO: Change this to begincast || cast
const castStartTimestamp = (begincast || cast).timestamp;
this.recordCastTime(
castStartTimestamp,
globalCooldown,
begincast,
cast,
spellId
);
}
showStatistic = true;
static icons = {
activeTime: '/img/sword.png',
downtime: '/img/afk.png',
};
statistic() {
const boss = this.owner.boss;
if (!this.showStatistic || (boss && boss.fight.disableDowntimeStatistic)) {
return null;
}
if (!this.globalCooldown.isAccurate) {
return null;
}
return (
<StatisticBox
icon={<Icon icon="spell_mage_altertime" alt="Downtime" />}
value={`${formatPercentage(this.downtimePercentage)} %`}
label="Downtime"
tooltip={`Downtime is available time not used to cast anything (including not having your GCD rolling). This can be caused by delays between casting spells, latency, cast interrupting or just simply not casting anything (e.g. due to movement/stunned).<br/>
<li>You spent <b>${formatPercentage(this.activeTimePercentage)}%</b> of your time casting something.</li>
<li>You spent <b>${formatPercentage(this.downtimePercentage)}%</b> of your time casting nothing at all.</li>
`}
footer={(
<div className="statistic-bar">
<div
className="stat-health-bg"
style={{ width: `${this.activeTimePercentage * 100}%` }}
data-tip={`You spent <b>${formatPercentage(this.activeTimePercentage)}%</b> of your time casting something.`}
>
<img src={this.constructor.icons.activeTime} alt="Active time" />
</div>
<div
className="remainder DeathKnight-bg"
data-tip={`You spent <b>${formatPercentage(this.downtimePercentage)}%</b> of your time casting nothing at all.`}
>
<img src={this.constructor.icons.downtime} alt="Downtime" />
</div>
</div>
)}
footerStyle={{ overflow: 'hidden' }}
/>
);
}
statisticOrder = STATISTIC_ORDER.CORE(10);
get downtimeSuggestionThresholds() {
return {
actual: this.downtimePercentage,
isGreaterThan: {
minor: 0.02,
average: 0.04,
major: 0.06,
},
style: 'percentage',
};
}
suggestions(when) {
when(this.downtimeSuggestionThresholds.actual).isGreaterThan(this.downtimeSuggestionThresholds.isGreaterThan.minor)
.addSuggestion((suggest, actual, recommended) => {
return suggest('Your downtime can be improved. Try to Always Be Casting (ABC), avoid delays between casting spells and cast instant spells when you have to move.')
.icon('spell_mage_altertime')
.actual(`${formatPercentage(actual)}% downtime`)
.recommended(`<${formatPercentage(recommended)}% is recommended`)
.regular(this.downtimeSuggestionThresholds.isGreaterThan.average).major(this.downtimeSuggestionThresholds.isGreaterThan.major);
});
}
}
export default AlwaysBeCasting;
|
ajax/libs/forerunnerdb/1.3.423/fdb-all.js | cdnjs/cdnjs | (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(_dereq_,module,exports){
var Core = _dereq_('./core'),
CollectionGroup = _dereq_('../lib/CollectionGroup'),
View = _dereq_('../lib/View'),
Highchart = _dereq_('../lib/Highchart'),
Persist = _dereq_('../lib/Persist'),
Document = _dereq_('../lib/Document'),
Overview = _dereq_('../lib/Overview'),
Grid = _dereq_('../lib/Grid'),
Rest = _dereq_('../lib/Rest'),
Odm = _dereq_('../lib/Odm');
if (typeof window !== 'undefined') {
window.ForerunnerDB = Core;
}
module.exports = Core;
},{"../lib/CollectionGroup":6,"../lib/Document":10,"../lib/Grid":11,"../lib/Highchart":12,"../lib/Odm":27,"../lib/Overview":30,"../lib/Persist":32,"../lib/Rest":36,"../lib/View":40,"./core":2}],2:[function(_dereq_,module,exports){
var Core = _dereq_('../lib/Core'),
ShimIE8 = _dereq_('../lib/Shim.IE8');
if (typeof window !== 'undefined') {
window.ForerunnerDB = Core;
}
module.exports = Core;
},{"../lib/Core":7,"../lib/Shim.IE8":39}],3:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
/**
* Creates an always-sorted multi-key bucket that allows ForerunnerDB to
* know the index that a document will occupy in an array with minimal
* processing, speeding up things like sorted views.
* @param {object} orderBy An order object.
* @constructor
*/
var ActiveBucket = function (orderBy) {
var sortKey;
this._primaryKey = '_id';
this._keyArr = [];
this._data = [];
this._objLookup = {};
this._count = 0;
for (sortKey in orderBy) {
if (orderBy.hasOwnProperty(sortKey)) {
this._keyArr.push({
key: sortKey,
dir: orderBy[sortKey]
});
}
}
};
Shared.addModule('ActiveBucket', ActiveBucket);
Shared.mixin(ActiveBucket.prototype, 'Mixin.Sorting');
/**
* Gets / sets the primary key used by the active bucket.
* @returns {String} The current primary key.
*/
Shared.synthesize(ActiveBucket.prototype, 'primaryKey');
/**
* Quicksorts a single document into the passed array and
* returns the index that the document should occupy.
* @param {object} obj The document to calculate index for.
* @param {array} arr The array the document index will be
* calculated for.
* @param {string} item The string key representation of the
* document whose index is being calculated.
* @param {function} fn The comparison function that is used
* to determine if a document is sorted below or above the
* document we are calculating the index for.
* @returns {number} The index the document should occupy.
*/
ActiveBucket.prototype.qs = function (obj, arr, item, fn) {
// If the array is empty then return index zero
if (!arr.length) {
return 0;
}
var lastMidwayIndex = -1,
midwayIndex,
lookupItem,
result,
start = 0,
end = arr.length - 1;
// Loop the data until our range overlaps
while (end >= start) {
// Calculate the midway point (divide and conquer)
midwayIndex = Math.floor((start + end) / 2);
if (lastMidwayIndex === midwayIndex) {
// No more items to scan
break;
}
// Get the item to compare against
lookupItem = arr[midwayIndex];
if (lookupItem !== undefined) {
// Compare items
result = fn(this, obj, item, lookupItem);
if (result > 0) {
start = midwayIndex + 1;
}
if (result < 0) {
end = midwayIndex - 1;
}
}
lastMidwayIndex = midwayIndex;
}
if (result > 0) {
return midwayIndex + 1;
} else {
return midwayIndex;
}
};
/**
* Calculates the sort position of an item against another item.
* @param {object} sorter An object or instance that contains
* sortAsc and sortDesc methods.
* @param {object} obj The document to compare.
* @param {string} a The first key to compare.
* @param {string} b The second key to compare.
* @returns {number} Either 1 for sort a after b or -1 to sort
* a before b.
* @private
*/
ActiveBucket.prototype._sortFunc = function (sorter, obj, a, b) {
var aVals = a.split('.:.'),
bVals = b.split('.:.'),
arr = sorter._keyArr,
count = arr.length,
index,
sortType,
castType;
for (index = 0; index < count; index++) {
sortType = arr[index];
castType = typeof obj[sortType.key];
if (castType === 'number') {
aVals[index] = Number(aVals[index]);
bVals[index] = Number(bVals[index]);
}
// Check for non-equal items
if (aVals[index] !== bVals[index]) {
// Return the sorted items
if (sortType.dir === 1) {
return sorter.sortAsc(aVals[index], bVals[index]);
}
if (sortType.dir === -1) {
return sorter.sortDesc(aVals[index], bVals[index]);
}
}
}
};
/**
* Inserts a document into the active bucket.
* @param {object} obj The document to insert.
* @returns {number} The index the document now occupies.
*/
ActiveBucket.prototype.insert = function (obj) {
var key,
keyIndex;
key = this.documentKey(obj);
keyIndex = this._data.indexOf(key);
if (keyIndex === -1) {
// Insert key
keyIndex = this.qs(obj, this._data, key, this._sortFunc);
this._data.splice(keyIndex, 0, key);
} else {
this._data.splice(keyIndex, 0, key);
}
this._objLookup[obj[this._primaryKey]] = key;
this._count++;
return keyIndex;
};
/**
* Removes a document from the active bucket.
* @param {object} obj The document to remove.
* @returns {boolean} True if the document was removed
* successfully or false if it wasn't found in the active
* bucket.
*/
ActiveBucket.prototype.remove = function (obj) {
var key,
keyIndex;
key = this._objLookup[obj[this._primaryKey]];
if (key) {
keyIndex = this._data.indexOf(key);
if (keyIndex > -1) {
this._data.splice(keyIndex, 1);
delete this._objLookup[obj[this._primaryKey]];
this._count--;
return true;
} else {
return false;
}
}
return false;
};
/**
* Get the index that the passed document currently occupies
* or the index it will occupy if added to the active bucket.
* @param {object} obj The document to get the index for.
* @returns {number} The index.
*/
ActiveBucket.prototype.index = function (obj) {
var key,
keyIndex;
key = this.documentKey(obj);
keyIndex = this._data.indexOf(key);
if (keyIndex === -1) {
// Get key index
keyIndex = this.qs(obj, this._data, key, this._sortFunc);
}
return keyIndex;
};
/**
* The key that represents the passed document.
* @param {object} obj The document to get the key for.
* @returns {string} The document key.
*/
ActiveBucket.prototype.documentKey = function (obj) {
var key = '',
arr = this._keyArr,
count = arr.length,
index,
sortType;
for (index = 0; index < count; index++) {
sortType = arr[index];
if (key) {
key += '.:.';
}
key += obj[sortType.key];
}
// Add the unique identifier on the end of the key
key += '.:.' + obj[this._primaryKey];
return key;
};
/**
* Get the number of documents currently indexed in the active
* bucket instance.
* @returns {number} The number of documents.
*/
ActiveBucket.prototype.count = function () {
return this._count;
};
Shared.finishModule('ActiveBucket');
module.exports = ActiveBucket;
},{"./Shared":38}],4:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path');
var BinaryTree = function (data, compareFunc, hashFunc) {
this.init.apply(this, arguments);
};
BinaryTree.prototype.init = function (data, index, compareFunc, hashFunc) {
this._store = [];
this._keys = [];
if (index !== undefined) { this.index(index); }
if (compareFunc !== undefined) { this.compareFunc(compareFunc); }
if (hashFunc !== undefined) { this.hashFunc(hashFunc); }
if (data !== undefined) { this.data(data); }
};
Shared.addModule('BinaryTree', BinaryTree);
Shared.mixin(BinaryTree.prototype, 'Mixin.ChainReactor');
Shared.mixin(BinaryTree.prototype, 'Mixin.Sorting');
Shared.mixin(BinaryTree.prototype, 'Mixin.Common');
Shared.synthesize(BinaryTree.prototype, 'compareFunc');
Shared.synthesize(BinaryTree.prototype, 'hashFunc');
Shared.synthesize(BinaryTree.prototype, 'indexDir');
Shared.synthesize(BinaryTree.prototype, 'keys');
Shared.synthesize(BinaryTree.prototype, 'index', function (index) {
if (index !== undefined) {
// Convert the index object to an array of key val objects
this.keys(this.extractKeys(index));
}
return this.$super.call(this, index);
});
BinaryTree.prototype.extractKeys = function (obj) {
var i,
keys = [];
for (i in obj) {
if (obj.hasOwnProperty(i)) {
keys.push({
key: i,
val: obj[i]
});
}
}
return keys;
};
BinaryTree.prototype.data = function (val) {
if (val !== undefined) {
this._data = val;
if (this._hashFunc) { this._hash = this._hashFunc(val); }
return this;
}
return this._data;
};
/**
* Pushes an item to the binary tree node's store array.
* @param {*} val The item to add to the store.
* @returns {*}
*/
BinaryTree.prototype.push = function (val) {
if (val !== undefined) {
this._store.push(val);
return this;
}
return false;
};
/**
* Pulls an item from the binary tree node's store array.
* @param {*} val The item to remove from the store.
* @returns {*}
*/
BinaryTree.prototype.pull = function (val) {
if (val !== undefined) {
var index = this._store.indexOf(val);
if (index > -1) {
this._store.splice(index, 1);
return this;
}
}
return false;
};
/**
* Default compare method. Can be overridden.
* @param a
* @param b
* @returns {number}
* @private
*/
BinaryTree.prototype._compareFunc = function (a, b) {
// Loop the index array
var i,
indexData,
result = 0;
for (i = 0; i < this._keys.length; i++) {
indexData = this._keys[i];
if (indexData.val === 1) {
result = this.sortAsc(a[indexData.key], b[indexData.key]);
} else if (indexData.val === -1) {
result = this.sortDesc(a[indexData.key], b[indexData.key]);
}
if (result !== 0) {
return result;
}
}
return result;
};
/**
* Default hash function. Can be overridden.
* @param obj
* @private
*/
BinaryTree.prototype._hashFunc = function (obj) {
/*var i,
indexData,
hash = '';
for (i = 0; i < this._keys.length; i++) {
indexData = this._keys[i];
if (hash) { hash += '_'; }
hash += obj[indexData.key];
}
return hash;*/
return obj[this._keys[0].key];
};
BinaryTree.prototype.insert = function (data) {
var result,
inserted,
failed,
i;
if (data instanceof Array) {
// Insert array of data
inserted = [];
failed = [];
for (i = 0; i < data.length; i++) {
if (this.insert(data[i])) {
inserted.push(data[i]);
} else {
failed.push(data[i]);
}
}
return {
inserted: inserted,
failed: failed
};
}
if (!this._data) {
// Insert into this node (overwrite) as there is no data
this.data(data);
//this.push(data);
return true;
}
result = this._compareFunc(this._data, data);
if (result === 0) {
this.push(data);
// Less than this node
if (this._left) {
// Propagate down the left branch
this._left.insert(data);
} else {
// Assign to left branch
this._left = new BinaryTree(data, this._index, this._compareFunc, this._hashFunc);
}
return true;
}
if (result === -1) {
// Greater than this node
if (this._right) {
// Propagate down the right branch
this._right.insert(data);
} else {
// Assign to right branch
this._right = new BinaryTree(data, this._index, this._compareFunc, this._hashFunc);
}
return true;
}
if (result === 1) {
// Less than this node
if (this._left) {
// Propagate down the left branch
this._left.insert(data);
} else {
// Assign to left branch
this._left = new BinaryTree(data, this._index, this._compareFunc, this._hashFunc);
}
return true;
}
return false;
};
BinaryTree.prototype.lookup = function (data, resultArr) {
var result = this._compareFunc(this._data, data);
resultArr = resultArr || [];
if (result === 0) {
if (this._left) { this._left.lookup(data, resultArr); }
resultArr.push(this._data);
if (this._right) { this._right.lookup(data, resultArr); }
}
if (result === -1) {
if (this._right) { this._right.lookup(data, resultArr); }
}
if (result === 1) {
if (this._left) { this._left.lookup(data, resultArr); }
}
return resultArr;
};
BinaryTree.prototype.inOrder = function (type, resultArr) {
resultArr = resultArr || [];
if (this._left) {
this._left.inOrder(type, resultArr);
}
switch (type) {
case 'hash':
resultArr.push(this._hash);
break;
case 'data':
resultArr.push(this._data);
break;
default:
resultArr.push({
key: this._data,
arr: this._store
});
break;
}
if (this._right) {
this._right.inOrder(type, resultArr);
}
return resultArr;
};
/*BinaryTree.prototype.find = function (type, search, resultArr) {
resultArr = resultArr || [];
if (this._left) {
this._left.find(type, search, resultArr);
}
// Check if this node's data is greater or less than the from value
var fromResult = this.sortAsc(this._data[key], from),
toResult = this.sortAsc(this._data[key], to);
if ((fromResult === 0 || fromResult === 1) && (toResult === 0 || toResult === -1)) {
// This data node is greater than or equal to the from value,
// and less than or equal to the to value so include it
switch (type) {
case 'hash':
resultArr.push(this._hash);
break;
case 'data':
resultArr.push(this._data);
break;
default:
resultArr.push({
key: this._data,
arr: this._store
});
break;
}
}
if (this._right) {
this._right.find(type, search, resultArr);
}
return resultArr;
};*/
/**
*
* @param {String} type
* @param {String} key The data key / path to range search against.
* @param {Number} from Range search from this value (inclusive)
* @param {Number} to Range search to this value (inclusive)
* @param {Array=} resultArr Leave undefined when calling (internal use),
* passes the result array between recursive calls to be returned when
* the recursion chain completes.
* @param {Path=} pathResolver Leave undefined when calling (internal use),
* caches the path resolver instance for performance.
* @returns {Array} Array of matching document objects
*/
BinaryTree.prototype.findRange = function (type, key, from, to, resultArr, pathResolver) {
resultArr = resultArr || [];
pathResolver = pathResolver || new Path(key);
if (this._left) {
this._left.findRange(type, key, from, to, resultArr, pathResolver);
}
// Check if this node's data is greater or less than the from value
var pathVal = pathResolver.value(this._data),
fromResult = this.sortAsc(pathVal, from),
toResult = this.sortAsc(pathVal, to);
if ((fromResult === 0 || fromResult === 1) && (toResult === 0 || toResult === -1)) {
// This data node is greater than or equal to the from value,
// and less than or equal to the to value so include it
switch (type) {
case 'hash':
resultArr.push(this._hash);
break;
case 'data':
resultArr.push(this._data);
break;
default:
resultArr.push({
key: this._data,
arr: this._store
});
break;
}
}
if (this._right) {
this._right.findRange(type, key, from, to, resultArr, pathResolver);
}
return resultArr;
};
/*BinaryTree.prototype.findRegExp = function (type, key, pattern, resultArr) {
resultArr = resultArr || [];
if (this._left) {
this._left.findRegExp(type, key, pattern, resultArr);
}
// Check if this node's data is greater or less than the from value
var fromResult = this.sortAsc(this._data[key], from),
toResult = this.sortAsc(this._data[key], to);
if ((fromResult === 0 || fromResult === 1) && (toResult === 0 || toResult === -1)) {
// This data node is greater than or equal to the from value,
// and less than or equal to the to value so include it
switch (type) {
case 'hash':
resultArr.push(this._hash);
break;
case 'data':
resultArr.push(this._data);
break;
default:
resultArr.push({
key: this._data,
arr: this._store
});
break;
}
}
if (this._right) {
this._right.findRegExp(type, key, pattern, resultArr);
}
return resultArr;
};*/
BinaryTree.prototype.match = function (query, options) {
// Check if the passed query has data in the keys our index
// operates on and if so, is the query sort matching our order
var pathSolver = new Path(),
indexKeyArr,
queryArr,
matchedKeys = [],
matchedKeyCount = 0,
i;
indexKeyArr = pathSolver.parseArr(this._index, {
verbose: true
});
queryArr = pathSolver.parseArr(query, {
ignore:/\$/,
verbose: true
});
// Loop the query array and check the order of keys against the
// index key array to see if this index can be used
for (i = 0; i < indexKeyArr.length; i++) {
if (queryArr[i] === indexKeyArr[i]) {
matchedKeyCount++;
matchedKeys.push(queryArr[i]);
}
}
return {
matchedKeys: matchedKeys,
totalKeyCount: queryArr.length,
score: matchedKeyCount
};
//return pathSolver.countObjectPaths(this._keys, query);
};
Shared.finishModule('BinaryTree');
module.exports = BinaryTree;
},{"./Path":31,"./Shared":38}],5:[function(_dereq_,module,exports){
"use strict";
var Shared,
Db,
Metrics,
KeyValueStore,
Path,
IndexHashMap,
IndexBinaryTree,
Crc,
Overload,
ReactorIO;
Shared = _dereq_('./Shared');
/**
* Creates a new collection. Collections store multiple documents and
* handle CRUD against those documents.
* @constructor
*/
var Collection = function (name) {
this.init.apply(this, arguments);
};
Collection.prototype.init = function (name, options) {
this._primaryKey = '_id';
this._primaryIndex = new KeyValueStore('primary');
this._primaryCrc = new KeyValueStore('primaryCrc');
this._crcLookup = new KeyValueStore('crcLookup');
this._name = name;
this._data = [];
this._metrics = new Metrics();
this._options = options || {
changeTimestamp: false
};
// Create an object to store internal protected data
this._metaData = {};
this._deferQueue = {
insert: [],
update: [],
remove: [],
upsert: []
};
this._deferThreshold = {
insert: 100,
update: 100,
remove: 100,
upsert: 100
};
this._deferTime = {
insert: 1,
update: 1,
remove: 1,
upsert: 1
};
// Set the subset to itself since it is the root collection
this.subsetOf(this);
};
Shared.addModule('Collection', Collection);
Shared.mixin(Collection.prototype, 'Mixin.Common');
Shared.mixin(Collection.prototype, 'Mixin.Events');
Shared.mixin(Collection.prototype, 'Mixin.ChainReactor');
Shared.mixin(Collection.prototype, 'Mixin.CRUD');
Shared.mixin(Collection.prototype, 'Mixin.Constants');
Shared.mixin(Collection.prototype, 'Mixin.Triggers');
Shared.mixin(Collection.prototype, 'Mixin.Sorting');
Shared.mixin(Collection.prototype, 'Mixin.Matching');
Shared.mixin(Collection.prototype, 'Mixin.Updating');
Shared.mixin(Collection.prototype, 'Mixin.Tags');
Metrics = _dereq_('./Metrics');
KeyValueStore = _dereq_('./KeyValueStore');
Path = _dereq_('./Path');
IndexHashMap = _dereq_('./IndexHashMap');
IndexBinaryTree = _dereq_('./IndexBinaryTree');
Crc = _dereq_('./Crc');
Db = Shared.modules.Db;
Overload = _dereq_('./Overload');
ReactorIO = _dereq_('./ReactorIO');
/**
* Returns a checksum of a string.
* @param {String} string The string to checksum.
* @return {String} The checksum generated.
*/
Collection.prototype.crc = Crc;
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'state');
/**
* Gets / sets the name of the collection.
* @param {String=} val The name of the collection to set.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'name');
/**
* Gets / sets the metadata stored in the collection.
*/
Shared.synthesize(Collection.prototype, 'metaData');
/**
* Get the data array that represents the collection's data.
* This data is returned by reference and should not be altered outside
* of the provided CRUD functionality of the collection as doing so
* may cause unstable index behaviour within the collection.
* @returns {Array}
*/
Collection.prototype.data = function () {
return this._data;
};
/**
* Drops a collection and all it's stored data from the database.
* @returns {boolean} True on success, false on failure.
*/
Collection.prototype.drop = function (callback) {
var key;
if (!this.isDropped()) {
if (this._db && this._db._collection && this._name) {
if (this.debug()) {
console.log(this.logIdentifier() + ' Dropping');
}
this._state = 'dropped';
this.emit('drop', this);
delete this._db._collection[this._name];
// Remove any reactor IO chain links
if (this._collate) {
for (key in this._collate) {
if (this._collate.hasOwnProperty(key)) {
this.collateRemove(key);
}
}
}
delete this._primaryKey;
delete this._primaryIndex;
delete this._primaryCrc;
delete this._crcLookup;
delete this._name;
delete this._data;
delete this._metrics;
if (callback) { callback(false, true); }
return true;
}
} else {
if (callback) { callback(false, true); }
return true;
}
if (callback) { callback(false, true); }
return false;
};
/**
* Gets / sets the primary key for this collection.
* @param {String=} keyName The name of the primary key.
* @returns {*}
*/
Collection.prototype.primaryKey = function (keyName) {
if (keyName !== undefined) {
if (this._primaryKey !== keyName) {
var oldKey = this._primaryKey;
this._primaryKey = keyName;
// Set the primary key index primary key
this._primaryIndex.primaryKey(keyName);
// Rebuild the primary key index
this.rebuildPrimaryKeyIndex();
// Propagate change down the chain
this.chainSend('primaryKey', keyName, {oldData: oldKey});
}
return this;
}
return this._primaryKey;
};
/**
* Handles insert events and routes changes to binds and views as required.
* @param {Array} inserted An array of inserted documents.
* @param {Array} failed An array of documents that failed to insert.
* @private
*/
Collection.prototype._onInsert = function (inserted, failed) {
this.emit('insert', inserted, failed);
};
/**
* Handles update events and routes changes to binds and views as required.
* @param {Array} items An array of updated documents.
* @private
*/
Collection.prototype._onUpdate = function (items) {
this.emit('update', items);
};
/**
* Handles remove events and routes changes to binds and views as required.
* @param {Array} items An array of removed documents.
* @private
*/
Collection.prototype._onRemove = function (items) {
this.emit('remove', items);
};
/**
* Handles any change to the collection.
* @private
*/
Collection.prototype._onChange = function () {
if (this._options.changeTimestamp) {
// Record the last change timestamp
this._metaData.lastChange = new Date();
}
};
/**
* Gets / sets the db instance this class instance belongs to.
* @param {Db=} db The db instance.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'db', function (db) {
if (db) {
if (this.primaryKey() === '_id') {
// Set primary key to the db's key by default
this.primaryKey(db.primaryKey());
// Apply the same debug settings
this.debug(db.debug());
}
}
return this.$super.apply(this, arguments);
});
/**
* Gets / sets mongodb emulation mode.
* @param {Boolean=} val True to enable, false to disable.
* @returns {*}
*/
Shared.synthesize(Collection.prototype, 'mongoEmulation');
/**
* Sets the collection's data to the array / documents passed. If any
* data already exists in the collection it will be removed before the
* new data is set.
* @param {Array|Object} data The array of documents or a single document
* that will be set as the collections data.
* @param options Optional options object.
* @param callback Optional callback function.
*/
Collection.prototype.setData = function (data, options, callback) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
if (data) {
var op = this._metrics.create('setData');
op.start();
options = this.options(options);
this.preSetData(data, options, callback);
if (options.$decouple) {
data = this.decouple(data);
}
if (!(data instanceof Array)) {
data = [data];
}
op.time('transformIn');
data = this.transformIn(data);
op.time('transformIn');
var oldData = [].concat(this._data);
this._dataReplace(data);
// Update the primary key index
op.time('Rebuild Primary Key Index');
this.rebuildPrimaryKeyIndex(options);
op.time('Rebuild Primary Key Index');
// Rebuild all other indexes
op.time('Rebuild All Other Indexes');
this._rebuildIndexes();
op.time('Rebuild All Other Indexes');
op.time('Resolve chains');
this.chainSend('setData', data, {oldData: oldData});
op.time('Resolve chains');
op.stop();
this._onChange();
this.emit('setData', this._data, oldData);
}
if (callback) { callback(false); }
return this;
};
/**
* Drops and rebuilds the primary key index for all documents in the collection.
* @param {Object=} options An optional options object.
* @private
*/
Collection.prototype.rebuildPrimaryKeyIndex = function (options) {
options = options || {
$ensureKeys: undefined,
$violationCheck: undefined
};
var ensureKeys = options && options.$ensureKeys !== undefined ? options.$ensureKeys : true,
violationCheck = options && options.$violationCheck !== undefined ? options.$violationCheck : true,
arr,
arrCount,
arrItem,
pIndex = this._primaryIndex,
crcIndex = this._primaryCrc,
crcLookup = this._crcLookup,
pKey = this._primaryKey,
jString;
// Drop the existing primary index
pIndex.truncate();
crcIndex.truncate();
crcLookup.truncate();
// Loop the data and check for a primary key in each object
arr = this._data;
arrCount = arr.length;
while (arrCount--) {
arrItem = arr[arrCount];
if (ensureKeys) {
// Make sure the item has a primary key
this.ensurePrimaryKey(arrItem);
}
if (violationCheck) {
// Check for primary key violation
if (!pIndex.uniqueSet(arrItem[pKey], arrItem)) {
// Primary key violation
throw(this.logIdentifier() + ' Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: ' + arrItem[this._primaryKey]);
}
} else {
pIndex.set(arrItem[pKey], arrItem);
}
// Generate a CRC string
jString = this.jStringify(arrItem);
crcIndex.set(arrItem[pKey], jString);
crcLookup.set(jString, arrItem);
}
};
/**
* Checks for a primary key on the document and assigns one if none
* currently exists.
* @param {Object} obj The object to check a primary key against.
* @private
*/
Collection.prototype.ensurePrimaryKey = function (obj) {
if (obj[this._primaryKey] === undefined) {
// Assign a primary key automatically
obj[this._primaryKey] = this.objectId();
}
};
/**
* Clears all data from the collection.
* @returns {Collection}
*/
Collection.prototype.truncate = function () {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
this.emit('truncate', this._data);
// Clear all the data from the collection
this._data.length = 0;
// Re-create the primary index data
this._primaryIndex = new KeyValueStore('primary');
this._primaryCrc = new KeyValueStore('primaryCrc');
this._crcLookup = new KeyValueStore('crcLookup');
this._onChange();
this.deferEmit('change', {type: 'truncate'});
return this;
};
/**
* Modifies an existing document or documents in a collection. This will update
* all matches for 'query' with the data held in 'update'. It will not overwrite
* the matched documents with the update document.
*
* @param {Object} obj The document object to upsert or an array containing
* documents to upsert.
*
* If the document contains a primary key field (based on the collections's primary
* key) then the database will search for an existing document with a matching id.
* If a matching document is found, the document will be updated. Any keys that
* match keys on the existing document will be overwritten with new data. Any keys
* that do not currently exist on the document will be added to the document.
*
* If the document does not contain an id or the id passed does not match an existing
* document, an insert is performed instead. If no id is present a new primary key
* id is provided for the item.
*
* @param {Function=} callback Optional callback method.
* @returns {Object} An object containing two keys, "op" contains either "insert" or
* "update" depending on the type of operation that was performed and "result"
* contains the return data from the operation used.
*/
Collection.prototype.upsert = function (obj, callback) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
if (obj) {
var queue = this._deferQueue.upsert,
deferThreshold = this._deferThreshold.upsert;
var returnData = {},
query,
i;
// Determine if the object passed is an array or not
if (obj instanceof Array) {
if (obj.length > deferThreshold) {
// Break up upsert into blocks
this._deferQueue.upsert = queue.concat(obj);
// Fire off the insert queue handler
this.processQueue('upsert', callback);
return {};
} else {
// Loop the array and upsert each item
returnData = [];
for (i = 0; i < obj.length; i++) {
returnData.push(this.upsert(obj[i]));
}
if (callback) { callback(); }
return returnData;
}
}
// Determine if the operation is an insert or an update
if (obj[this._primaryKey]) {
// Check if an object with this primary key already exists
query = {};
query[this._primaryKey] = obj[this._primaryKey];
if (this._primaryIndex.lookup(query)[0]) {
// The document already exists with this id, this operation is an update
returnData.op = 'update';
} else {
// No document with this id exists, this operation is an insert
returnData.op = 'insert';
}
} else {
// The document passed does not contain an id, this operation is an insert
returnData.op = 'insert';
}
switch (returnData.op) {
case 'insert':
returnData.result = this.insert(obj);
break;
case 'update':
returnData.result = this.update(query, obj);
break;
default:
break;
}
return returnData;
} else {
if (callback) { callback(); }
}
return {};
};
/**
* Executes a method against each document that matches query and returns an
* array of documents that may have been modified by the method.
* @param {Object} query The query object.
* @param {Function} func The method that each document is passed to. If this method
* returns false for a particular document it is excluded from the results.
* @param {Object=} options Optional options object.
* @returns {Array}
*/
Collection.prototype.filter = function (query, func, options) {
return (this.find(query, options)).filter(func);
};
/**
* Executes a method against each document that matches query and then executes
* an update based on the return data of the method.
* @param {Object} query The query object.
* @param {Function} func The method that each document is passed to. If this method
* returns false for a particular document it is excluded from the update.
* @param {Object=} options Optional options object passed to the initial find call.
* @returns {Array}
*/
Collection.prototype.filterUpdate = function (query, func, options) {
var items = this.find(query, options),
results = [],
singleItem,
singleQuery,
singleUpdate,
pk = this.primaryKey(),
i;
for (i = 0; i < items.length; i++) {
singleItem = items[i];
singleUpdate = func(singleItem);
if (singleUpdate) {
singleQuery = {};
singleQuery[pk] = singleItem[pk];
results.push(this.update(singleQuery, singleUpdate));
}
}
return results;
};
/**
* Modifies an existing document or documents in a collection. This will update
* all matches for 'query' with the data held in 'update'. It will not overwrite
* the matched documents with the update document.
*
* @param {Object} query The query that must be matched for a document to be
* operated on.
* @param {Object} update The object containing updated key/values. Any keys that
* match keys on the existing document will be overwritten with this data. Any
* keys that do not currently exist on the document will be added to the document.
* @param {Object=} options An options object.
* @returns {Array} The items that were updated.
*/
Collection.prototype.update = function (query, update, options) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
// Decouple the update data
update = this.decouple(update);
// Convert queries from mongo dot notation to forerunner queries
if (this.mongoEmulation()) {
this.convertToFdb(query);
this.convertToFdb(update);
}
// Handle transform
update = this.transformIn(update);
if (this.debug()) {
console.log(this.logIdentifier() + ' Updating some data');
}
var self = this,
op = this._metrics.create('update'),
dataSet,
updated,
updateCall = function (referencedDoc) {
var oldDoc = self.decouple(referencedDoc),
newDoc,
triggerOperation,
result;
if (self.willTrigger(self.TYPE_UPDATE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_UPDATE, self.PHASE_AFTER)) {
newDoc = self.decouple(referencedDoc);
triggerOperation = {
type: 'update',
query: self.decouple(query),
update: self.decouple(update),
options: self.decouple(options),
op: op
};
// Update newDoc with the update criteria so we know what the data will look
// like AFTER the update is processed
result = self.updateObject(newDoc, triggerOperation.update, triggerOperation.query, triggerOperation.options, '');
if (self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_BEFORE, referencedDoc, newDoc) !== false) {
// No triggers complained so let's execute the replacement of the existing
// object with the new one
result = self.updateObject(referencedDoc, newDoc, triggerOperation.query, triggerOperation.options, '');
// NOTE: If for some reason we would only like to fire this event if changes are actually going
// to occur on the object from the proposed update then we can add "result &&" to the if
self.processTrigger(triggerOperation, self.TYPE_UPDATE, self.PHASE_AFTER, oldDoc, newDoc);
} else {
// Trigger cancelled operation so tell result that it was not updated
result = false;
}
} else {
// No triggers complained so let's execute the replacement of the existing
// object with the new one
result = self.updateObject(referencedDoc, update, query, options, '');
}
// Inform indexes of the change
self._updateIndexes(oldDoc, referencedDoc);
return result;
};
op.start();
op.time('Retrieve documents to update');
dataSet = this.find(query, {$decouple: false});
op.time('Retrieve documents to update');
if (dataSet.length) {
op.time('Update documents');
updated = dataSet.filter(updateCall);
op.time('Update documents');
if (updated.length) {
op.time('Resolve chains');
this.chainSend('update', {
query: query,
update: update,
dataSet: updated
}, options);
op.time('Resolve chains');
this._onUpdate(updated);
this._onChange();
this.deferEmit('change', {type: 'update', data: updated});
}
}
op.stop();
// TODO: Should we decouple the updated array before return by default?
return updated || [];
};
/**
* Replaces an existing object with data from the new object without
* breaking data references.
* @param {Object} currentObj The object to alter.
* @param {Object} newObj The new object to overwrite the existing one with.
* @returns {*} Chain.
* @private
*/
Collection.prototype._replaceObj = function (currentObj, newObj) {
var i;
// Check if the new document has a different primary key value from the existing one
// Remove item from indexes
this._removeFromIndexes(currentObj);
// Remove existing keys from current object
for (i in currentObj) {
if (currentObj.hasOwnProperty(i)) {
delete currentObj[i];
}
}
// Add new keys to current object
for (i in newObj) {
if (newObj.hasOwnProperty(i)) {
currentObj[i] = newObj[i];
}
}
// Update the item in the primary index
if (!this._insertIntoIndexes(currentObj)) {
throw(this.logIdentifier() + ' Primary key violation in update! Key violated: ' + currentObj[this._primaryKey]);
}
// Update the object in the collection data
//this._data.splice(this._data.indexOf(currentObj), 1, newObj);
return this;
};
/**
* Helper method to update a document from it's id.
* @param {String} id The id of the document.
* @param {Object} update The object containing the key/values to update to.
* @returns {Array} The items that were updated.
*/
Collection.prototype.updateById = function (id, update) {
var searchObj = {};
searchObj[this._primaryKey] = id;
return this.update(searchObj, update);
};
/**
* Internal method for document updating.
* @param {Object} doc The document to update.
* @param {Object} update The object with key/value pairs to update the document with.
* @param {Object} query The query object that we need to match to perform an update.
* @param {Object} options An options object.
* @param {String} path The current recursive path.
* @param {String} opType The type of update operation to perform, if none is specified
* default is to set new data against matching fields.
* @returns {Boolean} True if the document was updated with new / changed data or
* false if it was not updated because the data was the same.
* @private
*/
Collection.prototype.updateObject = function (doc, update, query, options, path, opType) {
// TODO: This method is long, try to break it into smaller pieces
update = this.decouple(update);
// Clear leading dots from path
path = path || '';
if (path.substr(0, 1) === '.') { path = path.substr(1, path.length -1); }
//var oldDoc = this.decouple(doc),
var updated = false,
recurseUpdated = false,
operation,
tmpArray,
tmpIndex,
tmpCount,
tempIndex,
pathInstance,
sourceIsArray,
updateIsArray,
i;
// Loop each key in the update object
for (i in update) {
if (update.hasOwnProperty(i)) {
// Reset operation flag
operation = false;
// Check if the property starts with a dollar (function)
if (i.substr(0, 1) === '$') {
// Check for commands
switch (i) {
case '$key':
case '$index':
case '$data':
case '$min':
case '$max':
// Ignore some operators
operation = true;
break;
case '$each':
operation = true;
// Loop over the array of updates and run each one
tmpCount = update.$each.length;
for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) {
recurseUpdated = this.updateObject(doc, update.$each[tmpIndex], query, options, path);
if (recurseUpdated) {
updated = true;
}
}
updated = updated || recurseUpdated;
break;
default:
operation = true;
// Now run the operation
recurseUpdated = this.updateObject(doc, update[i], query, options, path, i);
updated = updated || recurseUpdated;
break;
}
}
// Check if the key has a .$ at the end, denoting an array lookup
if (this._isPositionalKey(i)) {
operation = true;
// Modify i to be the name of the field
i = i.substr(0, i.length - 2);
pathInstance = new Path(path + '.' + i);
// Check if the key is an array and has items
if (doc[i] && doc[i] instanceof Array && doc[i].length) {
tmpArray = [];
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
if (this._match(doc[i][tmpIndex], pathInstance.value(query)[0], options, '', {})) {
tmpArray.push(tmpIndex);
}
}
// Loop the items that matched and update them
for (tmpIndex = 0; tmpIndex < tmpArray.length; tmpIndex++) {
recurseUpdated = this.updateObject(doc[i][tmpArray[tmpIndex]], update[i + '.$'], query, options, path + '.' + i, opType);
updated = updated || recurseUpdated;
}
}
}
if (!operation) {
if (!opType && typeof(update[i]) === 'object') {
if (doc[i] !== null && typeof(doc[i]) === 'object') {
// Check if we are dealing with arrays
sourceIsArray = doc[i] instanceof Array;
updateIsArray = update[i] instanceof Array;
if (sourceIsArray || updateIsArray) {
// Check if the update is an object and the doc is an array
if (!updateIsArray && sourceIsArray) {
// Update is an object, source is an array so match the array items
// with our query object to find the one to update inside this array
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
recurseUpdated = this.updateObject(doc[i][tmpIndex], update[i], query, options, path + '.' + i, opType);
updated = updated || recurseUpdated;
}
} else {
// Either both source and update are arrays or the update is
// an array and the source is not, so set source to update
if (doc[i] !== update[i]) {
this._updateProperty(doc, i, update[i]);
updated = true;
}
}
} else {
// The doc key is an object so traverse the
// update further
recurseUpdated = this.updateObject(doc[i], update[i], query, options, path + '.' + i, opType);
updated = updated || recurseUpdated;
}
} else {
if (doc[i] !== update[i]) {
this._updateProperty(doc, i, update[i]);
updated = true;
}
}
} else {
switch (opType) {
case '$inc':
var doUpdate = true;
// Check for a $min / $max operator
if (update[i] > 0) {
if (update.$max) {
// Check current value
if (doc[i] >= update.$max) {
// Don't update
doUpdate = false;
}
}
} else if (update[i] < 0) {
if (update.$min) {
// Check current value
if (doc[i] <= update.$min) {
// Don't update
doUpdate = false;
}
}
}
if (doUpdate) {
this._updateIncrement(doc, i, update[i]);
updated = true;
}
break;
case '$cast':
// Casts a property to the type specified if it is not already
// that type. If the cast is an array or an object and the property
// is not already that type a new array or object is created and
// set to the property, overwriting the previous value
switch (update[i]) {
case 'array':
if (!(doc[i] instanceof Array)) {
// Cast to an array
this._updateProperty(doc, i, update.$data || []);
updated = true;
}
break;
case 'object':
if (!(doc[i] instanceof Object) || (doc[i] instanceof Array)) {
// Cast to an object
this._updateProperty(doc, i, update.$data || {});
updated = true;
}
break;
case 'number':
if (typeof doc[i] !== 'number') {
// Cast to a number
this._updateProperty(doc, i, Number(doc[i]));
updated = true;
}
break;
case 'string':
if (typeof doc[i] !== 'string') {
// Cast to a string
this._updateProperty(doc, i, String(doc[i]));
updated = true;
}
break;
default:
throw(this.logIdentifier() + ' Cannot update cast to unknown type: ' + update[i]);
}
break;
case '$push':
// Check if the target key is undefined and if so, create an array
if (doc[i] === undefined) {
// Initialise a new array
this._updateProperty(doc, i, []);
}
// Check that the target key is an array
if (doc[i] instanceof Array) {
// Check for a $position modifier with an $each
if (update[i].$position !== undefined && update[i].$each instanceof Array) {
// Grab the position to insert at
tempIndex = update[i].$position;
// Loop the each array and push each item
tmpCount = update[i].$each.length;
for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) {
this._updateSplicePush(doc[i], tempIndex + tmpIndex, update[i].$each[tmpIndex]);
}
} else if (update[i].$each instanceof Array) {
// Do a loop over the each to push multiple items
tmpCount = update[i].$each.length;
for (tmpIndex = 0; tmpIndex < tmpCount; tmpIndex++) {
this._updatePush(doc[i], update[i].$each[tmpIndex]);
}
} else {
// Do a standard push
this._updatePush(doc[i], update[i]);
}
updated = true;
} else {
throw(this.logIdentifier() + ' Cannot push to a key that is not an array! (' + i + ')');
}
break;
case '$pull':
if (doc[i] instanceof Array) {
tmpArray = [];
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
if (this._match(doc[i][tmpIndex], update[i], options, '', {})) {
tmpArray.push(tmpIndex);
}
}
tmpCount = tmpArray.length;
// Now loop the pull array and remove items to be pulled
while (tmpCount--) {
this._updatePull(doc[i], tmpArray[tmpCount]);
updated = true;
}
}
break;
case '$pullAll':
if (doc[i] instanceof Array) {
if (update[i] instanceof Array) {
tmpArray = doc[i];
tmpCount = tmpArray.length;
if (tmpCount > 0) {
// Now loop the pull array and remove items to be pulled
while (tmpCount--) {
for (tempIndex = 0; tempIndex < update[i].length; tempIndex++) {
if (tmpArray[tmpCount] === update[i][tempIndex]) {
this._updatePull(doc[i], tmpCount);
tmpCount--;
updated = true;
}
}
if (tmpCount < 0) {
break;
}
}
}
} else {
throw(this.logIdentifier() + ' Cannot pullAll without being given an array of values to pull! (' + i + ')');
}
}
break;
case '$addToSet':
// Check if the target key is undefined and if so, create an array
if (doc[i] === undefined) {
// Initialise a new array
this._updateProperty(doc, i, []);
}
// Check that the target key is an array
if (doc[i] instanceof Array) {
// Loop the target array and check for existence of item
var targetArr = doc[i],
targetArrIndex,
targetArrCount = targetArr.length,
objHash,
addObj = true,
optionObj = (options && options.$addToSet),
hashMode,
pathSolver;
// Check if we have an options object for our operation
if (update[i].$key) {
hashMode = false;
pathSolver = new Path(update[i].$key);
objHash = pathSolver.value(update[i])[0];
// Remove the key from the object before we add it
delete update[i].$key;
} else if (optionObj && optionObj.key) {
hashMode = false;
pathSolver = new Path(optionObj.key);
objHash = pathSolver.value(update[i])[0];
} else {
objHash = this.jStringify(update[i]);
hashMode = true;
}
for (targetArrIndex = 0; targetArrIndex < targetArrCount; targetArrIndex++) {
if (hashMode) {
// Check if objects match via a string hash (JSON)
if (this.jStringify(targetArr[targetArrIndex]) === objHash) {
// The object already exists, don't add it
addObj = false;
break;
}
} else {
// Check if objects match based on the path
if (objHash === pathSolver.value(targetArr[targetArrIndex])[0]) {
// The object already exists, don't add it
addObj = false;
break;
}
}
}
if (addObj) {
this._updatePush(doc[i], update[i]);
updated = true;
}
} else {
throw(this.logIdentifier() + ' Cannot addToSet on a key that is not an array! (' + i + ')');
}
break;
case '$splicePush':
// Check if the target key is undefined and if so, create an array
if (doc[i] === undefined) {
// Initialise a new array
this._updateProperty(doc, i, []);
}
// Check that the target key is an array
if (doc[i] instanceof Array) {
tempIndex = update.$index;
if (tempIndex !== undefined) {
delete update.$index;
// Check for out of bounds index
if (tempIndex > doc[i].length) {
tempIndex = doc[i].length;
}
this._updateSplicePush(doc[i], tempIndex, update[i]);
updated = true;
} else {
throw(this.logIdentifier() + ' Cannot splicePush without a $index integer value!');
}
} else {
throw(this.logIdentifier() + ' Cannot splicePush with a key that is not an array! (' + i + ')');
}
break;
case '$move':
if (doc[i] instanceof Array) {
// Loop the array and find matches to our search
for (tmpIndex = 0; tmpIndex < doc[i].length; tmpIndex++) {
if (this._match(doc[i][tmpIndex], update[i], options, '', {})) {
var moveToIndex = update.$index;
if (moveToIndex !== undefined) {
delete update.$index;
this._updateSpliceMove(doc[i], tmpIndex, moveToIndex);
updated = true;
} else {
throw(this.logIdentifier() + ' Cannot move without a $index integer value!');
}
break;
}
}
} else {
throw(this.logIdentifier() + ' Cannot move on a key that is not an array! (' + i + ')');
}
break;
case '$mul':
this._updateMultiply(doc, i, update[i]);
updated = true;
break;
case '$rename':
this._updateRename(doc, i, update[i]);
updated = true;
break;
case '$overwrite':
this._updateOverwrite(doc, i, update[i]);
updated = true;
break;
case '$unset':
this._updateUnset(doc, i);
updated = true;
break;
case '$clear':
this._updateClear(doc, i);
updated = true;
break;
case '$pop':
if (doc[i] instanceof Array) {
if (this._updatePop(doc[i], update[i])) {
updated = true;
}
} else {
throw(this.logIdentifier() + ' Cannot pop from a key that is not an array! (' + i + ')');
}
break;
case '$toggle':
// Toggle the boolean property between true and false
this._updateProperty(doc, i, !doc[i]);
updated = true;
break;
default:
if (doc[i] !== update[i]) {
this._updateProperty(doc, i, update[i]);
updated = true;
}
break;
}
}
}
}
}
return updated;
};
/**
* Determines if the passed key has an array positional mark (a dollar at the end
* of its name).
* @param {String} key The key to check.
* @returns {Boolean} True if it is a positional or false if not.
* @private
*/
Collection.prototype._isPositionalKey = function (key) {
return key.substr(key.length - 2, 2) === '.$';
};
/**
* Removes any documents from the collection that match the search query
* key/values.
* @param {Object} query The query object.
* @param {Object=} options An options object.
* @param {Function=} callback A callback method.
* @returns {Array} An array of the documents that were removed.
*/
Collection.prototype.remove = function (query, options, callback) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
var self = this,
dataSet,
index,
arrIndex,
returnArr,
removeMethod,
triggerOperation,
doc,
newDoc;
if (typeof(options) === 'function') {
callback = options;
options = {};
}
// Convert queries from mongo dot notation to forerunner queries
if (this.mongoEmulation()) {
this.convertToFdb(query);
}
if (query instanceof Array) {
returnArr = [];
for (arrIndex = 0; arrIndex < query.length; arrIndex++) {
returnArr.push(this.remove(query[arrIndex], {noEmit: true}));
}
if (!options || (options && !options.noEmit)) {
this._onRemove(returnArr);
}
if (callback) { callback(false, returnArr); }
return returnArr;
} else {
returnArr = [];
dataSet = this.find(query, {$decouple: false});
if (dataSet.length) {
removeMethod = function (dataItem) {
// Remove the item from the collection's indexes
self._removeFromIndexes(dataItem);
// Remove data from internal stores
index = self._data.indexOf(dataItem);
self._dataRemoveAtIndex(index);
returnArr.push(dataItem);
};
// Remove the data from the collection
for (var i = 0; i < dataSet.length; i++) {
doc = dataSet[i];
if (self.willTrigger(self.TYPE_REMOVE, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_REMOVE, self.PHASE_AFTER)) {
triggerOperation = {
type: 'remove'
};
newDoc = self.decouple(doc);
if (self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_BEFORE, newDoc, newDoc) !== false) {
// The trigger didn't ask to cancel so execute the removal method
removeMethod(doc);
self.processTrigger(triggerOperation, self.TYPE_REMOVE, self.PHASE_AFTER, newDoc, newDoc);
}
} else {
// No triggers to execute
removeMethod(doc);
}
}
if (returnArr.length) {
//op.time('Resolve chains');
self.chainSend('remove', {
query: query,
dataSet: returnArr
}, options);
//op.time('Resolve chains');
if (!options || (options && !options.noEmit)) {
this._onRemove(returnArr);
}
this._onChange();
this.deferEmit('change', {type: 'remove', data: returnArr});
}
}
if (callback) { callback(false, returnArr); }
return returnArr;
}
};
/**
* Helper method that removes a document that matches the given id.
* @param {String} id The id of the document to remove.
* @returns {Array} An array of documents that were removed.
*/
Collection.prototype.removeById = function (id) {
var searchObj = {};
searchObj[this._primaryKey] = id;
return this.remove(searchObj);
};
/**
* Processes a deferred action queue.
* @param {String} type The queue name to process.
* @param {Function} callback A method to call when the queue has processed.
* @param {Object=} resultObj A temp object to hold results in.
*/
Collection.prototype.processQueue = function (type, callback, resultObj) {
var self = this,
queue = this._deferQueue[type],
deferThreshold = this._deferThreshold[type],
deferTime = this._deferTime[type],
dataArr,
result;
resultObj = resultObj || {
deferred: true
};
if (queue.length) {
// Process items up to the threshold
if (queue.length) {
if (queue.length > deferThreshold) {
// Grab items up to the threshold value
dataArr = queue.splice(0, deferThreshold);
} else {
// Grab all the remaining items
dataArr = queue.splice(0, queue.length);
}
result = self[type](dataArr);
switch (type) {
case 'insert':
resultObj.inserted = resultObj.inserted || [];
resultObj.failed = resultObj.failed || [];
resultObj.inserted = resultObj.inserted.concat(result.inserted);
resultObj.failed = resultObj.failed.concat(result.failed);
break;
}
}
// Queue another process
setTimeout(function () {
self.processQueue.call(self, type, callback, resultObj);
}, deferTime);
} else {
if (callback) { callback(resultObj); }
}
// Check if all queues are complete
if (!this.isProcessingQueue()) {
this.emit('queuesComplete');
}
};
/**
* Checks if any CRUD operations have been deferred and are still waiting to
* be processed.
* @returns {Boolean} True if there are still deferred CRUD operations to process
* or false if all queues are clear.
*/
Collection.prototype.isProcessingQueue = function () {
var i;
for (i in this._deferQueue) {
if (this._deferQueue.hasOwnProperty(i)) {
if (this._deferQueue[i].length) {
return true;
}
}
}
return false;
};
/**
* Inserts a document or array of documents into the collection.
* @param {Object|Array} data Either a document object or array of document
* @param {Number=} index Optional index to insert the record at.
* @param {Function=} callback Optional callback called once action is complete.
* objects to insert into the collection.
*/
Collection.prototype.insert = function (data, index, callback) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
if (typeof(index) === 'function') {
callback = index;
index = this._data.length;
} else if (index === undefined) {
index = this._data.length;
}
data = this.transformIn(data);
return this._insertHandle(data, index, callback);
};
/**
* Inserts a document or array of documents into the collection.
* @param {Object|Array} data Either a document object or array of document
* @param {Number=} index Optional index to insert the record at.
* @param {Function=} callback Optional callback called once action is complete.
* objects to insert into the collection.
*/
Collection.prototype._insertHandle = function (data, index, callback) {
var //self = this,
queue = this._deferQueue.insert,
deferThreshold = this._deferThreshold.insert,
//deferTime = this._deferTime.insert,
inserted = [],
failed = [],
insertResult,
resultObj,
i;
if (data instanceof Array) {
// Check if there are more insert items than the insert defer
// threshold, if so, break up inserts so we don't tie up the
// ui or thread
if (data.length > deferThreshold) {
// Break up insert into blocks
this._deferQueue.insert = queue.concat(data);
// Fire off the insert queue handler
this.processQueue('insert', callback);
return;
} else {
// Loop the array and add items
for (i = 0; i < data.length; i++) {
insertResult = this._insert(data[i], index + i);
if (insertResult === true) {
inserted.push(data[i]);
} else {
failed.push({
doc: data[i],
reason: insertResult
});
}
}
}
} else {
// Store the data item
insertResult = this._insert(data, index);
if (insertResult === true) {
inserted.push(data);
} else {
failed.push({
doc: data,
reason: insertResult
});
}
}
resultObj = {
deferred: false,
inserted: inserted,
failed: failed
};
this._onInsert(inserted, failed);
if (callback) { callback(resultObj); }
this._onChange();
this.deferEmit('change', {type: 'insert', data: inserted});
return resultObj;
};
/**
* Internal method to insert a document into the collection. Will
* check for index violations before allowing the document to be inserted.
* @param {Object} doc The document to insert after passing index violation
* tests.
* @param {Number=} index Optional index to insert the document at.
* @returns {Boolean|Object} True on success, false if no document passed,
* or an object containing details about an index violation if one occurred.
* @private
*/
Collection.prototype._insert = function (doc, index) {
if (doc) {
var self = this,
indexViolation,
triggerOperation,
insertMethod,
newDoc;
this.ensurePrimaryKey(doc);
// Check indexes are not going to be broken by the document
indexViolation = this.insertIndexViolation(doc);
insertMethod = function (doc) {
// Add the item to the collection's indexes
self._insertIntoIndexes(doc);
// Check index overflow
if (index > self._data.length) {
index = self._data.length;
}
// Insert the document
self._dataInsertAtIndex(index, doc);
//op.time('Resolve chains');
self.chainSend('insert', doc, {index: index});
//op.time('Resolve chains');
};
if (!indexViolation) {
if (self.willTrigger(self.TYPE_INSERT, self.PHASE_BEFORE) || self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) {
triggerOperation = {
type: 'insert'
};
if (self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_BEFORE, {}, doc) !== false) {
insertMethod(doc);
if (self.willTrigger(self.TYPE_INSERT, self.PHASE_AFTER)) {
// Clone the doc so that the programmer cannot update the internal document
// on the "after" phase trigger
newDoc = self.decouple(doc);
self.processTrigger(triggerOperation, self.TYPE_INSERT, self.PHASE_AFTER, {}, newDoc);
}
} else {
// The trigger just wants to cancel the operation
return false;
}
} else {
// No triggers to execute
insertMethod(doc);
}
return true;
} else {
return 'Index violation in index: ' + indexViolation;
}
}
return 'No document passed to insert';
};
/**
* Inserts a document into the internal collection data array at
* Inserts a document into the internal collection data array at
* the specified index.
* @param {number} index The index to insert at.
* @param {object} doc The document to insert.
* @private
*/
Collection.prototype._dataInsertAtIndex = function (index, doc) {
this._data.splice(index, 0, doc);
};
/**
* Removes a document from the internal collection data array at
* the specified index.
* @param {number} index The index to remove from.
* @private
*/
Collection.prototype._dataRemoveAtIndex = function (index) {
this._data.splice(index, 1);
};
/**
* Replaces all data in the collection's internal data array with
* the passed array of data.
* @param {array} data The array of data to replace existing data with.
* @private
*/
Collection.prototype._dataReplace = function (data) {
// Clear the array - using a while loop with pop is by far the
// fastest way to clear an array currently
while (this._data.length) {
this._data.pop();
}
// Append new items to the array
this._data = this._data.concat(data);
};
/**
* Inserts a document into the collection indexes.
* @param {Object} doc The document to insert.
* @private
*/
Collection.prototype._insertIntoIndexes = function (doc) {
var arr = this._indexByName,
arrIndex,
violated,
jString = this.jStringify(doc);
// Insert to primary key index
violated = this._primaryIndex.uniqueSet(doc[this._primaryKey], doc);
this._primaryCrc.uniqueSet(doc[this._primaryKey], jString);
this._crcLookup.uniqueSet(jString, doc);
// Insert into other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arr[arrIndex].insert(doc);
}
}
return violated;
};
/**
* Removes a document from the collection indexes.
* @param {Object} doc The document to remove.
* @private
*/
Collection.prototype._removeFromIndexes = function (doc) {
var arr = this._indexByName,
arrIndex,
jString = this.jStringify(doc);
// Remove from primary key index
this._primaryIndex.unSet(doc[this._primaryKey]);
this._primaryCrc.unSet(doc[this._primaryKey]);
this._crcLookup.unSet(jString);
// Remove from other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arr[arrIndex].remove(doc);
}
}
};
/**
* Updates collection index data for the passed document.
* @param {Object} oldDoc The old document as it was before the update.
* @param {Object} newDoc The document as it now is after the update.
* @private
*/
Collection.prototype._updateIndexes = function (oldDoc, newDoc) {
this._removeFromIndexes(oldDoc);
this._insertIntoIndexes(newDoc);
};
/**
* Rebuild collection indexes.
* @private
*/
Collection.prototype._rebuildIndexes = function () {
var arr = this._indexByName,
arrIndex;
// Remove from other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arr[arrIndex].rebuild();
}
}
};
/**
* Uses the passed query to generate a new collection with results
* matching the query parameters.
*
* @param {Object} query The query object to generate the subset with.
* @param {Object=} options An options object.
* @returns {*}
*/
Collection.prototype.subset = function (query, options) {
var result = this.find(query, options);
return new Collection()
.subsetOf(this)
.primaryKey(this._primaryKey)
.setData(result);
};
/**
* Gets / sets the collection that this collection is a subset of.
* @param {Collection=} collection The collection to set as the parent of this subset.
* @returns {Collection}
*/
Shared.synthesize(Collection.prototype, 'subsetOf');
/**
* Checks if the collection is a subset of the passed collection.
* @param {Collection} collection The collection to test against.
* @returns {Boolean} True if the passed collection is the parent of
* the current collection.
*/
Collection.prototype.isSubsetOf = function (collection) {
return this._subsetOf === collection;
};
/**
* Find the distinct values for a specified field across a single collection and
* returns the results in an array.
* @param {String} key The field path to return distinct values for e.g. "person.name".
* @param {Object=} query The query to use to filter the documents used to return values from.
* @param {Object=} options The query options to use when running the query.
* @returns {Array}
*/
Collection.prototype.distinct = function (key, query, options) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
var data = this.find(query, options),
pathSolver = new Path(key),
valueUsed = {},
distinctValues = [],
value,
i;
// Loop the data and build array of distinct values
for (i = 0; i < data.length; i++) {
value = pathSolver.value(data[i])[0];
if (value && !valueUsed[value]) {
valueUsed[value] = true;
distinctValues.push(value);
}
}
return distinctValues;
};
/**
* Helper method to find a document by it's id.
* @param {String} id The id of the document.
* @param {Object=} options The options object, allowed keys are sort and limit.
* @returns {Array} The items that were updated.
*/
Collection.prototype.findById = function (id, options) {
var searchObj = {};
searchObj[this._primaryKey] = id;
return this.find(searchObj, options)[0];
};
/**
* Finds all documents that contain the passed string or search object
* regardless of where the string might occur within the document. This
* will match strings from the start, middle or end of the document's
* string (partial match).
* @param search The string to search for. Case sensitive.
* @param options A standard find() options object.
* @returns {Array} An array of documents that matched the search string.
*/
Collection.prototype.peek = function (search, options) {
// Loop all items
var arr = this._data,
arrCount = arr.length,
arrIndex,
arrItem,
tempColl = new Collection(),
typeOfSearch = typeof search;
if (typeOfSearch === 'string') {
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
// Get json representation of object
arrItem = this.jStringify(arr[arrIndex]);
// Check if string exists in object json
if (arrItem.indexOf(search) > -1) {
// Add this item to the temp collection
tempColl.insert(arr[arrIndex]);
}
}
return tempColl.find({}, options);
} else {
return this.find(search, options);
}
};
/**
* Provides a query plan / operations log for a query.
* @param {Object} query The query to execute.
* @param {Object=} options Optional options object.
* @returns {Object} The query plan.
*/
Collection.prototype.explain = function (query, options) {
var result = this.find(query, options);
return result.__fdbOp._data;
};
/**
* Generates an options object with default values or adds default
* values to a passed object if those values are not currently set
* to anything.
* @param {object=} obj Optional options object to modify.
* @returns {object} The options object.
*/
Collection.prototype.options = function (obj) {
obj = obj || {};
obj.$decouple = obj.$decouple !== undefined ? obj.$decouple : true;
obj.$explain = obj.$explain !== undefined ? obj.$explain : false;
return obj;
};
/**
* Queries the collection based on the query object passed.
* @param {Object} query The query key/values that a document must match in
* order for it to be returned in the result array.
* @param {Object=} options An optional options object.
* @param {Function=} callback !! DO NOT USE, THIS IS NON-OPERATIONAL !!
* Optional callback. If specified the find process
* will not return a value and will assume that you wish to operate under an
* async mode. This will break up large find requests into smaller chunks and
* process them in a non-blocking fashion allowing large datasets to be queried
* without causing the browser UI to pause. Results from this type of operation
* will be passed back to the callback once completed.
*
* @returns {Array} The results array from the find operation, containing all
* documents that matched the query.
*/
Collection.prototype.find = function (query, options, callback) {
// Convert queries from mongo dot notation to forerunner queries
if (this.mongoEmulation()) {
this.convertToFdb(query);
}
if (callback) {
// Check the size of the collection's data array
// Split operation into smaller tasks and callback when complete
callback('Callbacks for the find() operation are not yet implemented!', []);
return [];
}
return this._find.apply(this, arguments);
};
Collection.prototype._find = function (query, options) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
// TODO: This method is quite long, break into smaller pieces
query = query || {};
options = this.options(options);
var op = this._metrics.create('find'),
pk = this.primaryKey(),
self = this,
analysis,
scanLength,
requiresTableScan = true,
resultArr,
joinCollectionIndex,
joinIndex,
joinCollection = {},
joinQuery,
joinPath,
joinCollectionName,
joinCollectionInstance,
joinMatch,
joinMatchIndex,
joinSearchQuery,
joinSearchOptions,
joinMulti,
joinRequire,
joinFindResults,
joinFindResult,
joinItem,
joinPrefix,
resultCollectionName,
resultIndex,
resultRemove = [],
index,
i, j, k, l,
fieldListOn = [],
fieldListOff = [],
elemMatchPathSolver,
elemMatchSubArr,
elemMatchSpliceArr,
matcherTmpOptions = {},
result,
cursor = {},
//renameFieldMethod,
//renameFieldPath,
matcher = function (doc) {
return self._match(doc, query, options, 'and', matcherTmpOptions);
};
op.start();
if (query) {
// Get query analysis to execute best optimised code path
op.time('analyseQuery');
analysis = this._analyseQuery(self.decouple(query), options, op);
op.time('analyseQuery');
op.data('analysis', analysis);
if (analysis.hasJoin && analysis.queriesJoin) {
// The query has a join and tries to limit by it's joined data
// Get an instance reference to the join collections
op.time('joinReferences');
for (joinIndex = 0; joinIndex < analysis.joinsOn.length; joinIndex++) {
joinCollectionName = analysis.joinsOn[joinIndex];
joinPath = new Path(analysis.joinQueries[joinCollectionName]);
joinQuery = joinPath.value(query)[0];
joinCollection[analysis.joinsOn[joinIndex]] = this._db.collection(analysis.joinsOn[joinIndex]).subset(joinQuery);
// Remove join clause from main query
delete query[analysis.joinQueries[joinCollectionName]];
}
op.time('joinReferences');
}
// Check if an index lookup can be used to return this result
if (analysis.indexMatch.length && (!options || (options && !options.$skipIndex))) {
op.data('index.potential', analysis.indexMatch);
op.data('index.used', analysis.indexMatch[0].index);
// Get the data from the index
op.time('indexLookup');
resultArr = analysis.indexMatch[0].lookup || [];
op.time('indexLookup');
// Check if the index coverage is all keys, if not we still need to table scan it
if (analysis.indexMatch[0].keyData.totalKeyCount === analysis.indexMatch[0].keyData.score) {
// Don't require a table scan to find relevant documents
requiresTableScan = false;
}
} else {
op.flag('usedIndex', false);
}
if (requiresTableScan) {
if (resultArr && resultArr.length) {
scanLength = resultArr.length;
op.time('tableScan: ' + scanLength);
// Filter the source data and return the result
resultArr = resultArr.filter(matcher);
} else {
// Filter the source data and return the result
scanLength = this._data.length;
op.time('tableScan: ' + scanLength);
resultArr = this._data.filter(matcher);
}
op.time('tableScan: ' + scanLength);
}
// Order the array if we were passed a sort clause
if (options.$orderBy) {
op.time('sort');
resultArr = this.sort(options.$orderBy, resultArr);
op.time('sort');
}
if (options.$page !== undefined && options.$limit !== undefined) {
// Record paging data
cursor.page = options.$page;
cursor.pages = Math.ceil(resultArr.length / options.$limit);
cursor.records = resultArr.length;
// Check if we actually need to apply the paging logic
if (options.$page && options.$limit > 0) {
op.data('cursor', cursor);
// Skip to the page specified based on limit
resultArr.splice(0, options.$page * options.$limit);
}
}
if (options.$skip) {
cursor.skip = options.$skip;
// Skip past the number of records specified
resultArr.splice(0, options.$skip);
op.data('skip', options.$skip);
}
if (options.$limit && resultArr && resultArr.length > options.$limit) {
cursor.limit = options.$limit;
resultArr.length = options.$limit;
op.data('limit', options.$limit);
}
if (options.$decouple) {
// Now decouple the data from the original objects
op.time('decouple');
resultArr = this.decouple(resultArr);
op.time('decouple');
op.data('flag.decouple', true);
}
// Now process any joins on the final data
if (options.$join) {
for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) {
for (joinCollectionName in options.$join[joinCollectionIndex]) {
if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) {
// Set the key to store the join result in to the collection name by default
resultCollectionName = joinCollectionName;
// Get the join collection instance from the DB
if (joinCollection[joinCollectionName]) {
joinCollectionInstance = joinCollection[joinCollectionName];
} else {
joinCollectionInstance = this._db.collection(joinCollectionName);
}
// Get the match data for the join
joinMatch = options.$join[joinCollectionIndex][joinCollectionName];
// Loop our result data array
for (resultIndex = 0; resultIndex < resultArr.length; resultIndex++) {
// Loop the join conditions and build a search object from them
joinSearchQuery = {};
joinMulti = false;
joinRequire = false;
joinPrefix = '';
for (joinMatchIndex in joinMatch) {
if (joinMatch.hasOwnProperty(joinMatchIndex)) {
// Check the join condition name for a special command operator
if (joinMatchIndex.substr(0, 1) === '$') {
// Special command
switch (joinMatchIndex) {
case '$where':
if (joinMatch[joinMatchIndex].query) { joinSearchQuery = joinMatch[joinMatchIndex].query; }
if (joinMatch[joinMatchIndex].options) { joinSearchOptions = joinMatch[joinMatchIndex].options; }
break;
case '$as':
// Rename the collection when stored in the result document
resultCollectionName = joinMatch[joinMatchIndex];
break;
case '$multi':
// Return an array of documents instead of a single matching document
joinMulti = joinMatch[joinMatchIndex];
break;
case '$require':
// Remove the result item if no matching join data is found
joinRequire = joinMatch[joinMatchIndex];
break;
case '$prefix':
// Add a prefix to properties mixed in
joinPrefix = joinMatch[joinMatchIndex];
break;
default:
break;
}
} else {
// Get the data to match against and store in the search object
// Resolve complex referenced query
joinSearchQuery[joinMatchIndex] = self._resolveDynamicQuery(joinMatch[joinMatchIndex], resultArr[resultIndex]);
}
}
}
// Do a find on the target collection against the match data
joinFindResults = joinCollectionInstance.find(joinSearchQuery, joinSearchOptions);
// Check if we require a joined row to allow the result item
if (!joinRequire || (joinRequire && joinFindResults[0])) {
// Join is not required or condition is met
if (resultCollectionName === '$root') {
// The property name to store the join results in is $root
// which means we need to mixin the results but this only
// works if joinMulti is disabled
if (joinMulti !== false) {
// Throw an exception here as this join is not physically possible!
throw(this.logIdentifier() + ' Cannot combine [$as: "$root"] with [$joinMulti: true] in $join clause!');
}
// Mixin the result
joinFindResult = joinFindResults[0];
joinItem = resultArr[resultIndex];
for (l in joinFindResult) {
if (joinFindResult.hasOwnProperty(l) && joinItem[joinPrefix + l] === undefined) {
// Properties are only mixed in if they do not already exist
// in the target item (are undefined). Using a prefix denoted via
// $prefix is a good way to prevent property name conflicts
joinItem[joinPrefix + l] = joinFindResult[l];
}
}
} else {
resultArr[resultIndex][resultCollectionName] = joinMulti === false ? joinFindResults[0] : joinFindResults;
}
} else {
// Join required but condition not met, add item to removal queue
resultRemove.push(resultArr[resultIndex]);
}
}
}
}
}
op.data('flag.join', true);
}
// Process removal queue
if (resultRemove.length) {
op.time('removalQueue');
for (i = 0; i < resultRemove.length; i++) {
index = resultArr.indexOf(resultRemove[i]);
if (index > -1) {
resultArr.splice(index, 1);
}
}
op.time('removalQueue');
}
if (options.$transform) {
op.time('transform');
for (i = 0; i < resultArr.length; i++) {
resultArr.splice(i, 1, options.$transform(resultArr[i]));
}
op.time('transform');
op.data('flag.transform', true);
}
// Process transforms
if (this._transformEnabled && this._transformOut) {
op.time('transformOut');
resultArr = this.transformOut(resultArr);
op.time('transformOut');
}
op.data('results', resultArr.length);
} else {
resultArr = [];
}
// Check for an $as operator in the options object and if it exists
// iterate over the fields and generate a rename function that will
// operate over the entire returned data array and rename each object's
// fields to their new names
// TODO: Enable $as in collection find to allow renaming fields
/*if (options.$as) {
renameFieldPath = new Path();
renameFieldMethod = function (obj, oldFieldPath, newFieldName) {
renameFieldPath.path(oldFieldPath);
renameFieldPath.rename(newFieldName);
};
for (i in options.$as) {
if (options.$as.hasOwnProperty(i)) {
}
}
}*/
// Generate a list of fields to limit data by
// Each property starts off being enabled by default (= 1) then
// if any property is explicitly specified as 1 then all switch to
// zero except _id.
//
// Any that are explicitly set to zero are switched off.
op.time('scanFields');
for (i in options) {
if (options.hasOwnProperty(i) && i.indexOf('$') !== 0) {
if (options[i] === 1) {
fieldListOn.push(i);
} else if (options[i] === 0) {
fieldListOff.push(i);
}
}
}
op.time('scanFields');
// Limit returned fields by the options data
if (fieldListOn.length || fieldListOff.length) {
op.data('flag.limitFields', true);
op.data('limitFields.on', fieldListOn);
op.data('limitFields.off', fieldListOff);
op.time('limitFields');
// We have explicit fields switched on or off
for (i = 0; i < resultArr.length; i++) {
result = resultArr[i];
for (j in result) {
if (result.hasOwnProperty(j)) {
if (fieldListOn.length) {
// We have explicit fields switched on so remove all fields
// that are not explicitly switched on
// Check if the field name is not the primary key
if (j !== pk) {
if (fieldListOn.indexOf(j) === -1) {
// This field is not in the on list, remove it
delete result[j];
}
}
}
if (fieldListOff.length) {
// We have explicit fields switched off so remove fields
// that are explicitly switched off
if (fieldListOff.indexOf(j) > -1) {
// This field is in the off list, remove it
delete result[j];
}
}
}
}
}
op.time('limitFields');
}
// Now run any projections on the data required
if (options.$elemMatch) {
op.data('flag.elemMatch', true);
op.time('projection-elemMatch');
for (i in options.$elemMatch) {
if (options.$elemMatch.hasOwnProperty(i)) {
elemMatchPathSolver = new Path(i);
// Loop the results array
for (j = 0; j < resultArr.length; j++) {
elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0];
// Check we have a sub-array to loop
if (elemMatchSubArr && elemMatchSubArr.length) {
// Loop the sub-array and check for projection query matches
for (k = 0; k < elemMatchSubArr.length; k++) {
// Check if the current item in the sub-array matches the projection query
if (self._match(elemMatchSubArr[k], options.$elemMatch[i], options, '', {})) {
// The item matches the projection query so set the sub-array
// to an array that ONLY contains the matching item and then
// exit the loop since we only want to match the first item
elemMatchPathSolver.set(resultArr[j], i, [elemMatchSubArr[k]]);
break;
}
}
}
}
}
}
op.time('projection-elemMatch');
}
if (options.$elemsMatch) {
op.data('flag.elemsMatch', true);
op.time('projection-elemsMatch');
for (i in options.$elemsMatch) {
if (options.$elemsMatch.hasOwnProperty(i)) {
elemMatchPathSolver = new Path(i);
// Loop the results array
for (j = 0; j < resultArr.length; j++) {
elemMatchSubArr = elemMatchPathSolver.value(resultArr[j])[0];
// Check we have a sub-array to loop
if (elemMatchSubArr && elemMatchSubArr.length) {
elemMatchSpliceArr = [];
// Loop the sub-array and check for projection query matches
for (k = 0; k < elemMatchSubArr.length; k++) {
// Check if the current item in the sub-array matches the projection query
if (self._match(elemMatchSubArr[k], options.$elemsMatch[i], options, '', {})) {
// The item matches the projection query so add it to the final array
elemMatchSpliceArr.push(elemMatchSubArr[k]);
}
}
// Now set the final sub-array to the matched items
elemMatchPathSolver.set(resultArr[j], i, elemMatchSpliceArr);
}
}
}
}
op.time('projection-elemsMatch');
}
op.stop();
resultArr.__fdbOp = op;
resultArr.$cursor = cursor;
return resultArr;
};
Collection.prototype._resolveDynamicQuery = function (query, item) {
var self = this,
newQuery,
propType,
propVal,
i;
if (typeof query === 'string') {
// Check if the property name starts with a back-reference
if (query.substr(0, 3) === '$$.') {
// Fill the query with a back-referenced value
return new Path(query.substr(3, query.length - 3)).value(item)[0];
}
return new Path(query).value(item)[0];
}
newQuery = {};
for (i in query) {
if (query.hasOwnProperty(i)) {
propType = typeof query[i];
propVal = query[i];
switch (propType) {
case 'string':
// Check if the property name starts with a back-reference
if (propVal.substr(0, 3) === '$$.') {
// Fill the query with a back-referenced value
newQuery[i] = new Path(propVal.substr(3, propVal.length - 3)).value(item)[0];
} else {
newQuery[i] = propVal;
}
break;
case 'object':
newQuery[i] = self._resolveDynamicQuery(propVal, item);
break;
default:
newQuery[i] = propVal;
break;
}
}
}
return newQuery;
};
/**
* Returns one document that satisfies the specified query criteria. If multiple
* documents satisfy the query, this method returns the first document to match
* the query.
* @returns {*}
*/
Collection.prototype.findOne = function () {
return (this.find.apply(this, arguments))[0];
};
/**
* Gets the index in the collection data array of the first item matched by
* the passed query object.
* @param {Object} query The query to run to find the item to return the index of.
* @param {Object=} options An options object.
* @returns {Number}
*/
Collection.prototype.indexOf = function (query, options) {
var item = this.find(query, {$decouple: false})[0],
sortedData;
if (item) {
if (!options || options && !options.$orderBy) {
// Basic lookup from order of insert
return this._data.indexOf(item);
} else {
// Trying to locate index based on query with sort order
options.$decouple = false;
sortedData = this.find(query, options);
return sortedData.indexOf(item);
}
}
return -1;
};
/**
* Returns the index of the document identified by the passed item's primary key.
* @param {*} itemLookup The document whose primary key should be used to lookup
* or the id to lookup.
* @param {Object=} options An options object.
* @returns {Number} The index the item with the matching primary key is occupying.
*/
Collection.prototype.indexOfDocById = function (itemLookup, options) {
var item,
sortedData;
if (typeof itemLookup !== 'object') {
item = this._primaryIndex.get(itemLookup);
} else {
item = this._primaryIndex.get(itemLookup[this._primaryKey]);
}
if (item) {
if (!options || options && !options.$orderBy) {
// Basic lookup
return this._data.indexOf(item);
} else {
// Sorted lookup
options.$decouple = false;
sortedData = this.find({}, options);
return sortedData.indexOf(item);
}
}
return -1;
};
/**
* Removes a document from the collection by it's index in the collection's
* data array.
* @param {Number} index The index of the document to remove.
* @returns {Object} The document that has been removed or false if none was
* removed.
*/
Collection.prototype.removeByIndex = function (index) {
var doc,
docId;
doc = this._data[index];
if (doc !== undefined) {
doc = this.decouple(doc);
docId = doc[this.primaryKey()];
return this.removeById(docId);
}
return false;
};
/**
* Gets / sets the collection transform options.
* @param {Object} obj A collection transform options object.
* @returns {*}
*/
Collection.prototype.transform = function (obj) {
if (obj !== undefined) {
if (typeof obj === "object") {
if (obj.enabled !== undefined) {
this._transformEnabled = obj.enabled;
}
if (obj.dataIn !== undefined) {
this._transformIn = obj.dataIn;
}
if (obj.dataOut !== undefined) {
this._transformOut = obj.dataOut;
}
} else {
this._transformEnabled = obj !== false;
}
return this;
}
return {
enabled: this._transformEnabled,
dataIn: this._transformIn,
dataOut: this._transformOut
};
};
/**
* Transforms data using the set transformIn method.
* @param {Object} data The data to transform.
* @returns {*}
*/
Collection.prototype.transformIn = function (data) {
if (this._transformEnabled && this._transformIn) {
if (data instanceof Array) {
var finalArr = [], i;
for (i = 0; i < data.length; i++) {
finalArr[i] = this._transformIn(data[i]);
}
return finalArr;
} else {
return this._transformIn(data);
}
}
return data;
};
/**
* Transforms data using the set transformOut method.
* @param {Object} data The data to transform.
* @returns {*}
*/
Collection.prototype.transformOut = function (data) {
if (this._transformEnabled && this._transformOut) {
if (data instanceof Array) {
var finalArr = [], i;
for (i = 0; i < data.length; i++) {
finalArr[i] = this._transformOut(data[i]);
}
return finalArr;
} else {
return this._transformOut(data);
}
}
return data;
};
/**
* Sorts an array of documents by the given sort path.
* @param {*} sortObj The keys and orders the array objects should be sorted by.
* @param {Array} arr The array of documents to sort.
* @returns {Array}
*/
Collection.prototype.sort = function (sortObj, arr) {
// Make sure we have an array object
arr = arr || [];
var sortArr = [],
sortKey,
sortSingleObj;
for (sortKey in sortObj) {
if (sortObj.hasOwnProperty(sortKey)) {
sortSingleObj = {};
sortSingleObj[sortKey] = sortObj[sortKey];
sortSingleObj.___fdbKey = String(sortKey);
sortArr.push(sortSingleObj);
}
}
if (sortArr.length < 2) {
// There is only one sort criteria, do a simple sort and return it
return this._sort(sortObj, arr);
} else {
return this._bucketSort(sortArr, arr);
}
};
/**
* Takes array of sort paths and sorts them into buckets before returning final
* array fully sorted by multi-keys.
* @param keyArr
* @param arr
* @returns {*}
* @private
*/
Collection.prototype._bucketSort = function (keyArr, arr) {
var keyObj = keyArr.shift(),
arrCopy,
bucketData,
bucketOrder,
bucketKey,
buckets,
i,
finalArr = [];
if (keyArr.length > 0) {
// Sort array by bucket key
arr = this._sort(keyObj, arr);
// Split items into buckets
bucketData = this.bucket(keyObj.___fdbKey, arr);
bucketOrder = bucketData.order;
buckets = bucketData.buckets;
// Loop buckets and sort contents
for (i = 0; i < bucketOrder.length; i++) {
bucketKey = bucketOrder[i];
arrCopy = [].concat(keyArr);
finalArr = finalArr.concat(this._bucketSort(arrCopy, buckets[bucketKey]));
}
return finalArr;
} else {
return this._sort(keyObj, arr);
}
};
/**
* Sorts array by individual sort path.
* @param key
* @param arr
* @returns {Array|*}
* @private
*/
Collection.prototype._sort = function (key, arr) {
var self = this,
sorterMethod,
pathSolver = new Path(),
dataPath = pathSolver.parse(key, true)[0];
pathSolver.path(dataPath.path);
if (dataPath.value === 1) {
// Sort ascending
sorterMethod = function (a, b) {
var valA = pathSolver.value(a)[0],
valB = pathSolver.value(b)[0];
return self.sortAsc(valA, valB);
};
} else if (dataPath.value === -1) {
// Sort descending
sorterMethod = function (a, b) {
var valA = pathSolver.value(a)[0],
valB = pathSolver.value(b)[0];
return self.sortDesc(valA, valB);
};
} else {
throw(this.logIdentifier() + ' $orderBy clause has invalid direction: ' + dataPath.value + ', accepted values are 1 or -1 for ascending or descending!');
}
return arr.sort(sorterMethod);
};
/**
* Takes an array of objects and returns a new object with the array items
* split into buckets by the passed key.
* @param {String} key The key to split the array into buckets by.
* @param {Array} arr An array of objects.
* @returns {Object}
*/
Collection.prototype.bucket = function (key, arr) {
var i,
oldField,
field,
fieldArr = [],
buckets = {};
for (i = 0; i < arr.length; i++) {
field = String(arr[i][key]);
if (oldField !== field) {
fieldArr.push(field);
oldField = field;
}
buckets[field] = buckets[field] || [];
buckets[field].push(arr[i]);
}
return {
buckets: buckets,
order: fieldArr
};
};
/**
* Internal method that takes a search query and options and returns an object
* containing details about the query which can be used to optimise the search.
*
* @param query
* @param options
* @param op
* @returns {Object}
* @private
*/
Collection.prototype._analyseQuery = function (query, options, op) {
var analysis = {
queriesOn: [this._name],
indexMatch: [],
hasJoin: false,
queriesJoin: false,
joinQueries: {},
query: query,
options: options
},
joinCollectionIndex,
joinCollectionName,
joinCollections = [],
joinCollectionReferences = [],
queryPath,
index,
indexMatchData,
indexRef,
indexRefName,
indexLookup,
pathSolver,
queryKeyCount,
i;
// Check if the query is a primary key lookup
op.time('checkIndexes');
pathSolver = new Path();
queryKeyCount = pathSolver.countKeys(query);
if (queryKeyCount) {
if (query[this._primaryKey] !== undefined) {
// Return item via primary key possible
op.time('checkIndexMatch: Primary Key');
analysis.indexMatch.push({
lookup: this._primaryIndex.lookup(query, options),
keyData: {
matchedKeys: [this._primaryKey],
totalKeyCount: queryKeyCount,
score: 1
},
index: this._primaryIndex
});
op.time('checkIndexMatch: Primary Key');
}
// Check if an index can speed up the query
for (i in this._indexById) {
if (this._indexById.hasOwnProperty(i)) {
indexRef = this._indexById[i];
indexRefName = indexRef.name();
op.time('checkIndexMatch: ' + indexRefName);
indexMatchData = indexRef.match(query, options);
if (indexMatchData.score > 0) {
// This index can be used, store it
indexLookup = indexRef.lookup(query, options);
analysis.indexMatch.push({
lookup: indexLookup,
keyData: indexMatchData,
index: indexRef
});
}
op.time('checkIndexMatch: ' + indexRefName);
if (indexMatchData.score === queryKeyCount) {
// Found an optimal index, do not check for any more
break;
}
}
}
op.time('checkIndexes');
// Sort array descending on index key count (effectively a measure of relevance to the query)
if (analysis.indexMatch.length > 1) {
op.time('findOptimalIndex');
analysis.indexMatch.sort(function (a, b) {
if (a.keyData.score > b.keyData.score) {
// This index has a higher score than the other
return -1;
}
if (a.keyData.score < b.keyData.score) {
// This index has a lower score than the other
return 1;
}
// The indexes have the same score but can still be compared by the number of records
// they return from the query. The fewer records they return the better so order by
// record count
if (a.keyData.score === b.keyData.score) {
return a.lookup.length - b.lookup.length;
}
});
op.time('findOptimalIndex');
}
}
// Check for join data
if (options.$join) {
analysis.hasJoin = true;
// Loop all join operations
for (joinCollectionIndex = 0; joinCollectionIndex < options.$join.length; joinCollectionIndex++) {
// Loop the join collections and keep a reference to them
for (joinCollectionName in options.$join[joinCollectionIndex]) {
if (options.$join[joinCollectionIndex].hasOwnProperty(joinCollectionName)) {
joinCollections.push(joinCollectionName);
// Check if the join uses an $as operator
if ('$as' in options.$join[joinCollectionIndex][joinCollectionName]) {
joinCollectionReferences.push(options.$join[joinCollectionIndex][joinCollectionName].$as);
} else {
joinCollectionReferences.push(joinCollectionName);
}
}
}
}
// Loop the join collection references and determine if the query references
// any of the collections that are used in the join. If there no queries against
// joined collections the find method can use a code path optimised for this.
// Queries against joined collections requires the joined collections to be filtered
// first and then joined so requires a little more work.
for (index = 0; index < joinCollectionReferences.length; index++) {
// Check if the query references any collection data that the join will create
queryPath = this._queryReferencesCollection(query, joinCollectionReferences[index], '');
if (queryPath) {
analysis.joinQueries[joinCollections[index]] = queryPath;
analysis.queriesJoin = true;
}
}
analysis.joinsOn = joinCollections;
analysis.queriesOn = analysis.queriesOn.concat(joinCollections);
}
return analysis;
};
/**
* Checks if the passed query references this collection.
* @param query
* @param collection
* @param path
* @returns {*}
* @private
*/
Collection.prototype._queryReferencesCollection = function (query, collection, path) {
var i;
for (i in query) {
if (query.hasOwnProperty(i)) {
// Check if this key is a reference match
if (i === collection) {
if (path) { path += '.'; }
return path + i;
} else {
if (typeof(query[i]) === 'object') {
// Recurse
if (path) { path += '.'; }
path += i;
return this._queryReferencesCollection(query[i], collection, path);
}
}
}
}
return false;
};
/**
* Returns the number of documents currently in the collection.
* @returns {Number}
*/
Collection.prototype.count = function (query, options) {
if (!query) {
return this._data.length;
} else {
// Run query and return count
return this.find(query, options).length;
}
};
/**
* Finds sub-documents from the collection's documents.
* @param {Object} match The query object to use when matching parent documents
* from which the sub-documents are queried.
* @param {String} path The path string used to identify the key in which
* sub-documents are stored in parent documents.
* @param {Object=} subDocQuery The query to use when matching which sub-documents
* to return.
* @param {Object=} subDocOptions The options object to use when querying for
* sub-documents.
* @returns {*}
*/
Collection.prototype.findSub = function (match, path, subDocQuery, subDocOptions) {
var pathHandler = new Path(path),
docArr = this.find(match),
docCount = docArr.length,
docIndex,
subDocArr,
subDocCollection = this._db.collection('__FDB_temp_' + this.objectId()),
subDocResults,
resultObj = {
parents: docCount,
subDocTotal: 0,
subDocs: [],
pathFound: false,
err: ''
};
subDocOptions = subDocOptions || {};
for (docIndex = 0; docIndex < docCount; docIndex++) {
subDocArr = pathHandler.value(docArr[docIndex])[0];
if (subDocArr) {
subDocCollection.setData(subDocArr);
subDocResults = subDocCollection.find(subDocQuery, subDocOptions);
if (subDocOptions.returnFirst && subDocResults.length) {
return subDocResults[0];
}
if (subDocOptions.$split) {
resultObj.subDocs.push(subDocResults);
} else {
resultObj.subDocs = resultObj.subDocs.concat(subDocResults);
}
resultObj.subDocTotal += subDocResults.length;
resultObj.pathFound = true;
}
}
// Drop the sub-document collection
subDocCollection.drop();
// Check if the call should not return stats, if so return only subDocs array
if (subDocOptions.$stats) {
return resultObj;
} else {
return resultObj.subDocs;
}
if (!resultObj.pathFound) {
resultObj.err = 'No objects found in the parent documents with a matching path of: ' + path;
}
return resultObj;
};
/**
* Finds the first sub-document from the collection's documents that matches
* the subDocQuery parameter.
* @param {Object} match The query object to use when matching parent documents
* from which the sub-documents are queried.
* @param {String} path The path string used to identify the key in which
* sub-documents are stored in parent documents.
* @param {Object=} subDocQuery The query to use when matching which sub-documents
* to return.
* @param {Object=} subDocOptions The options object to use when querying for
* sub-documents.
* @returns {Object}
*/
Collection.prototype.findSubOne = function (match, path, subDocQuery, subDocOptions) {
return this.findSub(match, path, subDocQuery, subDocOptions)[0];
};
/**
* Checks that the passed document will not violate any index rules if
* inserted into the collection.
* @param {Object} doc The document to check indexes against.
* @returns {Boolean} Either false (no violation occurred) or true if
* a violation was detected.
*/
Collection.prototype.insertIndexViolation = function (doc) {
var indexViolated,
arr = this._indexByName,
arrIndex,
arrItem;
// Check the item's primary key is not already in use
if (this._primaryIndex.get(doc[this._primaryKey])) {
indexViolated = this._primaryIndex;
} else {
// Check violations of other indexes
for (arrIndex in arr) {
if (arr.hasOwnProperty(arrIndex)) {
arrItem = arr[arrIndex];
if (arrItem.unique()) {
if (arrItem.violation(doc)) {
indexViolated = arrItem;
break;
}
}
}
}
}
return indexViolated ? indexViolated.name() : false;
};
/**
* Creates an index on the specified keys.
* @param {Object} keys The object containing keys to index.
* @param {Object} options An options object.
* @returns {*}
*/
Collection.prototype.ensureIndex = function (keys, options) {
if (this.isDropped()) {
throw(this.logIdentifier() + ' Cannot operate in a dropped state!');
}
this._indexByName = this._indexByName || {};
this._indexById = this._indexById || {};
var index,
time = {
start: new Date().getTime()
};
if (options) {
switch (options.type) {
case 'hashed':
index = new IndexHashMap(keys, options, this);
break;
case 'btree':
index = new IndexBinaryTree(keys, options, this);
break;
default:
// Default
index = new IndexHashMap(keys, options, this);
break;
}
} else {
// Default
index = new IndexHashMap(keys, options, this);
}
// Check the index does not already exist
if (this._indexByName[index.name()]) {
// Index already exists
return {
err: 'Index with that name already exists'
};
}
if (this._indexById[index.id()]) {
// Index already exists
return {
err: 'Index with those keys already exists'
};
}
// Create the index
index.rebuild();
// Add the index
this._indexByName[index.name()] = index;
this._indexById[index.id()] = index;
time.end = new Date().getTime();
time.total = time.end - time.start;
this._lastOp = {
type: 'ensureIndex',
stats: {
time: time
}
};
return {
index: index,
id: index.id(),
name: index.name(),
state: index.state()
};
};
/**
* Gets an index by it's name.
* @param {String} name The name of the index to retreive.
* @returns {*}
*/
Collection.prototype.index = function (name) {
if (this._indexByName) {
return this._indexByName[name];
}
};
/**
* Gets the last reporting operation's details such as run time.
* @returns {Object}
*/
Collection.prototype.lastOp = function () {
return this._metrics.list();
};
/**
* Generates a difference object that contains insert, update and remove arrays
* representing the operations to execute to make this collection have the same
* data as the one passed.
* @param {Collection} collection The collection to diff against.
* @returns {{}}
*/
Collection.prototype.diff = function (collection) {
var diff = {
insert: [],
update: [],
remove: []
};
var pm = this.primaryKey(),
arr,
arrIndex,
arrItem,
arrCount;
// Check if the primary key index of each collection can be utilised
if (pm !== collection.primaryKey()) {
throw(this.logIdentifier() + ' Diffing requires that both collections have the same primary key!');
}
// Use the collection primary key index to do the diff (super-fast)
arr = collection._data;
// Check if we have an array or another collection
while (arr && !(arr instanceof Array)) {
// We don't have an array, assign collection and get data
collection = arr;
arr = collection._data;
}
arrCount = arr.length;
// Loop the collection's data array and check for matching items
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arrItem = arr[arrIndex];
// Check for a matching item in this collection
if (this._primaryIndex.get(arrItem[pm])) {
// Matching item exists, check if the data is the same
if (this._primaryCrc.get(arrItem[pm]) !== collection._primaryCrc.get(arrItem[pm])) {
// The documents exist in both collections but data differs, update required
diff.update.push(arrItem);
}
} else {
// The document is missing from this collection, insert required
diff.insert.push(arrItem);
}
}
// Now loop this collection's data and check for matching items
arr = this._data;
arrCount = arr.length;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arrItem = arr[arrIndex];
if (!collection._primaryIndex.get(arrItem[pm])) {
// The document does not exist in the other collection, remove required
diff.remove.push(arrItem);
}
}
return diff;
};
Collection.prototype.collateAdd = new Overload({
/**
* Adds a data source to collate data from and specifies the
* key name to collate data to.
* @func collateAdd
* @memberof Collection
* @param {Collection} collection The collection to collate data from.
* @param {String=} keyName Optional name of the key to collate data to.
* If none is provided the record CRUD is operated on the root collection
* data.
*/
'object, string': function (collection, keyName) {
var self = this;
self.collateAdd(collection, function (packet) {
var obj1,
obj2;
switch (packet.type) {
case 'insert':
if (keyName) {
obj1 = {
$push: {}
};
obj1.$push[keyName] = self.decouple(packet.data);
self.update({}, obj1);
} else {
self.insert(packet.data);
}
break;
case 'update':
if (keyName) {
obj1 = {};
obj2 = {};
obj1[keyName] = packet.data.query;
obj2[keyName + '.$'] = packet.data.update;
self.update(obj1, obj2);
} else {
self.update(packet.data.query, packet.data.update);
}
break;
case 'remove':
if (keyName) {
obj1 = {
$pull: {}
};
obj1.$pull[keyName] = {};
obj1.$pull[keyName][self.primaryKey()] = packet.data.dataSet[0][collection.primaryKey()];
self.update({}, obj1);
} else {
self.remove(packet.data);
}
break;
default:
}
});
},
/**
* Adds a data source to collate data from and specifies a process
* method that will handle the collation functionality (for custom
* collation).
* @func collateAdd
* @memberof Collection
* @param {Collection} collection The collection to collate data from.
* @param {Function} process The process method.
*/
'object, function': function (collection, process) {
if (typeof collection === 'string') {
// The collection passed is a name, not a reference so get
// the reference from the name
collection = this._db.collection(collection, {
autoCreate: false,
throwError: false
});
}
if (collection) {
this._collate = this._collate || {};
this._collate[collection.name()] = new ReactorIO(collection, this, process);
return this;
} else {
throw('Cannot collate from a non-existent collection!');
}
}
});
Collection.prototype.collateRemove = function (collection) {
if (typeof collection === 'object') {
// We need to have the name of the collection to remove it
collection = collection.name();
}
if (collection) {
// Drop the reactor IO chain node
this._collate[collection].drop();
// Remove the collection data from the collate object
delete this._collate[collection];
return this;
} else {
throw('No collection name passed to collateRemove() or collection not found!');
}
};
Db.prototype.collection = new Overload({
/**
* Get a collection with no name (generates a random name). If the
* collection does not already exist then one is created for that
* name automatically.
* @func collection
* @memberof Db
* @param {String} collectionName The name of the collection.
* @returns {Collection}
*/
'': function () {
return this.$main.call(this, {
name: this.objectId()
});
},
/**
* Get a collection by name. If the collection does not already exist
* then one is created for that name automatically.
* @func collection
* @memberof Db
* @param {Object} data An options object or a collection instance.
* @returns {Collection}
*/
'object': function (data) {
// Handle being passed an instance
if (data instanceof Collection) {
if (data.state() !== 'droppped') {
return data;
} else {
return this.$main.call(this, {
name: data.name()
});
}
}
return this.$main.call(this, data);
},
/**
* Get a collection by name. If the collection does not already exist
* then one is created for that name automatically.
* @func collection
* @memberof Db
* @param {String} collectionName The name of the collection.
* @returns {Collection}
*/
'string': function (collectionName) {
return this.$main.call(this, {
name: collectionName
});
},
/**
* Get a collection by name. If the collection does not already exist
* then one is created for that name automatically.
* @func collection
* @memberof Db
* @param {String} collectionName The name of the collection.
* @param {String} primaryKey Optional primary key to specify the primary key field on the collection
* objects. Defaults to "_id".
* @returns {Collection}
*/
'string, string': function (collectionName, primaryKey) {
return this.$main.call(this, {
name: collectionName,
primaryKey: primaryKey
});
},
/**
* Get a collection by name. If the collection does not already exist
* then one is created for that name automatically.
* @func collection
* @memberof Db
* @param {String} collectionName The name of the collection.
* @param {Object} options An options object.
* @returns {Collection}
*/
'string, object': function (collectionName, options) {
options.name = collectionName;
return this.$main.call(this, options);
},
/**
* Get a collection by name. If the collection does not already exist
* then one is created for that name automatically.
* @func collection
* @memberof Db
* @param {String} collectionName The name of the collection.
* @param {String} primaryKey Optional primary key to specify the primary key field on the collection
* objects. Defaults to "_id".
* @param {Object} options An options object.
* @returns {Collection}
*/
'string, string, object': function (collectionName, primaryKey, options) {
options.name = collectionName;
options.primaryKey = primaryKey;
return this.$main.call(this, options);
},
/**
* The main handler method. This gets called by all the other variants and
* handles the actual logic of the overloaded method.
* @func collection
* @memberof Db
* @param {Object} options An options object.
* @returns {*}
*/
'$main': function (options) {
var name = options.name;
if (name) {
if (!this._collection[name]) {
if (options && options.autoCreate === false) {
if (options && options.throwError !== false) {
throw(this.logIdentifier() + ' Cannot get collection ' + name + ' because it does not exist and auto-create has been disabled!');
}
}
if (this.debug()) {
console.log(this.logIdentifier() + ' Creating collection ' + name);
}
}
this._collection[name] = this._collection[name] || new Collection(name, options).db(this);
this._collection[name].mongoEmulation(this.mongoEmulation());
if (options.primaryKey !== undefined) {
this._collection[name].primaryKey(options.primaryKey);
}
return this._collection[name];
} else {
if (!options || (options && options.throwError !== false)) {
throw(this.logIdentifier() + ' Cannot get collection with undefined name!');
}
}
}
});
/**
* Determine if a collection with the passed name already exists.
* @memberof Db
* @param {String} viewName The name of the collection to check for.
* @returns {boolean}
*/
Db.prototype.collectionExists = function (viewName) {
return Boolean(this._collection[viewName]);
};
/**
* Returns an array of collections the DB currently has.
* @memberof Db
* @param {String|RegExp=} search The optional search string or regular expression to use
* to match collection names against.
* @returns {Array} An array of objects containing details of each collection
* the database is currently managing.
*/
Db.prototype.collections = function (search) {
var arr = [],
collections = this._collection,
collection,
i;
if (search) {
if (!(search instanceof RegExp)) {
// Turn the search into a regular expression
search = new RegExp(search);
}
}
for (i in collections) {
if (collections.hasOwnProperty(i)) {
collection = collections[i];
if (search) {
if (search.exec(i)) {
arr.push({
name: i,
count: collection.count(),
linked: collection.isLinked !== undefined ? collection.isLinked() : false
});
}
} else {
arr.push({
name: i,
count: collection.count(),
linked: collection.isLinked !== undefined ? collection.isLinked() : false
});
}
}
}
arr.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
return arr;
};
Shared.finishModule('Collection');
module.exports = Collection;
},{"./Crc":8,"./IndexBinaryTree":13,"./IndexHashMap":14,"./KeyValueStore":15,"./Metrics":16,"./Overload":29,"./Path":31,"./ReactorIO":35,"./Shared":38}],6:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Db,
DbInit,
Collection;
Shared = _dereq_('./Shared');
/**
* Creates a new collection group. Collection groups allow single operations to be
* propagated to multiple collections at once. CRUD operations against a collection
* group are in fed to the group's collections. Useful when separating out slightly
* different data into multiple collections but querying as one collection.
* @constructor
*/
var CollectionGroup = function () {
this.init.apply(this, arguments);
};
CollectionGroup.prototype.init = function (name) {
var self = this;
self._name = name;
self._data = new Collection('__FDB__cg_data_' + self._name);
self._collections = [];
self._view = [];
};
Shared.addModule('CollectionGroup', CollectionGroup);
Shared.mixin(CollectionGroup.prototype, 'Mixin.Common');
Shared.mixin(CollectionGroup.prototype, 'Mixin.ChainReactor');
Shared.mixin(CollectionGroup.prototype, 'Mixin.Constants');
Shared.mixin(CollectionGroup.prototype, 'Mixin.Triggers');
Shared.mixin(CollectionGroup.prototype, 'Mixin.Tags');
Collection = _dereq_('./Collection');
Db = Shared.modules.Db;
DbInit = Shared.modules.Db.prototype.init;
CollectionGroup.prototype.on = function () {
this._data.on.apply(this._data, arguments);
};
CollectionGroup.prototype.off = function () {
this._data.off.apply(this._data, arguments);
};
CollectionGroup.prototype.emit = function () {
this._data.emit.apply(this._data, arguments);
};
/**
* Gets / sets the primary key for this collection group.
* @param {String=} keyName The name of the primary key.
* @returns {*}
*/
CollectionGroup.prototype.primaryKey = function (keyName) {
if (keyName !== undefined) {
this._primaryKey = keyName;
return this;
}
return this._primaryKey;
};
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(CollectionGroup.prototype, 'state');
/**
* Gets / sets the db instance the collection group belongs to.
* @param {Db=} db The db instance.
* @returns {*}
*/
Shared.synthesize(CollectionGroup.prototype, 'db');
/**
* Gets / sets the instance name.
* @param {Name=} name The new name to set.
* @returns {*}
*/
Shared.synthesize(CollectionGroup.prototype, 'name');
CollectionGroup.prototype.addCollection = function (collection) {
if (collection) {
if (this._collections.indexOf(collection) === -1) {
//var self = this;
// Check for compatible primary keys
if (this._collections.length) {
if (this._primaryKey !== collection.primaryKey()) {
throw(this.logIdentifier() + ' All collections in a collection group must have the same primary key!');
}
} else {
// Set the primary key to the first collection added
this.primaryKey(collection.primaryKey());
}
// Add the collection
this._collections.push(collection);
collection._groups = collection._groups || [];
collection._groups.push(this);
collection.chain(this);
// Hook the collection's drop event to destroy group data
collection.on('drop', function () {
// Remove collection from any group associations
if (collection._groups && collection._groups.length) {
var groupArr = [],
i;
// Copy the group array because if we call removeCollection on a group
// it will alter the groups array of this collection mid-loop!
for (i = 0; i < collection._groups.length; i++) {
groupArr.push(collection._groups[i]);
}
// Loop any groups we are part of and remove ourselves from them
for (i = 0; i < groupArr.length; i++) {
collection._groups[i].removeCollection(collection);
}
}
delete collection._groups;
});
// Add collection's data
this._data.insert(collection.find());
}
}
return this;
};
CollectionGroup.prototype.removeCollection = function (collection) {
if (collection) {
var collectionIndex = this._collections.indexOf(collection),
groupIndex;
if (collectionIndex !== -1) {
collection.unChain(this);
this._collections.splice(collectionIndex, 1);
collection._groups = collection._groups || [];
groupIndex = collection._groups.indexOf(this);
if (groupIndex !== -1) {
collection._groups.splice(groupIndex, 1);
}
collection.off('drop');
}
if (this._collections.length === 0) {
// Wipe the primary key
delete this._primaryKey;
}
}
return this;
};
CollectionGroup.prototype._chainHandler = function (chainPacket) {
//sender = chainPacket.sender;
switch (chainPacket.type) {
case 'setData':
// Decouple the data to ensure we are working with our own copy
chainPacket.data = this.decouple(chainPacket.data);
// Remove old data
this._data.remove(chainPacket.options.oldData);
// Add new data
this._data.insert(chainPacket.data);
break;
case 'insert':
// Decouple the data to ensure we are working with our own copy
chainPacket.data = this.decouple(chainPacket.data);
// Add new data
this._data.insert(chainPacket.data);
break;
case 'update':
// Update data
this._data.update(chainPacket.data.query, chainPacket.data.update, chainPacket.options);
break;
case 'remove':
this._data.remove(chainPacket.data.query, chainPacket.options);
break;
default:
break;
}
};
CollectionGroup.prototype.insert = function () {
this._collectionsRun('insert', arguments);
};
CollectionGroup.prototype.update = function () {
this._collectionsRun('update', arguments);
};
CollectionGroup.prototype.updateById = function () {
this._collectionsRun('updateById', arguments);
};
CollectionGroup.prototype.remove = function () {
this._collectionsRun('remove', arguments);
};
CollectionGroup.prototype._collectionsRun = function (type, args) {
for (var i = 0; i < this._collections.length; i++) {
this._collections[i][type].apply(this._collections[i], args);
}
};
CollectionGroup.prototype.find = function (query, options) {
return this._data.find(query, options);
};
/**
* Helper method that removes a document that matches the given id.
* @param {String} id The id of the document to remove.
*/
CollectionGroup.prototype.removeById = function (id) {
// Loop the collections in this group and apply the remove
for (var i = 0; i < this._collections.length; i++) {
this._collections[i].removeById(id);
}
};
/**
* Uses the passed query to generate a new collection with results
* matching the query parameters.
*
* @param query
* @param options
* @returns {*}
*/
CollectionGroup.prototype.subset = function (query, options) {
var result = this.find(query, options);
return new Collection()
.subsetOf(this)
.primaryKey(this._primaryKey)
.setData(result);
};
/**
* Drops a collection group from the database.
* @returns {boolean} True on success, false on failure.
*/
CollectionGroup.prototype.drop = function (callback) {
if (!this.isDropped()) {
var i,
collArr,
viewArr;
if (this._debug) {
console.log(this.logIdentifier() + ' Dropping');
}
this._state = 'dropped';
if (this._collections && this._collections.length) {
collArr = [].concat(this._collections);
for (i = 0; i < collArr.length; i++) {
this.removeCollection(collArr[i]);
}
}
if (this._view && this._view.length) {
viewArr = [].concat(this._view);
for (i = 0; i < viewArr.length; i++) {
this._removeView(viewArr[i]);
}
}
this.emit('drop', this);
if (callback) { callback(false, true); }
}
return true;
};
// Extend DB to include collection groups
Db.prototype.init = function () {
this._collectionGroup = {};
DbInit.apply(this, arguments);
};
Db.prototype.collectionGroup = function (collectionGroupName) {
if (collectionGroupName) {
// Handle being passed an instance
if (collectionGroupName instanceof CollectionGroup) {
return collectionGroupName;
}
this._collectionGroup[collectionGroupName] = this._collectionGroup[collectionGroupName] || new CollectionGroup(collectionGroupName).db(this);
return this._collectionGroup[collectionGroupName];
} else {
// Return an object of collection data
return this._collectionGroup;
}
};
/**
* Returns an array of collection groups the DB currently has.
* @returns {Array} An array of objects containing details of each collection group
* the database is currently managing.
*/
Db.prototype.collectionGroups = function () {
var arr = [],
i;
for (i in this._collectionGroup) {
if (this._collectionGroup.hasOwnProperty(i)) {
arr.push({
name: i
});
}
}
return arr;
};
module.exports = CollectionGroup;
},{"./Collection":5,"./Shared":38}],7:[function(_dereq_,module,exports){
/*
License
Copyright (c) 2015 Irrelon Software Limited
http://www.irrelon.com
http://www.forerunnerdb.com
Please visit the license page to see latest license information:
http://www.forerunnerdb.com/licensing.html
*/
"use strict";
var Shared,
Db,
Metrics,
Overload,
_instances = [];
Shared = _dereq_('./Shared');
Overload = _dereq_('./Overload');
/**
* Creates a new ForerunnerDB instance. Core instances handle the lifecycle of
* multiple database instances.
* @constructor
*/
var Core = function (name) {
this.init.apply(this, arguments);
};
Core.prototype.init = function (name) {
this._db = {};
this._debug = {};
this._name = name || 'ForerunnerDB';
_instances.push(this);
};
/**
* Returns the number of instantiated ForerunnerDB objects.
* @returns {Number} The number of instantiated instances.
*/
Core.prototype.instantiatedCount = function () {
return _instances.length;
};
/**
* Get all instances as an array or a single ForerunnerDB instance
* by it's array index.
* @param {Number=} index Optional index of instance to get.
* @returns {Array|Object} Array of instances or a single instance.
*/
Core.prototype.instances = function (index) {
if (index !== undefined) {
return _instances[index];
}
return _instances;
};
/**
* Get all instances as an array of instance names or a single ForerunnerDB
* instance by it's name.
* @param {String=} name Optional name of instance to get.
* @returns {Array|Object} Array of instance names or a single instance.
*/
Core.prototype.namedInstances = function (name) {
var i,
instArr;
if (name !== undefined) {
for (i = 0; i < _instances.length; i++) {
if (_instances[i].name === name) {
return _instances[i];
}
}
return undefined;
}
instArr = [];
for (i = 0; i < _instances.length; i++) {
instArr.push(_instances[i].name);
}
return instArr;
};
Core.prototype.moduleLoaded = new Overload({
/**
* Checks if a module has been loaded into the database.
* @func moduleLoaded
* @memberof Core
* @param {String} moduleName The name of the module to check for.
* @returns {Boolean} True if the module is loaded, false if not.
*/
'string': function (moduleName) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
return true;
}
return false;
},
/**
* Checks if a module is loaded and if so calls the passed
* callback method.
* @func moduleLoaded
* @memberof Core
* @param {String} moduleName The name of the module to check for.
* @param {Function} callback The callback method to call if module is loaded.
*/
'string, function': function (moduleName, callback) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
if (callback) { callback(); }
}
},
/**
* Checks if an array of named modules are loaded and if so
* calls the passed callback method.
* @func moduleLoaded
* @memberof Core
* @param {Array} moduleName The array of module names to check for.
* @param {Function} callback The callback method to call if modules are loaded.
*/
'array, function': function (moduleNameArr, callback) {
var moduleName,
i;
for (i = 0; i < moduleNameArr.length; i++) {
moduleName = moduleNameArr[i];
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
}
}
if (callback) { callback(); }
},
/**
* Checks if a module is loaded and if so calls the passed
* success method, otherwise calls the failure method.
* @func moduleLoaded
* @memberof Core
* @param {String} moduleName The name of the module to check for.
* @param {Function} success The callback method to call if module is loaded.
* @param {Function} failure The callback method to call if module not loaded.
*/
'string, function, function': function (moduleName, success, failure) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
failure();
return false;
}
}
success();
}
}
});
/**
* Checks version against the string passed and if it matches (or partially matches)
* then the callback is called.
* @param {String} val The version to check against.
* @param {Function} callback The callback to call if match is true.
* @returns {Boolean}
*/
Core.prototype.version = function (val, callback) {
if (val !== undefined) {
if (Shared.version.indexOf(val) === 0) {
if (callback) { callback(); }
return true;
}
return false;
}
return Shared.version;
};
// Expose moduleLoaded() method to non-instantiated object ForerunnerDB
Core.moduleLoaded = Core.prototype.moduleLoaded;
// Expose version() method to non-instantiated object ForerunnerDB
Core.version = Core.prototype.version;
// Expose instances() method to non-instantiated object ForerunnerDB
Core.instances = Core.prototype.instances;
// Expose instantiatedCount() method to non-instantiated object ForerunnerDB
Core.instantiatedCount = Core.prototype.instantiatedCount;
// Provide public access to the Shared object
Core.shared = Shared;
Core.prototype.shared = Shared;
Shared.addModule('Core', Core);
Shared.mixin(Core.prototype, 'Mixin.Common');
Shared.mixin(Core.prototype, 'Mixin.Constants');
Db = _dereq_('./Db.js');
Metrics = _dereq_('./Metrics.js');
/**
* Gets / sets the name of the instance. This is primarily used for
* name-spacing persistent storage.
* @param {String=} val The name of the instance to set.
* @returns {*}
*/
Shared.synthesize(Core.prototype, 'name');
/**
* Gets / sets mongodb emulation mode.
* @param {Boolean=} val True to enable, false to disable.
* @returns {*}
*/
Shared.synthesize(Core.prototype, 'mongoEmulation');
// Set a flag to determine environment
Core.prototype._isServer = false;
/**
* Returns true if ForerunnerDB is running on a client browser.
* @returns {boolean}
*/
Core.prototype.isClient = function () {
return !this._isServer;
};
/**
* Returns true if ForerunnerDB is running on a server.
* @returns {boolean}
*/
Core.prototype.isServer = function () {
return this._isServer;
};
/**
* Checks if the database is running on a client (browser) or
* a server (node.js).
* @returns {Boolean} Returns true if running on a browser.
*/
Core.prototype.isClient = function () {
return !this._isServer;
};
/**
* Checks if the database is running on a client (browser) or
* a server (node.js).
* @returns {Boolean} Returns true if running on a server.
*/
Core.prototype.isServer = function () {
return this._isServer;
};
/**
* Added to provide an error message for users who have not seen
* the new instantiation breaking change warning and try to get
* a collection directly from the core instance.
*/
Core.prototype.collection = function () {
throw("ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44");
};
module.exports = Core;
},{"./Db.js":9,"./Metrics.js":16,"./Overload":29,"./Shared":38}],8:[function(_dereq_,module,exports){
"use strict";
/**
* @mixin
*/
var crcTable = (function () {
var crcTable = [],
c, n, k;
for (n = 0; n < 256; n++) {
c = n;
for (k = 0; k < 8; k++) {
c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); // jshint ignore:line
}
crcTable[n] = c;
}
return crcTable;
}());
module.exports = function(str) {
var crc = 0 ^ (-1), // jshint ignore:line
i;
for (i = 0; i < str.length; i++) {
crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF]; // jshint ignore:line
}
return (crc ^ (-1)) >>> 0; // jshint ignore:line
};
},{}],9:[function(_dereq_,module,exports){
"use strict";
var Shared,
Core,
Collection,
Metrics,
Crc,
Overload;
Shared = _dereq_('./Shared');
Overload = _dereq_('./Overload');
/**
* Creates a new ForerunnerDB database instance.
* @constructor
*/
var Db = function (name, core) {
this.init.apply(this, arguments);
};
Db.prototype.init = function (name, core) {
this.core(core);
this._primaryKey = '_id';
this._name = name;
this._collection = {};
this._debug = {};
};
Shared.addModule('Db', Db);
Db.prototype.moduleLoaded = new Overload({
/**
* Checks if a module has been loaded into the database.
* @func moduleLoaded
* @memberof Db
* @param {String} moduleName The name of the module to check for.
* @returns {Boolean} True if the module is loaded, false if not.
*/
'string': function (moduleName) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
return true;
}
return false;
},
/**
* Checks if a module is loaded and if so calls the passed
* callback method.
* @func moduleLoaded
* @memberof Db
* @param {String} moduleName The name of the module to check for.
* @param {Function} callback The callback method to call if module is loaded.
*/
'string, function': function (moduleName, callback) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
return false;
}
}
if (callback) { callback(); }
}
},
/**
* Checks if a module is loaded and if so calls the passed
* success method, otherwise calls the failure method.
* @func moduleLoaded
* @memberof Db
* @param {String} moduleName The name of the module to check for.
* @param {Function} success The callback method to call if module is loaded.
* @param {Function} failure The callback method to call if module not loaded.
*/
'string, function, function': function (moduleName, success, failure) {
if (moduleName !== undefined) {
moduleName = moduleName.replace(/ /g, '');
var modules = moduleName.split(','),
index;
for (index = 0; index < modules.length; index++) {
if (!Shared.modules[modules[index]]) {
failure();
return false;
}
}
success();
}
}
});
/**
* Checks version against the string passed and if it matches (or partially matches)
* then the callback is called.
* @param {String} val The version to check against.
* @param {Function} callback The callback to call if match is true.
* @returns {Boolean}
*/
Db.prototype.version = function (val, callback) {
if (val !== undefined) {
if (Shared.version.indexOf(val) === 0) {
if (callback) { callback(); }
return true;
}
return false;
}
return Shared.version;
};
// Expose moduleLoaded method to non-instantiated object ForerunnerDB
Db.moduleLoaded = Db.prototype.moduleLoaded;
// Expose version method to non-instantiated object ForerunnerDB
Db.version = Db.prototype.version;
// Provide public access to the Shared object
Db.shared = Shared;
Db.prototype.shared = Shared;
Shared.addModule('Db', Db);
Shared.mixin(Db.prototype, 'Mixin.Common');
Shared.mixin(Db.prototype, 'Mixin.ChainReactor');
Shared.mixin(Db.prototype, 'Mixin.Constants');
Shared.mixin(Db.prototype, 'Mixin.Tags');
Core = Shared.modules.Core;
Collection = _dereq_('./Collection.js');
Metrics = _dereq_('./Metrics.js');
Crc = _dereq_('./Crc.js');
Db.prototype._isServer = false;
/**
* Gets / sets the core object this database belongs to.
*/
Shared.synthesize(Db.prototype, 'core');
/**
* Gets / sets the default primary key for new collections.
* @param {String=} val The name of the primary key to set.
* @returns {*}
*/
Shared.synthesize(Db.prototype, 'primaryKey');
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(Db.prototype, 'state');
/**
* Gets / sets the name of the database.
* @param {String=} val The name of the database to set.
* @returns {*}
*/
Shared.synthesize(Db.prototype, 'name');
/**
* Gets / sets mongodb emulation mode.
* @param {Boolean=} val True to enable, false to disable.
* @returns {*}
*/
Shared.synthesize(Db.prototype, 'mongoEmulation');
/**
* Returns true if ForerunnerDB is running on a client browser.
* @returns {boolean}
*/
Db.prototype.isClient = function () {
return !this._isServer;
};
/**
* Returns true if ForerunnerDB is running on a server.
* @returns {boolean}
*/
Db.prototype.isServer = function () {
return this._isServer;
};
/**
* Returns a checksum of a string.
* @param {String} string The string to checksum.
* @return {String} The checksum generated.
*/
Db.prototype.crc = Crc;
/**
* Checks if the database is running on a client (browser) or
* a server (node.js).
* @returns {Boolean} Returns true if running on a browser.
*/
Db.prototype.isClient = function () {
return !this._isServer;
};
/**
* Checks if the database is running on a client (browser) or
* a server (node.js).
* @returns {Boolean} Returns true if running on a server.
*/
Db.prototype.isServer = function () {
return this._isServer;
};
/**
* Converts a normal javascript array of objects into a DB collection.
* @param {Array} arr An array of objects.
* @returns {Collection} A new collection instance with the data set to the
* array passed.
*/
Db.prototype.arrayToCollection = function (arr) {
return new Collection().setData(arr);
};
/**
* Registers an event listener against an event name.
* @param {String} event The name of the event to listen for.
* @param {Function} listener The listener method to call when
* the event is fired.
* @returns {*}
*/
Db.prototype.on = function(event, listener) {
this._listeners = this._listeners || {};
this._listeners[event] = this._listeners[event] || [];
this._listeners[event].push(listener);
return this;
};
/**
* De-registers an event listener from an event name.
* @param {String} event The name of the event to stop listening for.
* @param {Function} listener The listener method passed to on() when
* registering the event listener.
* @returns {*}
*/
Db.prototype.off = function(event, listener) {
if (event in this._listeners) {
var arr = this._listeners[event],
index = arr.indexOf(listener);
if (index > -1) {
arr.splice(index, 1);
}
}
return this;
};
/**
* Emits an event by name with the given data.
* @param {String} event The name of the event to emit.
* @param {*=} data The data to emit with the event.
* @returns {*}
*/
Db.prototype.emit = function(event, data) {
this._listeners = this._listeners || {};
if (event in this._listeners) {
var arr = this._listeners[event],
arrCount = arr.length,
arrIndex;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arr[arrIndex].apply(this, Array.prototype.slice.call(arguments, 1));
}
}
return this;
};
Db.prototype.peek = function (search) {
var i,
coll,
arr = [],
typeOfSearch = typeof search;
// Loop collections
for (i in this._collection) {
if (this._collection.hasOwnProperty(i)) {
coll = this._collection[i];
if (typeOfSearch === 'string') {
arr = arr.concat(coll.peek(search));
} else {
arr = arr.concat(coll.find(search));
}
}
}
return arr;
};
/**
* Find all documents across all collections in the database that match the passed
* string or search object.
* @param search String or search object.
* @returns {Array}
*/
Db.prototype.peek = function (search) {
var i,
coll,
arr = [],
typeOfSearch = typeof search;
// Loop collections
for (i in this._collection) {
if (this._collection.hasOwnProperty(i)) {
coll = this._collection[i];
if (typeOfSearch === 'string') {
arr = arr.concat(coll.peek(search));
} else {
arr = arr.concat(coll.find(search));
}
}
}
return arr;
};
/**
* Find all documents across all collections in the database that match the passed
* string or search object and return them in an object where each key is the name
* of the collection that the document was matched in.
* @param search String or search object.
* @returns {object}
*/
Db.prototype.peekCat = function (search) {
var i,
coll,
cat = {},
arr,
typeOfSearch = typeof search;
// Loop collections
for (i in this._collection) {
if (this._collection.hasOwnProperty(i)) {
coll = this._collection[i];
if (typeOfSearch === 'string') {
arr = coll.peek(search);
if (arr && arr.length) {
cat[coll.name()] = arr;
}
} else {
arr = coll.find(search);
if (arr && arr.length) {
cat[coll.name()] = arr;
}
}
}
}
return cat;
};
Db.prototype.drop = new Overload({
/**
* Drops the database.
* @func drop
* @memberof Db
*/
'': function () {
if (!this.isDropped()) {
var arr = this.collections(),
arrCount = arr.length,
arrIndex;
this._state = 'dropped';
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
this.collection(arr[arrIndex].name).drop();
delete this._collection[arr[arrIndex].name];
}
this.emit('drop', this);
delete this._core._db[this._name];
}
return true;
},
/**
* Drops the database with optional callback method.
* @func drop
* @memberof Db
* @param {Function} callback Optional callback method.
*/
'function': function (callback) {
if (!this.isDropped()) {
var arr = this.collections(),
arrCount = arr.length,
arrIndex,
finishCount = 0,
afterDrop = function () {
finishCount++;
if (finishCount === arrCount) {
if (callback) { callback(); }
}
};
this._state = 'dropped';
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
this.collection(arr[arrIndex].name).drop(afterDrop);
delete this._collection[arr[arrIndex].name];
}
this.emit('drop', this);
delete this._core._db[this._name];
}
return true;
},
/**
* Drops the database with optional persistent storage drop. Persistent
* storage is dropped by default if no preference is provided.
* @func drop
* @memberof Db
* @param {Boolean} removePersist Drop persistent storage for this database.
*/
'boolean': function (removePersist) {
if (!this.isDropped()) {
var arr = this.collections(),
arrCount = arr.length,
arrIndex;
this._state = 'dropped';
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
this.collection(arr[arrIndex].name).drop(removePersist);
delete this._collection[arr[arrIndex].name];
}
this.emit('drop', this);
delete this._core._db[this._name];
}
return true;
},
/**
* Drops the database and optionally controls dropping persistent storage
* and callback method.
* @func drop
* @memberof Db
* @param {Boolean} removePersist Drop persistent storage for this database.
* @param {Function} callback Optional callback method.
*/
'boolean, function': function (removePersist, callback) {
if (!this.isDropped()) {
var arr = this.collections(),
arrCount = arr.length,
arrIndex,
finishCount = 0,
afterDrop = function () {
finishCount++;
if (finishCount === arrCount) {
if (callback) { callback(); }
}
};
this._state = 'dropped';
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
this.collection(arr[arrIndex].name).drop(removePersist, afterDrop);
delete this._collection[arr[arrIndex].name];
}
this.emit('drop', this);
delete this._core._db[this._name];
}
return true;
}
});
/**
* Gets a database instance by name.
* @memberof Core
* @param {String=} name Optional name of the database. If none is provided
* a random name is assigned.
* @returns {Db}
*/
Core.prototype.db = function (name) {
// Handle being passed an instance
if (name instanceof Db) {
return name;
}
if (!name) {
name = this.objectId();
}
this._db[name] = this._db[name] || new Db(name, this);
this._db[name].mongoEmulation(this.mongoEmulation());
return this._db[name];
};
/**
* Returns an array of databases that ForerunnerDB currently has.
* @memberof Core
* @param {String|RegExp=} search The optional search string or regular expression to use
* to match collection names against.
* @returns {Array} An array of objects containing details of each database
* that ForerunnerDB is currently managing and it's child entities.
*/
Core.prototype.databases = function (search) {
var arr = [],
tmpObj,
addDb,
i;
if (search) {
if (!(search instanceof RegExp)) {
// Turn the search into a regular expression
search = new RegExp(search);
}
}
for (i in this._db) {
if (this._db.hasOwnProperty(i)) {
addDb = true;
if (search) {
if (!search.exec(i)) {
addDb = false;
}
}
if (addDb) {
tmpObj = {
name: i,
children: []
};
if (this.shared.moduleExists('Collection')) {
tmpObj.children.push({
module: 'collection',
moduleName: 'Collections',
count: this._db[i].collections().length
});
}
if (this.shared.moduleExists('CollectionGroup')) {
tmpObj.children.push({
module: 'collectionGroup',
moduleName: 'Collection Groups',
count: this._db[i].collectionGroups().length
});
}
if (this.shared.moduleExists('Document')) {
tmpObj.children.push({
module: 'document',
moduleName: 'Documents',
count: this._db[i].documents().length
});
}
if (this.shared.moduleExists('Grid')) {
tmpObj.children.push({
module: 'grid',
moduleName: 'Grids',
count: this._db[i].grids().length
});
}
if (this.shared.moduleExists('Overview')) {
tmpObj.children.push({
module: 'overview',
moduleName: 'Overviews',
count: this._db[i].overviews().length
});
}
if (this.shared.moduleExists('View')) {
tmpObj.children.push({
module: 'view',
moduleName: 'Views',
count: this._db[i].views().length
});
}
arr.push(tmpObj);
}
}
}
arr.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
return arr;
};
Shared.finishModule('Db');
module.exports = Db;
},{"./Collection.js":5,"./Crc.js":8,"./Metrics.js":16,"./Overload":29,"./Shared":38}],10:[function(_dereq_,module,exports){
"use strict";
// TODO: Remove the _update* methods because we are already mixing them
// TODO: in now via Mixin.Updating and update autobind to extend the _update*
// TODO: methods like we already do with collection
var Shared,
Collection,
Db;
Shared = _dereq_('./Shared');
/**
* Creates a new Document instance. Documents allow you to create individual
* objects that can have standard ForerunnerDB CRUD operations run against
* them, as well as data-binding if the AutoBind module is included in your
* project.
* @name Document
* @class Document
* @constructor
*/
var FdbDocument = function () {
this.init.apply(this, arguments);
};
FdbDocument.prototype.init = function (name) {
this._name = name;
this._data = {};
};
Shared.addModule('Document', FdbDocument);
Shared.mixin(FdbDocument.prototype, 'Mixin.Common');
Shared.mixin(FdbDocument.prototype, 'Mixin.Events');
Shared.mixin(FdbDocument.prototype, 'Mixin.ChainReactor');
Shared.mixin(FdbDocument.prototype, 'Mixin.Constants');
Shared.mixin(FdbDocument.prototype, 'Mixin.Triggers');
Shared.mixin(FdbDocument.prototype, 'Mixin.Matching');
Shared.mixin(FdbDocument.prototype, 'Mixin.Updating');
Shared.mixin(FdbDocument.prototype, 'Mixin.Tags');
Collection = _dereq_('./Collection');
Db = Shared.modules.Db;
/**
* Gets / sets the current state.
* @func state
* @memberof Document
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(FdbDocument.prototype, 'state');
/**
* Gets / sets the db instance this class instance belongs to.
* @func db
* @memberof Document
* @param {Db=} db The db instance.
* @returns {*}
*/
Shared.synthesize(FdbDocument.prototype, 'db');
/**
* Gets / sets the document name.
* @func name
* @memberof Document
* @param {String=} val The name to assign
* @returns {*}
*/
Shared.synthesize(FdbDocument.prototype, 'name');
/**
* Sets the data for the document.
* @func setData
* @memberof Document
* @param data
* @param options
* @returns {Document}
*/
FdbDocument.prototype.setData = function (data, options) {
var i,
$unset;
if (data) {
options = options || {
$decouple: true
};
if (options && options.$decouple === true) {
data = this.decouple(data);
}
if (this._linked) {
$unset = {};
// Remove keys that don't exist in the new data from the current object
for (i in this._data) {
if (i.substr(0, 6) !== 'jQuery' && this._data.hasOwnProperty(i)) {
// Check if existing data has key
if (data[i] === undefined) {
// Add property name to those to unset
$unset[i] = 1;
}
}
}
data.$unset = $unset;
// Now update the object with new data
this.updateObject(this._data, data, {});
} else {
// Straight data assignment
this._data = data;
}
this.deferEmit('change', {type: 'setData', data: this.decouple(this._data)});
}
return this;
};
/**
* Gets the document's data returned as a single object.
* @func find
* @memberof Document
* @param {Object} query The query object - currently unused, just
* provide a blank object e.g. {}
* @param {Object=} options An options object.
* @returns {Object} The document's data object.
*/
FdbDocument.prototype.find = function (query, options) {
var result;
if (options && options.$decouple === false) {
result = this._data;
} else {
result = this.decouple(this._data);
}
return result;
};
/**
* Modifies the document. This will update the document with the data held in 'update'.
* @func update
* @memberof Document
* @param {Object} query The query that must be matched for a document to be
* operated on.
* @param {Object} update The object containing updated key/values. Any keys that
* match keys on the existing document will be overwritten with this data. Any
* keys that do not currently exist on the document will be added to the document.
* @param {Object=} options An options object.
* @returns {Array} The items that were updated.
*/
FdbDocument.prototype.update = function (query, update, options) {
var result = this.updateObject(this._data, update, query, options);
if (result) {
this.deferEmit('change', {type: 'update', data: this.decouple(this._data)});
}
};
/**
* Internal method for document updating.
* @func updateObject
* @memberof Document
* @param {Object} doc The document to update.
* @param {Object} update The object with key/value pairs to update the document with.
* @param {Object} query The query object that we need to match to perform an update.
* @param {Object} options An options object.
* @param {String} path The current recursive path.
* @param {String} opType The type of update operation to perform, if none is specified
* default is to set new data against matching fields.
* @returns {Boolean} True if the document was updated with new / changed data or
* false if it was not updated because the data was the same.
* @private
*/
FdbDocument.prototype.updateObject = Collection.prototype.updateObject;
/**
* Determines if the passed key has an array positional mark (a dollar at the end
* of its name).
* @func _isPositionalKey
* @memberof Document
* @param {String} key The key to check.
* @returns {Boolean} True if it is a positional or false if not.
* @private
*/
FdbDocument.prototype._isPositionalKey = function (key) {
return key.substr(key.length - 2, 2) === '.$';
};
/**
* Updates a property on an object depending on if the collection is
* currently running data-binding or not.
* @func _updateProperty
* @memberof Document
* @param {Object} doc The object whose property is to be updated.
* @param {String} prop The property to update.
* @param {*} val The new value of the property.
* @private
*/
FdbDocument.prototype._updateProperty = function (doc, prop, val) {
if (this._linked) {
window.jQuery.observable(doc).setProperty(prop, val);
if (this.debug()) {
console.log(this.logIdentifier() + ' Setting data-bound document property "' + prop + '"');
}
} else {
doc[prop] = val;
if (this.debug()) {
console.log(this.logIdentifier() + ' Setting non-data-bound document property "' + prop + '"');
}
}
};
/**
* Increments a value for a property on a document by the passed number.
* @func _updateIncrement
* @memberof Document
* @param {Object} doc The document to modify.
* @param {String} prop The property to modify.
* @param {Number} val The amount to increment by.
* @private
*/
FdbDocument.prototype._updateIncrement = function (doc, prop, val) {
if (this._linked) {
window.jQuery.observable(doc).setProperty(prop, doc[prop] + val);
} else {
doc[prop] += val;
}
};
/**
* Changes the index of an item in the passed array.
* @func _updateSpliceMove
* @memberof Document
* @param {Array} arr The array to modify.
* @param {Number} indexFrom The index to move the item from.
* @param {Number} indexTo The index to move the item to.
* @private
*/
FdbDocument.prototype._updateSpliceMove = function (arr, indexFrom, indexTo) {
if (this._linked) {
window.jQuery.observable(arr).move(indexFrom, indexTo);
if (this.debug()) {
console.log(this.logIdentifier() + ' Moving data-bound document array index from "' + indexFrom + '" to "' + indexTo + '"');
}
} else {
arr.splice(indexTo, 0, arr.splice(indexFrom, 1)[0]);
if (this.debug()) {
console.log(this.logIdentifier() + ' Moving non-data-bound document array index from "' + indexFrom + '" to "' + indexTo + '"');
}
}
};
/**
* Inserts an item into the passed array at the specified index.
* @func _updateSplicePush
* @memberof Document
* @param {Array} arr The array to insert into.
* @param {Number} index The index to insert at.
* @param {Object} doc The document to insert.
* @private
*/
FdbDocument.prototype._updateSplicePush = function (arr, index, doc) {
if (arr.length > index) {
if (this._linked) {
window.jQuery.observable(arr).insert(index, doc);
} else {
arr.splice(index, 0, doc);
}
} else {
if (this._linked) {
window.jQuery.observable(arr).insert(doc);
} else {
arr.push(doc);
}
}
};
/**
* Inserts an item at the end of an array.
* @func _updatePush
* @memberof Document
* @param {Array} arr The array to insert the item into.
* @param {Object} doc The document to insert.
* @private
*/
FdbDocument.prototype._updatePush = function (arr, doc) {
if (this._linked) {
window.jQuery.observable(arr).insert(doc);
} else {
arr.push(doc);
}
};
/**
* Removes an item from the passed array.
* @func _updatePull
* @memberof Document
* @param {Array} arr The array to modify.
* @param {Number} index The index of the item in the array to remove.
* @private
*/
FdbDocument.prototype._updatePull = function (arr, index) {
if (this._linked) {
window.jQuery.observable(arr).remove(index);
} else {
arr.splice(index, 1);
}
};
/**
* Multiplies a value for a property on a document by the passed number.
* @func _updateMultiply
* @memberof Document
* @param {Object} doc The document to modify.
* @param {String} prop The property to modify.
* @param {Number} val The amount to multiply by.
* @private
*/
FdbDocument.prototype._updateMultiply = function (doc, prop, val) {
if (this._linked) {
window.jQuery.observable(doc).setProperty(prop, doc[prop] * val);
} else {
doc[prop] *= val;
}
};
/**
* Renames a property on a document to the passed property.
* @func _updateRename
* @memberof Document
* @param {Object} doc The document to modify.
* @param {String} prop The property to rename.
* @param {Number} val The new property name.
* @private
*/
FdbDocument.prototype._updateRename = function (doc, prop, val) {
var existingVal = doc[prop];
if (this._linked) {
window.jQuery.observable(doc).setProperty(val, existingVal);
window.jQuery.observable(doc).removeProperty(prop);
} else {
doc[val] = existingVal;
delete doc[prop];
}
};
/**
* Deletes a property on a document.
* @func _updateUnset
* @memberof Document
* @param {Object} doc The document to modify.
* @param {String} prop The property to delete.
* @private
*/
FdbDocument.prototype._updateUnset = function (doc, prop) {
if (this._linked) {
window.jQuery.observable(doc).removeProperty(prop);
} else {
delete doc[prop];
}
};
/**
* Drops the document.
* @func drop
* @memberof Document
* @returns {boolean} True if successful, false if not.
*/
FdbDocument.prototype.drop = function (callback) {
if (!this.isDropped()) {
if (this._db && this._name) {
if (this._db && this._db._document && this._db._document[this._name]) {
this._state = 'dropped';
delete this._db._document[this._name];
delete this._data;
this.emit('drop', this);
if (callback) { callback(false, true); }
return true;
}
}
} else {
return true;
}
return false;
};
/**
* Creates a new document instance.
* @func document
* @memberof Db
* @param {String} documentName The name of the document to create.
* @returns {*}
*/
Db.prototype.document = function (documentName) {
if (documentName) {
// Handle being passed an instance
if (documentName instanceof FdbDocument) {
if (documentName.state() !== 'droppped') {
return documentName;
} else {
documentName = documentName.name();
}
}
this._document = this._document || {};
this._document[documentName] = this._document[documentName] || new FdbDocument(documentName).db(this);
return this._document[documentName];
} else {
// Return an object of document data
return this._document;
}
};
/**
* Returns an array of documents the DB currently has.
* @func documents
* @memberof Db
* @returns {Array} An array of objects containing details of each document
* the database is currently managing.
*/
Db.prototype.documents = function () {
var arr = [],
item,
i;
for (i in this._document) {
if (this._document.hasOwnProperty(i)) {
item = this._document[i];
arr.push({
name: i,
linked: item.isLinked !== undefined ? item.isLinked() : false
});
}
}
return arr;
};
Shared.finishModule('Document');
module.exports = FdbDocument;
},{"./Collection":5,"./Shared":38}],11:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Db,
Collection,
CollectionGroup,
View,
CollectionInit,
DbInit,
ReactorIO;
//Shared = ForerunnerDB.shared;
Shared = _dereq_('./Shared');
/**
* Creates a new grid instance.
* @name Grid
* @class Grid
* @param {String} selector jQuery selector.
* @param {String} template The template selector.
* @param {Object=} options The options object to apply to the grid.
* @constructor
*/
var Grid = function (selector, template, options) {
this.init.apply(this, arguments);
};
Grid.prototype.init = function (selector, template, options) {
var self = this;
this._selector = selector;
this._template = template;
this._options = options || {};
this._debug = {};
this._id = this.objectId();
this._collectionDroppedWrap = function () {
self._collectionDropped.apply(self, arguments);
};
};
Shared.addModule('Grid', Grid);
Shared.mixin(Grid.prototype, 'Mixin.Common');
Shared.mixin(Grid.prototype, 'Mixin.ChainReactor');
Shared.mixin(Grid.prototype, 'Mixin.Constants');
Shared.mixin(Grid.prototype, 'Mixin.Triggers');
Shared.mixin(Grid.prototype, 'Mixin.Events');
Shared.mixin(Grid.prototype, 'Mixin.Tags');
Collection = _dereq_('./Collection');
CollectionGroup = _dereq_('./CollectionGroup');
View = _dereq_('./View');
ReactorIO = _dereq_('./ReactorIO');
CollectionInit = Collection.prototype.init;
Db = Shared.modules.Db;
DbInit = Db.prototype.init;
/**
* Gets / sets the current state.
* @func state
* @memberof Grid
* @param {String=} val The name of the state to set.
* @returns {Grid}
*/
Shared.synthesize(Grid.prototype, 'state');
/**
* Gets / sets the current name.
* @func name
* @memberof Grid
* @param {String=} val The name to set.
* @returns {Grid}
*/
Shared.synthesize(Grid.prototype, 'name');
/**
* Executes an insert against the grid's underlying data-source.
* @func insert
* @memberof Grid
*/
Grid.prototype.insert = function () {
this._from.insert.apply(this._from, arguments);
};
/**
* Executes an update against the grid's underlying data-source.
* @func update
* @memberof Grid
*/
Grid.prototype.update = function () {
this._from.update.apply(this._from, arguments);
};
/**
* Executes an updateById against the grid's underlying data-source.
* @func updateById
* @memberof Grid
*/
Grid.prototype.updateById = function () {
this._from.updateById.apply(this._from, arguments);
};
/**
* Executes a remove against the grid's underlying data-source.
* @func remove
* @memberof Grid
*/
Grid.prototype.remove = function () {
this._from.remove.apply(this._from, arguments);
};
/**
* Sets the collection from which the grid will assemble its data.
* @func from
* @memberof Grid
* @param {Collection} collection The collection to use to assemble grid data.
* @returns {Grid}
*/
Grid.prototype.from = function (collection) {
//var self = this;
if (collection !== undefined) {
// Check if we have an existing from
if (this._from) {
// Remove the listener to the drop event
this._from.off('drop', this._collectionDroppedWrap);
this._from._removeGrid(this);
}
if (typeof(collection) === 'string') {
collection = this._db.collection(collection);
}
this._from = collection;
this._from.on('drop', this._collectionDroppedWrap);
this.refresh();
}
return this;
};
/**
* Gets / sets the db instance this class instance belongs to.
* @func db
* @memberof Grid
* @param {Db=} db The db instance.
* @returns {*}
*/
Shared.synthesize(Grid.prototype, 'db', function (db) {
if (db) {
// Apply the same debug settings
this.debug(db.debug());
}
return this.$super.apply(this, arguments);
});
Grid.prototype._collectionDropped = function (collection) {
if (collection) {
// Collection was dropped, remove from grid
delete this._from;
}
};
/**
* Drops a grid and all it's stored data from the database.
* @func drop
* @memberof Grid
* @returns {boolean} True on success, false on failure.
*/
Grid.prototype.drop = function (callback) {
if (!this.isDropped()) {
if (this._from) {
// Remove data-binding
this._from.unlink(this._selector, this.template());
// Kill listeners and references
this._from.off('drop', this._collectionDroppedWrap);
this._from._removeGrid(this);
if (this.debug() || (this._db && this._db.debug())) {
console.log(this.logIdentifier() + ' Dropping grid ' + this._selector);
}
this._state = 'dropped';
if (this._db && this._selector) {
delete this._db._grid[this._selector];
}
this.emit('drop', this);
if (callback) { callback(false, true); }
delete this._selector;
delete this._template;
delete this._from;
delete this._db;
return true;
}
} else {
return true;
}
return false;
};
/**
* Gets / sets the grid's HTML template to use when rendering.
* @func template
* @memberof Grid
* @param {Selector} template The template's jQuery selector.
* @returns {*}
*/
Grid.prototype.template = function (template) {
if (template !== undefined) {
this._template = template;
return this;
}
return this._template;
};
Grid.prototype._sortGridClick = function (e) {
var elem = window.jQuery(e.currentTarget),
sortColText = elem.attr('data-grid-sort') || '',
sortColDir = parseInt((elem.attr('data-grid-dir') || "-1"), 10) === -1 ? 1 : -1,
sortCols = sortColText.split(','),
sortObj = {},
i;
// Remove all grid sort tags from the grid
window.jQuery(this._selector).find('[data-grid-dir]').removeAttr('data-grid-dir');
// Flip the sort direction
elem.attr('data-grid-dir', sortColDir);
for (i = 0; i < sortCols.length; i++) {
sortObj[sortCols] = sortColDir;
}
Shared.mixin(sortObj, this._options.$orderBy);
this._from.orderBy(sortObj);
this.emit('sort', sortObj);
};
/**
* Refreshes the grid data such as ordering etc.
* @func refresh
* @memberof Grid
*/
Grid.prototype.refresh = function () {
if (this._from) {
if (this._from.link) {
var self = this,
elem = window.jQuery(this._selector),
sortClickListener = function () {
self._sortGridClick.apply(self, arguments);
};
// Clear the container
elem.html('');
if (self._from.orderBy) {
// Remove listeners
elem.off('click', '[data-grid-sort]', sortClickListener);
}
if (self._from.query) {
// Remove listeners
elem.off('click', '[data-grid-filter]', sortClickListener );
}
// Set wrap name if none is provided
self._options.$wrap = self._options.$wrap || 'gridRow';
// Auto-bind the data to the grid template
self._from.link(self._selector, self.template(), self._options);
// Check if the data source (collection or view) has an
// orderBy method (usually only views) and if so activate
// the sorting system
if (self._from.orderBy) {
// Listen for sort requests
elem.on('click', '[data-grid-sort]', sortClickListener);
}
if (self._from.query) {
// Listen for filter requests
var queryObj = {};
elem.find('[data-grid-filter]').each(function (index, filterElem) {
filterElem = window.jQuery(filterElem);
var filterField = filterElem.attr('data-grid-filter'),
filterVarType = filterElem.attr('data-grid-vartype'),
filterSort = {},
title = filterElem.html(),
dropDownButton,
dropDownMenu,
template,
filterQuery,
filterView = self._db.view('tmpGridFilter_' + self._id + '_' + filterField);
filterSort[filterField] = 1;
filterQuery = {
$distinct: filterSort
};
filterView
.query(filterQuery)
.orderBy(filterSort)
.from(self._from._from);
template = [
'<div class="dropdown" id="' + self._id + '_' + filterField + '">',
'<button class="btn btn-default dropdown-toggle" type="button" id="' + self._id + '_' + filterField + '_dropdownButton" data-toggle="dropdown" aria-expanded="true">',
title + ' <span class="caret"></span>',
'</button>',
'</div>'
];
dropDownButton = window.jQuery(template.join(''));
dropDownMenu = window.jQuery('<ul class="dropdown-menu" role="menu" id="' + self._id + '_' + filterField + '_dropdownMenu"></ul>');
dropDownButton.append(dropDownMenu);
filterElem.html(dropDownButton);
// Data-link the underlying data to the grid filter drop-down
filterView.link(dropDownMenu, {
template: [
'<li role="presentation" class="input-group" style="width: 240px; padding-left: 10px; padding-right: 10px; padding-top: 5px;">',
'<input type="search" class="form-control gridFilterSearch" placeholder="Search...">',
'<span class="input-group-btn">',
'<button class="btn btn-default gridFilterClearSearch" type="button"><span class="glyphicon glyphicon-remove-circle glyphicons glyphicons-remove"></span></button>',
'</span>',
'</li>',
'<li role="presentation" class="divider"></li>',
'<li role="presentation" data-val="$all">',
'<a role="menuitem" tabindex="-1">',
'<input type="checkbox" checked> All',
'</a>',
'</li>',
'<li role="presentation" class="divider"></li>',
'{^{for options}}',
'<li role="presentation" data-link="data-val{:' + filterField + '}">',
'<a role="menuitem" tabindex="-1">',
'<input type="checkbox"> {^{:' + filterField + '}}',
'</a>',
'</li>',
'{{/for}}'
].join('')
}, {
$wrap: 'options'
});
elem.on('keyup', '#' + self._id + '_' + filterField + '_dropdownMenu .gridFilterSearch', function (e) {
var elem = window.jQuery(this),
query = filterView.query(),
search = elem.val();
if (search) {
query[filterField] = new RegExp(search, 'gi');
} else {
delete query[filterField];
}
filterView.query(query);
});
elem.on('click', '#' + self._id + '_' + filterField + '_dropdownMenu .gridFilterClearSearch', function (e) {
// Clear search text box
window.jQuery(this).parents('li').find('.gridFilterSearch').val('');
// Clear view query
var query = filterView.query();
delete query[filterField];
filterView.query(query);
});
elem.on('click', '#' + self._id + '_' + filterField + '_dropdownMenu li', function (e) {
e.stopPropagation();
var fieldValue,
elem = $(this),
checkbox = elem.find('input[type="checkbox"]'),
checked,
addMode = true,
fieldInArr,
liElem,
i;
// If the checkbox is not the one clicked on
if (!window.jQuery(e.target).is('input')) {
// Set checkbox to opposite of current value
checkbox.prop('checked', !checkbox.prop('checked'));
checked = checkbox.is(':checked');
} else {
checkbox.prop('checked', checkbox.prop('checked'));
checked = checkbox.is(':checked');
}
liElem = window.jQuery(this);
fieldValue = liElem.attr('data-val');
// Check if the selection is the "all" option
if (fieldValue === '$all') {
// Remove the field from the query
delete queryObj[filterField];
// Clear all other checkboxes
liElem.parent().find('li[data-val!="$all"]').find('input[type="checkbox"]').prop('checked', false);
} else {
// Clear the "all" checkbox
liElem.parent().find('[data-val="$all"]').find('input[type="checkbox"]').prop('checked', false);
// Check if the type needs casting
switch (filterVarType) {
case 'integer':
fieldValue = parseInt(fieldValue, 10);
break;
case 'float':
fieldValue = parseFloat(fieldValue);
break;
default:
}
// Check if the item exists already
queryObj[filterField] = queryObj[filterField] || {
$in: []
};
fieldInArr = queryObj[filterField].$in;
for (i = 0; i < fieldInArr.length; i++) {
if (fieldInArr[i] === fieldValue) {
// Item already exists
if (checked === false) {
// Remove the item
fieldInArr.splice(i, 1);
}
addMode = false;
break;
}
}
if (addMode && checked) {
fieldInArr.push(fieldValue);
}
if (!fieldInArr.length) {
// Remove the field from the query
delete queryObj[filterField];
}
}
// Set the view query
self._from.queryData(queryObj);
if (self._from.pageFirst) {
self._from.pageFirst();
}
});
});
}
self.emit('refresh');
} else {
throw('Grid requires the AutoBind module in order to operate!');
}
}
return this;
};
/**
* Returns the number of documents currently in the grid.
* @func count
* @memberof Grid
* @returns {Number}
*/
Grid.prototype.count = function () {
return this._from.count();
};
/**
* Creates a grid and assigns the collection as its data source.
* @func grid
* @memberof Collection
* @param {String} selector jQuery selector of grid output target.
* @param {String} template The table template to use when rendering the grid.
* @param {Object=} options The options object to apply to the grid.
* @returns {*}
*/
Collection.prototype.grid = View.prototype.grid = function (selector, template, options) {
if (this._db && this._db._grid ) {
if (selector !== undefined) {
if (template !== undefined) {
if (!this._db._grid[selector]) {
var grid = new Grid(selector, template, options)
.db(this._db)
.from(this);
this._grid = this._grid || [];
this._grid.push(grid);
this._db._grid[selector] = grid;
return grid;
} else {
throw(this.logIdentifier() + ' Cannot create a grid because a grid with this name already exists: ' + selector);
}
}
return this._db._grid[selector];
}
return this._db._grid;
}
};
/**
* Removes a grid safely from the DOM. Must be called when grid is
* no longer required / is being removed from DOM otherwise references
* will stick around and cause memory leaks.
* @func unGrid
* @memberof Collection
* @param {String} selector jQuery selector of grid output target.
* @param {String} template The table template to use when rendering the grid.
* @param {Object=} options The options object to apply to the grid.
* @returns {*}
*/
Collection.prototype.unGrid = View.prototype.unGrid = function (selector, template, options) {
var i,
grid;
if (this._db && this._db._grid ) {
if (selector && template) {
if (this._db._grid[selector]) {
grid = this._db._grid[selector];
delete this._db._grid[selector];
return grid.drop();
} else {
throw(this.logIdentifier() + ' Cannot remove grid because a grid with this name does not exist: ' + name);
}
} else {
// No parameters passed, remove all grids from this module
for (i in this._db._grid) {
if (this._db._grid.hasOwnProperty(i)) {
grid = this._db._grid[i];
delete this._db._grid[i];
grid.drop();
if (this.debug()) {
console.log(this.logIdentifier() + ' Removed grid binding "' + i + '"');
}
}
}
this._db._grid = {};
}
}
};
/**
* Adds a grid to the internal grid lookup.
* @func _addGrid
* @memberof Collection
* @param {Grid} grid The grid to add.
* @returns {Collection}
* @private
*/
Collection.prototype._addGrid = CollectionGroup.prototype._addGrid = View.prototype._addGrid = function (grid) {
if (grid !== undefined) {
this._grid = this._grid || [];
this._grid.push(grid);
}
return this;
};
/**
* Removes a grid from the internal grid lookup.
* @func _removeGrid
* @memberof Collection
* @param {Grid} grid The grid to remove.
* @returns {Collection}
* @private
*/
Collection.prototype._removeGrid = CollectionGroup.prototype._removeGrid = View.prototype._removeGrid = function (grid) {
if (grid !== undefined && this._grid) {
var index = this._grid.indexOf(grid);
if (index > -1) {
this._grid.splice(index, 1);
}
}
return this;
};
// Extend DB with grids init
Db.prototype.init = function () {
this._grid = {};
DbInit.apply(this, arguments);
};
/**
* Determine if a grid with the passed name already exists.
* @func gridExists
* @memberof Db
* @param {String} selector The jQuery selector to bind the grid to.
* @returns {boolean}
*/
Db.prototype.gridExists = function (selector) {
return Boolean(this._grid[selector]);
};
/**
* Creates a grid based on the passed arguments.
* @func grid
* @memberof Db
* @param {String} selector The jQuery selector of the grid to retrieve.
* @param {String} template The table template to use when rendering the grid.
* @param {Object=} options The options object to apply to the grid.
* @returns {*}
*/
Db.prototype.grid = function (selector, template, options) {
if (!this._grid[selector]) {
if (this.debug() || (this._db && this._db.debug())) {
console.log(this.logIdentifier() + ' Creating grid ' + selector);
}
}
this._grid[selector] = this._grid[selector] || new Grid(selector, template, options).db(this);
return this._grid[selector];
};
/**
* Removes a grid based on the passed arguments.
* @func unGrid
* @memberof Db
* @param {String} selector The jQuery selector of the grid to retrieve.
* @param {String} template The table template to use when rendering the grid.
* @param {Object=} options The options object to apply to the grid.
* @returns {*}
*/
Db.prototype.unGrid = function (selector, template, options) {
if (!this._grid[selector]) {
if (this.debug() || (this._db && this._db.debug())) {
console.log(this.logIdentifier() + ' Creating grid ' + selector);
}
}
this._grid[selector] = this._grid[selector] || new Grid(selector, template, options).db(this);
return this._grid[selector];
};
/**
* Returns an array of grids the DB currently has.
* @func grids
* @memberof Db
* @returns {Array} An array of objects containing details of each grid
* the database is currently managing.
*/
Db.prototype.grids = function () {
var arr = [],
item,
i;
for (i in this._grid) {
if (this._grid.hasOwnProperty(i)) {
item = this._grid[i];
arr.push({
name: i,
count: item.count(),
linked: item.isLinked !== undefined ? item.isLinked() : false
});
}
}
return arr;
};
Shared.finishModule('Grid');
module.exports = Grid;
},{"./Collection":5,"./CollectionGroup":6,"./ReactorIO":35,"./Shared":38,"./View":40}],12:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Collection,
CollectionInit,
Overload;
Shared = _dereq_('./Shared');
Overload = _dereq_('./Overload');
/**
* The constructor.
*
* @constructor
*/
var Highchart = function (collection, options) {
this.init.apply(this, arguments);
};
Highchart.prototype.init = function (collection, options) {
this._options = options;
this._selector = window.jQuery(this._options.selector);
if (!this._selector[0]) {
throw(this.classIdentifier() + ' "' + collection.name() + '": Chart target element does not exist via selector: ' + this._options.selector);
}
this._listeners = {};
this._collection = collection;
// Setup the chart
this._options.series = [];
// Disable attribution on highcharts
options.chartOptions = options.chartOptions || {};
options.chartOptions.credits = false;
// Set the data for the chart
var data,
seriesObj,
chartData;
switch (this._options.type) {
case 'pie':
// Create chart from data
this._selector.highcharts(this._options.chartOptions);
this._chart = this._selector.highcharts();
// Generate graph data from collection data
data = this._collection.find();
seriesObj = {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {y} ({point.percentage:.0f}%)',
style: {
color: (window.Highcharts.theme && window.Highcharts.theme.contrastTextColor) || 'black'
}
}
};
chartData = this.pieDataFromCollectionData(data, this._options.keyField, this._options.valField);
window.jQuery.extend(seriesObj, this._options.seriesOptions);
window.jQuery.extend(seriesObj, {
name: this._options.seriesName,
data: chartData
});
this._chart.addSeries(seriesObj, true, true);
break;
case 'line':
case 'area':
case 'column':
case 'bar':
// Generate graph data from collection data
chartData = this.seriesDataFromCollectionData(
this._options.seriesField,
this._options.keyField,
this._options.valField,
this._options.orderBy
);
this._options.chartOptions.xAxis = chartData.xAxis;
this._options.chartOptions.series = chartData.series;
this._selector.highcharts(this._options.chartOptions);
this._chart = this._selector.highcharts();
break;
default:
throw(this.classIdentifier() + ' "' + collection.name() + '": Chart type specified is not currently supported by ForerunnerDB: ' + this._options.type);
}
// Hook the collection events to auto-update the chart
this._hookEvents();
};
Shared.addModule('Highchart', Highchart);
Collection = Shared.modules.Collection;
CollectionInit = Collection.prototype.init;
Shared.mixin(Highchart.prototype, 'Mixin.Common');
Shared.mixin(Highchart.prototype, 'Mixin.Events');
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(Highchart.prototype, 'state');
/**
* Generate pie-chart series data from the given collection data array.
* @param data
* @param keyField
* @param valField
* @returns {Array}
*/
Highchart.prototype.pieDataFromCollectionData = function (data, keyField, valField) {
var graphData = [],
i;
for (i = 0; i < data.length; i++) {
graphData.push([data[i][keyField], data[i][valField]]);
}
return graphData;
};
/**
* Generate line-chart series data from the given collection data array.
* @param seriesField
* @param keyField
* @param valField
* @param orderBy
*/
Highchart.prototype.seriesDataFromCollectionData = function (seriesField, keyField, valField, orderBy) {
var data = this._collection.distinct(seriesField),
seriesData = [],
xAxis = {
categories: []
},
seriesName,
query,
dataSearch,
seriesValues,
i, k;
// What we WANT to output:
/*series: [{
name: 'Responses',
data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
}]*/
// Loop keys
for (i = 0; i < data.length; i++) {
seriesName = data[i];
query = {};
query[seriesField] = seriesName;
seriesValues = [];
dataSearch = this._collection.find(query, {
orderBy: orderBy
});
// Loop the keySearch data and grab the value for each item
for (k = 0; k < dataSearch.length; k++) {
xAxis.categories.push(dataSearch[k][keyField]);
seriesValues.push(dataSearch[k][valField]);
}
seriesData.push({
name: seriesName,
data: seriesValues
});
}
return {
xAxis: xAxis,
series: seriesData
};
};
/**
* Hook the events the chart needs to know about from the internal collection.
* @private
*/
Highchart.prototype._hookEvents = function () {
var self = this;
self._collection.on('change', function () { self._changeListener.apply(self, arguments); });
// If the collection is dropped, clean up after ourselves
self._collection.on('drop', function () { self.drop.apply(self); });
};
/**
* Handles changes to the collection data that the chart is reading from and then
* updates the data in the chart display.
* @private
*/
Highchart.prototype._changeListener = function () {
var self = this;
// Update the series data on the chart
if(typeof self._collection !== 'undefined' && self._chart) {
var data = self._collection.find(),
i;
switch (self._options.type) {
case 'pie':
self._chart.series[0].setData(
self.pieDataFromCollectionData(
data,
self._options.keyField,
self._options.valField
),
true,
true
);
break;
case 'bar':
case 'line':
case 'area':
case 'column':
var seriesData = self.seriesDataFromCollectionData(
self._options.seriesField,
self._options.keyField,
self._options.valField,
self._options.orderBy
);
self._chart.xAxis[0].setCategories(
seriesData.xAxis.categories
);
for (i = 0; i < seriesData.series.length; i++) {
if (self._chart.series[i]) {
// Series exists, set it's data
self._chart.series[i].setData(
seriesData.series[i].data,
true,
true
);
} else {
// Series data does not yet exist, add a new series
self._chart.addSeries(
seriesData.series[i],
true,
true
);
}
}
break;
default:
break;
}
}
};
/**
* Destroys the chart and all internal references.
* @returns {Boolean}
*/
Highchart.prototype.drop = function (callback) {
if (!this.isDropped()) {
this._state = 'dropped';
if (this._chart) {
this._chart.destroy();
}
if (this._collection) {
this._collection.off('change', this._changeListener);
this._collection.off('drop', this.drop);
if (this._collection._highcharts) {
delete this._collection._highcharts[this._options.selector];
}
}
delete this._chart;
delete this._options;
delete this._collection;
this.emit('drop', this);
if (callback) { callback(false, true); }
return true;
} else {
return true;
}
};
// Extend collection with highchart init
Collection.prototype.init = function () {
this._highcharts = {};
CollectionInit.apply(this, arguments);
};
/**
* Creates a pie chart from the collection.
* @type {Overload}
*/
Collection.prototype.pieChart = new Overload({
/**
* Chart via options object.
* @func pieChart
* @memberof Highchart
* @param {Object} options The options object.
* @returns {*}
*/
'object': function (options) {
options.type = 'pie';
options.chartOptions = options.chartOptions || {};
options.chartOptions.chart = options.chartOptions.chart || {};
options.chartOptions.chart.type = 'pie';
if (!this._highcharts[options.selector]) {
// Store new chart in charts array
this._highcharts[options.selector] = new Highchart(this, options);
}
return this._highcharts[options.selector];
},
/**
* Chart via defined params and an options object.
* @func pieChart
* @memberof Highchart
* @param {String|jQuery} selector The element to render the chart to.
* @param {String} keyField The field to use as the data key.
* @param {String} valField The field to use as the data value.
* @param {String} seriesName The name of the series to display on the chart.
* @param {Object} options The options object.
*/
'*, string, string, string, ...': function (selector, keyField, valField, seriesName, options) {
options = options || {};
options.selector = selector;
options.keyField = keyField;
options.valField = valField;
options.seriesName = seriesName;
// Call the main chart method
this.pieChart(options);
}
});
/**
* Creates a line chart from the collection.
* @type {Overload}
*/
Collection.prototype.lineChart = new Overload({
/**
* Chart via options object.
* @func lineChart
* @memberof Highchart
* @param {Object} options The options object.
* @returns {*}
*/
'object': function (options) {
options.type = 'line';
options.chartOptions = options.chartOptions || {};
options.chartOptions.chart = options.chartOptions.chart || {};
options.chartOptions.chart.type = 'line';
if (!this._highcharts[options.selector]) {
// Store new chart in charts array
this._highcharts[options.selector] = new Highchart(this, options);
}
return this._highcharts[options.selector];
},
/**
* Chart via defined params and an options object.
* @func lineChart
* @memberof Highchart
* @param {String|jQuery} selector The element to render the chart to.
* @param {String} seriesField The name of the series to plot.
* @param {String} keyField The field to use as the data key.
* @param {String} valField The field to use as the data value.
* @param {Object} options The options object.
*/
'*, string, string, string, ...': function (selector, seriesField, keyField, valField, options) {
options = options || {};
options.seriesField = seriesField;
options.selector = selector;
options.keyField = keyField;
options.valField = valField;
// Call the main chart method
this.lineChart(options);
}
});
/**
* Creates an area chart from the collection.
* @type {Overload}
*/
Collection.prototype.areaChart = new Overload({
/**
* Chart via options object.
* @func areaChart
* @memberof Highchart
* @param {Object} options The options object.
* @returns {*}
*/
'object': function (options) {
options.type = 'area';
options.chartOptions = options.chartOptions || {};
options.chartOptions.chart = options.chartOptions.chart || {};
options.chartOptions.chart.type = 'area';
if (!this._highcharts[options.selector]) {
// Store new chart in charts array
this._highcharts[options.selector] = new Highchart(this, options);
}
return this._highcharts[options.selector];
},
/**
* Chart via defined params and an options object.
* @func areaChart
* @memberof Highchart
* @param {String|jQuery} selector The element to render the chart to.
* @param {String} seriesField The name of the series to plot.
* @param {String} keyField The field to use as the data key.
* @param {String} valField The field to use as the data value.
* @param {Object} options The options object.
*/
'*, string, string, string, ...': function (selector, seriesField, keyField, valField, options) {
options = options || {};
options.seriesField = seriesField;
options.selector = selector;
options.keyField = keyField;
options.valField = valField;
// Call the main chart method
this.areaChart(options);
}
});
/**
* Creates a column chart from the collection.
* @type {Overload}
*/
Collection.prototype.columnChart = new Overload({
/**
* Chart via options object.
* @func columnChart
* @memberof Highchart
* @param {Object} options The options object.
* @returns {*}
*/
'object': function (options) {
options.type = 'column';
options.chartOptions = options.chartOptions || {};
options.chartOptions.chart = options.chartOptions.chart || {};
options.chartOptions.chart.type = 'column';
if (!this._highcharts[options.selector]) {
// Store new chart in charts array
this._highcharts[options.selector] = new Highchart(this, options);
}
return this._highcharts[options.selector];
},
/**
* Chart via defined params and an options object.
* @func columnChart
* @memberof Highchart
* @param {String|jQuery} selector The element to render the chart to.
* @param {String} seriesField The name of the series to plot.
* @param {String} keyField The field to use as the data key.
* @param {String} valField The field to use as the data value.
* @param {Object} options The options object.
*/
'*, string, string, string, ...': function (selector, seriesField, keyField, valField, options) {
options = options || {};
options.seriesField = seriesField;
options.selector = selector;
options.keyField = keyField;
options.valField = valField;
// Call the main chart method
this.columnChart(options);
}
});
/**
* Creates a bar chart from the collection.
* @type {Overload}
*/
Collection.prototype.barChart = new Overload({
/**
* Chart via options object.
* @func barChart
* @memberof Highchart
* @param {Object} options The options object.
* @returns {*}
*/
'object': function (options) {
options.type = 'bar';
options.chartOptions = options.chartOptions || {};
options.chartOptions.chart = options.chartOptions.chart || {};
options.chartOptions.chart.type = 'bar';
if (!this._highcharts[options.selector]) {
// Store new chart in charts array
this._highcharts[options.selector] = new Highchart(this, options);
}
return this._highcharts[options.selector];
},
/**
* Chart via defined params and an options object.
* @func barChart
* @memberof Highchart
* @param {String|jQuery} selector The element to render the chart to.
* @param {String} seriesField The name of the series to plot.
* @param {String} keyField The field to use as the data key.
* @param {String} valField The field to use as the data value.
* @param {Object} options The options object.
*/
'*, string, string, string, ...': function (selector, seriesField, keyField, valField, options) {
options = options || {};
options.seriesField = seriesField;
options.selector = selector;
options.keyField = keyField;
options.valField = valField;
// Call the main chart method
this.barChart(options);
}
});
/**
* Creates a stacked bar chart from the collection.
* @type {Overload}
*/
Collection.prototype.stackedBarChart = new Overload({
/**
* Chart via options object.
* @func stackedBarChart
* @memberof Highchart
* @param {Object} options The options object.
* @returns {*}
*/
'object': function (options) {
options.type = 'bar';
options.chartOptions = options.chartOptions || {};
options.chartOptions.chart = options.chartOptions.chart || {};
options.chartOptions.chart.type = 'bar';
options.plotOptions = options.plotOptions || {};
options.plotOptions.series = options.plotOptions.series || {};
options.plotOptions.series.stacking = options.plotOptions.series.stacking || 'normal';
if (!this._highcharts[options.selector]) {
// Store new chart in charts array
this._highcharts[options.selector] = new Highchart(this, options);
}
return this._highcharts[options.selector];
},
/**
* Chart via defined params and an options object.
* @func stackedBarChart
* @memberof Highchart
* @param {String|jQuery} selector The element to render the chart to.
* @param {String} seriesField The name of the series to plot.
* @param {String} keyField The field to use as the data key.
* @param {String} valField The field to use as the data value.
* @param {Object} options The options object.
*/
'*, string, string, string, ...': function (selector, seriesField, keyField, valField, options) {
options = options || {};
options.seriesField = seriesField;
options.selector = selector;
options.keyField = keyField;
options.valField = valField;
// Call the main chart method
this.stackedBarChart(options);
}
});
/**
* Removes a chart from the page by it's selector.
* @memberof Collection
* @param {String} selector The chart selector.
*/
Collection.prototype.dropChart = function (selector) {
if (this._highcharts && this._highcharts[selector]) {
this._highcharts[selector].drop();
}
};
Shared.finishModule('Highchart');
module.exports = Highchart;
},{"./Overload":29,"./Shared":38}],13:[function(_dereq_,module,exports){
"use strict";
/*
name
id
rebuild
state
match
lookup
*/
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path'),
BinaryTree = _dereq_('./BinaryTree'),
treeInstance = new BinaryTree(),
btree = function () {};
treeInstance.inOrder('hash');
/**
* The index class used to instantiate hash map indexes that the database can
* use to speed up queries on collections and views.
* @constructor
*/
var IndexBinaryTree = function () {
this.init.apply(this, arguments);
};
IndexBinaryTree.prototype.init = function (keys, options, collection) {
this._btree = new (btree.create(2, this.sortAsc))();
this._size = 0;
this._id = this._itemKeyHash(keys, keys);
this.unique(options && options.unique ? options.unique : false);
if (keys !== undefined) {
this.keys(keys);
}
if (collection !== undefined) {
this.collection(collection);
}
this.name(options && options.name ? options.name : this._id);
};
Shared.addModule('IndexBinaryTree', IndexBinaryTree);
Shared.mixin(IndexBinaryTree.prototype, 'Mixin.ChainReactor');
Shared.mixin(IndexBinaryTree.prototype, 'Mixin.Sorting');
IndexBinaryTree.prototype.id = function () {
return this._id;
};
IndexBinaryTree.prototype.state = function () {
return this._state;
};
IndexBinaryTree.prototype.size = function () {
return this._size;
};
Shared.synthesize(IndexBinaryTree.prototype, 'data');
Shared.synthesize(IndexBinaryTree.prototype, 'name');
Shared.synthesize(IndexBinaryTree.prototype, 'collection');
Shared.synthesize(IndexBinaryTree.prototype, 'type');
Shared.synthesize(IndexBinaryTree.prototype, 'unique');
IndexBinaryTree.prototype.keys = function (val) {
if (val !== undefined) {
this._keys = val;
// Count the keys
this._keyCount = (new Path()).parse(this._keys).length;
return this;
}
return this._keys;
};
IndexBinaryTree.prototype.rebuild = function () {
// Do we have a collection?
if (this._collection) {
// Get sorted data
var collection = this._collection.subset({}, {
$decouple: false,
$orderBy: this._keys
}),
collectionData = collection.find(),
dataIndex,
dataCount = collectionData.length;
// Clear the index data for the index
this._btree = new (btree.create(2, this.sortAsc))();
if (this._unique) {
this._uniqueLookup = {};
}
// Loop the collection data
for (dataIndex = 0; dataIndex < dataCount; dataIndex++) {
this.insert(collectionData[dataIndex]);
}
}
this._state = {
name: this._name,
keys: this._keys,
indexSize: this._size,
built: new Date(),
updated: new Date(),
ok: true
};
};
IndexBinaryTree.prototype.insert = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
dataItemHash = this._itemKeyHash(dataItem, this._keys),
keyArr;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
this._uniqueLookup[uniqueHash] = dataItem;
}
// We store multiple items that match a key inside an array
// that is then stored against that key in the tree...
// Check if item exists for this key already
keyArr = this._btree.get(dataItemHash);
// Check if the array exists
if (keyArr === undefined) {
// Generate an array for this key first
keyArr = [];
// Put the new array into the tree under the key
this._btree.put(dataItemHash, keyArr);
}
// Push the item into the array
keyArr.push(dataItem);
this._size++;
};
IndexBinaryTree.prototype.remove = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
dataItemHash = this._itemKeyHash(dataItem, this._keys),
keyArr,
itemIndex;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
delete this._uniqueLookup[uniqueHash];
}
// Try and get the array for the item hash key
keyArr = this._btree.get(dataItemHash);
if (keyArr !== undefined) {
// The key array exits, remove the item from the key array
itemIndex = keyArr.indexOf(dataItem);
if (itemIndex > -1) {
// Check the length of the array
if (keyArr.length === 1) {
// This item is the last in the array, just kill the tree entry
this._btree.del(dataItemHash);
} else {
// Remove the item
keyArr.splice(itemIndex, 1);
}
this._size--;
}
}
};
IndexBinaryTree.prototype.violation = function (dataItem) {
// Generate item hash
var uniqueHash = this._itemHash(dataItem, this._keys);
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexBinaryTree.prototype.hashViolation = function (uniqueHash) {
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexBinaryTree.prototype.lookup = function (query) {
return this._data[this._itemHash(query, this._keys)] || [];
};
IndexBinaryTree.prototype.match = function (query, options) {
// Check if the passed query has data in the keys our index
// operates on and if so, is the query sort matching our order
var pathSolver = new Path();
var indexKeyArr = pathSolver.parseArr(this._keys),
queryArr = pathSolver.parseArr(query),
matchedKeys = [],
matchedKeyCount = 0,
i;
// Loop the query array and check the order of keys against the
// index key array to see if this index can be used
for (i = 0; i < indexKeyArr.length; i++) {
if (queryArr[i] === indexKeyArr[i]) {
matchedKeyCount++;
matchedKeys.push(queryArr[i]);
} else {
// Query match failed - this is a hash map index so partial key match won't work
return {
matchedKeys: [],
totalKeyCount: queryArr.length,
score: 0
};
}
}
return {
matchedKeys: matchedKeys,
totalKeyCount: queryArr.length,
score: matchedKeyCount
};
//return pathSolver.countObjectPaths(this._keys, query);
};
IndexBinaryTree.prototype._itemHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.value(item, pathData[k].path).join(':');
}
return hash;
};
IndexBinaryTree.prototype._itemKeyHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.keyValue(item, pathData[k].path);
}
return hash;
};
IndexBinaryTree.prototype._itemHashArr = function (item, keys) {
var path = new Path(),
pathData,
//hash = '',
hashArr = [],
valArr,
i, k, j;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
valArr = path.value(item, pathData[k].path);
for (i = 0; i < valArr.length; i++) {
if (k === 0) {
// Setup the initial hash array
hashArr.push(valArr[i]);
} else {
// Loop the hash array and concat the value to it
for (j = 0; j < hashArr.length; j++) {
hashArr[j] = hashArr[j] + '_' + valArr[i];
}
}
}
}
return hashArr;
};
Shared.finishModule('IndexBinaryTree');
module.exports = IndexBinaryTree;
},{"./BinaryTree":4,"./Path":31,"./Shared":38}],14:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path');
/**
* The index class used to instantiate hash map indexes that the database can
* use to speed up queries on collections and views.
* @constructor
*/
var IndexHashMap = function () {
this.init.apply(this, arguments);
};
IndexHashMap.prototype.init = function (keys, options, collection) {
this._crossRef = {};
this._size = 0;
this._id = this._itemKeyHash(keys, keys);
this.data({});
this.unique(options && options.unique ? options.unique : false);
if (keys !== undefined) {
this.keys(keys);
}
if (collection !== undefined) {
this.collection(collection);
}
this.name(options && options.name ? options.name : this._id);
};
Shared.addModule('IndexHashMap', IndexHashMap);
Shared.mixin(IndexHashMap.prototype, 'Mixin.ChainReactor');
IndexHashMap.prototype.id = function () {
return this._id;
};
IndexHashMap.prototype.state = function () {
return this._state;
};
IndexHashMap.prototype.size = function () {
return this._size;
};
Shared.synthesize(IndexHashMap.prototype, 'data');
Shared.synthesize(IndexHashMap.prototype, 'name');
Shared.synthesize(IndexHashMap.prototype, 'collection');
Shared.synthesize(IndexHashMap.prototype, 'type');
Shared.synthesize(IndexHashMap.prototype, 'unique');
IndexHashMap.prototype.keys = function (val) {
if (val !== undefined) {
this._keys = val;
// Count the keys
this._keyCount = (new Path()).parse(this._keys).length;
return this;
}
return this._keys;
};
IndexHashMap.prototype.rebuild = function () {
// Do we have a collection?
if (this._collection) {
// Get sorted data
var collection = this._collection.subset({}, {
$decouple: false,
$orderBy: this._keys
}),
collectionData = collection.find(),
dataIndex,
dataCount = collectionData.length;
// Clear the index data for the index
this._data = {};
if (this._unique) {
this._uniqueLookup = {};
}
// Loop the collection data
for (dataIndex = 0; dataIndex < dataCount; dataIndex++) {
this.insert(collectionData[dataIndex]);
}
}
this._state = {
name: this._name,
keys: this._keys,
indexSize: this._size,
built: new Date(),
updated: new Date(),
ok: true
};
};
IndexHashMap.prototype.insert = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
itemHashArr,
hashIndex;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
this._uniqueLookup[uniqueHash] = dataItem;
}
// Generate item hash
itemHashArr = this._itemHashArr(dataItem, this._keys);
// Get the path search results and store them
for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) {
this.pushToPathValue(itemHashArr[hashIndex], dataItem);
}
};
IndexHashMap.prototype.update = function (dataItem, options) {
// TODO: Write updates to work
// 1: Get uniqueHash for the dataItem primary key value (may need to generate a store for this)
// 2: Remove the uniqueHash as it currently stands
// 3: Generate a new uniqueHash for dataItem
// 4: Insert the new uniqueHash
};
IndexHashMap.prototype.remove = function (dataItem, options) {
var uniqueFlag = this._unique,
uniqueHash,
itemHashArr,
hashIndex;
if (uniqueFlag) {
uniqueHash = this._itemHash(dataItem, this._keys);
delete this._uniqueLookup[uniqueHash];
}
// Generate item hash
itemHashArr = this._itemHashArr(dataItem, this._keys);
// Get the path search results and store them
for (hashIndex = 0; hashIndex < itemHashArr.length; hashIndex++) {
this.pullFromPathValue(itemHashArr[hashIndex], dataItem);
}
};
IndexHashMap.prototype.violation = function (dataItem) {
// Generate item hash
var uniqueHash = this._itemHash(dataItem, this._keys);
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexHashMap.prototype.hashViolation = function (uniqueHash) {
// Check if the item breaks the unique constraint
return Boolean(this._uniqueLookup[uniqueHash]);
};
IndexHashMap.prototype.pushToPathValue = function (hash, obj) {
var pathValArr = this._data[hash] = this._data[hash] || [];
// Make sure we have not already indexed this object at this path/value
if (pathValArr.indexOf(obj) === -1) {
// Index the object
pathValArr.push(obj);
// Record the reference to this object in our index size
this._size++;
// Cross-reference this association for later lookup
this.pushToCrossRef(obj, pathValArr);
}
};
IndexHashMap.prototype.pullFromPathValue = function (hash, obj) {
var pathValArr = this._data[hash],
indexOfObject;
// Make sure we have already indexed this object at this path/value
indexOfObject = pathValArr.indexOf(obj);
if (indexOfObject > -1) {
// Un-index the object
pathValArr.splice(indexOfObject, 1);
// Record the reference to this object in our index size
this._size--;
// Remove object cross-reference
this.pullFromCrossRef(obj, pathValArr);
}
// Check if we should remove the path value array
if (!pathValArr.length) {
// Remove the array
delete this._data[hash];
}
};
IndexHashMap.prototype.pull = function (obj) {
// Get all places the object has been used and remove them
var id = obj[this._collection.primaryKey()],
crossRefArr = this._crossRef[id],
arrIndex,
arrCount = crossRefArr.length,
arrItem;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
arrItem = crossRefArr[arrIndex];
// Remove item from this index lookup array
this._pullFromArray(arrItem, obj);
}
// Record the reference to this object in our index size
this._size--;
// Now remove the cross-reference entry for this object
delete this._crossRef[id];
};
IndexHashMap.prototype._pullFromArray = function (arr, obj) {
var arrCount = arr.length;
while (arrCount--) {
if (arr[arrCount] === obj) {
arr.splice(arrCount, 1);
}
}
};
IndexHashMap.prototype.pushToCrossRef = function (obj, pathValArr) {
var id = obj[this._collection.primaryKey()],
crObj;
this._crossRef[id] = this._crossRef[id] || [];
// Check if the cross-reference to the pathVal array already exists
crObj = this._crossRef[id];
if (crObj.indexOf(pathValArr) === -1) {
// Add the cross-reference
crObj.push(pathValArr);
}
};
IndexHashMap.prototype.pullFromCrossRef = function (obj, pathValArr) {
var id = obj[this._collection.primaryKey()];
delete this._crossRef[id];
};
IndexHashMap.prototype.lookup = function (query) {
return this._data[this._itemHash(query, this._keys)] || [];
};
IndexHashMap.prototype.match = function (query, options) {
// Check if the passed query has data in the keys our index
// operates on and if so, is the query sort matching our order
var pathSolver = new Path();
var indexKeyArr = pathSolver.parseArr(this._keys),
queryArr = pathSolver.parseArr(query),
matchedKeys = [],
matchedKeyCount = 0,
i;
// Loop the query array and check the order of keys against the
// index key array to see if this index can be used
for (i = 0; i < indexKeyArr.length; i++) {
if (queryArr[i] === indexKeyArr[i]) {
matchedKeyCount++;
matchedKeys.push(queryArr[i]);
} else {
// Query match failed - this is a hash map index so partial key match won't work
return {
matchedKeys: [],
totalKeyCount: queryArr.length,
score: 0
};
}
}
return {
matchedKeys: matchedKeys,
totalKeyCount: queryArr.length,
score: matchedKeyCount
};
//return pathSolver.countObjectPaths(this._keys, query);
};
IndexHashMap.prototype._itemHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.value(item, pathData[k].path).join(':');
}
return hash;
};
IndexHashMap.prototype._itemKeyHash = function (item, keys) {
var path = new Path(),
pathData,
hash = '',
k;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
if (hash) { hash += '_'; }
hash += path.keyValue(item, pathData[k].path);
}
return hash;
};
IndexHashMap.prototype._itemHashArr = function (item, keys) {
var path = new Path(),
pathData,
//hash = '',
hashArr = [],
valArr,
i, k, j;
pathData = path.parse(keys);
for (k = 0; k < pathData.length; k++) {
valArr = path.value(item, pathData[k].path);
for (i = 0; i < valArr.length; i++) {
if (k === 0) {
// Setup the initial hash array
hashArr.push(valArr[i]);
} else {
// Loop the hash array and concat the value to it
for (j = 0; j < hashArr.length; j++) {
hashArr[j] = hashArr[j] + '_' + valArr[i];
}
}
}
}
return hashArr;
};
Shared.finishModule('IndexHashMap');
module.exports = IndexHashMap;
},{"./Path":31,"./Shared":38}],15:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
/**
* The key value store class used when storing basic in-memory KV data,
* and can be queried for quick retrieval. Mostly used for collection
* primary key indexes and lookups.
* @param {String=} name Optional KV store name.
* @constructor
*/
var KeyValueStore = function (name) {
this.init.apply(this, arguments);
};
KeyValueStore.prototype.init = function (name) {
this._name = name;
this._data = {};
this._primaryKey = '_id';
};
Shared.addModule('KeyValueStore', KeyValueStore);
Shared.mixin(KeyValueStore.prototype, 'Mixin.ChainReactor');
/**
* Get / set the name of the key/value store.
* @param {String} val The name to set.
* @returns {*}
*/
Shared.synthesize(KeyValueStore.prototype, 'name');
/**
* Get / set the primary key.
* @param {String} key The key to set.
* @returns {*}
*/
KeyValueStore.prototype.primaryKey = function (key) {
if (key !== undefined) {
this._primaryKey = key;
return this;
}
return this._primaryKey;
};
/**
* Removes all data from the store.
* @returns {*}
*/
KeyValueStore.prototype.truncate = function () {
this._data = {};
return this;
};
/**
* Sets data against a key in the store.
* @param {String} key The key to set data for.
* @param {*} value The value to assign to the key.
* @returns {*}
*/
KeyValueStore.prototype.set = function (key, value) {
this._data[key] = value ? value : true;
return this;
};
/**
* Gets data stored for the passed key.
* @param {String} key The key to get data for.
* @returns {*}
*/
KeyValueStore.prototype.get = function (key) {
return this._data[key];
};
/**
* Get / set the primary key.
* @param {*} obj A lookup query, can be a string key, an array of string keys,
* an object with further query clauses or a regular expression that should be
* run against all keys.
* @returns {*}
*/
KeyValueStore.prototype.lookup = function (obj) {
var pKeyVal = obj[this._primaryKey],
arrIndex,
arrCount,
lookupItem,
result;
if (pKeyVal instanceof Array) {
// An array of primary keys, find all matches
arrCount = pKeyVal.length;
result = [];
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
lookupItem = this._data[pKeyVal[arrIndex]];
if (lookupItem) {
result.push(lookupItem);
}
}
return result;
} else if (pKeyVal instanceof RegExp) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (pKeyVal.test(arrIndex)) {
result.push(this._data[arrIndex]);
}
}
}
return result;
} else if (typeof pKeyVal === 'object') {
// The primary key clause is an object, now we have to do some
// more extensive searching
if (pKeyVal.$ne) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (arrIndex !== pKeyVal.$ne) {
result.push(this._data[arrIndex]);
}
}
}
return result;
}
if (pKeyVal.$in && (pKeyVal.$in instanceof Array)) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (pKeyVal.$in.indexOf(arrIndex) > -1) {
result.push(this._data[arrIndex]);
}
}
}
return result;
}
if (pKeyVal.$nin && (pKeyVal.$nin instanceof Array)) {
// Create new data
result = [];
for (arrIndex in this._data) {
if (this._data.hasOwnProperty(arrIndex)) {
if (pKeyVal.$nin.indexOf(arrIndex) === -1) {
result.push(this._data[arrIndex]);
}
}
}
return result;
}
if (pKeyVal.$or && (pKeyVal.$or instanceof Array)) {
// Create new data
result = [];
for (arrIndex = 0; arrIndex < pKeyVal.$or.length; arrIndex++) {
result = result.concat(this.lookup(pKeyVal.$or[arrIndex]));
}
return result;
}
} else {
// Key is a basic lookup from string
lookupItem = this._data[pKeyVal];
if (lookupItem !== undefined) {
return [lookupItem];
} else {
return [];
}
}
};
/**
* Removes data for the given key from the store.
* @param {String} key The key to un-set.
* @returns {*}
*/
KeyValueStore.prototype.unSet = function (key) {
delete this._data[key];
return this;
};
/**
* Sets data for the give key in the store only where the given key
* does not already have a value in the store.
* @param {String} key The key to set data for.
* @param {*} value The value to assign to the key.
* @returns {Boolean} True if data was set or false if data already
* exists for the key.
*/
KeyValueStore.prototype.uniqueSet = function (key, value) {
if (this._data[key] === undefined) {
this._data[key] = value;
return true;
}
return false;
};
Shared.finishModule('KeyValueStore');
module.exports = KeyValueStore;
},{"./Shared":38}],16:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Operation = _dereq_('./Operation');
/**
* The metrics class used to store details about operations.
* @constructor
*/
var Metrics = function () {
this.init.apply(this, arguments);
};
Metrics.prototype.init = function () {
this._data = [];
};
Shared.addModule('Metrics', Metrics);
Shared.mixin(Metrics.prototype, 'Mixin.ChainReactor');
/**
* Creates an operation within the metrics instance and if metrics
* are currently enabled (by calling the start() method) the operation
* is also stored in the metrics log.
* @param {String} name The name of the operation.
* @returns {Operation}
*/
Metrics.prototype.create = function (name) {
var op = new Operation(name);
if (this._enabled) {
this._data.push(op);
}
return op;
};
/**
* Starts logging operations.
* @returns {Metrics}
*/
Metrics.prototype.start = function () {
this._enabled = true;
return this;
};
/**
* Stops logging operations.
* @returns {Metrics}
*/
Metrics.prototype.stop = function () {
this._enabled = false;
return this;
};
/**
* Clears all logged operations.
* @returns {Metrics}
*/
Metrics.prototype.clear = function () {
this._data = [];
return this;
};
/**
* Returns an array of all logged operations.
* @returns {Array}
*/
Metrics.prototype.list = function () {
return this._data;
};
Shared.finishModule('Metrics');
module.exports = Metrics;
},{"./Operation":28,"./Shared":38}],17:[function(_dereq_,module,exports){
"use strict";
var CRUD = {
preSetData: function () {
},
postSetData: function () {
}
};
module.exports = CRUD;
},{}],18:[function(_dereq_,module,exports){
"use strict";
/**
* The chain reactor mixin, provides methods to the target object that allow chain
* reaction events to propagate to the target and be handled, processed and passed
* on down the chain.
* @mixin
*/
var ChainReactor = {
/**
*
* @param obj
*/
chain: function (obj) {
if (this.debug && this.debug()) {
if (obj._reactorIn && obj._reactorOut) {
console.log(obj._reactorIn.logIdentifier() + ' Adding target "' + obj._reactorOut.instanceIdentifier() + '" to the chain reactor target list');
} else {
console.log(this.logIdentifier() + ' Adding target "' + obj.instanceIdentifier() + '" to the chain reactor target list');
}
}
this._chain = this._chain || [];
var index = this._chain.indexOf(obj);
if (index === -1) {
this._chain.push(obj);
}
},
unChain: function (obj) {
if (this.debug && this.debug()) {
if (obj._reactorIn && obj._reactorOut) {
console.log(obj._reactorIn.logIdentifier() + ' Removing target "' + obj._reactorOut.instanceIdentifier() + '" from the chain reactor target list');
} else {
console.log(this.logIdentifier() + ' Removing target "' + obj.instanceIdentifier() + '" from the chain reactor target list');
}
}
if (this._chain) {
var index = this._chain.indexOf(obj);
if (index > -1) {
this._chain.splice(index, 1);
}
}
},
chainSend: function (type, data, options) {
if (this._chain) {
var arr = this._chain,
arrItem,
count = arr.length,
index;
for (index = 0; index < count; index++) {
arrItem = arr[index];
if (!arrItem._state || (arrItem._state && !arrItem.isDropped())) {
if (this.debug && this.debug()) {
if (arrItem._reactorIn && arrItem._reactorOut) {
console.log(arrItem._reactorIn.logIdentifier() + ' Sending data down the chain reactor pipe to "' + arrItem._reactorOut.instanceIdentifier() + '"');
} else {
console.log(this.logIdentifier() + ' Sending data down the chain reactor pipe to "' + arrItem.instanceIdentifier() + '"');
}
}
arrItem.chainReceive(this, type, data, options);
} else {
console.log('Reactor Data:', type, data, options);
console.log('Reactor Node:', arrItem);
throw('Chain reactor attempting to send data to target reactor node that is in a dropped state!');
}
}
}
},
chainReceive: function (sender, type, data, options) {
var chainPacket = {
sender: sender,
type: type,
data: data,
options: options
};
if (this.debug && this.debug()) {
console.log(this.logIdentifier() + 'Received data from parent reactor node');
}
// Fire our internal handler
if (!this._chainHandler || (this._chainHandler && !this._chainHandler(chainPacket))) {
// Propagate the message down the chain
this.chainSend(chainPacket.type, chainPacket.data, chainPacket.options);
}
}
};
module.exports = ChainReactor;
},{}],19:[function(_dereq_,module,exports){
"use strict";
var idCounter = 0,
Overload = _dereq_('./Overload'),
Serialiser = _dereq_('./Serialiser'),
Common,
serialiser = new Serialiser();
/**
* Provides commonly used methods to most classes in ForerunnerDB.
* @mixin
*/
Common = {
// Expose the serialiser object so it can be extended with new data handlers.
serialiser: serialiser,
/**
* Gets / sets data in the item store. The store can be used to set and
* retrieve data against a key. Useful for adding arbitrary key/value data
* to a collection / view etc and retrieving it later.
* @param {String|*} key The key under which to store the passed value or
* retrieve the existing stored value.
* @param {*=} val Optional value. If passed will overwrite the existing value
* stored against the specified key if one currently exists.
* @returns {*}
*/
store: function (key, val) {
if (key !== undefined) {
if (val !== undefined) {
// Store the data
this._store = this._store || {};
this._store[key] = val;
return this;
}
if (this._store) {
return this._store[key];
}
}
return undefined;
},
/**
* Removes a previously stored key/value pair from the item store, set previously
* by using the store() method.
* @param {String|*} key The key of the key/value pair to remove;
* @returns {Common} Returns this for chaining.
*/
unStore: function (key) {
if (key !== undefined) {
delete this._store[key];
}
return this;
},
/**
* Returns a non-referenced version of the passed object / array.
* @param {Object} data The object or array to return as a non-referenced version.
* @param {Number=} copies Optional number of copies to produce. If specified, the return
* value will be an array of decoupled objects, each distinct from the other.
* @returns {*}
*/
decouple: function (data, copies) {
if (data !== undefined) {
if (!copies) {
return this.jParse(this.jStringify(data));
} else {
var i,
json = this.jStringify(data),
copyArr = [];
for (i = 0; i < copies; i++) {
copyArr.push(this.jParse(json));
}
return copyArr;
}
}
return undefined;
},
/**
* Parses and returns data from stringified version.
* @param {String} data The stringified version of data to parse.
* @returns {Object} The parsed JSON object from the data.
*/
jParse: function (data) {
return serialiser.parse(data);
//return JSON.parse(data);
},
/**
* Converts a JSON object into a stringified version.
* @param {Object} data The data to stringify.
* @returns {String} The stringified data.
*/
jStringify: function (data) {
return serialiser.stringify(data);
//return JSON.stringify(data);
},
/**
* Generates a new 16-character hexadecimal unique ID or
* generates a new 16-character hexadecimal ID based on
* the passed string. Will always generate the same ID
* for the same string.
* @param {String=} str A string to generate the ID from.
* @return {String}
*/
objectId: function (str) {
var id,
pow = Math.pow(10, 17);
if (!str) {
idCounter++;
id = (idCounter + (
Math.random() * pow +
Math.random() * pow +
Math.random() * pow +
Math.random() * pow
)).toString(16);
} else {
var val = 0,
count = str.length,
i;
for (i = 0; i < count; i++) {
val += str.charCodeAt(i) * pow;
}
id = val.toString(16);
}
return id;
},
/**
* Gets / sets debug flag that can enable debug message output to the
* console if required.
* @param {Boolean} val The value to set debug flag to.
* @return {Boolean} True if enabled, false otherwise.
*/
/**
* Sets debug flag for a particular type that can enable debug message
* output to the console if required.
* @param {String} type The name of the debug type to set flag for.
* @param {Boolean} val The value to set debug flag to.
* @return {Boolean} True if enabled, false otherwise.
*/
debug: new Overload([
function () {
return this._debug && this._debug.all;
},
function (val) {
if (val !== undefined) {
if (typeof val === 'boolean') {
this._debug = this._debug || {};
this._debug.all = val;
this.chainSend('debug', this._debug);
return this;
} else {
return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[val]) || (this._debug && this._debug.all);
}
}
return this._debug && this._debug.all;
},
function (type, val) {
if (type !== undefined) {
if (val !== undefined) {
this._debug = this._debug || {};
this._debug[type] = val;
this.chainSend('debug', this._debug);
return this;
}
return (this._debug && this._debug[val]) || (this._db && this._db._debug && this._db._debug[type]);
}
return this._debug && this._debug.all;
}
]),
/**
* Returns a string describing the class this instance is derived from.
* @returns {string}
*/
classIdentifier: function () {
return 'ForerunnerDB.' + this.className;
},
/**
* Returns a string describing the instance by it's class name and instance
* object name.
* @returns {String} The instance identifier.
*/
instanceIdentifier: function () {
return '[' + this.className + ']' + this.name();
},
/**
* Returns a string used to denote a console log against this instance,
* consisting of the class identifier and instance identifier.
* @returns {string} The log identifier.
*/
logIdentifier: function () {
return this.classIdentifier() + ': ' + this.instanceIdentifier();
},
/**
* Converts a query object with MongoDB dot notation syntax
* to Forerunner's object notation syntax.
* @param {Object} obj The object to convert.
*/
convertToFdb: function (obj) {
var varName,
splitArr,
objCopy,
i;
for (i in obj) {
if (obj.hasOwnProperty(i)) {
objCopy = obj;
if (i.indexOf('.') > -1) {
// Replace .$ with a placeholder before splitting by . char
i = i.replace('.$', '[|$|]');
splitArr = i.split('.');
while ((varName = splitArr.shift())) {
// Replace placeholder back to original .$
varName = varName.replace('[|$|]', '.$');
if (splitArr.length) {
objCopy[varName] = {};
} else {
objCopy[varName] = obj[i];
}
objCopy = objCopy[varName];
}
delete obj[i];
}
}
}
},
/**
* Checks if the state is dropped.
* @returns {boolean} True when dropped, false otherwise.
*/
isDropped: function () {
return this._state === 'dropped';
}
};
module.exports = Common;
},{"./Overload":29,"./Serialiser":37}],20:[function(_dereq_,module,exports){
"use strict";
/**
* Provides some database constants.
* @mixin
*/
var Constants = {
TYPE_INSERT: 0,
TYPE_UPDATE: 1,
TYPE_REMOVE: 2,
PHASE_BEFORE: 0,
PHASE_AFTER: 1
};
module.exports = Constants;
},{}],21:[function(_dereq_,module,exports){
"use strict";
var Overload = _dereq_('./Overload');
/**
* Provides event emitter functionality including the methods: on, off, once, emit, deferEmit.
* @mixin
*/
var Events = {
on: new Overload({
/**
* Attach an event listener to the passed event.
* @param {String} event The name of the event to listen for.
* @param {Function} listener The method to call when the event is fired.
*/
'string, function': function (event, listener) {
this._listeners = this._listeners || {};
this._listeners[event] = this._listeners[event] || {};
this._listeners[event]['*'] = this._listeners[event]['*'] || [];
this._listeners[event]['*'].push(listener);
return this;
},
/**
* Attach an event listener to the passed event only if the passed
* id matches the document id for the event being fired.
* @param {String} event The name of the event to listen for.
* @param {*} id The document id to match against.
* @param {Function} listener The method to call when the event is fired.
*/
'string, *, function': function (event, id, listener) {
this._listeners = this._listeners || {};
this._listeners[event] = this._listeners[event] || {};
this._listeners[event][id] = this._listeners[event][id] || [];
this._listeners[event][id].push(listener);
return this;
}
}),
once: new Overload({
'string, function': function (eventName, callback) {
var self = this,
internalCallback = function () {
self.off(eventName, internalCallback);
callback.apply(self, arguments);
};
return this.on(eventName, internalCallback);
},
'string, *, function': function (eventName, id, callback) {
var self = this,
internalCallback = function () {
self.off(eventName, id, internalCallback);
callback.apply(self, arguments);
};
return this.on(eventName, id, internalCallback);
}
}),
off: new Overload({
'string': function (event) {
if (this._listeners && this._listeners[event] && event in this._listeners) {
delete this._listeners[event];
}
return this;
},
'string, function': function (event, listener) {
var arr,
index;
if (typeof(listener) === 'string') {
if (this._listeners && this._listeners[event] && this._listeners[event][listener]) {
delete this._listeners[event][listener];
}
} else {
if (this._listeners && event in this._listeners) {
arr = this._listeners[event]['*'];
index = arr.indexOf(listener);
if (index > -1) {
arr.splice(index, 1);
}
}
}
return this;
},
'string, *, function': function (event, id, listener) {
if (this._listeners && event in this._listeners && id in this.listeners[event]) {
var arr = this._listeners[event][id],
index = arr.indexOf(listener);
if (index > -1) {
arr.splice(index, 1);
}
}
},
'string, *': function (event, id) {
if (this._listeners && event in this._listeners && id in this._listeners[event]) {
// Kill all listeners for this event id
delete this._listeners[event][id];
}
}
}),
emit: function (event, data) {
this._listeners = this._listeners || {};
if (event in this._listeners) {
var arrIndex,
arrCount,
tmpFunc,
arr,
listenerIdArr,
listenerIdCount,
listenerIdIndex;
// Handle global emit
if (this._listeners[event]['*']) {
arr = this._listeners[event]['*'];
arrCount = arr.length;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
// Check we have a function to execute
tmpFunc = arr[arrIndex];
if (typeof tmpFunc === 'function') {
tmpFunc.apply(this, Array.prototype.slice.call(arguments, 1));
}
}
}
// Handle individual emit
if (data instanceof Array) {
// Check if the array is an array of objects in the collection
if (data[0] && data[0][this._primaryKey]) {
// Loop the array and check for listeners against the primary key
listenerIdArr = this._listeners[event];
arrCount = data.length;
for (arrIndex = 0; arrIndex < arrCount; arrIndex++) {
if (listenerIdArr[data[arrIndex][this._primaryKey]]) {
// Emit for this id
listenerIdCount = listenerIdArr[data[arrIndex][this._primaryKey]].length;
for (listenerIdIndex = 0; listenerIdIndex < listenerIdCount; listenerIdIndex++) {
tmpFunc = listenerIdArr[data[arrIndex][this._primaryKey]][listenerIdIndex];
if (typeof tmpFunc === 'function') {
listenerIdArr[data[arrIndex][this._primaryKey]][listenerIdIndex].apply(this, Array.prototype.slice.call(arguments, 1));
}
}
}
}
}
}
}
return this;
},
/**
* Queues an event to be fired. This has automatic de-bouncing so that any
* events of the same type that occur within 100 milliseconds of a previous
* one will all be wrapped into a single emit rather than emitting tons of
* events for lots of chained inserts etc. Only the data from the last
* de-bounced event will be emitted.
* @param {String} eventName The name of the event to emit.
* @param {*=} data Optional data to emit with the event.
*/
deferEmit: function (eventName, data) {
var self = this,
args;
if (!this._noEmitDefer && (!this._db || (this._db && !this._db._noEmitDefer))) {
args = arguments;
// Check for an existing timeout
this._deferTimeout = this._deferTimeout || {};
if (this._deferTimeout[eventName]) {
clearTimeout(this._deferTimeout[eventName]);
}
// Set a timeout
this._deferTimeout[eventName] = setTimeout(function () {
if (self.debug()) {
console.log(self.logIdentifier() + ' Emitting ' + args[0]);
}
self.emit.apply(self, args);
}, 1);
} else {
this.emit.apply(this, arguments);
}
return this;
}
};
module.exports = Events;
},{"./Overload":29}],22:[function(_dereq_,module,exports){
"use strict";
/**
* Provides object matching algorithm methods.
* @mixin
*/
var Matching = {
/**
* Internal method that checks a document against a test object.
* @param {*} source The source object or value to test against.
* @param {*} test The test object or value to test with.
* @param {Object} queryOptions The options the query was passed with.
* @param {String=} opToApply The special operation to apply to the test such
* as 'and' or an 'or' operator.
* @param {Object=} options An object containing options to apply to the
* operation such as limiting the fields returned etc.
* @returns {Boolean} True if the test was positive, false on negative.
* @private
*/
_match: function (source, test, queryOptions, opToApply, options) {
// TODO: This method is quite long, break into smaller pieces
var operation,
applyOp = opToApply,
recurseVal,
tmpIndex,
sourceType = typeof source,
testType = typeof test,
matchedAll = true,
opResult,
substringCache,
i;
options = options || {};
queryOptions = queryOptions || {};
// Check if options currently holds a root query object
if (!options.$rootQuery) {
// Root query not assigned, hold the root query
options.$rootQuery = test;
}
options.$rootData = options.$rootData || {};
// Check if the comparison data are both strings or numbers
if ((sourceType === 'string' || sourceType === 'number') && (testType === 'string' || testType === 'number')) {
// The source and test data are flat types that do not require recursive searches,
// so just compare them and return the result
if (sourceType === 'number') {
// Number comparison
if (source !== test) {
matchedAll = false;
}
} else {
// String comparison
// TODO: We can probably use a queryOptions.$locale as a second parameter here
// TODO: to satisfy https://github.com/Irrelon/ForerunnerDB/issues/35
if (source.localeCompare(test)) {
matchedAll = false;
}
}
} else {
for (i in test) {
if (test.hasOwnProperty(i)) {
// Reset operation flag
operation = false;
substringCache = i.substr(0, 2);
// Check if the property is a comment (ignorable)
if (substringCache === '//') {
// Skip this property
continue;
}
// Check if the property starts with a dollar (function)
if (substringCache.indexOf('$') === 0) {
// Ask the _matchOp method to handle the operation
opResult = this._matchOp(i, source, test[i], queryOptions, options);
// Check the result of the matchOp operation
// If the result is -1 then no operation took place, otherwise the result
// will be a boolean denoting a match (true) or no match (false)
if (opResult > -1) {
if (opResult) {
if (opToApply === 'or') {
return true;
}
} else {
// Set the matchedAll flag to the result of the operation
// because the operation did not return true
matchedAll = opResult;
}
// Record that an operation was handled
operation = true;
}
}
// Check for regex
if (!operation && test[i] instanceof RegExp) {
operation = true;
if (sourceType === 'object' && source[i] !== undefined && test[i].test(source[i])) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
}
if (!operation) {
// Check if our query is an object
if (typeof(test[i]) === 'object') {
// Because test[i] is an object, source must also be an object
// Check if our source data we are checking the test query against
// is an object or an array
if (source[i] !== undefined) {
if (source[i] instanceof Array && !(test[i] instanceof Array)) {
// The source data is an array, so check each item until a
// match is found
recurseVal = false;
for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) {
recurseVal = this._match(source[i][tmpIndex], test[i], queryOptions, applyOp, options);
if (recurseVal) {
// One of the array items matched the query so we can
// include this item in the results, so break now
break;
}
}
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else if (!(source[i] instanceof Array) && test[i] instanceof Array) {
// The test key data is an array and the source key data is not so check
// each item in the test key data to see if the source item matches one
// of them. This is effectively an $in search.
recurseVal = false;
for (tmpIndex = 0; tmpIndex < test[i].length; tmpIndex++) {
recurseVal = this._match(source[i], test[i][tmpIndex], queryOptions, applyOp, options);
if (recurseVal) {
// One of the array items matched the query so we can
// include this item in the results, so break now
break;
}
}
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else if (typeof(source) === 'object') {
// Recurse down the object tree
recurseVal = this._match(source[i], test[i], queryOptions, applyOp, options);
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else {
recurseVal = this._match(undefined, test[i], queryOptions, applyOp, options);
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
}
} else {
// First check if the test match is an $exists
if (test[i] && test[i].$exists !== undefined) {
// Push the item through another match recurse
recurseVal = this._match(undefined, test[i], queryOptions, applyOp, options);
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else {
matchedAll = false;
}
}
} else {
// Check if the prop matches our test value
if (source && source[i] === test[i]) {
if (opToApply === 'or') {
return true;
}
} else if (source && source[i] && source[i] instanceof Array && test[i] && typeof(test[i]) !== "object") {
// We are looking for a value inside an array
// The source data is an array, so check each item until a
// match is found
recurseVal = false;
for (tmpIndex = 0; tmpIndex < source[i].length; tmpIndex++) {
recurseVal = this._match(source[i][tmpIndex], test[i], queryOptions, applyOp, options);
if (recurseVal) {
// One of the array items matched the query so we can
// include this item in the results, so break now
break;
}
}
if (recurseVal) {
if (opToApply === 'or') {
return true;
}
} else {
matchedAll = false;
}
} else {
matchedAll = false;
}
}
}
if (opToApply === 'and' && !matchedAll) {
return false;
}
}
}
}
return matchedAll;
},
/**
* Internal method, performs a matching process against a query operator such as $gt or $nin.
* @param {String} key The property name in the test that matches the operator to perform
* matching against.
* @param {*} source The source data to match the query against.
* @param {*} test The query to match the source against.
* @param {Object=} options An options object.
* @returns {*}
* @private
*/
_matchOp: function (key, source, test, queryOptions, options) {
// Check for commands
switch (key) {
case '$gt':
// Greater than
return source > test;
case '$gte':
// Greater than or equal
return source >= test;
case '$lt':
// Less than
return source < test;
case '$lte':
// Less than or equal
return source <= test;
case '$exists':
// Property exists
return (source === undefined) !== test;
case '$ne': // Not equals
return source != test; // jshint ignore:line
case '$nee': // Not equals equals
return source !== test;
case '$or':
// Match true on ANY check to pass
for (var orIndex = 0; orIndex < test.length; orIndex++) {
if (this._match(source, test[orIndex], queryOptions, 'and', options)) {
return true;
}
}
return false;
case '$and':
// Match true on ALL checks to pass
for (var andIndex = 0; andIndex < test.length; andIndex++) {
if (!this._match(source, test[andIndex], queryOptions, 'and', options)) {
return false;
}
}
return true;
case '$in': // In
// Check that the in test is an array
if (test instanceof Array) {
var inArr = test,
inArrCount = inArr.length,
inArrIndex;
for (inArrIndex = 0; inArrIndex < inArrCount; inArrIndex++) {
if (inArr[inArrIndex] instanceof RegExp && inArr[inArrIndex].test(source)) {
return true;
} else if (inArr[inArrIndex] === source) {
return true;
}
}
return false;
} else {
throw(this.logIdentifier() + ' Cannot use an $in operator on a non-array key: ' + key);
}
break;
case '$nin': // Not in
// Check that the not-in test is an array
if (test instanceof Array) {
var notInArr = test,
notInArrCount = notInArr.length,
notInArrIndex;
for (notInArrIndex = 0; notInArrIndex < notInArrCount; notInArrIndex++) {
if (notInArr[notInArrIndex] === source) {
return false;
}
}
return true;
} else {
throw(this.logIdentifier() + ' Cannot use a $nin operator on a non-array key: ' + key);
}
break;
case '$distinct':
// Ensure options holds a distinct lookup
options.$rootData['//distinctLookup'] = options.$rootData['//distinctLookup'] || {};
for (var distinctProp in test) {
if (test.hasOwnProperty(distinctProp)) {
options.$rootData['//distinctLookup'][distinctProp] = options.$rootData['//distinctLookup'][distinctProp] || {};
// Check if the options distinct lookup has this field's value
if (options.$rootData['//distinctLookup'][distinctProp][source[distinctProp]]) {
// Value is already in use
return false;
} else {
// Set the value in the lookup
options.$rootData['//distinctLookup'][distinctProp][source[distinctProp]] = true;
// Allow the item in the results
return true;
}
}
}
break;
case '$count':
var countKey,
countArr,
countVal;
// Iterate the count object's keys
for (countKey in test) {
if (test.hasOwnProperty(countKey)) {
// Check the property exists and is an array. If the property being counted is not
// an array (or doesn't exist) then use a value of zero in any further count logic
countArr = source[countKey];
if (typeof countArr === 'object' && countArr instanceof Array) {
countVal = countArr.length;
} else {
countVal = 0;
}
// Now recurse down the query chain further to satisfy the query for this key (countKey)
if (!this._match(countVal, test[countKey], queryOptions, 'and', options)) {
return false;
}
}
}
// Allow the item in the results
return true;
}
return -1;
}
};
module.exports = Matching;
},{}],23:[function(_dereq_,module,exports){
"use strict";
/**
* Provides sorting methods.
* @mixin
*/
var Sorting = {
/**
* Sorts the passed value a against the passed value b ascending.
* @param {*} a The first value to compare.
* @param {*} b The second value to compare.
* @returns {*} 1 if a is sorted after b, -1 if a is sorted before b.
*/
sortAsc: function (a, b) {
if (typeof(a) === 'string' && typeof(b) === 'string') {
return a.localeCompare(b);
} else {
if (a > b) {
return 1;
} else if (a < b) {
return -1;
}
}
return 0;
},
/**
* Sorts the passed value a against the passed value b descending.
* @param {*} a The first value to compare.
* @param {*} b The second value to compare.
* @returns {*} 1 if a is sorted after b, -1 if a is sorted before b.
*/
sortDesc: function (a, b) {
if (typeof(a) === 'string' && typeof(b) === 'string') {
return b.localeCompare(a);
} else {
if (a > b) {
return -1;
} else if (a < b) {
return 1;
}
}
return 0;
}
};
module.exports = Sorting;
},{}],24:[function(_dereq_,module,exports){
"use strict";
var Tags,
tagMap = {};
/**
* Provides class instance tagging and tag operation methods.
* @mixin
*/
Tags = {
/**
* Tags a class instance for later lookup.
* @param {String} name The tag to add.
* @returns {boolean}
*/
tagAdd: function (name) {
var i,
self = this,
mapArr = tagMap[name] = tagMap[name] || [];
for (i = 0; i < mapArr.length; i++) {
if (mapArr[i] === self) {
return true;
}
}
mapArr.push(self);
// Hook the drop event for this so we can react
if (self.on) {
self.on('drop', function () {
// We've been dropped so remove ourselves from the tag map
self.tagRemove(name);
});
}
return true;
},
/**
* Removes a tag from a class instance.
* @param {String} name The tag to remove.
* @returns {boolean}
*/
tagRemove: function (name) {
var i,
mapArr = tagMap[name];
if (mapArr) {
for (i = 0; i < mapArr.length; i++) {
if (mapArr[i] === this) {
mapArr.splice(i, 1);
return true;
}
}
}
return false;
},
/**
* Gets an array of all instances tagged with the passed tag name.
* @param {String} name The tag to lookup.
* @returns {Array} The array of instances that have the passed tag.
*/
tagLookup: function (name) {
return tagMap[name] || [];
},
/**
* Drops all instances that are tagged with the passed tag name.
* @param {String} name The tag to lookup.
* @param {Function} callback Callback once dropping has completed
* for all instances that match the passed tag name.
* @returns {boolean}
*/
tagDrop: function (name, callback) {
var arr = this.tagLookup(name),
dropCb,
dropCount,
i;
dropCb = function () {
dropCount--;
if (callback && dropCount === 0) {
callback(false);
}
};
if (arr.length) {
dropCount = arr.length;
// Loop the array and drop all items
for (i = arr.length - 1; i >= 0; i--) {
arr[i].drop(dropCb);
}
}
return true;
}
};
module.exports = Tags;
},{}],25:[function(_dereq_,module,exports){
"use strict";
var Overload = _dereq_('./Overload');
/**
* Provides trigger functionality methods.
* @mixin
*/
var Triggers = {
/**
* Add a trigger by id.
* @param {String} id The id of the trigger. This must be unique to the type and
* phase of the trigger. Only one trigger may be added with this id per type and
* phase.
* @param {Number} type The type of operation to apply the trigger to. See
* Mixin.Constants for constants to use.
* @param {Number} phase The phase of an operation to fire the trigger on. See
* Mixin.Constants for constants to use.
* @param {Function} method The method to call when the trigger is fired.
* @returns {boolean} True if the trigger was added successfully, false if not.
*/
addTrigger: function (id, type, phase, method) {
var self = this,
triggerIndex;
// Check if the trigger already exists
triggerIndex = self._triggerIndexOf(id, type, phase);
if (triggerIndex === -1) {
// The trigger does not exist, create it
self._trigger = self._trigger || {};
self._trigger[type] = self._trigger[type] || {};
self._trigger[type][phase] = self._trigger[type][phase] || [];
self._trigger[type][phase].push({
id: id,
method: method,
enabled: true
});
return true;
}
return false;
},
/**
*
* @param {String} id The id of the trigger to remove.
* @param {Number} type The type of operation to remove the trigger from. See
* Mixin.Constants for constants to use.
* @param {Number} phase The phase of the operation to remove the trigger from.
* See Mixin.Constants for constants to use.
* @returns {boolean} True if removed successfully, false if not.
*/
removeTrigger: function (id, type, phase) {
var self = this,
triggerIndex;
// Check if the trigger already exists
triggerIndex = self._triggerIndexOf(id, type, phase);
if (triggerIndex > -1) {
// The trigger exists, remove it
self._trigger[type][phase].splice(triggerIndex, 1);
}
return false;
},
enableTrigger: new Overload({
'string': function (id) {
// Alter all triggers of this type
var self = this,
types = self._trigger,
phases,
triggers,
result = false,
i, k, j;
if (types) {
for (j in types) {
if (types.hasOwnProperty(j)) {
phases = types[j];
if (phases) {
for (i in phases) {
if (phases.hasOwnProperty(i)) {
triggers = phases[i];
// Loop triggers and set enabled flag
for (k = 0; k < triggers.length; k++) {
if (triggers[k].id === id) {
triggers[k].enabled = true;
result = true;
}
}
}
}
}
}
}
}
return result;
},
'number': function (type) {
// Alter all triggers of this type
var self = this,
phases = self._trigger[type],
triggers,
result = false,
i, k;
if (phases) {
for (i in phases) {
if (phases.hasOwnProperty(i)) {
triggers = phases[i];
// Loop triggers and set to enabled
for (k = 0; k < triggers.length; k++) {
triggers[k].enabled = true;
result = true;
}
}
}
}
return result;
},
'number, number': function (type, phase) {
// Alter all triggers of this type and phase
var self = this,
phases = self._trigger[type],
triggers,
result = false,
k;
if (phases) {
triggers = phases[phase];
if (triggers) {
// Loop triggers and set to enabled
for (k = 0; k < triggers.length; k++) {
triggers[k].enabled = true;
result = true;
}
}
}
return result;
},
'string, number, number': function (id, type, phase) {
// Check if the trigger already exists
var self = this,
triggerIndex = self._triggerIndexOf(id, type, phase);
if (triggerIndex > -1) {
// Update the trigger
self._trigger[type][phase][triggerIndex].enabled = true;
return true;
}
return false;
}
}),
disableTrigger: new Overload({
'string': function (id) {
// Alter all triggers of this type
var self = this,
types = self._trigger,
phases,
triggers,
result = false,
i, k, j;
if (types) {
for (j in types) {
if (types.hasOwnProperty(j)) {
phases = types[j];
if (phases) {
for (i in phases) {
if (phases.hasOwnProperty(i)) {
triggers = phases[i];
// Loop triggers and set enabled flag
for (k = 0; k < triggers.length; k++) {
if (triggers[k].id === id) {
triggers[k].enabled = false;
result = true;
}
}
}
}
}
}
}
}
return result;
},
'number': function (type) {
// Alter all triggers of this type
var self = this,
phases = self._trigger[type],
triggers,
result = false,
i, k;
if (phases) {
for (i in phases) {
if (phases.hasOwnProperty(i)) {
triggers = phases[i];
// Loop triggers and set to disabled
for (k = 0; k < triggers.length; k++) {
triggers[k].enabled = false;
result = true;
}
}
}
}
return result;
},
'number, number': function (type, phase) {
// Alter all triggers of this type and phase
var self = this,
phases = self._trigger[type],
triggers,
result = false,
k;
if (phases) {
triggers = phases[phase];
if (triggers) {
// Loop triggers and set to disabled
for (k = 0; k < triggers.length; k++) {
triggers[k].enabled = false;
result = true;
}
}
}
return result;
},
'string, number, number': function (id, type, phase) {
// Check if the trigger already exists
var self = this,
triggerIndex = self._triggerIndexOf(id, type, phase);
if (triggerIndex > -1) {
// Update the trigger
self._trigger[type][phase][triggerIndex].enabled = false;
return true;
}
return false;
}
}),
/**
* Checks if a trigger will fire based on the type and phase provided.
* @param {Number} type The type of operation. See Mixin.Constants for
* constants to use.
* @param {Number} phase The phase of the operation. See Mixin.Constants
* for constants to use.
* @returns {Boolean} True if the trigger will fire, false otherwise.
*/
willTrigger: function (type, phase) {
if (this._trigger && this._trigger[type] && this._trigger[type][phase] && this._trigger[type][phase].length) {
// Check if a trigger in this array is enabled
var arr = this._trigger[type][phase],
i;
for (i = 0; i < arr.length; i++) {
if (arr[i].enabled) {
return true;
}
}
}
return false;
},
/**
* Processes trigger actions based on the operation, type and phase.
* @param {Object} operation Operation data to pass to the trigger.
* @param {Number} type The type of operation. See Mixin.Constants for
* constants to use.
* @param {Number} phase The phase of the operation. See Mixin.Constants
* for constants to use.
* @param {Object} oldDoc The document snapshot before operations are
* carried out against the data.
* @param {Object} newDoc The document snapshot after operations are
* carried out against the data.
* @returns {boolean}
*/
processTrigger: function (operation, type, phase, oldDoc, newDoc) {
var self = this,
triggerArr,
triggerIndex,
triggerCount,
triggerItem,
response;
if (self._trigger && self._trigger[type] && self._trigger[type][phase]) {
triggerArr = self._trigger[type][phase];
triggerCount = triggerArr.length;
for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) {
triggerItem = triggerArr[triggerIndex];
// Check if the trigger is enabled
if (triggerItem.enabled) {
if (this.debug()) {
var typeName,
phaseName;
switch (type) {
case this.TYPE_INSERT:
typeName = 'insert';
break;
case this.TYPE_UPDATE:
typeName = 'update';
break;
case this.TYPE_REMOVE:
typeName = 'remove';
break;
default:
typeName = '';
break;
}
switch (phase) {
case this.PHASE_BEFORE:
phaseName = 'before';
break;
case this.PHASE_AFTER:
phaseName = 'after';
break;
default:
phaseName = '';
break;
}
//console.log('Triggers: Processing trigger "' + id + '" for ' + typeName + ' in phase "' + phaseName + '"');
}
// Run the trigger's method and store the response
response = triggerItem.method.call(self, operation, oldDoc, newDoc);
// Check the response for a non-expected result (anything other than
// undefined, true or false is considered a throwable error)
if (response === false) {
// The trigger wants us to cancel operations
return false;
}
if (response !== undefined && response !== true && response !== false) {
// Trigger responded with error, throw the error
throw('ForerunnerDB.Mixin.Triggers: Trigger error: ' + response);
}
}
}
// Triggers all ran without issue, return a success (true)
return true;
}
},
/**
* Returns the index of a trigger by id based on type and phase.
* @param {String} id The id of the trigger to find the index of.
* @param {Number} type The type of operation. See Mixin.Constants for
* constants to use.
* @param {Number} phase The phase of the operation. See Mixin.Constants
* for constants to use.
* @returns {number}
* @private
*/
_triggerIndexOf: function (id, type, phase) {
var self = this,
triggerArr,
triggerCount,
triggerIndex;
if (self._trigger && self._trigger[type] && self._trigger[type][phase]) {
triggerArr = self._trigger[type][phase];
triggerCount = triggerArr.length;
for (triggerIndex = 0; triggerIndex < triggerCount; triggerIndex++) {
if (triggerArr[triggerIndex].id === id) {
return triggerIndex;
}
}
}
return -1;
}
};
module.exports = Triggers;
},{"./Overload":29}],26:[function(_dereq_,module,exports){
"use strict";
/**
* Provides methods to handle object update operations.
* @mixin
*/
var Updating = {
/**
* Updates a property on an object.
* @param {Object} doc The object whose property is to be updated.
* @param {String} prop The property to update.
* @param {*} val The new value of the property.
* @private
*/
_updateProperty: function (doc, prop, val) {
doc[prop] = val;
if (this.debug()) {
console.log(this.logIdentifier() + ' Setting non-data-bound document property "' + prop + '"');
}
},
/**
* Increments a value for a property on a document by the passed number.
* @param {Object} doc The document to modify.
* @param {String} prop The property to modify.
* @param {Number} val The amount to increment by.
* @private
*/
_updateIncrement: function (doc, prop, val) {
doc[prop] += val;
},
/**
* Changes the index of an item in the passed array.
* @param {Array} arr The array to modify.
* @param {Number} indexFrom The index to move the item from.
* @param {Number} indexTo The index to move the item to.
* @private
*/
_updateSpliceMove: function (arr, indexFrom, indexTo) {
arr.splice(indexTo, 0, arr.splice(indexFrom, 1)[0]);
if (this.debug()) {
console.log(this.logIdentifier() + ' Moving non-data-bound document array index from "' + indexFrom + '" to "' + indexTo + '"');
}
},
/**
* Inserts an item into the passed array at the specified index.
* @param {Array} arr The array to insert into.
* @param {Number} index The index to insert at.
* @param {Object} doc The document to insert.
* @private
*/
_updateSplicePush: function (arr, index, doc) {
if (arr.length > index) {
arr.splice(index, 0, doc);
} else {
arr.push(doc);
}
},
/**
* Inserts an item at the end of an array.
* @param {Array} arr The array to insert the item into.
* @param {Object} doc The document to insert.
* @private
*/
_updatePush: function (arr, doc) {
arr.push(doc);
},
/**
* Removes an item from the passed array.
* @param {Array} arr The array to modify.
* @param {Number} index The index of the item in the array to remove.
* @private
*/
_updatePull: function (arr, index) {
arr.splice(index, 1);
},
/**
* Multiplies a value for a property on a document by the passed number.
* @param {Object} doc The document to modify.
* @param {String} prop The property to modify.
* @param {Number} val The amount to multiply by.
* @private
*/
_updateMultiply: function (doc, prop, val) {
doc[prop] *= val;
},
/**
* Renames a property on a document to the passed property.
* @param {Object} doc The document to modify.
* @param {String} prop The property to rename.
* @param {Number} val The new property name.
* @private
*/
_updateRename: function (doc, prop, val) {
doc[val] = doc[prop];
delete doc[prop];
},
/**
* Sets a property on a document to the passed value.
* @param {Object} doc The document to modify.
* @param {String} prop The property to delete.
* @param {*} val The new property value.
* @private
*/
_updateOverwrite: function (doc, prop, val) {
doc[prop] = val;
},
/**
* Deletes a property on a document.
* @param {Object} doc The document to modify.
* @param {String} prop The property to delete.
* @private
*/
_updateUnset: function (doc, prop) {
delete doc[prop];
},
/**
* Removes all properties from an object without destroying
* the object instance, thereby maintaining data-bound linking.
* @param {Object} doc The parent object to modify.
* @param {String} prop The name of the child object to clear.
* @private
*/
_updateClear: function (doc, prop) {
var obj = doc[prop],
i;
if (obj && typeof obj === 'object') {
for (i in obj) {
if (obj.hasOwnProperty(i)) {
this._updateUnset(obj, i);
}
}
}
},
/**
* Pops an item or items from the array stack.
* @param {Object} doc The document to modify.
* @param {Number} val If set to a positive integer, will pop the number specified
* from the stack, if set to a negative integer will shift the number specified
* from the stack.
* @return {Boolean}
* @private
*/
_updatePop: function (doc, val) {
var updated = false,
i;
if (doc.length > 0) {
if (val > 0) {
for (i = 0; i < val; i++) {
doc.pop();
}
updated = true;
} else if (val < 0) {
for (i = 0; i > val; i--) {
doc.shift();
}
updated = true;
}
}
return updated;
}
};
module.exports = Updating;
},{}],27:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Collection;
Shared = _dereq_('./Shared');
var Odm = function () {
this.init.apply(this, arguments);
};
Odm.prototype.init = function (from, name) {
var self = this;
self.name(name);
self._collectionDroppedWrap = function () {
self._collectionDropped.apply(self, arguments);
};
self.from(from);
};
Shared.addModule('Odm', Odm);
Shared.mixin(Odm.prototype, 'Mixin.Common');
Shared.mixin(Odm.prototype, 'Mixin.ChainReactor');
Shared.mixin(Odm.prototype, 'Mixin.Constants');
Shared.mixin(Odm.prototype, 'Mixin.Events');
Collection = _dereq_('./Collection');
Shared.synthesize(Odm.prototype, 'name');
Shared.synthesize(Odm.prototype, 'state');
Shared.synthesize(Odm.prototype, 'parent');
Shared.synthesize(Odm.prototype, 'query');
Shared.synthesize(Odm.prototype, 'from', function (val) {
if (val !== undefined) {
val.chain(this);
val.on('drop', this._collectionDroppedWrap);
}
return this.$super(val);
});
Odm.prototype._collectionDropped = function (collection) {
this.drop();
};
Odm.prototype._chainHandler = function (chainPacket) {
switch (chainPacket.type) {
case 'setData':
case 'insert':
case 'update':
case 'remove':
//this._refresh();
break;
default:
break;
}
};
Odm.prototype.drop = function () {
if (!this.isDropped()) {
this.state('dropped');
this.emit('drop', this);
if (this._from) {
delete this._from._odm;
}
delete this._name;
}
return true;
};
/**
* Queries the current object and returns a result that can
* also be queried in the same way.
* @param {String} prop The property to delve into.
* @param {Object=} query Optional query that limits the returned documents.
* @returns {Odm}
*/
Odm.prototype.$ = function (prop, query) {
var data,
tmpQuery,
tmpColl,
tmpOdm;
if (prop === this._from.primaryKey()) {
// Query is against a specific PK id
tmpQuery = {};
tmpQuery[prop] = query;
data = this._from.find(tmpQuery, {$decouple: false});
tmpColl = new Collection();
tmpColl.setData(data, {$decouple: false});
tmpColl._linked = this._from._linked;
} else {
// Query is against an array of sub-documents
tmpColl = new Collection();
data = this._from.find({}, {$decouple: false});
if (data[0] && data[0][prop]) {
// Set the temp collection data to the array property
tmpColl.setData(data[0][prop], {$decouple: false});
// Check if we need to filter this array further
if (query) {
data = tmpColl.find(query, {$decouple: false});
tmpColl.setData(data, {$decouple: false});
}
}
tmpColl._linked = this._from._linked;
}
tmpOdm = new Odm(tmpColl);
tmpOdm.parent(this);
tmpOdm.query(query);
return tmpOdm;
};
/**
* Gets / sets a property on the current ODM document.
* @param {String} prop The name of the property.
* @param {*} val Optional value to set.
* @returns {*}
*/
Odm.prototype.prop = function (prop, val) {
var tmpQuery;
if (prop !== undefined) {
if (val !== undefined) {
tmpQuery = {};
tmpQuery[prop] = val;
return this._from.update({}, tmpQuery);
}
if (this._from._data[0]) {
return this._from._data[0][prop];
}
}
return undefined;
};
/**
* Get the ODM instance for this collection.
* @returns {Odm}
*/
Collection.prototype.odm = function (name) {
if (!this._odm) {
this._odm = new Odm(this, name);
}
return this._odm;
};
Shared.finishModule('Odm');
module.exports = Odm;
},{"./Collection":5,"./Shared":38}],28:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
Path = _dereq_('./Path');
/**
* The operation class, used to store details about an operation being
* performed by the database.
* @param {String} name The name of the operation.
* @constructor
*/
var Operation = function (name) {
this.pathSolver = new Path();
this.counter = 0;
this.init.apply(this, arguments);
};
Operation.prototype.init = function (name) {
this._data = {
operation: name, // The name of the operation executed such as "find", "update" etc
index: {
potential: [], // Indexes that could have potentially been used
used: false // The index that was picked to use
},
steps: [], // The steps taken to generate the query results,
time: {
startMs: 0,
stopMs: 0,
totalMs: 0,
process: {}
},
flag: {}, // An object with flags that denote certain execution paths
log: [] // Any extra data that might be useful such as warnings or helpful hints
};
};
Shared.addModule('Operation', Operation);
Shared.mixin(Operation.prototype, 'Mixin.ChainReactor');
/**
* Starts the operation timer.
*/
Operation.prototype.start = function () {
this._data.time.startMs = new Date().getTime();
};
/**
* Adds an item to the operation log.
* @param {String} event The item to log.
* @returns {*}
*/
Operation.prototype.log = function (event) {
if (event) {
var lastLogTime = this._log.length > 0 ? this._data.log[this._data.log.length - 1].time : 0,
logObj = {
event: event,
time: new Date().getTime(),
delta: 0
};
this._data.log.push(logObj);
if (lastLogTime) {
logObj.delta = logObj.time - lastLogTime;
}
return this;
}
return this._data.log;
};
/**
* Called when starting and ending a timed operation, used to time
* internal calls within an operation's execution.
* @param {String} section An operation name.
* @returns {*}
*/
Operation.prototype.time = function (section) {
if (section !== undefined) {
var process = this._data.time.process,
processObj = process[section] = process[section] || {};
if (!processObj.startMs) {
// Timer started
processObj.startMs = new Date().getTime();
processObj.stepObj = {
name: section
};
this._data.steps.push(processObj.stepObj);
} else {
processObj.stopMs = new Date().getTime();
processObj.totalMs = processObj.stopMs - processObj.startMs;
processObj.stepObj.totalMs = processObj.totalMs;
delete processObj.stepObj;
}
return this;
}
return this._data.time;
};
/**
* Used to set key/value flags during operation execution.
* @param {String} key
* @param {String} val
* @returns {*}
*/
Operation.prototype.flag = function (key, val) {
if (key !== undefined && val !== undefined) {
this._data.flag[key] = val;
} else if (key !== undefined) {
return this._data.flag[key];
} else {
return this._data.flag;
}
};
Operation.prototype.data = function (path, val, noTime) {
if (val !== undefined) {
// Assign value to object path
this.pathSolver.set(this._data, path, val);
return this;
}
return this.pathSolver.get(this._data, path);
};
Operation.prototype.pushData = function (path, val, noTime) {
// Assign value to object path
this.pathSolver.push(this._data, path, val);
};
/**
* Stops the operation timer.
*/
Operation.prototype.stop = function () {
this._data.time.stopMs = new Date().getTime();
this._data.time.totalMs = this._data.time.stopMs - this._data.time.startMs;
};
Shared.finishModule('Operation');
module.exports = Operation;
},{"./Path":31,"./Shared":38}],29:[function(_dereq_,module,exports){
"use strict";
/**
* Allows a method to accept overloaded calls with different parameters controlling
* which passed overload function is called.
* @param {Object} def
* @returns {Function}
* @constructor
*/
var Overload = function (def) {
if (def) {
var self = this,
index,
count,
tmpDef,
defNewKey,
sigIndex,
signatures;
if (!(def instanceof Array)) {
tmpDef = {};
// Def is an object, make sure all prop names are devoid of spaces
for (index in def) {
if (def.hasOwnProperty(index)) {
defNewKey = index.replace(/ /g, '');
// Check if the definition array has a * string in it
if (defNewKey.indexOf('*') === -1) {
// No * found
tmpDef[defNewKey] = def[index];
} else {
// A * was found, generate the different signatures that this
// definition could represent
signatures = this.generateSignaturePermutations(defNewKey);
for (sigIndex = 0; sigIndex < signatures.length; sigIndex++) {
if (!tmpDef[signatures[sigIndex]]) {
tmpDef[signatures[sigIndex]] = def[index];
}
}
}
}
}
def = tmpDef;
}
return function () {
var arr = [],
lookup,
type,
name;
// Check if we are being passed a key/function object or an array of functions
if (def instanceof Array) {
// We were passed an array of functions
count = def.length;
for (index = 0; index < count; index++) {
if (def[index].length === arguments.length) {
return self.callExtend(this, '$main', def, def[index], arguments);
}
}
} else {
// Generate lookup key from arguments
// Copy arguments to an array
for (index = 0; index < arguments.length; index++) {
type = typeof arguments[index];
// Handle detecting arrays
if (type === 'object' && arguments[index] instanceof Array) {
type = 'array';
}
// Handle been presented with a single undefined argument
if (arguments.length === 1 && type === 'undefined') {
break;
}
// Add the type to the argument types array
arr.push(type);
}
lookup = arr.join(',');
// Check for an exact lookup match
if (def[lookup]) {
return self.callExtend(this, '$main', def, def[lookup], arguments);
} else {
for (index = arr.length; index >= 0; index--) {
// Get the closest match
lookup = arr.slice(0, index).join(',');
if (def[lookup + ',...']) {
// Matched against arguments + "any other"
return self.callExtend(this, '$main', def, def[lookup + ',...'], arguments);
}
}
}
}
name = typeof this.name === 'function' ? this.name() : 'Unknown';
throw('ForerunnerDB.Overload "' + name + '": Overloaded method does not have a matching signature for the passed arguments: ' + this.jStringify(arr));
};
}
return function () {};
};
/**
* Generates an array of all the different definition signatures that can be
* created from the passed string with a catch-all wildcard *. E.g. it will
* convert the signature: string,*,string to all potentials:
* string,string,string
* string,number,string
* string,object,string,
* string,function,string,
* string,undefined,string
*
* @param {String} str Signature string with a wildcard in it.
* @returns {Array} An array of signature strings that are generated.
*/
Overload.prototype.generateSignaturePermutations = function (str) {
var signatures = [],
newSignature,
types = ['string', 'object', 'number', 'function', 'undefined'],
index;
if (str.indexOf('*') > -1) {
// There is at least one "any" type, break out into multiple keys
// We could do this at query time with regular expressions but
// would be significantly slower
for (index = 0; index < types.length; index++) {
newSignature = str.replace('*', types[index]);
signatures = signatures.concat(this.generateSignaturePermutations(newSignature));
}
} else {
signatures.push(str);
}
return signatures;
};
Overload.prototype.callExtend = function (context, prop, propContext, func, args) {
var tmp,
ret;
if (context && propContext[prop]) {
tmp = context[prop];
context[prop] = propContext[prop];
ret = func.apply(context, args);
context[prop] = tmp;
return ret;
} else {
return func.apply(context, args);
}
};
module.exports = Overload;
},{}],30:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Db,
Collection,
DbDocument;
Shared = _dereq_('./Shared');
var Overview = function () {
this.init.apply(this, arguments);
};
Overview.prototype.init = function (name) {
var self = this;
this._name = name;
this._data = new DbDocument('__FDB__dc_data_' + this._name);
this._collData = new Collection();
this._sources = [];
this._sourceDroppedWrap = function () {
self._sourceDropped.apply(self, arguments);
};
};
Shared.addModule('Overview', Overview);
Shared.mixin(Overview.prototype, 'Mixin.Common');
Shared.mixin(Overview.prototype, 'Mixin.ChainReactor');
Shared.mixin(Overview.prototype, 'Mixin.Constants');
Shared.mixin(Overview.prototype, 'Mixin.Triggers');
Shared.mixin(Overview.prototype, 'Mixin.Events');
Shared.mixin(Overview.prototype, 'Mixin.Tags');
Collection = _dereq_('./Collection');
DbDocument = _dereq_('./Document');
Db = Shared.modules.Db;
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(Overview.prototype, 'state');
Shared.synthesize(Overview.prototype, 'db');
Shared.synthesize(Overview.prototype, 'name');
Shared.synthesize(Overview.prototype, 'query', function (val) {
var ret = this.$super(val);
if (val !== undefined) {
this._refresh();
}
return ret;
});
Shared.synthesize(Overview.prototype, 'queryOptions', function (val) {
var ret = this.$super(val);
if (val !== undefined) {
this._refresh();
}
return ret;
});
Shared.synthesize(Overview.prototype, 'reduce', function (val) {
var ret = this.$super(val);
if (val !== undefined) {
this._refresh();
}
return ret;
});
Overview.prototype.from = function (source) {
if (source !== undefined) {
if (typeof(source) === 'string') {
source = this._db.collection(source);
}
this._setFrom(source);
return this;
}
return this._sources;
};
Overview.prototype.find = function () {
return this._collData.find.apply(this._collData, arguments);
};
/**
* Executes and returns the response from the current reduce method
* assigned to the overview.
* @returns {*}
*/
Overview.prototype.exec = function () {
var reduceFunc = this.reduce();
return reduceFunc ? reduceFunc.apply(this) : undefined;
};
Overview.prototype.count = function () {
return this._collData.count.apply(this._collData, arguments);
};
Overview.prototype._setFrom = function (source) {
// Remove all source references
while (this._sources.length) {
this._removeSource(this._sources[0]);
}
this._addSource(source);
return this;
};
Overview.prototype._addSource = function (source) {
if (source && source.className === 'View') {
// The source is a view so IO to the internal data collection
// instead of the view proper
source = source.privateData();
if (this.debug()) {
console.log(this.logIdentifier() + ' Using internal private data "' + source.instanceIdentifier() + '" for IO graph linking');
}
}
if (this._sources.indexOf(source) === -1) {
this._sources.push(source);
source.chain(this);
source.on('drop', this._sourceDroppedWrap);
this._refresh();
}
return this;
};
Overview.prototype._removeSource = function (source) {
if (source && source.className === 'View') {
// The source is a view so IO to the internal data collection
// instead of the view proper
source = source.privateData();
if (this.debug()) {
console.log(this.logIdentifier() + ' Using internal private data "' + source.instanceIdentifier() + '" for IO graph linking');
}
}
var sourceIndex = this._sources.indexOf(source);
if (sourceIndex > -1) {
this._sources.splice(source, 1);
source.unChain(this);
source.off('drop', this._sourceDroppedWrap);
this._refresh();
}
return this;
};
Overview.prototype._sourceDropped = function (source) {
if (source) {
// Source was dropped, remove from overview
this._removeSource(source);
}
};
Overview.prototype._refresh = function () {
if (!this.isDropped()) {
if (this._sources && this._sources[0]) {
this._collData.primaryKey(this._sources[0].primaryKey());
var tempArr = [],
i;
for (i = 0; i < this._sources.length; i++) {
tempArr = tempArr.concat(this._sources[i].find(this._query, this._queryOptions));
}
this._collData.setData(tempArr);
}
// Now execute the reduce method
if (this._reduce) {
var reducedData = this._reduce.apply(this);
// Update the document with the newly returned data
this._data.setData(reducedData);
}
}
};
Overview.prototype._chainHandler = function (chainPacket) {
switch (chainPacket.type) {
case 'setData':
case 'insert':
case 'update':
case 'remove':
this._refresh();
break;
default:
break;
}
};
/**
* Gets the module's internal data collection.
* @returns {Collection}
*/
Overview.prototype.data = function () {
return this._data;
};
Overview.prototype.drop = function (callback) {
if (!this.isDropped()) {
this._state = 'dropped';
delete this._data;
delete this._collData;
// Remove all source references
while (this._sources.length) {
this._removeSource(this._sources[0]);
}
delete this._sources;
if (this._db && this._name) {
delete this._db._overview[this._name];
}
delete this._name;
this.emit('drop', this);
if (callback) { callback(false, true); }
}
return true;
};
Db.prototype.overview = function (overviewName) {
if (overviewName) {
// Handle being passed an instance
if (overviewName instanceof Overview) {
return overviewName;
}
this._overview = this._overview || {};
this._overview[overviewName] = this._overview[overviewName] || new Overview(overviewName).db(this);
return this._overview[overviewName];
} else {
// Return an object of collection data
return this._overview || {};
}
};
/**
* Returns an array of overviews the DB currently has.
* @returns {Array} An array of objects containing details of each overview
* the database is currently managing.
*/
Db.prototype.overviews = function () {
var arr = [],
item,
i;
for (i in this._overview) {
if (this._overview.hasOwnProperty(i)) {
item = this._overview[i];
arr.push({
name: i,
count: item.count(),
linked: item.isLinked !== undefined ? item.isLinked() : false
});
}
}
return arr;
};
Shared.finishModule('Overview');
module.exports = Overview;
},{"./Collection":5,"./Document":10,"./Shared":38}],31:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
/**
* Path object used to resolve object paths and retrieve data from
* objects by using paths.
* @param {String=} path The path to assign.
* @constructor
*/
var Path = function (path) {
this.init.apply(this, arguments);
};
Path.prototype.init = function (path) {
if (path) {
this.path(path);
}
};
Shared.addModule('Path', Path);
Shared.mixin(Path.prototype, 'Mixin.Common');
Shared.mixin(Path.prototype, 'Mixin.ChainReactor');
/**
* Gets / sets the given path for the Path instance.
* @param {String=} path The path to assign.
*/
Path.prototype.path = function (path) {
if (path !== undefined) {
this._path = this.clean(path);
this._pathParts = this._path.split('.');
return this;
}
return this._path;
};
/**
* Tests if the passed object has the paths that are specified and that
* a value exists in those paths.
* @param {Object} testKeys The object describing the paths to test for.
* @param {Object} testObj The object to test paths against.
* @returns {Boolean} True if the object paths exist.
*/
Path.prototype.hasObjectPaths = function (testKeys, testObj) {
var result = true,
i;
for (i in testKeys) {
if (testKeys.hasOwnProperty(i)) {
if (testObj[i] === undefined) {
return false;
}
if (typeof testKeys[i] === 'object') {
// Recurse object
result = this.hasObjectPaths(testKeys[i], testObj[i]);
// Should we exit early?
if (!result) {
return false;
}
}
}
}
return result;
};
/**
* Counts the total number of key endpoints in the passed object.
* @param {Object} testObj The object to count key endpoints for.
* @returns {Number} The number of endpoints.
*/
Path.prototype.countKeys = function (testObj) {
var totalKeys = 0,
i;
for (i in testObj) {
if (testObj.hasOwnProperty(i)) {
if (testObj[i] !== undefined) {
if (typeof testObj[i] !== 'object') {
totalKeys++;
} else {
totalKeys += this.countKeys(testObj[i]);
}
}
}
}
return totalKeys;
};
/**
* Tests if the passed object has the paths that are specified and that
* a value exists in those paths and if so returns the number matched.
* @param {Object} testKeys The object describing the paths to test for.
* @param {Object} testObj The object to test paths against.
* @returns {Object} Stats on the matched keys
*/
Path.prototype.countObjectPaths = function (testKeys, testObj) {
var matchData,
matchedKeys = {},
matchedKeyCount = 0,
totalKeyCount = 0,
i;
for (i in testObj) {
if (testObj.hasOwnProperty(i)) {
if (typeof testObj[i] === 'object') {
// The test / query object key is an object, recurse
matchData = this.countObjectPaths(testKeys[i], testObj[i]);
matchedKeys[i] = matchData.matchedKeys;
totalKeyCount += matchData.totalKeyCount;
matchedKeyCount += matchData.matchedKeyCount;
} else {
// The test / query object has a property that is not an object so add it as a key
totalKeyCount++;
// Check if the test keys also have this key and it is also not an object
if (testKeys && testKeys[i] && typeof testKeys[i] !== 'object') {
matchedKeys[i] = true;
matchedKeyCount++;
} else {
matchedKeys[i] = false;
}
}
}
}
return {
matchedKeys: matchedKeys,
matchedKeyCount: matchedKeyCount,
totalKeyCount: totalKeyCount
};
};
/**
* Takes a non-recursive object and converts the object hierarchy into
* a path string.
* @param {Object} obj The object to parse.
* @param {Boolean=} withValue If true will include a 'value' key in the returned
* object that represents the value the object path points to.
* @returns {Object}
*/
Path.prototype.parse = function (obj, withValue) {
var paths = [],
path = '',
resultData,
i, k;
for (i in obj) {
if (obj.hasOwnProperty(i)) {
// Set the path to the key
path = i;
if (typeof(obj[i]) === 'object') {
if (withValue) {
resultData = this.parse(obj[i], withValue);
for (k = 0; k < resultData.length; k++) {
paths.push({
path: path + '.' + resultData[k].path,
value: resultData[k].value
});
}
} else {
resultData = this.parse(obj[i]);
for (k = 0; k < resultData.length; k++) {
paths.push({
path: path + '.' + resultData[k].path
});
}
}
} else {
if (withValue) {
paths.push({
path: path,
value: obj[i]
});
} else {
paths.push({
path: path
});
}
}
}
}
return paths;
};
/**
* Takes a non-recursive object and converts the object hierarchy into
* an array of path strings that allow you to target all possible paths
* in an object.
*
* The options object accepts an "ignore" field with a regular expression
* as the value. If any key matches the expression it is not included in
* the results.
*
* The options object accepts a boolean "verbose" field. If set to true
* the results will include all paths leading up to endpoints as well as
* they endpoints themselves.
*
* @returns {Array}
*/
Path.prototype.parseArr = function (obj, options) {
options = options || {};
return this._parseArr(obj, '', [], options);
};
Path.prototype._parseArr = function (obj, path, paths, options) {
var i,
newPath = '';
path = path || '';
paths = paths || [];
for (i in obj) {
if (obj.hasOwnProperty(i)) {
if (!options.ignore || (options.ignore && !options.ignore.test(i))) {
if (path) {
newPath = path + '.' + i;
} else {
newPath = i;
}
if (typeof(obj[i]) === 'object') {
if (options.verbose) {
paths.push(newPath);
}
this._parseArr(obj[i], newPath, paths, options);
} else {
paths.push(newPath);
}
}
}
}
return paths;
};
/**
* Gets the value(s) that the object contains for the currently assigned path string.
* @param {Object} obj The object to evaluate the path against.
* @param {String=} path A path to use instead of the existing one passed in path().
* @returns {Array} An array of values for the given path.
*/
Path.prototype.value = function (obj, path) {
if (obj !== undefined && typeof obj === 'object') {
var pathParts,
arr,
arrCount,
objPart,
objPartParent,
valuesArr = [],
i, k;
if (path !== undefined) {
path = this.clean(path);
pathParts = path.split('.');
}
arr = pathParts || this._pathParts;
arrCount = arr.length;
objPart = obj;
for (i = 0; i < arrCount; i++) {
objPart = objPart[arr[i]];
if (objPartParent instanceof Array) {
// Search inside the array for the next key
for (k = 0; k < objPartParent.length; k++) {
valuesArr = valuesArr.concat(this.value(objPartParent, k + '.' + arr[i]));
}
return valuesArr;
} else {
if (!objPart || typeof(objPart) !== 'object') {
break;
}
}
objPartParent = objPart;
}
return [objPart];
} else {
return [];
}
};
/**
* Sets a value on an object for the specified path.
* @param {Object} obj The object to update.
* @param {String} path The path to update.
* @param {*} val The value to set the object path to.
* @returns {*}
*/
Path.prototype.set = function (obj, path, val) {
if (obj !== undefined && path !== undefined) {
var pathParts,
part;
path = this.clean(path);
pathParts = path.split('.');
part = pathParts.shift();
if (pathParts.length) {
// Generate the path part in the object if it does not already exist
obj[part] = obj[part] || {};
// Recurse
this.set(obj[part], pathParts.join('.'), val);
} else {
// Set the value
obj[part] = val;
}
}
return obj;
};
Path.prototype.get = function (obj, path) {
return this.value(obj, path)[0];
};
/**
* Push a value to an array on an object for the specified path.
* @param {Object} obj The object to update.
* @param {String} path The path to the array to push to.
* @param {*} val The value to push to the array at the object path.
* @returns {*}
*/
Path.prototype.push = function (obj, path, val) {
if (obj !== undefined && path !== undefined) {
var pathParts,
part;
path = this.clean(path);
pathParts = path.split('.');
part = pathParts.shift();
if (pathParts.length) {
// Generate the path part in the object if it does not already exist
obj[part] = obj[part] || {};
// Recurse
this.set(obj[part], pathParts.join('.'), val);
} else {
// Set the value
obj[part] = obj[part] || [];
if (obj[part] instanceof Array) {
obj[part].push(val);
} else {
throw('ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!');
}
}
}
return obj;
};
/**
* Gets the value(s) that the object contains for the currently assigned path string
* with their associated keys.
* @param {Object} obj The object to evaluate the path against.
* @param {String=} path A path to use instead of the existing one passed in path().
* @returns {Array} An array of values for the given path with the associated key.
*/
Path.prototype.keyValue = function (obj, path) {
var pathParts,
arr,
arrCount,
objPart,
objPartParent,
objPartHash,
i;
if (path !== undefined) {
path = this.clean(path);
pathParts = path.split('.');
}
arr = pathParts || this._pathParts;
arrCount = arr.length;
objPart = obj;
for (i = 0; i < arrCount; i++) {
objPart = objPart[arr[i]];
if (!objPart || typeof(objPart) !== 'object') {
objPartHash = arr[i] + ':' + objPart;
break;
}
objPartParent = objPart;
}
return objPartHash;
};
/**
* Sets a value on an object for the specified path.
* @param {Object} obj The object to update.
* @param {String} path The path to update.
* @param {*} val The value to set the object path to.
* @returns {*}
*/
Path.prototype.set = function (obj, path, val) {
if (obj !== undefined && path !== undefined) {
var pathParts,
part;
path = this.clean(path);
pathParts = path.split('.');
part = pathParts.shift();
if (pathParts.length) {
// Generate the path part in the object if it does not already exist
obj[part] = obj[part] || {};
// Recurse
this.set(obj[part], pathParts.join('.'), val);
} else {
// Set the value
obj[part] = val;
}
}
return obj;
};
/**
* Removes leading period (.) from string and returns it.
* @param {String} str The string to clean.
* @returns {*}
*/
Path.prototype.clean = function (str) {
if (str.substr(0, 1) === '.') {
str = str.substr(1, str.length -1);
}
return str;
};
Shared.finishModule('Path');
module.exports = Path;
},{"./Shared":38}],32:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared = _dereq_('./Shared'),
async = _dereq_('async'),
localforage = _dereq_('localforage'),
FdbCompress = _dereq_('./PersistCompress'),// jshint ignore:line
FdbCrypto = _dereq_('./PersistCrypto'),// jshint ignore:line
Db,
Collection,
CollectionDrop,
CollectionGroup,
CollectionInit,
DbInit,
DbDrop,
Persist,
Overload;//,
//DataVersion = '2.0';
/**
* The persistent storage class handles loading and saving data to browser
* storage.
* @constructor
*/
Persist = function () {
this.init.apply(this, arguments);
};
/**
* The local forage library.
*/
Persist.prototype.localforage = localforage;
/**
* The init method that can be overridden or extended.
* @param {Db} db The ForerunnerDB database instance.
*/
Persist.prototype.init = function (db) {
var self = this;
this._encodeSteps = [
function () { return self._encode.apply(self, arguments); }
];
this._decodeSteps = [
function () { return self._decode.apply(self, arguments); }
];
// Check environment
if (db.isClient()) {
if (window.Storage !== undefined) {
this.mode('localforage');
localforage.config({
driver: [
localforage.INDEXEDDB,
localforage.WEBSQL,
localforage.LOCALSTORAGE
],
name: String(db.core().name()),
storeName: 'FDB'
});
}
}
};
Shared.addModule('Persist', Persist);
Shared.mixin(Persist.prototype, 'Mixin.ChainReactor');
Shared.mixin(Persist.prototype, 'Mixin.Common');
Db = Shared.modules.Db;
Collection = _dereq_('./Collection');
CollectionDrop = Collection.prototype.drop;
CollectionGroup = _dereq_('./CollectionGroup');
CollectionInit = Collection.prototype.init;
DbInit = Db.prototype.init;
DbDrop = Db.prototype.drop;
Overload = Shared.overload;
/**
* Gets / sets the persistent storage mode (the library used
* to persist data to the browser - defaults to localForage).
* @param {String} type The library to use for storage. Defaults
* to localForage.
* @returns {*}
*/
Persist.prototype.mode = function (type) {
if (type !== undefined) {
this._mode = type;
return this;
}
return this._mode;
};
/**
* Gets / sets the driver used when persisting data.
* @param {String} val Specify the driver type (LOCALSTORAGE,
* WEBSQL or INDEXEDDB)
* @returns {*}
*/
Persist.prototype.driver = function (val) {
if (val !== undefined) {
switch (val.toUpperCase()) {
case 'LOCALSTORAGE':
localforage.setDriver(localforage.LOCALSTORAGE);
break;
case 'WEBSQL':
localforage.setDriver(localforage.WEBSQL);
break;
case 'INDEXEDDB':
localforage.setDriver(localforage.INDEXEDDB);
break;
default:
throw('ForerunnerDB.Persist: The persistence driver you have specified is not found. Please use either IndexedDB, WebSQL or LocalStorage!');
}
return this;
}
return localforage.driver();
};
/**
* Starts a decode waterfall process.
* @param {*} val The data to be decoded.
* @param {Function} finished The callback to pass final data to.
*/
Persist.prototype.decode = function (val, finished) {
async.waterfall([function (callback) {
if (callback) { callback(false, val, {}); }
}].concat(this._decodeSteps), finished);
};
/**
* Starts an encode waterfall process.
* @param {*} val The data to be encoded.
* @param {Function} finished The callback to pass final data to.
*/
Persist.prototype.encode = function (val, finished) {
async.waterfall([function (callback) {
if (callback) { callback(false, val, {}); }
}].concat(this._encodeSteps), finished);
};
Shared.synthesize(Persist.prototype, 'encodeSteps');
Shared.synthesize(Persist.prototype, 'decodeSteps');
/**
* Adds an encode/decode step to the persistent storage system so
* that you can add custom functionality.
* @param {Function} encode The encode method called with the data from the
* previous encode step. When your method is complete it MUST call the
* callback method. If you provide anything other than false to the err
* parameter the encoder will fail and throw an error.
* @param {Function} decode The decode method called with the data from the
* previous decode step. When your method is complete it MUST call the
* callback method. If you provide anything other than false to the err
* parameter the decoder will fail and throw an error.
* @param {Number=} index Optional index to add the encoder step to. This
* allows you to place a step before or after other existing steps. If not
* provided your step is placed last in the list of steps. For instance if
* you are providing an encryption step it makes sense to place this last
* since all previous steps will then have their data encrypted by your
* final step.
*/
Persist.prototype.addStep = new Overload({
'object': function (obj) {
this.$main.call(this, function objEncode () { obj.encode.apply(obj, arguments); }, function objDecode () { obj.decode.apply(obj, arguments); }, 0);
},
'function, function': function (encode, decode) {
this.$main.call(this, encode, decode, 0);
},
'function, function, number': function (encode, decode, index) {
this.$main.call(this, encode, decode, index);
},
$main: function (encode, decode, index) {
if (index === 0 || index === undefined) {
this._encodeSteps.push(encode);
this._decodeSteps.unshift(decode);
} else {
// Place encoder step at index then work out correct
// index to place decoder step
this._encodeSteps.splice(index, 0, encode);
this._decodeSteps.splice(this._decodeSteps.length - index, 0, decode);
}
}
});
Persist.prototype.unwrap = function (dataStr) {
var parts = dataStr.split('::fdb::'),
data;
switch (parts[0]) {
case 'json':
data = this.jParse(parts[1]);
break;
case 'raw':
data = parts[1];
break;
default:
break;
}
};
/**
* Takes encoded data and decodes it for use as JS native objects and arrays.
* @param {String} val The currently encoded string data.
* @param {Object} meta Meta data object that can be used to pass back useful
* supplementary data.
* @param {Function} finished The callback method to call when decoding is
* completed.
* @private
*/
Persist.prototype._decode = function (val, meta, finished) {
var parts,
data;
if (val) {
parts = val.split('::fdb::');
switch (parts[0]) {
case 'json':
data = this.jParse(parts[1]);
break;
case 'raw':
data = parts[1];
break;
default:
break;
}
if (data) {
meta.foundData = true;
meta.rowCount = data.length;
} else {
meta.foundData = false;
}
if (finished) {
finished(false, data, meta);
}
} else {
meta.foundData = false;
meta.rowCount = 0;
if (finished) {
finished(false, val, meta);
}
}
};
/**
* Takes native JS data and encodes it for for storage as a string.
* @param {Object} val The current un-encoded data.
* @param {Object} meta Meta data object that can be used to pass back useful
* supplementary data.
* @param {Function} finished The callback method to call when encoding is
* completed.
* @private
*/
Persist.prototype._encode = function (val, meta, finished) {
var data = val;
if (typeof val === 'object') {
val = 'json::fdb::' + this.jStringify(val);
} else {
val = 'raw::fdb::' + val;
}
if (data) {
meta.foundData = true;
meta.rowCount = data.length;
} else {
meta.foundData = false;
}
if (finished) {
finished(false, val, meta);
}
};
/**
* Encodes passed data and then stores it in the browser's persistent
* storage layer.
* @param {String} key The key to store the data under in the persistent
* storage.
* @param {Object} data The data to store under the key.
* @param {Function=} callback The method to call when the save process
* has completed.
*/
Persist.prototype.save = function (key, data, callback) {
switch (this.mode()) {
case 'localforage':
this.encode(data, function (err, data, tableStats) {
localforage.setItem(key, data).then(function (data) {
if (callback) { callback(false, data, tableStats); }
}, function (err) {
if (callback) { callback(err); }
});
});
break;
default:
if (callback) { callback('No data handler.'); }
break;
}
};
/**
* Loads and decodes data from the passed key.
* @param {String} key The key to retrieve data from in the persistent
* storage.
* @param {Function=} callback The method to call when the load process
* has completed.
*/
Persist.prototype.load = function (key, callback) {
var self = this;
switch (this.mode()) {
case 'localforage':
localforage.getItem(key).then(function (val) {
self.decode(val, callback);
}, function (err) {
if (callback) { callback(err); }
});
break;
default:
if (callback) { callback('No data handler or unrecognised data type.'); }
break;
}
};
/**
* Deletes data in persistent storage stored under the passed key.
* @param {String} key The key to drop data for in the storage.
* @param {Function=} callback The method to call when the data is dropped.
*/
Persist.prototype.drop = function (key, callback) {
switch (this.mode()) {
case 'localforage':
localforage.removeItem(key).then(function () {
if (callback) { callback(false); }
}, function (err) {
if (callback) { callback(err); }
});
break;
default:
if (callback) { callback('No data handler or unrecognised data type.'); }
break;
}
};
// Extend the Collection prototype with persist methods
Collection.prototype.drop = new Overload({
/**
* Drop collection and persistent storage.
*/
'': function () {
if (!this.isDropped()) {
this.drop(true);
}
},
/**
* Drop collection and persistent storage with callback.
* @param {Function} callback Callback method.
*/
'function': function (callback) {
if (!this.isDropped()) {
this.drop(true, callback);
}
},
/**
* Drop collection and optionally drop persistent storage.
* @param {Boolean} removePersistent True to drop persistent storage, false to keep it.
*/
'boolean': function (removePersistent) {
if (!this.isDropped()) {
// Remove persistent storage
if (removePersistent) {
if (this._name) {
if (this._db) {
// Drop the collection data from storage
this._db.persist.drop(this._db._name + '-' + this._name);
this._db.persist.drop(this._db._name + '-' + this._name + '-metaData');
}
} else {
throw('ForerunnerDB.Persist: Cannot drop a collection\'s persistent storage when no name assigned to collection!');
}
}
// Call the original method
CollectionDrop.call(this);
}
},
/**
* Drop collections and optionally drop persistent storage with callback.
* @param {Boolean} removePersistent True to drop persistent storage, false to keep it.
* @param {Function} callback Callback method.
*/
'boolean, function': function (removePersistent, callback) {
var self = this;
if (!this.isDropped()) {
// Remove persistent storage
if (removePersistent) {
if (this._name) {
if (this._db) {
// Drop the collection data from storage
this._db.persist.drop(this._db._name + '-' + this._name, function () {
self._db.persist.drop(self._db._name + '-' + self._name + '-metaData', callback);
});
return CollectionDrop.call(this);
} else {
if (callback) { callback('Cannot drop a collection\'s persistent storage when the collection is not attached to a database!'); }
}
} else {
if (callback) { callback('Cannot drop a collection\'s persistent storage when no name assigned to collection!'); }
}
} else {
// Call the original method
return CollectionDrop.call(this, callback);
}
}
}
});
/**
* Saves an entire collection's data to persistent storage.
* @param {Function=} callback The method to call when the save function
* has completed.
*/
Collection.prototype.save = function (callback) {
var self = this,
processSave;
if (self._name) {
if (self._db) {
processSave = function () {
// Save the collection data
self._db.persist.save(self._db._name + '-' + self._name, self._data, function (err, data, tableStats) {
if (!err) {
self._db.persist.save(self._db._name + '-' + self._name + '-metaData', self.metaData(), function (err, data, metaStats) {
if (callback) { callback(err, data, tableStats, metaStats); }
});
} else {
if (callback) { callback(err); }
}
});
};
// Check for processing queues
if (self.isProcessingQueue()) {
// Hook queue complete to process save
self.on('queuesComplete', function () {
processSave();
});
} else {
// Process save immediately
processSave();
}
} else {
if (callback) { callback('Cannot save a collection that is not attached to a database!'); }
}
} else {
if (callback) { callback('Cannot save a collection with no assigned name!'); }
}
};
/**
* Loads an entire collection's data from persistent storage.
* @param {Function=} callback The method to call when the load function
* has completed.
*/
Collection.prototype.load = function (callback) {
var self = this;
if (self._name) {
if (self._db) {
// Load the collection data
self._db.persist.load(self._db._name + '-' + self._name, function (err, data, tableStats) {
if (!err) {
if (data) {
self.setData(data);
}
// Now load the collection's metadata
self._db.persist.load(self._db._name + '-' + self._name + '-metaData', function (err, data, metaStats) {
if (!err) {
if (data) {
self.metaData(data);
}
}
if (callback) { callback(err, tableStats, metaStats); }
});
} else {
if (callback) { callback(err); }
}
});
} else {
if (callback) { callback('Cannot load a collection that is not attached to a database!'); }
}
} else {
if (callback) { callback('Cannot load a collection with no assigned name!'); }
}
};
// Override the DB init to instantiate the plugin
Db.prototype.init = function () {
DbInit.apply(this, arguments);
this.persist = new Persist(this);
};
/**
* Loads an entire database's data from persistent storage.
* @param {Function=} callback The method to call when the load function
* has completed.
*/
Db.prototype.load = function (callback) {
// Loop the collections in the database
var obj = this._collection,
keys = obj.keys(),
keyCount = keys.length,
loadCallback,
index;
loadCallback = function (err) {
if (!err) {
keyCount--;
if (keyCount === 0) {
if (callback) { callback(false); }
}
} else {
if (callback) { callback(err); }
}
};
for (index in obj) {
if (obj.hasOwnProperty(index)) {
// Call the collection load method
obj[index].load(loadCallback);
}
}
};
/**
* Saves an entire database's data to persistent storage.
* @param {Function=} callback The method to call when the save function
* has completed.
*/
Db.prototype.save = function (callback) {
// Loop the collections in the database
var obj = this._collection,
keys = obj.keys(),
keyCount = keys.length,
saveCallback,
index;
saveCallback = function (err) {
if (!err) {
keyCount--;
if (keyCount === 0) {
if (callback) { callback(false); }
}
} else {
if (callback) { callback(err); }
}
};
for (index in obj) {
if (obj.hasOwnProperty(index)) {
// Call the collection save method
obj[index].save(saveCallback);
}
}
};
Shared.finishModule('Persist');
module.exports = Persist;
},{"./Collection":5,"./CollectionGroup":6,"./PersistCompress":33,"./PersistCrypto":34,"./Shared":38,"async":41,"localforage":83}],33:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
pako = _dereq_('pako');
var Plugin = function () {
this.init.apply(this, arguments);
};
Plugin.prototype.init = function (options) {
};
Shared.mixin(Plugin.prototype, 'Mixin.Common');
Plugin.prototype.encode = function (val, meta, finished) {
var wrapper = {
data: val,
type: 'fdbCompress',
enabled: false
},
before,
after,
compressedVal;
// Compress the data
before = val.length;
compressedVal = pako.deflate(val, {to: 'string'});
after = compressedVal.length;
// If the compressed version is smaller than the original, use it!
if (after < before) {
wrapper.data = compressedVal;
wrapper.enabled = true;
}
meta.compression = {
enabled: wrapper.enabled,
compressedBytes: after,
uncompressedBytes: before,
effect: Math.round((100 / before) * after) + '%'
};
finished(false, this.jStringify(wrapper), meta);
};
Plugin.prototype.decode = function (wrapper, meta, finished) {
var compressionEnabled = false,
data;
if (wrapper) {
wrapper = this.jParse(wrapper);
// Check if we need to decompress the string
if (wrapper.enabled) {
data = pako.inflate(wrapper.data, {to: 'string'});
compressionEnabled = true;
} else {
data = wrapper.data;
compressionEnabled = false;
}
meta.compression = {
enabled: compressionEnabled
};
if (finished) {
finished(false, data, meta);
}
} else {
if (finished) {
finished(false, data, meta);
}
}
};
// Register this plugin with the persistent storage class
Shared.plugins.FdbCompress = Plugin;
module.exports = Plugin;
},{"./Shared":38,"pako":85}],34:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
CryptoJS = _dereq_('crypto-js');
var Plugin = function () {
this.init.apply(this, arguments);
};
Plugin.prototype.init = function (options) {
// Ensure at least a password is passed in options
if (!options || !options.pass) {
throw('Cannot initialise persistent storage encryption without a passphrase provided in the passed options object as the "pass" field.');
}
this._algo = options.algo || 'AES';
this._pass = options.pass;
};
Shared.mixin(Plugin.prototype, 'Mixin.Common');
/**
* Gets / sets the current pass-phrase being used to encrypt / decrypt
* data with the plugin.
*/
Shared.synthesize(Plugin.prototype, 'pass');
Plugin.prototype.stringify = function (cipherParams) {
// create json object with ciphertext
var jsonObj = {
ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64)
};
// optionally add iv and salt
if (cipherParams.iv) {
jsonObj.iv = cipherParams.iv.toString();
}
if (cipherParams.salt) {
jsonObj.s = cipherParams.salt.toString();
}
// stringify json object
return this.jStringify(jsonObj);
};
Plugin.prototype.parse = function (jsonStr) {
// parse json string
var jsonObj = this.jParse(jsonStr);
// extract ciphertext from json object, and create cipher params object
var cipherParams = CryptoJS.lib.CipherParams.create({
ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct)
});
// optionally extract iv and salt
if (jsonObj.iv) {
cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv);
}
if (jsonObj.s) {
cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s);
}
return cipherParams;
};
Plugin.prototype.encode = function (val, meta, finished) {
var self = this,
wrapper = {
type: 'fdbCrypto'
},
encryptedVal;
// Encrypt the data
encryptedVal = CryptoJS[this._algo].encrypt(val, this._pass, {
format: {
stringify: function () { return self.stringify.apply(self, arguments); },
parse: function () { return self.parse.apply(self, arguments); }
}
});
wrapper.data = encryptedVal.toString();
wrapper.enabled = true;
meta.encryption = {
enabled: wrapper.enabled
};
if (finished) {
finished(false, this.jStringify(wrapper), meta);
}
};
Plugin.prototype.decode = function (wrapper, meta, finished) {
var self = this,
data;
if (wrapper) {
wrapper = this.jParse(wrapper);
data = CryptoJS[this._algo].decrypt(wrapper.data, this._pass, {
format: {
stringify: function () { return self.stringify.apply(self, arguments); },
parse: function () { return self.parse.apply(self, arguments); }
}
}).toString(CryptoJS.enc.Utf8);
if (finished) {
finished(false, data, meta);
}
} else {
if (finished) {
finished(false, wrapper, meta);
}
}
};
// Register this plugin with the persistent storage class
Shared.plugins.FdbCrypto = Plugin;
module.exports = Plugin;
},{"./Shared":38,"crypto-js":50}],35:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared');
/**
* Provides chain reactor node linking so that a chain reaction can propagate
* down a node tree. Effectively creates a chain link between the reactorIn and
* reactorOut objects where a chain reaction from the reactorIn is passed through
* the reactorProcess before being passed to the reactorOut object. Reactor
* packets are only passed through to the reactorOut if the reactor IO method
* chainSend is used.
* @param {*} reactorIn An object that has the Mixin.ChainReactor methods mixed
* in to it. Chain reactions that occur inside this object will be passed through
* to the reactorOut object.
* @param {*} reactorOut An object that has the Mixin.ChainReactor methods mixed
* in to it. Chain reactions that occur in the reactorIn object will be passed
* through to this object.
* @param {Function} reactorProcess The processing method to use when chain
* reactions occur.
* @constructor
*/
var ReactorIO = function (reactorIn, reactorOut, reactorProcess) {
if (reactorIn && reactorOut && reactorProcess) {
this._reactorIn = reactorIn;
this._reactorOut = reactorOut;
this._chainHandler = reactorProcess;
if (!reactorIn.chain || !reactorOut.chainReceive) {
throw('ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!');
}
// Register the reactorIO with the input
reactorIn.chain(this);
// Register the output with the reactorIO
this.chain(reactorOut);
} else {
throw('ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!');
}
};
Shared.addModule('ReactorIO', ReactorIO);
/**
* Drop a reactor IO object, breaking the reactor link between the in and out
* reactor nodes.
* @returns {boolean}
*/
ReactorIO.prototype.drop = function () {
if (!this.isDropped()) {
this._state = 'dropped';
// Remove links
if (this._reactorIn) {
this._reactorIn.unChain(this);
}
if (this._reactorOut) {
this.unChain(this._reactorOut);
}
delete this._reactorIn;
delete this._reactorOut;
delete this._chainHandler;
this.emit('drop', this);
}
return true;
};
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(ReactorIO.prototype, 'state');
Shared.mixin(ReactorIO.prototype, 'Mixin.Common');
Shared.mixin(ReactorIO.prototype, 'Mixin.ChainReactor');
Shared.mixin(ReactorIO.prototype, 'Mixin.Events');
Shared.finishModule('ReactorIO');
module.exports = ReactorIO;
},{"./Shared":38}],36:[function(_dereq_,module,exports){
"use strict";
var Shared = _dereq_('./Shared'),
RestClient = _dereq_('rest'),
mime = _dereq_('rest/interceptor/mime'),
Db,
Collection,
CollectionDrop,
CollectionGroup,
CollectionInit,
DbInit,
Overload;
var Rest = function () {
this.init.apply(this, arguments);
};
Rest.prototype.init = function (db) {
this._endPoint = '';
this._client = RestClient.wrap(mime);
};
/**
* Convert a JSON object to url query parameter format.
* @param {Object} obj The object to convert.
* @returns {String}
* @private
*/
Rest.prototype._params = function (obj) {
var parts = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]));
}
}
return parts.join('&');
};
Rest.prototype.get = function (path, data, callback) {
var self= this,
coll;
path = path !== undefined ? path : "";
//console.log('Getting: ', this.endPoint() + path + '?' + this._params(data));
this._client({
method: 'get',
path: this.endPoint() + path,
params: data
}).then(function (response) {
if (response.entity && response.entity.error) {
if (callback) { callback(response.entity.error, response.entity, response); }
} else {
// Check if we have a collection
coll = self.collection();
if (coll) {
// Upsert the records into the collection
coll.upsert(response.entity);
}
if (callback) { callback(false, response.entity, response); }
}
}, function(response) {
if (callback) { callback(true, response.entity, response); }
});
};
Rest.prototype.post = function (path, data, callback) {
this._client({
method: 'post',
path: this.endPoint() + path,
entity: data,
headers: {
'Content-Type': 'application/json'
}
}).then(function (response) {
if (response.entity && response.entity.error) {
if (callback) { callback(response.entity.error, response.entity, response); }
} else {
if (callback) { callback(false, response.entity, response); }
}
}, function(response) {
if (callback) { callback(true, response); }
});
};
Shared.synthesize(Rest.prototype, 'sessionData');
Shared.synthesize(Rest.prototype, 'endPoint');
Shared.synthesize(Rest.prototype, 'collection');
Shared.addModule('Rest', Rest);
Shared.mixin(Rest.prototype, 'Mixin.ChainReactor');
Db = Shared.modules.Db;
Collection = _dereq_('./Collection');
CollectionDrop = Collection.prototype.drop;
CollectionGroup = _dereq_('./CollectionGroup');
CollectionInit = Collection.prototype.init;
DbInit = Db.prototype.init;
Overload = Shared.overload;
Collection.prototype.init = function () {
this.rest = new Rest();
this.rest.collection(this);
CollectionInit.apply(this, arguments);
};
Db.prototype.init = function () {
this.rest = new Rest();
DbInit.apply(this, arguments);
};
Shared.finishModule('Rest');
module.exports = Rest;
},{"./Collection":5,"./CollectionGroup":6,"./Shared":38,"rest":102,"rest/interceptor/mime":107}],37:[function(_dereq_,module,exports){
"use strict";
/**
* Provides functionality to encode and decode JavaScript objects to strings
* and back again. This differs from JSON.stringify and JSON.parse in that
* special objects such as dates can be encoded to strings and back again
* so that the reconstituted version of the string still contains a JavaScript
* date object.
* @constructor
*/
var Serialiser = function () {
this.init.apply(this, arguments);
};
Serialiser.prototype.init = function () {
this._encoder = [];
this._decoder = {};
// Register our handlers
this.registerEncoder('$date', function (data) {
if (data instanceof Date) {
return data.toISOString();
}
});
this.registerDecoder('$date', function (data) {
return new Date(data);
});
};
/**
* Register an encoder that can handle encoding for a particular
* object type.
* @param {String} handles The name of the handler e.g. $date.
* @param {Function} method The encoder method.
*/
Serialiser.prototype.registerEncoder = function (handles, method) {
this._encoder.push(function (data) {
var methodVal = method(data),
returnObj;
if (methodVal !== undefined) {
returnObj = {};
returnObj[handles] = methodVal;
}
return returnObj;
});
};
/**
* Register a decoder that can handle decoding for a particular
* object type.
* @param {String} handles The name of the handler e.g. $date. When an object
* has a field matching this handler name then this decode will be invoked
* to provide a decoded version of the data that was previously encoded by
* it's counterpart encoder method.
* @param {Function} method The decoder method.
*/
Serialiser.prototype.registerDecoder = function (handles, method) {
this._decoder[handles] = method;
};
/**
* Loops the encoders and asks each one if it wants to handle encoding for
* the passed data object. If no value is returned (undefined) then the data
* will be passed to the next encoder and so on. If a value is returned the
* loop will break and the encoded data will be used.
* @param {Object} data The data object to handle.
* @returns {*} The encoded data.
* @private
*/
Serialiser.prototype._encode = function (data) {
// Loop the encoders and if a return value is given by an encoder
// the loop will exit and return that value.
var count = this._encoder.length,
retVal;
while (count-- && !retVal) {
retVal = this._encoder[count](data);
}
return retVal;
};
/**
* Converts a previously encoded string back into an object.
* @param {String} data The string to convert to an object.
* @returns {Object} The reconstituted object.
*/
Serialiser.prototype.parse = function (data) {
return this._parse(JSON.parse(data));
};
/**
* Handles restoring an object with special data markers back into
* it's original format.
* @param {Object} data The object to recurse.
* @param {Object=} target The target object to restore data to.
* @returns {Object} The final restored object.
* @private
*/
Serialiser.prototype._parse = function (data, target) {
var i;
if (typeof data === 'object' && data !== null) {
if (data instanceof Array) {
target = target || [];
} else {
target = target || {};
}
// Iterate through the object's keys and handle
// special object types and restore them
for (i in data) {
if (data.hasOwnProperty(i)) {
if (i.substr(0, 1) === '$' && this._decoder[i]) {
// This is a special object type and a handler
// exists, restore it
return this._decoder[i](data[i]);
}
// Not a special object or no handler, recurse as normal
target[i] = this._parse(data[i], target[i]);
}
}
} else {
target = data;
}
// The data is a basic type
return target;
};
/**
* Converts an object to a encoded string representation.
* @param {Object} data The object to encode.
*/
Serialiser.prototype.stringify = function (data) {
return JSON.stringify(this._stringify(data));
};
/**
* Recurse down an object and encode special objects so they can be
* stringified and later restored.
* @param {Object} data The object to parse.
* @param {Object=} target The target object to store converted data to.
* @returns {Object} The converted object.
* @private
*/
Serialiser.prototype._stringify = function (data, target) {
var handledData,
i;
if (typeof data === 'object' && data !== null) {
// Handle special object types so they can be encoded with
// a special marker and later restored by a decoder counterpart
handledData = this._encode(data);
if (handledData) {
// An encoder handled this object type so return it now
return handledData;
}
if (data instanceof Array) {
target = target || [];
} else {
target = target || {};
}
// Iterate through the object's keys and serialise
for (i in data) {
if (data.hasOwnProperty(i)) {
target[i] = this._stringify(data[i], target[i]);
}
}
} else {
target = data;
}
// The data is a basic type
return target;
};
module.exports = Serialiser;
},{}],38:[function(_dereq_,module,exports){
"use strict";
var Overload = _dereq_('./Overload');
/**
* A shared object that can be used to store arbitrary data between class
* instances, and access helper methods.
* @mixin
*/
var Shared = {
version: '1.3.423',
modules: {},
plugins: {},
_synth: {},
/**
* Adds a module to ForerunnerDB.
* @memberof Shared
* @param {String} name The name of the module.
* @param {Function} module The module class.
*/
addModule: function (name, module) {
// Store the module in the module registry
this.modules[name] = module;
// Tell the universe we are loading this module
this.emit('moduleLoad', [name, module]);
},
/**
* Called by the module once all processing has been completed. Used to determine
* if the module is ready for use by other modules.
* @memberof Shared
* @param {String} name The name of the module.
*/
finishModule: function (name) {
if (this.modules[name]) {
// Set the finished loading flag to true
this.modules[name]._fdbFinished = true;
// Assign the module name to itself so it knows what it
// is called
if (this.modules[name].prototype) {
this.modules[name].prototype.className = name;
} else {
this.modules[name].className = name;
}
this.emit('moduleFinished', [name, this.modules[name]]);
} else {
throw('ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): ' + name);
}
},
/**
* Will call your callback method when the specified module has loaded. If the module
* is already loaded the callback is called immediately.
* @memberof Shared
* @param {String} name The name of the module.
* @param {Function} callback The callback method to call when the module is loaded.
*/
moduleFinished: function (name, callback) {
if (this.modules[name] && this.modules[name]._fdbFinished) {
if (callback) { callback(name, this.modules[name]); }
} else {
this.on('moduleFinished', callback);
}
},
/**
* Determines if a module has been added to ForerunnerDB or not.
* @memberof Shared
* @param {String} name The name of the module.
* @returns {Boolean} True if the module exists or false if not.
*/
moduleExists: function (name) {
return Boolean(this.modules[name]);
},
/**
* Adds the properties and methods defined in the mixin to the passed object.
* @memberof Shared
* @param {Object} obj The target object to add mixin key/values to.
* @param {String} mixinName The name of the mixin to add to the object.
*/
mixin: new Overload({
'object, string': function (obj, mixinName) {
var mixinObj;
if (typeof mixinName === 'string') {
mixinObj = this.mixins[mixinName];
if (!mixinObj) {
throw('ForerunnerDB.Shared: Cannot find mixin named: ' + mixinName);
}
}
return this.$main.call(this, obj, mixinObj);
},
'object, *': function (obj, mixinObj) {
return this.$main.call(this, obj, mixinObj);
},
'$main': function (obj, mixinObj) {
if (mixinObj && typeof mixinObj === 'object') {
for (var i in mixinObj) {
if (mixinObj.hasOwnProperty(i)) {
obj[i] = mixinObj[i];
}
}
}
return obj;
}
}),
/**
* Generates a generic getter/setter method for the passed method name.
* @memberof Shared
* @param {Object} obj The object to add the getter/setter to.
* @param {String} name The name of the getter/setter to generate.
* @param {Function=} extend A method to call before executing the getter/setter.
* The existing getter/setter can be accessed from the extend method via the
* $super e.g. this.$super();
*/
synthesize: function (obj, name, extend) {
this._synth[name] = this._synth[name] || function (val) {
if (val !== undefined) {
this['_' + name] = val;
return this;
}
return this['_' + name];
};
if (extend) {
var self = this;
obj[name] = function () {
var tmp = this.$super,
ret;
this.$super = self._synth[name];
ret = extend.apply(this, arguments);
this.$super = tmp;
return ret;
};
} else {
obj[name] = this._synth[name];
}
},
/**
* Allows a method to be overloaded.
* @memberof Shared
* @param arr
* @returns {Function}
* @constructor
*/
overload: Overload,
/**
* Define the mixins that other modules can use as required.
* @memberof Shared
*/
mixins: {
'Mixin.Common': _dereq_('./Mixin.Common'),
'Mixin.Events': _dereq_('./Mixin.Events'),
'Mixin.ChainReactor': _dereq_('./Mixin.ChainReactor'),
'Mixin.CRUD': _dereq_('./Mixin.CRUD'),
'Mixin.Constants': _dereq_('./Mixin.Constants'),
'Mixin.Triggers': _dereq_('./Mixin.Triggers'),
'Mixin.Sorting': _dereq_('./Mixin.Sorting'),
'Mixin.Matching': _dereq_('./Mixin.Matching'),
'Mixin.Updating': _dereq_('./Mixin.Updating'),
'Mixin.Tags': _dereq_('./Mixin.Tags')
}
};
// Add event handling to shared
Shared.mixin(Shared, 'Mixin.Events');
module.exports = Shared;
},{"./Mixin.CRUD":17,"./Mixin.ChainReactor":18,"./Mixin.Common":19,"./Mixin.Constants":20,"./Mixin.Events":21,"./Mixin.Matching":22,"./Mixin.Sorting":23,"./Mixin.Tags":24,"./Mixin.Triggers":25,"./Mixin.Updating":26,"./Overload":29}],39:[function(_dereq_,module,exports){
/* jshint strict:false */
if (!Array.prototype.filter) {
Array.prototype.filter = function(fun/*, thisArg*/) {
if (this === void 0 || this === null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0; // jshint ignore:line
if (typeof fun !== 'function') {
throw new TypeError();
}
var res = [];
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++) {
if (i in t) {
var val = t[i];
// NOTE: Technically this should Object.defineProperty at
// the next index, as push can be affected by
// properties on Object.prototype and Array.prototype.
// But that method's new, and collisions should be
// rare, so use the more-compatible alternative.
if (fun.call(thisArg, val, i, t)) {
res.push(val);
}
}
}
return res;
};
}
if (typeof Object.create !== 'function') {
Object.create = (function() {
var Temp = function() {};
return function (prototype) {
if (arguments.length > 1) {
throw Error('Second argument not supported');
}
if (typeof prototype !== 'object') {
throw TypeError('Argument must be an object');
}
Temp.prototype = prototype;
var result = new Temp();
Temp.prototype = null;
return result;
};
})();
}
// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14e
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(searchElement, fromIndex) {
var k;
// 1. Let O be the result of calling ToObject passing
// the this value as the argument.
if (this === null) {
throw new TypeError('"this" is null or not defined');
}
var O = Object(this);
// 2. Let lenValue be the result of calling the Get
// internal method of O with the argument "length".
// 3. Let len be ToUint32(lenValue).
var len = O.length >>> 0; // jshint ignore:line
// 4. If len is 0, return -1.
if (len === 0) {
return -1;
}
// 5. If argument fromIndex was passed let n be
// ToInteger(fromIndex); else let n be 0.
var n = +fromIndex || 0;
if (Math.abs(n) === Infinity) {
n = 0;
}
// 6. If n >= len, return -1.
if (n >= len) {
return -1;
}
// 7. If n >= 0, then Let k be n.
// 8. Else, n<0, Let k be len - abs(n).
// If k is less than 0, then let k be 0.
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
// 9. Repeat, while k < len
while (k < len) {
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator
// b. Let kPresent be the result of calling the
// HasProperty internal method of O with argument Pk.
// This step can be combined with c
// c. If kPresent is true, then
// i. Let elementK be the result of calling the Get
// internal method of O with the argument ToString(k).
// ii. Let same be the result of applying the
// Strict Equality Comparison Algorithm to
// searchElement and elementK.
// iii. If same is true, return k.
if (k in O && O[k] === searchElement) {
return k;
}
k++;
}
return -1;
};
}
module.exports = {};
},{}],40:[function(_dereq_,module,exports){
"use strict";
// Import external names locally
var Shared,
Db,
Collection,
CollectionGroup,
CollectionInit,
DbInit,
ReactorIO,
ActiveBucket;
Shared = _dereq_('./Shared');
/**
* Creates a new view instance.
* @param {String} name The name of the view.
* @param {Object=} query The view's query.
* @param {Object=} options An options object.
* @constructor
*/
var View = function (name, query, options) {
this.init.apply(this, arguments);
};
View.prototype.init = function (name, query, options) {
var self = this;
this._name = name;
this._listeners = {};
this._querySettings = {};
this._debug = {};
this.query(query, false);
this.queryOptions(options, false);
this._collectionDroppedWrap = function () {
self._collectionDropped.apply(self, arguments);
};
this._privateData = new Collection(this.name() + '_internalPrivate');
};
Shared.addModule('View', View);
Shared.mixin(View.prototype, 'Mixin.Common');
Shared.mixin(View.prototype, 'Mixin.ChainReactor');
Shared.mixin(View.prototype, 'Mixin.Constants');
Shared.mixin(View.prototype, 'Mixin.Triggers');
Shared.mixin(View.prototype, 'Mixin.Tags');
Collection = _dereq_('./Collection');
CollectionGroup = _dereq_('./CollectionGroup');
ActiveBucket = _dereq_('./ActiveBucket');
ReactorIO = _dereq_('./ReactorIO');
CollectionInit = Collection.prototype.init;
Db = Shared.modules.Db;
DbInit = Db.prototype.init;
/**
* Gets / sets the current state.
* @param {String=} val The name of the state to set.
* @returns {*}
*/
Shared.synthesize(View.prototype, 'state');
/**
* Gets / sets the current name.
* @param {String=} val The new name to set.
* @returns {*}
*/
Shared.synthesize(View.prototype, 'name');
/**
* Gets / sets the current cursor.
* @param {String=} val The new cursor to set.
* @returns {*}
*/
Shared.synthesize(View.prototype, 'cursor', function (val) {
if (val === undefined) {
return this._cursor || {};
}
this.$super.apply(this, arguments);
});
/**
* Executes an insert against the view's underlying data-source.
* @see Collection::insert()
*/
View.prototype.insert = function () {
this._from.insert.apply(this._from, arguments);
};
/**
* Executes an update against the view's underlying data-source.
* @see Collection::update()
*/
View.prototype.update = function () {
this._from.update.apply(this._from, arguments);
};
/**
* Executes an updateById against the view's underlying data-source.
* @see Collection::updateById()
*/
View.prototype.updateById = function () {
this._from.updateById.apply(this._from, arguments);
};
/**
* Executes a remove against the view's underlying data-source.
* @see Collection::remove()
*/
View.prototype.remove = function () {
this._from.remove.apply(this._from, arguments);
};
/**
* Queries the view data.
* @see Collection::find()
* @returns {Array} The result of the find query.
*/
View.prototype.find = function (query, options) {
return this.publicData().find(query, options);
};
/**
* Queries the view data for a single document.
* @see Collection::findOne()
* @returns {Object} The result of the find query.
*/
View.prototype.findOne = function (query, options) {
return this.publicData().findOne(query, options);
};
/**
* Queries the view data by specific id.
* @see Collection::findById()
* @returns {Array} The result of the find query.
*/
View.prototype.findById = function (id, options) {
return this.publicData().findById(id, options);
};
/**
* Queries the view data in a sub-array.
* @see Collection::findSub()
* @returns {Array} The result of the find query.
*/
View.prototype.findSub = function (match, path, subDocQuery, subDocOptions) {
return this.publicData().findSub(match, path, subDocQuery, subDocOptions);
};
/**
* Queries the view data in a sub-array and returns first match.
* @see Collection::findSubOne()
* @returns {Object} The result of the find query.
*/
View.prototype.findSubOne = function (match, path, subDocQuery, subDocOptions) {
return this.publicData().findSubOne(match, path, subDocQuery, subDocOptions);
};
/**
* Gets the module's internal data collection.
* @returns {Collection}
*/
View.prototype.data = function () {
return this._privateData;
};
/**
* Sets the source from which the view will assemble its data.
* @param {Collection|View} source The source to use to assemble view data.
* @param {Function=} callback A callback method.
* @returns {*} If no argument is passed, returns the current value of from,
* otherwise returns itself for chaining.
*/
View.prototype.from = function (source, callback) {
var self = this;
if (source !== undefined) {
// Check if we have an existing from
if (this._from) {
// Remove the listener to the drop event
this._from.off('drop', this._collectionDroppedWrap);
delete this._from;
}
if (typeof(source) === 'string') {
source = this._db.collection(source);
}
if (source.className === 'View') {
// The source is a view so IO to the internal data collection
// instead of the view proper
source = source.privateData();
if (this.debug()) {
console.log(this.logIdentifier() + ' Using internal private data "' + source.instanceIdentifier() + '" for IO graph linking');
}
}
this._from = source;
this._from.on('drop', this._collectionDroppedWrap);
// Create a new reactor IO graph node that intercepts chain packets from the
// view's "from" source and determines how they should be interpreted by
// this view. If the view does not have a query then this reactor IO will
// simply pass along the chain packet without modifying it.
this._io = new ReactorIO(source, this, function (chainPacket) {
var data,
diff,
query,
filteredData,
doSend,
pk,
i;
// Check that the state of the "self" object is not dropped
if (self && !self.isDropped()) {
// Check if we have a constraining query
if (self._querySettings.query) {
if (chainPacket.type === 'insert') {
data = chainPacket.data;
// Check if the data matches our query
if (data instanceof Array) {
filteredData = [];
for (i = 0; i < data.length; i++) {
if (self._privateData._match(data[i], self._querySettings.query, self._querySettings.options, 'and', {})) {
filteredData.push(data[i]);
doSend = true;
}
}
} else {
if (self._privateData._match(data, self._querySettings.query, self._querySettings.options, 'and', {})) {
filteredData = data;
doSend = true;
}
}
if (doSend) {
this.chainSend('insert', filteredData);
}
return true;
}
if (chainPacket.type === 'update') {
// Do a DB diff between this view's data and the underlying collection it reads from
// to see if something has changed
diff = self._privateData.diff(self._from.subset(self._querySettings.query, self._querySettings.options));
if (diff.insert.length || diff.remove.length) {
// Now send out new chain packets for each operation
if (diff.insert.length) {
this.chainSend('insert', diff.insert);
}
if (diff.update.length) {
pk = self._privateData.primaryKey();
for (i = 0; i < diff.update.length; i++) {
query = {};
query[pk] = diff.update[i][pk];
this.chainSend('update', {
query: query,
update: diff.update[i]
});
}
}
if (diff.remove.length) {
pk = self._privateData.primaryKey();
var $or = [],
removeQuery = {
query: {
$or: $or
}
};
for (i = 0; i < diff.remove.length; i++) {
$or.push({_id: diff.remove[i][pk]});
}
this.chainSend('remove', removeQuery);
}
// Return true to stop further propagation of the chain packet
return true;
} else {
// Returning false informs the chain reactor to continue propagation
// of the chain packet down the graph tree
return false;
}
}
}
}
// Returning false informs the chain reactor to continue propagation
// of the chain packet down the graph tree
return false;
});
var collData = source.find(this._querySettings.query, this._querySettings.options);
this._privateData.primaryKey(source.primaryKey());
this._privateData.setData(collData, {}, callback);
if (this._querySettings.options && this._querySettings.options.$orderBy) {
this.rebuildActiveBucket(this._querySettings.options.$orderBy);
} else {
this.rebuildActiveBucket();
}
return this;
}
return this._from;
};
/**
* Handles when an underlying collection the view is using as a data
* source is dropped.
* @param {Collection} collection The collection that has been dropped.
* @private
*/
View.prototype._collectionDropped = function (collection) {
if (collection) {
// Collection was dropped, remove from view
delete this._from;
}
};
/**
* Creates an index on the view.
* @see Collection::ensureIndex()
* @returns {*}
*/
View.prototype.ensureIndex = function () {
return this._privateData.ensureIndex.apply(this._privateData, arguments);
};
/**
* The chain reaction handler method for the view.
* @param {Object} chainPacket The chain reaction packet to handle.
* @private
*/
View.prototype._chainHandler = function (chainPacket) {
var //self = this,
arr,
count,
index,
insertIndex,
updates,
primaryKey,
item,
currentIndex;
if (this.debug()) {
console.log(this.logIdentifier() + ' Received chain reactor data');
}
switch (chainPacket.type) {
case 'setData':
if (this.debug()) {
console.log(this.logIdentifier() + ' Setting data in underlying (internal) view collection "' + this._privateData.name() + '"');
}
// Get the new data from our underlying data source sorted as we want
var collData = this._from.find(this._querySettings.query, this._querySettings.options);
this._privateData.setData(collData);
break;
case 'insert':
if (this.debug()) {
console.log(this.logIdentifier() + ' Inserting some data into underlying (internal) view collection "' + this._privateData.name() + '"');
}
// Decouple the data to ensure we are working with our own copy
chainPacket.data = this.decouple(chainPacket.data);
// Make sure we are working with an array
if (!(chainPacket.data instanceof Array)) {
chainPacket.data = [chainPacket.data];
}
if (this._querySettings.options && this._querySettings.options.$orderBy) {
// Loop the insert data and find each item's index
arr = chainPacket.data;
count = arr.length;
for (index = 0; index < count; index++) {
insertIndex = this._activeBucket.insert(arr[index]);
this._privateData._insertHandle(chainPacket.data, insertIndex);
}
} else {
// Set the insert index to the passed index, or if none, the end of the view data array
insertIndex = this._privateData._data.length;
this._privateData._insertHandle(chainPacket.data, insertIndex);
}
break;
case 'update':
if (this.debug()) {
console.log(this.logIdentifier() + ' Updating some data in underlying (internal) view collection "' + this._privateData.name() + '"');
}
primaryKey = this._privateData.primaryKey();
// Do the update
updates = this._privateData.update(
chainPacket.data.query,
chainPacket.data.update,
chainPacket.data.options
);
if (this._querySettings.options && this._querySettings.options.$orderBy) {
// TODO: This would be a good place to improve performance by somehow
// TODO: inspecting the change that occurred when update was performed
// TODO: above and determining if it affected the order clause keys
// TODO: and if not, skipping the active bucket updates here
// Loop the updated items and work out their new sort locations
count = updates.length;
for (index = 0; index < count; index++) {
item = updates[index];
// Remove the item from the active bucket (via it's id)
this._activeBucket.remove(item);
// Get the current location of the item
currentIndex = this._privateData._data.indexOf(item);
// Add the item back in to the active bucket
insertIndex = this._activeBucket.insert(item);
if (currentIndex !== insertIndex) {
// Move the updated item to the new index
this._privateData._updateSpliceMove(this._privateData._data, currentIndex, insertIndex);
}
}
}
break;
case 'remove':
if (this.debug()) {
console.log(this.logIdentifier() + ' Removing some data from underlying (internal) view collection "' + this._privateData.name() + '"');
}
this._privateData.remove(chainPacket.data.query, chainPacket.options);
break;
default:
break;
}
};
/**
* Listens for an event.
* @see Mixin.Events::on()
*/
View.prototype.on = function () {
return this._privateData.on.apply(this._privateData, arguments);
};
/**
* Cancels an event listener.
* @see Mixin.Events::off()
*/
View.prototype.off = function () {
return this._privateData.off.apply(this._privateData, arguments);
};
/**
* Emits an event.
* @see Mixin.Events::emit()
*/
View.prototype.emit = function () {
return this._privateData.emit.apply(this._privateData, arguments);
};
/**
* Find the distinct values for a specified field across a single collection and
* returns the results in an array.
* @param {String} key The field path to return distinct values for e.g. "person.name".
* @param {Object=} query The query to use to filter the documents used to return values from.
* @param {Object=} options The query options to use when running the query.
* @returns {Array}
*/
View.prototype.distinct = function (key, query, options) {
var coll = this.publicData();
return coll.distinct.apply(coll, arguments);
};
/**
* Gets the primary key for this view from the assigned collection.
* @see Collection::primaryKey()
* @returns {String}
*/
View.prototype.primaryKey = function () {
return this.publicData().primaryKey();
};
/**
* Drops a view and all it's stored data from the database.
* @returns {boolean} True on success, false on failure.
*/
View.prototype.drop = function (callback) {
if (!this.isDropped()) {
if (this._from) {
this._from.off('drop', this._collectionDroppedWrap);
this._from._removeView(this);
}
if (this.debug() || (this._db && this._db.debug())) {
console.log(this.logIdentifier() + ' Dropping');
}
this._state = 'dropped';
// Clear io and chains
if (this._io) {
this._io.drop();
}
// Drop the view's internal collection
if (this._privateData) {
this._privateData.drop();
}
if (this._publicData && this._publicData !== this._privateData) {
this._publicData.drop();
}
if (this._db && this._name) {
delete this._db._view[this._name];
}
this.emit('drop', this);
if (callback) { callback(false, true); }
delete this._chain;
delete this._from;
delete this._privateData;
delete this._io;
delete this._listeners;
delete this._querySettings;
delete this._db;
return true;
}
return false;
};
/**
* Gets / sets the db instance this class instance belongs to.
* @param {Db=} db The db instance.
* @memberof View
* @returns {*}
*/
Shared.synthesize(View.prototype, 'db', function (db) {
if (db) {
this.privateData().db(db);
this.publicData().db(db);
// Apply the same debug settings
this.debug(db.debug());
this.privateData().debug(db.debug());
this.publicData().debug(db.debug());
}
return this.$super.apply(this, arguments);
});
/**
* Gets / sets the query object and query options that the view uses
* to build it's data set. This call modifies both the query and
* query options at the same time.
* @param {Object=} query The query to set.
* @param {Boolean=} options The query options object.
* @param {Boolean=} refresh Whether to refresh the view data after
* this operation. Defaults to true.
* @returns {*}
*/
View.prototype.queryData = function (query, options, refresh) {
if (query !== undefined) {
this._querySettings.query = query;
}
if (options !== undefined) {
this._querySettings.options = options;
}
if (query !== undefined || options !== undefined) {
if (refresh === undefined || refresh === true) {
this.refresh();
}
return this;
}
return this._querySettings;
};
/**
* Add data to the existing query.
* @param {Object} obj The data whose keys will be added to the existing
* query object.
* @param {Boolean} overwrite Whether or not to overwrite data that already
* exists in the query object. Defaults to true.
* @param {Boolean=} refresh Whether or not to refresh the view data set
* once the operation is complete. Defaults to true.
*/
View.prototype.queryAdd = function (obj, overwrite, refresh) {
this._querySettings.query = this._querySettings.query || {};
var query = this._querySettings.query,
i;
if (obj !== undefined) {
// Loop object properties and add to existing query
for (i in obj) {
if (obj.hasOwnProperty(i)) {
if (query[i] === undefined || (query[i] !== undefined && overwrite !== false)) {
query[i] = obj[i];
}
}
}
}
if (refresh === undefined || refresh === true) {
this.refresh();
}
};
/**
* Remove data from the existing query.
* @param {Object} obj The data whose keys will be removed from the existing
* query object.
* @param {Boolean=} refresh Whether or not to refresh the view data set
* once the operation is complete. Defaults to true.
*/
View.prototype.queryRemove = function (obj, refresh) {
var query = this._querySettings.query,
i;
if (query) {
if (obj !== undefined) {
// Loop object properties and add to existing query
for (i in obj) {
if (obj.hasOwnProperty(i)) {
delete query[i];
}
}
}
if (refresh === undefined || refresh === true) {
this.refresh();
}
}
};
/**
* Gets / sets the query being used to generate the view data. It
* does not change or modify the view's query options.
* @param {Object=} query The query to set.
* @param {Boolean=} refresh Whether to refresh the view data after
* this operation. Defaults to true.
* @returns {*}
*/
View.prototype.query = function (query, refresh) {
if (query !== undefined) {
this._querySettings.query = query;
if (refresh === undefined || refresh === true) {
this.refresh();
}
return this;
}
return this._querySettings.query;
};
/**
* Gets / sets the orderBy clause in the query options for the view.
* @param {Object=} val The order object.
* @returns {*}
*/
View.prototype.orderBy = function (val) {
if (val !== undefined) {
var queryOptions = this.queryOptions() || {};
queryOptions.$orderBy = val;
this.queryOptions(queryOptions);
return this;
}
return (this.queryOptions() || {}).$orderBy;
};
/**
* Gets / sets the page clause in the query options for the view.
* @param {Number=} val The page number to change to (zero index).
* @returns {*}
*/
View.prototype.page = function (val) {
if (val !== undefined) {
var queryOptions = this.queryOptions() || {};
// Only execute a query options update if page has changed
if (val !== queryOptions.$page) {
queryOptions.$page = val;
this.queryOptions(queryOptions);
}
return this;
}
return (this.queryOptions() || {}).$page;
};
/**
* Jump to the first page in the data set.
* @returns {*}
*/
View.prototype.pageFirst = function () {
return this.page(0);
};
/**
* Jump to the last page in the data set.
* @returns {*}
*/
View.prototype.pageLast = function () {
var pages = this.cursor().pages,
lastPage = pages !== undefined ? pages : 0;
return this.page(lastPage - 1);
};
/**
* Move forward or backwards in the data set pages by passing a positive
* or negative integer of the number of pages to move.
* @param {Number} val The number of pages to move.
* @returns {*}
*/
View.prototype.pageScan = function (val) {
if (val !== undefined) {
var pages = this.cursor().pages,
queryOptions = this.queryOptions() || {},
currentPage = queryOptions.$page !== undefined ? queryOptions.$page : 0;
currentPage += val;
if (currentPage < 0) {
currentPage = 0;
}
if (currentPage >= pages) {
currentPage = pages - 1;
}
return this.page(currentPage);
}
};
/**
* Gets / sets the query options used when applying sorting etc to the
* view data set.
* @param {Object=} options An options object.
* @param {Boolean=} refresh Whether to refresh the view data after
* this operation. Defaults to true.
* @returns {*}
*/
View.prototype.queryOptions = function (options, refresh) {
if (options !== undefined) {
this._querySettings.options = options;
if (options.$decouple === undefined) { options.$decouple = true; }
if (refresh === undefined || refresh === true) {
this.refresh();
} else {
this.rebuildActiveBucket(options.$orderBy);
}
return this;
}
return this._querySettings.options;
};
View.prototype.rebuildActiveBucket = function (orderBy) {
if (orderBy) {
var arr = this._privateData._data,
arrCount = arr.length;
// Build a new active bucket
this._activeBucket = new ActiveBucket(orderBy);
this._activeBucket.primaryKey(this._privateData.primaryKey());
// Loop the current view data and add each item
for (var i = 0; i < arrCount; i++) {
this._activeBucket.insert(arr[i]);
}
} else {
// Remove any existing active bucket
delete this._activeBucket;
}
};
/**
* Refreshes the view data such as ordering etc.
*/
View.prototype.refresh = function () {
if (this._from) {
var pubData = this.publicData(),
refreshResults;
// Re-grab all the data for the view from the collection
this._privateData.remove();
//pubData.remove();
refreshResults = this._from.find(this._querySettings.query, this._querySettings.options);
this.cursor(refreshResults.$cursor);
this._privateData.insert(refreshResults);
this._privateData._data.$cursor = refreshResults.$cursor;
pubData._data.$cursor = refreshResults.$cursor;
/*if (pubData._linked) {
// Update data and observers
//var transformedData = this._privateData.find();
// TODO: Shouldn't this data get passed into a transformIn first?
// TODO: This breaks linking because its passing decoupled data and overwriting non-decoupled data
// TODO: Is this even required anymore? After commenting it all seems to work
// TODO: Might be worth setting up a test to check transforms and linking then remove this if working?
//jQuery.observable(pubData._data).refresh(transformedData);
}*/
}
if (this._querySettings.options && this._querySettings.options.$orderBy) {
this.rebuildActiveBucket(this._querySettings.options.$orderBy);
} else {
this.rebuildActiveBucket();
}
return this;
};
/**
* Returns the number of documents currently in the view.
* @returns {Number}
*/
View.prototype.count = function () {
if (this.publicData()) {
return this.publicData().count.apply(this.publicData(), arguments);
}
return 0;
};
// Call underlying
View.prototype.subset = function () {
return this.publicData().subset.apply(this._privateData, arguments);
};
/**
* Takes the passed data and uses it to set transform methods and globally
* enable or disable the transform system for the view.
* @param {Object} obj The new transform system settings "enabled", "dataIn" and "dataOut":
* {
* "enabled": true,
* "dataIn": function (data) { return data; },
* "dataOut": function (data) { return data; }
* }
* @returns {*}
*/
View.prototype.transform = function (obj) {
var self = this;
if (obj !== undefined) {
if (typeof obj === "object") {
if (obj.enabled !== undefined) {
this._transformEnabled = obj.enabled;
}
if (obj.dataIn !== undefined) {
this._transformIn = obj.dataIn;
}
if (obj.dataOut !== undefined) {
this._transformOut = obj.dataOut;
}
} else {
this._transformEnabled = obj !== false;
}
if (this._transformEnabled) {
// Check for / create the public data collection
if (!this._publicData) {
// Create the public data collection
this._publicData = new Collection('__FDB__view_publicData_' + this._name);
this._publicData.db(this._privateData._db);
this._publicData.transform({
enabled: true,
dataIn: this._transformIn,
dataOut: this._transformOut
});
// Create a chain reaction IO node to keep the private and
// public data collections in sync
this._transformIo = new ReactorIO(this._privateData, this._publicData, function (chainPacket) {
var data = chainPacket.data;
switch (chainPacket.type) {
case 'primaryKey':
self._publicData.primaryKey(data);
this.chainSend('primaryKey', data);
break;
case 'setData':
self._publicData.setData(data);
this.chainSend('setData', data);
break;
case 'insert':
self._publicData.insert(data);
this.chainSend('insert', data);
break;
case 'update':
// Do the update
self._publicData.update(
data.query,
data.update,
data.options
);
this.chainSend('update', data);
break;
case 'remove':
self._publicData.remove(data.query, chainPacket.options);
this.chainSend('remove', data);
break;
default:
break;
}
});
}
// Set initial data and settings
this._publicData.primaryKey(this.privateData().primaryKey());
this._publicData.setData(this.privateData().find());
} else {
// Remove the public data collection
if (this._publicData) {
this._publicData.drop();
delete this._publicData;
if (this._transformIo) {
this._transformIo.drop();
delete this._transformIo;
}
}
}
return this;
}
return {
enabled: this._transformEnabled,
dataIn: this._transformIn,
dataOut: this._transformOut
};
};
/**
* Executes a method against each document that matches query and returns an
* array of documents that may have been modified by the method.
* @param {Object} query The query object.
* @param {Function} func The method that each document is passed to. If this method
* returns false for a particular document it is excluded from the results.
* @param {Object=} options Optional options object.
* @returns {Array}
*/
View.prototype.filter = function (query, func, options) {
return (this.publicData()).filter(query, func, options);
};
/**
* Returns the non-transformed data the view holds as a collection
* reference.
* @return {Collection} The non-transformed collection reference.
*/
View.prototype.privateData = function () {
return this._privateData;
};
/**
* Returns a data object representing the public data this view
* contains. This can change depending on if transforms are being
* applied to the view or not.
*
* If no transforms are applied then the public data will be the
* same as the private data the view holds. If transforms are
* applied then the public data will contain the transformed version
* of the private data.
*
* The public data collection is also used by data binding to only
* changes to the publicData will show in a data-bound element.
*/
View.prototype.publicData = function () {
if (this._transformEnabled) {
return this._publicData;
} else {
return this._privateData;
}
};
// Extend collection with view init
Collection.prototype.init = function () {
this._view = [];
CollectionInit.apply(this, arguments);
};
/**
* Creates a view and assigns the collection as its data source.
* @param {String} name The name of the new view.
* @param {Object} query The query to apply to the new view.
* @param {Object} options The options object to apply to the view.
* @returns {*}
*/
Collection.prototype.view = function (name, query, options) {
if (this._db && this._db._view ) {
if (!this._db._view[name]) {
var view = new View(name, query, options)
.db(this._db)
.from(this);
this._view = this._view || [];
this._view.push(view);
return view;
} else {
throw(this.logIdentifier() + ' Cannot create a view using this collection because a view with this name already exists: ' + name);
}
}
};
/**
* Adds a view to the internal view lookup.
* @param {View} view The view to add.
* @returns {Collection}
* @private
*/
Collection.prototype._addView = CollectionGroup.prototype._addView = function (view) {
if (view !== undefined) {
this._view.push(view);
}
return this;
};
/**
* Removes a view from the internal view lookup.
* @param {View} view The view to remove.
* @returns {Collection}
* @private
*/
Collection.prototype._removeView = CollectionGroup.prototype._removeView = function (view) {
if (view !== undefined) {
var index = this._view.indexOf(view);
if (index > -1) {
this._view.splice(index, 1);
}
}
return this;
};
// Extend DB with views init
Db.prototype.init = function () {
this._view = {};
DbInit.apply(this, arguments);
};
/**
* Gets a view by it's name.
* @param {String} viewName The name of the view to retrieve.
* @returns {*}
*/
Db.prototype.view = function (viewName) {
// Handle being passed an instance
if (viewName instanceof View) {
return viewName;
}
if (!this._view[viewName]) {
if (this.debug() || (this._db && this._db.debug())) {
console.log(this.logIdentifier() + ' Creating view ' + viewName);
}
}
this._view[viewName] = this._view[viewName] || new View(viewName).db(this);
return this._view[viewName];
};
/**
* Determine if a view with the passed name already exists.
* @param {String} viewName The name of the view to check for.
* @returns {boolean}
*/
Db.prototype.viewExists = function (viewName) {
return Boolean(this._view[viewName]);
};
/**
* Returns an array of views the DB currently has.
* @returns {Array} An array of objects containing details of each view
* the database is currently managing.
*/
Db.prototype.views = function () {
var arr = [],
view,
i;
for (i in this._view) {
if (this._view.hasOwnProperty(i)) {
view = this._view[i];
arr.push({
name: i,
count: view.count(),
linked: view.isLinked !== undefined ? view.isLinked() : false
});
}
}
return arr;
};
Shared.finishModule('View');
module.exports = View;
},{"./ActiveBucket":3,"./Collection":5,"./CollectionGroup":6,"./ReactorIO":35,"./Shared":38}],41:[function(_dereq_,module,exports){
(function (process,global){
/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/
(function () {
var async = {};
function noop() {}
function identity(v) {
return v;
}
function toBool(v) {
return !!v;
}
function notId(v) {
return !v;
}
// global on the server, window in the browser
var previous_async;
// Establish the root object, `window` (`self`) in the browser, `global`
// on the server, or `this` in some virtual machines. We use `self`
// instead of `window` for `WebWorker` support.
var root = typeof self === 'object' && self.self === self && self ||
typeof global === 'object' && global.global === global && global ||
this;
if (root != null) {
previous_async = root.async;
}
async.noConflict = function () {
root.async = previous_async;
return async;
};
function only_once(fn) {
return function() {
if (fn === null) throw new Error("Callback was already called.");
fn.apply(this, arguments);
fn = null;
};
}
function _once(fn) {
return function() {
if (fn === null) return;
fn.apply(this, arguments);
fn = null;
};
}
//// cross-browser compatiblity functions ////
var _toString = Object.prototype.toString;
var _isArray = Array.isArray || function (obj) {
return _toString.call(obj) === '[object Array]';
};
// Ported from underscore.js isObject
var _isObject = function(obj) {
var type = typeof obj;
return type === 'function' || type === 'object' && !!obj;
};
function _isArrayLike(arr) {
return _isArray(arr) || (
// has a positive integer length property
typeof arr.length === "number" &&
arr.length >= 0 &&
arr.length % 1 === 0
);
}
function _arrayEach(arr, iterator) {
var index = -1,
length = arr.length;
while (++index < length) {
iterator(arr[index], index, arr);
}
}
function _map(arr, iterator) {
var index = -1,
length = arr.length,
result = Array(length);
while (++index < length) {
result[index] = iterator(arr[index], index, arr);
}
return result;
}
function _range(count) {
return _map(Array(count), function (v, i) { return i; });
}
function _reduce(arr, iterator, memo) {
_arrayEach(arr, function (x, i, a) {
memo = iterator(memo, x, i, a);
});
return memo;
}
function _forEachOf(object, iterator) {
_arrayEach(_keys(object), function (key) {
iterator(object[key], key);
});
}
function _indexOf(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === item) return i;
}
return -1;
}
var _keys = Object.keys || function (obj) {
var keys = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
keys.push(k);
}
}
return keys;
};
function _keyIterator(coll) {
var i = -1;
var len;
var keys;
if (_isArrayLike(coll)) {
len = coll.length;
return function next() {
i++;
return i < len ? i : null;
};
} else {
keys = _keys(coll);
len = keys.length;
return function next() {
i++;
return i < len ? keys[i] : null;
};
}
}
// Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
// This accumulates the arguments passed into an array, after a given index.
// From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
function _restParam(func, startIndex) {
startIndex = startIndex == null ? func.length - 1 : +startIndex;
return function() {
var length = Math.max(arguments.length - startIndex, 0);
var rest = Array(length);
for (var index = 0; index < length; index++) {
rest[index] = arguments[index + startIndex];
}
switch (startIndex) {
case 0: return func.call(this, rest);
case 1: return func.call(this, arguments[0], rest);
}
// Currently unused but handle cases outside of the switch statement:
// var args = Array(startIndex + 1);
// for (index = 0; index < startIndex; index++) {
// args[index] = arguments[index];
// }
// args[startIndex] = rest;
// return func.apply(this, args);
};
}
function _withoutIndex(iterator) {
return function (value, index, callback) {
return iterator(value, callback);
};
}
//// exported async module functions ////
//// nextTick implementation with browser-compatible fallback ////
// capture the global reference to guard against fakeTimer mocks
var _setImmediate = typeof setImmediate === 'function' && setImmediate;
var _delay = _setImmediate ? function(fn) {
// not a direct alias for IE10 compatibility
_setImmediate(fn);
} : function(fn) {
setTimeout(fn, 0);
};
if (typeof process === 'object' && typeof process.nextTick === 'function') {
async.nextTick = process.nextTick;
} else {
async.nextTick = _delay;
}
async.setImmediate = _setImmediate ? _delay : async.nextTick;
async.forEach =
async.each = function (arr, iterator, callback) {
return async.eachOf(arr, _withoutIndex(iterator), callback);
};
async.forEachSeries =
async.eachSeries = function (arr, iterator, callback) {
return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
};
async.forEachLimit =
async.eachLimit = function (arr, limit, iterator, callback) {
return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
};
async.forEachOf =
async.eachOf = function (object, iterator, callback) {
callback = _once(callback || noop);
object = object || [];
var iter = _keyIterator(object);
var key, completed = 0;
while ((key = iter()) != null) {
completed += 1;
iterator(object[key], key, only_once(done));
}
if (completed === 0) callback(null);
function done(err) {
completed--;
if (err) {
callback(err);
}
// Check key is null in case iterator isn't exhausted
// and done resolved synchronously.
else if (key === null && completed <= 0) {
callback(null);
}
}
};
async.forEachOfSeries =
async.eachOfSeries = function (obj, iterator, callback) {
callback = _once(callback || noop);
obj = obj || [];
var nextKey = _keyIterator(obj);
var key = nextKey();
function iterate() {
var sync = true;
if (key === null) {
return callback(null);
}
iterator(obj[key], key, only_once(function (err) {
if (err) {
callback(err);
}
else {
key = nextKey();
if (key === null) {
return callback(null);
} else {
if (sync) {
async.setImmediate(iterate);
} else {
iterate();
}
}
}
}));
sync = false;
}
iterate();
};
async.forEachOfLimit =
async.eachOfLimit = function (obj, limit, iterator, callback) {
_eachOfLimit(limit)(obj, iterator, callback);
};
function _eachOfLimit(limit) {
return function (obj, iterator, callback) {
callback = _once(callback || noop);
obj = obj || [];
var nextKey = _keyIterator(obj);
if (limit <= 0) {
return callback(null);
}
var done = false;
var running = 0;
var errored = false;
(function replenish () {
if (done && running <= 0) {
return callback(null);
}
while (running < limit && !errored) {
var key = nextKey();
if (key === null) {
done = true;
if (running <= 0) {
callback(null);
}
return;
}
running += 1;
iterator(obj[key], key, only_once(function (err) {
running -= 1;
if (err) {
callback(err);
errored = true;
}
else {
replenish();
}
}));
}
})();
};
}
function doParallel(fn) {
return function (obj, iterator, callback) {
return fn(async.eachOf, obj, iterator, callback);
};
}
function doParallelLimit(fn) {
return function (obj, limit, iterator, callback) {
return fn(_eachOfLimit(limit), obj, iterator, callback);
};
}
function doSeries(fn) {
return function (obj, iterator, callback) {
return fn(async.eachOfSeries, obj, iterator, callback);
};
}
function _asyncMap(eachfn, arr, iterator, callback) {
callback = _once(callback || noop);
arr = arr || [];
var results = _isArrayLike(arr) ? [] : {};
eachfn(arr, function (value, index, callback) {
iterator(value, function (err, v) {
results[index] = v;
callback(err);
});
}, function (err) {
callback(err, results);
});
}
async.map = doParallel(_asyncMap);
async.mapSeries = doSeries(_asyncMap);
async.mapLimit = doParallelLimit(_asyncMap);
// reduce only has a series version, as doing reduce in parallel won't
// work in many situations.
async.inject =
async.foldl =
async.reduce = function (arr, memo, iterator, callback) {
async.eachOfSeries(arr, function (x, i, callback) {
iterator(memo, x, function (err, v) {
memo = v;
callback(err);
});
}, function (err) {
callback(err, memo);
});
};
async.foldr =
async.reduceRight = function (arr, memo, iterator, callback) {
var reversed = _map(arr, identity).reverse();
async.reduce(reversed, memo, iterator, callback);
};
async.transform = function (arr, memo, iterator, callback) {
if (arguments.length === 3) {
callback = iterator;
iterator = memo;
memo = _isArray(arr) ? [] : {};
}
async.eachOf(arr, function(v, k, cb) {
iterator(memo, v, k, cb);
}, function(err) {
callback(err, memo);
});
};
function _filter(eachfn, arr, iterator, callback) {
var results = [];
eachfn(arr, function (x, index, callback) {
iterator(x, function (v) {
if (v) {
results.push({index: index, value: x});
}
callback();
});
}, function () {
callback(_map(results.sort(function (a, b) {
return a.index - b.index;
}), function (x) {
return x.value;
}));
});
}
async.select =
async.filter = doParallel(_filter);
async.selectLimit =
async.filterLimit = doParallelLimit(_filter);
async.selectSeries =
async.filterSeries = doSeries(_filter);
function _reject(eachfn, arr, iterator, callback) {
_filter(eachfn, arr, function(value, cb) {
iterator(value, function(v) {
cb(!v);
});
}, callback);
}
async.reject = doParallel(_reject);
async.rejectLimit = doParallelLimit(_reject);
async.rejectSeries = doSeries(_reject);
function _createTester(eachfn, check, getResult) {
return function(arr, limit, iterator, cb) {
function done() {
if (cb) cb(getResult(false, void 0));
}
function iteratee(x, _, callback) {
if (!cb) return callback();
iterator(x, function (v) {
if (cb && check(v)) {
cb(getResult(true, x));
cb = iterator = false;
}
callback();
});
}
if (arguments.length > 3) {
eachfn(arr, limit, iteratee, done);
} else {
cb = iterator;
iterator = limit;
eachfn(arr, iteratee, done);
}
};
}
async.any =
async.some = _createTester(async.eachOf, toBool, identity);
async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
async.all =
async.every = _createTester(async.eachOf, notId, notId);
async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
function _findGetResult(v, x) {
return x;
}
async.detect = _createTester(async.eachOf, identity, _findGetResult);
async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
async.sortBy = function (arr, iterator, callback) {
async.map(arr, function (x, callback) {
iterator(x, function (err, criteria) {
if (err) {
callback(err);
}
else {
callback(null, {value: x, criteria: criteria});
}
});
}, function (err, results) {
if (err) {
return callback(err);
}
else {
callback(null, _map(results.sort(comparator), function (x) {
return x.value;
}));
}
});
function comparator(left, right) {
var a = left.criteria, b = right.criteria;
return a < b ? -1 : a > b ? 1 : 0;
}
};
async.auto = function (tasks, concurrency, callback) {
if (!callback) {
// concurrency is optional, shift the args.
callback = concurrency;
concurrency = null;
}
callback = _once(callback || noop);
var keys = _keys(tasks);
var remainingTasks = keys.length;
if (!remainingTasks) {
return callback(null);
}
if (!concurrency) {
concurrency = remainingTasks;
}
var results = {};
var runningTasks = 0;
var listeners = [];
function addListener(fn) {
listeners.unshift(fn);
}
function removeListener(fn) {
var idx = _indexOf(listeners, fn);
if (idx >= 0) listeners.splice(idx, 1);
}
function taskComplete() {
remainingTasks--;
_arrayEach(listeners.slice(0), function (fn) {
fn();
});
}
addListener(function () {
if (!remainingTasks) {
callback(null, results);
}
});
_arrayEach(keys, function (k) {
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
var taskCallback = _restParam(function(err, args) {
runningTasks--;
if (args.length <= 1) {
args = args[0];
}
if (err) {
var safeResults = {};
_forEachOf(results, function(val, rkey) {
safeResults[rkey] = val;
});
safeResults[k] = args;
callback(err, safeResults);
}
else {
results[k] = args;
async.setImmediate(taskComplete);
}
});
var requires = task.slice(0, task.length - 1);
// prevent dead-locks
var len = requires.length;
var dep;
while (len--) {
if (!(dep = tasks[requires[len]])) {
throw new Error('Has inexistant dependency');
}
if (_isArray(dep) && _indexOf(dep, k) >= 0) {
throw new Error('Has cyclic dependencies');
}
}
function ready() {
return runningTasks < concurrency && _reduce(requires, function (a, x) {
return (a && results.hasOwnProperty(x));
}, true) && !results.hasOwnProperty(k);
}
if (ready()) {
runningTasks++;
task[task.length - 1](taskCallback, results);
}
else {
addListener(listener);
}
function listener() {
if (ready()) {
runningTasks++;
removeListener(listener);
task[task.length - 1](taskCallback, results);
}
}
});
};
async.retry = function(times, task, callback) {
var DEFAULT_TIMES = 5;
var DEFAULT_INTERVAL = 0;
var attempts = [];
var opts = {
times: DEFAULT_TIMES,
interval: DEFAULT_INTERVAL
};
function parseTimes(acc, t){
if(typeof t === 'number'){
acc.times = parseInt(t, 10) || DEFAULT_TIMES;
} else if(typeof t === 'object'){
acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
} else {
throw new Error('Unsupported argument type for \'times\': ' + typeof t);
}
}
var length = arguments.length;
if (length < 1 || length > 3) {
throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
} else if (length <= 2 && typeof times === 'function') {
callback = task;
task = times;
}
if (typeof times !== 'function') {
parseTimes(opts, times);
}
opts.callback = callback;
opts.task = task;
function wrappedTask(wrappedCallback, wrappedResults) {
function retryAttempt(task, finalAttempt) {
return function(seriesCallback) {
task(function(err, result){
seriesCallback(!err || finalAttempt, {err: err, result: result});
}, wrappedResults);
};
}
function retryInterval(interval){
return function(seriesCallback){
setTimeout(function(){
seriesCallback(null);
}, interval);
};
}
while (opts.times) {
var finalAttempt = !(opts.times-=1);
attempts.push(retryAttempt(opts.task, finalAttempt));
if(!finalAttempt && opts.interval > 0){
attempts.push(retryInterval(opts.interval));
}
}
async.series(attempts, function(done, data){
data = data[data.length - 1];
(wrappedCallback || opts.callback)(data.err, data.result);
});
}
// If a callback is passed, run this as a controll flow
return opts.callback ? wrappedTask() : wrappedTask;
};
async.waterfall = function (tasks, callback) {
callback = _once(callback || noop);
if (!_isArray(tasks)) {
var err = new Error('First argument to waterfall must be an array of functions');
return callback(err);
}
if (!tasks.length) {
return callback();
}
function wrapIterator(iterator) {
return _restParam(function (err, args) {
if (err) {
callback.apply(null, [err].concat(args));
}
else {
var next = iterator.next();
if (next) {
args.push(wrapIterator(next));
}
else {
args.push(callback);
}
ensureAsync(iterator).apply(null, args);
}
});
}
wrapIterator(async.iterator(tasks))();
};
function _parallel(eachfn, tasks, callback) {
callback = callback || noop;
var results = _isArrayLike(tasks) ? [] : {};
eachfn(tasks, function (task, key, callback) {
task(_restParam(function (err, args) {
if (args.length <= 1) {
args = args[0];
}
results[key] = args;
callback(err);
}));
}, function (err) {
callback(err, results);
});
}
async.parallel = function (tasks, callback) {
_parallel(async.eachOf, tasks, callback);
};
async.parallelLimit = function(tasks, limit, callback) {
_parallel(_eachOfLimit(limit), tasks, callback);
};
async.series = function(tasks, callback) {
_parallel(async.eachOfSeries, tasks, callback);
};
async.iterator = function (tasks) {
function makeCallback(index) {
function fn() {
if (tasks.length) {
tasks[index].apply(null, arguments);
}
return fn.next();
}
fn.next = function () {
return (index < tasks.length - 1) ? makeCallback(index + 1): null;
};
return fn;
}
return makeCallback(0);
};
async.apply = _restParam(function (fn, args) {
return _restParam(function (callArgs) {
return fn.apply(
null, args.concat(callArgs)
);
});
});
function _concat(eachfn, arr, fn, callback) {
var result = [];
eachfn(arr, function (x, index, cb) {
fn(x, function (err, y) {
result = result.concat(y || []);
cb(err);
});
}, function (err) {
callback(err, result);
});
}
async.concat = doParallel(_concat);
async.concatSeries = doSeries(_concat);
async.whilst = function (test, iterator, callback) {
callback = callback || noop;
if (test()) {
var next = _restParam(function(err, args) {
if (err) {
callback(err);
} else if (test.apply(this, args)) {
iterator(next);
} else {
callback(null);
}
});
iterator(next);
} else {
callback(null);
}
};
async.doWhilst = function (iterator, test, callback) {
var calls = 0;
return async.whilst(function() {
return ++calls <= 1 || test.apply(this, arguments);
}, iterator, callback);
};
async.until = function (test, iterator, callback) {
return async.whilst(function() {
return !test.apply(this, arguments);
}, iterator, callback);
};
async.doUntil = function (iterator, test, callback) {
return async.doWhilst(iterator, function() {
return !test.apply(this, arguments);
}, callback);
};
async.during = function (test, iterator, callback) {
callback = callback || noop;
var next = _restParam(function(err, args) {
if (err) {
callback(err);
} else {
args.push(check);
test.apply(this, args);
}
});
var check = function(err, truth) {
if (err) {
callback(err);
} else if (truth) {
iterator(next);
} else {
callback(null);
}
};
test(check);
};
async.doDuring = function (iterator, test, callback) {
var calls = 0;
async.during(function(next) {
if (calls++ < 1) {
next(null, true);
} else {
test.apply(this, arguments);
}
}, iterator, callback);
};
function _queue(worker, concurrency, payload) {
if (concurrency == null) {
concurrency = 1;
}
else if(concurrency === 0) {
throw new Error('Concurrency must not be zero');
}
function _insert(q, data, pos, callback) {
if (callback != null && typeof callback !== "function") {
throw new Error("task callback must be a function");
}
q.started = true;
if (!_isArray(data)) {
data = [data];
}
if(data.length === 0 && q.idle()) {
// call drain immediately if there are no tasks
return async.setImmediate(function() {
q.drain();
});
}
_arrayEach(data, function(task) {
var item = {
data: task,
callback: callback || noop
};
if (pos) {
q.tasks.unshift(item);
} else {
q.tasks.push(item);
}
if (q.tasks.length === q.concurrency) {
q.saturated();
}
});
async.setImmediate(q.process);
}
function _next(q, tasks) {
return function(){
workers -= 1;
var removed = false;
var args = arguments;
_arrayEach(tasks, function (task) {
_arrayEach(workersList, function (worker, index) {
if (worker === task && !removed) {
workersList.splice(index, 1);
removed = true;
}
});
task.callback.apply(task, args);
});
if (q.tasks.length + workers === 0) {
q.drain();
}
q.process();
};
}
var workers = 0;
var workersList = [];
var q = {
tasks: [],
concurrency: concurrency,
payload: payload,
saturated: noop,
empty: noop,
drain: noop,
started: false,
paused: false,
push: function (data, callback) {
_insert(q, data, false, callback);
},
kill: function () {
q.drain = noop;
q.tasks = [];
},
unshift: function (data, callback) {
_insert(q, data, true, callback);
},
process: function () {
if (!q.paused && workers < q.concurrency && q.tasks.length) {
while(workers < q.concurrency && q.tasks.length){
var tasks = q.payload ?
q.tasks.splice(0, q.payload) :
q.tasks.splice(0, q.tasks.length);
var data = _map(tasks, function (task) {
return task.data;
});
if (q.tasks.length === 0) {
q.empty();
}
workers += 1;
workersList.push(tasks[0]);
var cb = only_once(_next(q, tasks));
worker(data, cb);
}
}
},
length: function () {
return q.tasks.length;
},
running: function () {
return workers;
},
workersList: function () {
return workersList;
},
idle: function() {
return q.tasks.length + workers === 0;
},
pause: function () {
q.paused = true;
},
resume: function () {
if (q.paused === false) { return; }
q.paused = false;
var resumeCount = Math.min(q.concurrency, q.tasks.length);
// Need to call q.process once per concurrent
// worker to preserve full concurrency after pause
for (var w = 1; w <= resumeCount; w++) {
async.setImmediate(q.process);
}
}
};
return q;
}
async.queue = function (worker, concurrency) {
var q = _queue(function (items, cb) {
worker(items[0], cb);
}, concurrency, 1);
return q;
};
async.priorityQueue = function (worker, concurrency) {
function _compareTasks(a, b){
return a.priority - b.priority;
}
function _binarySearch(sequence, item, compare) {
var beg = -1,
end = sequence.length - 1;
while (beg < end) {
var mid = beg + ((end - beg + 1) >>> 1);
if (compare(item, sequence[mid]) >= 0) {
beg = mid;
} else {
end = mid - 1;
}
}
return beg;
}
function _insert(q, data, priority, callback) {
if (callback != null && typeof callback !== "function") {
throw new Error("task callback must be a function");
}
q.started = true;
if (!_isArray(data)) {
data = [data];
}
if(data.length === 0) {
// call drain immediately if there are no tasks
return async.setImmediate(function() {
q.drain();
});
}
_arrayEach(data, function(task) {
var item = {
data: task,
priority: priority,
callback: typeof callback === 'function' ? callback : noop
};
q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
if (q.tasks.length === q.concurrency) {
q.saturated();
}
async.setImmediate(q.process);
});
}
// Start with a normal queue
var q = async.queue(worker, concurrency);
// Override push to accept second parameter representing priority
q.push = function (data, priority, callback) {
_insert(q, data, priority, callback);
};
// Remove unshift function
delete q.unshift;
return q;
};
async.cargo = function (worker, payload) {
return _queue(worker, 1, payload);
};
function _console_fn(name) {
return _restParam(function (fn, args) {
fn.apply(null, args.concat([_restParam(function (err, args) {
if (typeof console === 'object') {
if (err) {
if (console.error) {
console.error(err);
}
}
else if (console[name]) {
_arrayEach(args, function (x) {
console[name](x);
});
}
}
})]));
});
}
async.log = _console_fn('log');
async.dir = _console_fn('dir');
/*async.info = _console_fn('info');
async.warn = _console_fn('warn');
async.error = _console_fn('error');*/
async.memoize = function (fn, hasher) {
var memo = {};
var queues = {};
hasher = hasher || identity;
var memoized = _restParam(function memoized(args) {
var callback = args.pop();
var key = hasher.apply(null, args);
if (key in memo) {
async.setImmediate(function () {
callback.apply(null, memo[key]);
});
}
else if (key in queues) {
queues[key].push(callback);
}
else {
queues[key] = [callback];
fn.apply(null, args.concat([_restParam(function (args) {
memo[key] = args;
var q = queues[key];
delete queues[key];
for (var i = 0, l = q.length; i < l; i++) {
q[i].apply(null, args);
}
})]));
}
});
memoized.memo = memo;
memoized.unmemoized = fn;
return memoized;
};
async.unmemoize = function (fn) {
return function () {
return (fn.unmemoized || fn).apply(null, arguments);
};
};
function _times(mapper) {
return function (count, iterator, callback) {
mapper(_range(count), iterator, callback);
};
}
async.times = _times(async.map);
async.timesSeries = _times(async.mapSeries);
async.timesLimit = function (count, limit, iterator, callback) {
return async.mapLimit(_range(count), limit, iterator, callback);
};
async.seq = function (/* functions... */) {
var fns = arguments;
return _restParam(function (args) {
var that = this;
var callback = args[args.length - 1];
if (typeof callback == 'function') {
args.pop();
} else {
callback = noop;
}
async.reduce(fns, args, function (newargs, fn, cb) {
fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
cb(err, nextargs);
})]));
},
function (err, results) {
callback.apply(that, [err].concat(results));
});
});
};
async.compose = function (/* functions... */) {
return async.seq.apply(null, Array.prototype.reverse.call(arguments));
};
function _applyEach(eachfn) {
return _restParam(function(fns, args) {
var go = _restParam(function(args) {
var that = this;
var callback = args.pop();
return eachfn(fns, function (fn, _, cb) {
fn.apply(that, args.concat([cb]));
},
callback);
});
if (args.length) {
return go.apply(this, args);
}
else {
return go;
}
});
}
async.applyEach = _applyEach(async.eachOf);
async.applyEachSeries = _applyEach(async.eachOfSeries);
async.forever = function (fn, callback) {
var done = only_once(callback || noop);
var task = ensureAsync(fn);
function next(err) {
if (err) {
return done(err);
}
task(next);
}
next();
};
function ensureAsync(fn) {
return _restParam(function (args) {
var callback = args.pop();
args.push(function () {
var innerArgs = arguments;
if (sync) {
async.setImmediate(function () {
callback.apply(null, innerArgs);
});
} else {
callback.apply(null, innerArgs);
}
});
var sync = true;
fn.apply(this, args);
sync = false;
});
}
async.ensureAsync = ensureAsync;
async.constant = _restParam(function(values) {
var args = [null].concat(values);
return function (callback) {
return callback.apply(this, args);
};
});
async.wrapSync =
async.asyncify = function asyncify(func) {
return _restParam(function (args) {
var callback = args.pop();
var result;
try {
result = func.apply(this, args);
} catch (e) {
return callback(e);
}
// if result is Promise object
if (_isObject(result) && typeof result.then === "function") {
result.then(function(value) {
callback(null, value);
})["catch"](function(err) {
callback(err.message ? err : new Error(err));
});
} else {
callback(null, result);
}
});
};
// Node.js
if (typeof module === 'object' && module.exports) {
module.exports = async;
}
// AMD / RequireJS
else if (typeof define === 'function' && define.amd) {
define([], function () {
return async;
});
}
// included directly via <script> tag
else {
root.async = async;
}
}());
}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"_process":76}],42:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var BlockCipher = C_lib.BlockCipher;
var C_algo = C.algo;
// Lookup tables
var SBOX = [];
var INV_SBOX = [];
var SUB_MIX_0 = [];
var SUB_MIX_1 = [];
var SUB_MIX_2 = [];
var SUB_MIX_3 = [];
var INV_SUB_MIX_0 = [];
var INV_SUB_MIX_1 = [];
var INV_SUB_MIX_2 = [];
var INV_SUB_MIX_3 = [];
// Compute lookup tables
(function () {
// Compute double table
var d = [];
for (var i = 0; i < 256; i++) {
if (i < 128) {
d[i] = i << 1;
} else {
d[i] = (i << 1) ^ 0x11b;
}
}
// Walk GF(2^8)
var x = 0;
var xi = 0;
for (var i = 0; i < 256; i++) {
// Compute sbox
var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
SBOX[x] = sx;
INV_SBOX[sx] = x;
// Compute multiplication
var x2 = d[x];
var x4 = d[x2];
var x8 = d[x4];
// Compute sub bytes, mix columns tables
var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
SUB_MIX_0[x] = (t << 24) | (t >>> 8);
SUB_MIX_1[x] = (t << 16) | (t >>> 16);
SUB_MIX_2[x] = (t << 8) | (t >>> 24);
SUB_MIX_3[x] = t;
// Compute inv sub bytes, inv mix columns tables
var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
INV_SUB_MIX_3[sx] = t;
// Compute next counter
if (!x) {
x = xi = 1;
} else {
x = x2 ^ d[d[d[x8 ^ x2]]];
xi ^= d[d[xi]];
}
}
}());
// Precomputed Rcon lookup
var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
/**
* AES block cipher algorithm.
*/
var AES = C_algo.AES = BlockCipher.extend({
_doReset: function () {
// Shortcuts
var key = this._key;
var keyWords = key.words;
var keySize = key.sigBytes / 4;
// Compute number of rounds
var nRounds = this._nRounds = keySize + 6
// Compute number of key schedule rows
var ksRows = (nRounds + 1) * 4;
// Compute key schedule
var keySchedule = this._keySchedule = [];
for (var ksRow = 0; ksRow < ksRows; ksRow++) {
if (ksRow < keySize) {
keySchedule[ksRow] = keyWords[ksRow];
} else {
var t = keySchedule[ksRow - 1];
if (!(ksRow % keySize)) {
// Rot word
t = (t << 8) | (t >>> 24);
// Sub word
t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
// Mix Rcon
t ^= RCON[(ksRow / keySize) | 0] << 24;
} else if (keySize > 6 && ksRow % keySize == 4) {
// Sub word
t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
}
keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
}
}
// Compute inv key schedule
var invKeySchedule = this._invKeySchedule = [];
for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
var ksRow = ksRows - invKsRow;
if (invKsRow % 4) {
var t = keySchedule[ksRow];
} else {
var t = keySchedule[ksRow - 4];
}
if (invKsRow < 4 || ksRow <= 4) {
invKeySchedule[invKsRow] = t;
} else {
invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
}
}
},
encryptBlock: function (M, offset) {
this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
},
decryptBlock: function (M, offset) {
// Swap 2nd and 4th rows
var t = M[offset + 1];
M[offset + 1] = M[offset + 3];
M[offset + 3] = t;
this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
// Inv swap 2nd and 4th rows
var t = M[offset + 1];
M[offset + 1] = M[offset + 3];
M[offset + 3] = t;
},
_doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
// Shortcut
var nRounds = this._nRounds;
// Get input, add round key
var s0 = M[offset] ^ keySchedule[0];
var s1 = M[offset + 1] ^ keySchedule[1];
var s2 = M[offset + 2] ^ keySchedule[2];
var s3 = M[offset + 3] ^ keySchedule[3];
// Key schedule row counter
var ksRow = 4;
// Rounds
for (var round = 1; round < nRounds; round++) {
// Shift rows, sub bytes, mix columns, add round key
var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
// Update state
s0 = t0;
s1 = t1;
s2 = t2;
s3 = t3;
}
// Shift rows, sub bytes, add round key
var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
// Set output
M[offset] = t0;
M[offset + 1] = t1;
M[offset + 2] = t2;
M[offset + 3] = t3;
},
keySize: 256/32
});
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
* var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
*/
C.AES = BlockCipher._createHelper(AES);
}());
return CryptoJS.AES;
}));
},{"./cipher-core":43,"./core":44,"./enc-base64":45,"./evpkdf":47,"./md5":52}],43:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* Cipher core components.
*/
CryptoJS.lib.Cipher || (function (undefined) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var WordArray = C_lib.WordArray;
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
var C_enc = C.enc;
var Utf8 = C_enc.Utf8;
var Base64 = C_enc.Base64;
var C_algo = C.algo;
var EvpKDF = C_algo.EvpKDF;
/**
* Abstract base cipher template.
*
* @property {number} keySize This cipher's key size. Default: 4 (128 bits)
* @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
* @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
* @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
*/
var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
/**
* Configuration options.
*
* @property {WordArray} iv The IV to use for this operation.
*/
cfg: Base.extend(),
/**
* Creates this cipher in encryption mode.
*
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {Cipher} A cipher instance.
*
* @static
*
* @example
*
* var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
*/
createEncryptor: function (key, cfg) {
return this.create(this._ENC_XFORM_MODE, key, cfg);
},
/**
* Creates this cipher in decryption mode.
*
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {Cipher} A cipher instance.
*
* @static
*
* @example
*
* var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
*/
createDecryptor: function (key, cfg) {
return this.create(this._DEC_XFORM_MODE, key, cfg);
},
/**
* Initializes a newly created cipher.
*
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @example
*
* var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
*/
init: function (xformMode, key, cfg) {
// Apply config defaults
this.cfg = this.cfg.extend(cfg);
// Store transform mode and key
this._xformMode = xformMode;
this._key = key;
// Set initial values
this.reset();
},
/**
* Resets this cipher to its initial state.
*
* @example
*
* cipher.reset();
*/
reset: function () {
// Reset data buffer
BufferedBlockAlgorithm.reset.call(this);
// Perform concrete-cipher logic
this._doReset();
},
/**
* Adds data to be encrypted or decrypted.
*
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
*
* @return {WordArray} The data after processing.
*
* @example
*
* var encrypted = cipher.process('data');
* var encrypted = cipher.process(wordArray);
*/
process: function (dataUpdate) {
// Append
this._append(dataUpdate);
// Process available blocks
return this._process();
},
/**
* Finalizes the encryption or decryption process.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
*
* @return {WordArray} The data after final processing.
*
* @example
*
* var encrypted = cipher.finalize();
* var encrypted = cipher.finalize('data');
* var encrypted = cipher.finalize(wordArray);
*/
finalize: function (dataUpdate) {
// Final data update
if (dataUpdate) {
this._append(dataUpdate);
}
// Perform concrete-cipher logic
var finalProcessedData = this._doFinalize();
return finalProcessedData;
},
keySize: 128/32,
ivSize: 128/32,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
/**
* Creates shortcut functions to a cipher's object interface.
*
* @param {Cipher} cipher The cipher to create a helper for.
*
* @return {Object} An object with encrypt and decrypt shortcut functions.
*
* @static
*
* @example
*
* var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
*/
_createHelper: (function () {
function selectCipherStrategy(key) {
if (typeof key == 'string') {
return PasswordBasedCipher;
} else {
return SerializableCipher;
}
}
return function (cipher) {
return {
encrypt: function (message, key, cfg) {
return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
},
decrypt: function (ciphertext, key, cfg) {
return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
}
};
};
}())
});
/**
* Abstract base stream cipher template.
*
* @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
*/
var StreamCipher = C_lib.StreamCipher = Cipher.extend({
_doFinalize: function () {
// Process partial blocks
var finalProcessedBlocks = this._process(!!'flush');
return finalProcessedBlocks;
},
blockSize: 1
});
/**
* Mode namespace.
*/
var C_mode = C.mode = {};
/**
* Abstract base block cipher mode template.
*/
var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
/**
* Creates this mode for encryption.
*
* @param {Cipher} cipher A block cipher instance.
* @param {Array} iv The IV words.
*
* @static
*
* @example
*
* var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
*/
createEncryptor: function (cipher, iv) {
return this.Encryptor.create(cipher, iv);
},
/**
* Creates this mode for decryption.
*
* @param {Cipher} cipher A block cipher instance.
* @param {Array} iv The IV words.
*
* @static
*
* @example
*
* var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
*/
createDecryptor: function (cipher, iv) {
return this.Decryptor.create(cipher, iv);
},
/**
* Initializes a newly created mode.
*
* @param {Cipher} cipher A block cipher instance.
* @param {Array} iv The IV words.
*
* @example
*
* var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
*/
init: function (cipher, iv) {
this._cipher = cipher;
this._iv = iv;
}
});
/**
* Cipher Block Chaining mode.
*/
var CBC = C_mode.CBC = (function () {
/**
* Abstract base CBC mode.
*/
var CBC = BlockCipherMode.extend();
/**
* CBC encryptor.
*/
CBC.Encryptor = CBC.extend({
/**
* Processes the data block at offset.
*
* @param {Array} words The data words to operate on.
* @param {number} offset The offset where the block starts.
*
* @example
*
* mode.processBlock(data.words, offset);
*/
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
// XOR and encrypt
xorBlock.call(this, words, offset, blockSize);
cipher.encryptBlock(words, offset);
// Remember this block to use with next block
this._prevBlock = words.slice(offset, offset + blockSize);
}
});
/**
* CBC decryptor.
*/
CBC.Decryptor = CBC.extend({
/**
* Processes the data block at offset.
*
* @param {Array} words The data words to operate on.
* @param {number} offset The offset where the block starts.
*
* @example
*
* mode.processBlock(data.words, offset);
*/
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
// Remember this block to use with next block
var thisBlock = words.slice(offset, offset + blockSize);
// Decrypt and XOR
cipher.decryptBlock(words, offset);
xorBlock.call(this, words, offset, blockSize);
// This block becomes the previous block
this._prevBlock = thisBlock;
}
});
function xorBlock(words, offset, blockSize) {
// Shortcut
var iv = this._iv;
// Choose mixing block
if (iv) {
var block = iv;
// Remove IV for subsequent blocks
this._iv = undefined;
} else {
var block = this._prevBlock;
}
// XOR blocks
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= block[i];
}
}
return CBC;
}());
/**
* Padding namespace.
*/
var C_pad = C.pad = {};
/**
* PKCS #5/7 padding strategy.
*/
var Pkcs7 = C_pad.Pkcs7 = {
/**
* Pads data using the algorithm defined in PKCS #5/7.
*
* @param {WordArray} data The data to pad.
* @param {number} blockSize The multiple that the data should be padded to.
*
* @static
*
* @example
*
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
*/
pad: function (data, blockSize) {
// Shortcut
var blockSizeBytes = blockSize * 4;
// Count padding bytes
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
// Create padding word
var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
// Create padding
var paddingWords = [];
for (var i = 0; i < nPaddingBytes; i += 4) {
paddingWords.push(paddingWord);
}
var padding = WordArray.create(paddingWords, nPaddingBytes);
// Add padding
data.concat(padding);
},
/**
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
*
* @param {WordArray} data The data to unpad.
*
* @static
*
* @example
*
* CryptoJS.pad.Pkcs7.unpad(wordArray);
*/
unpad: function (data) {
// Get number of padding bytes from last byte
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
// Remove padding
data.sigBytes -= nPaddingBytes;
}
};
/**
* Abstract base block cipher template.
*
* @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
*/
var BlockCipher = C_lib.BlockCipher = Cipher.extend({
/**
* Configuration options.
*
* @property {Mode} mode The block mode to use. Default: CBC
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
*/
cfg: Cipher.cfg.extend({
mode: CBC,
padding: Pkcs7
}),
reset: function () {
// Reset cipher
Cipher.reset.call(this);
// Shortcuts
var cfg = this.cfg;
var iv = cfg.iv;
var mode = cfg.mode;
// Reset block mode
if (this._xformMode == this._ENC_XFORM_MODE) {
var modeCreator = mode.createEncryptor;
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
var modeCreator = mode.createDecryptor;
// Keep at least one block in the buffer for unpadding
this._minBufferSize = 1;
}
this._mode = modeCreator.call(mode, this, iv && iv.words);
},
_doProcessBlock: function (words, offset) {
this._mode.processBlock(words, offset);
},
_doFinalize: function () {
// Shortcut
var padding = this.cfg.padding;
// Finalize
if (this._xformMode == this._ENC_XFORM_MODE) {
// Pad data
padding.pad(this._data, this.blockSize);
// Process final blocks
var finalProcessedBlocks = this._process(!!'flush');
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
// Process final blocks
var finalProcessedBlocks = this._process(!!'flush');
// Unpad data
padding.unpad(finalProcessedBlocks);
}
return finalProcessedBlocks;
},
blockSize: 128/32
});
/**
* A collection of cipher parameters.
*
* @property {WordArray} ciphertext The raw ciphertext.
* @property {WordArray} key The key to this ciphertext.
* @property {WordArray} iv The IV used in the ciphering operation.
* @property {WordArray} salt The salt used with a key derivation function.
* @property {Cipher} algorithm The cipher algorithm.
* @property {Mode} mode The block mode used in the ciphering operation.
* @property {Padding} padding The padding scheme used in the ciphering operation.
* @property {number} blockSize The block size of the cipher.
* @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
*/
var CipherParams = C_lib.CipherParams = Base.extend({
/**
* Initializes a newly created cipher params object.
*
* @param {Object} cipherParams An object with any of the possible cipher parameters.
*
* @example
*
* var cipherParams = CryptoJS.lib.CipherParams.create({
* ciphertext: ciphertextWordArray,
* key: keyWordArray,
* iv: ivWordArray,
* salt: saltWordArray,
* algorithm: CryptoJS.algo.AES,
* mode: CryptoJS.mode.CBC,
* padding: CryptoJS.pad.PKCS7,
* blockSize: 4,
* formatter: CryptoJS.format.OpenSSL
* });
*/
init: function (cipherParams) {
this.mixIn(cipherParams);
},
/**
* Converts this cipher params object to a string.
*
* @param {Format} formatter (Optional) The formatting strategy to use.
*
* @return {string} The stringified cipher params.
*
* @throws Error If neither the formatter nor the default formatter is set.
*
* @example
*
* var string = cipherParams + '';
* var string = cipherParams.toString();
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
*/
toString: function (formatter) {
return (formatter || this.formatter).stringify(this);
}
});
/**
* Format namespace.
*/
var C_format = C.format = {};
/**
* OpenSSL formatting strategy.
*/
var OpenSSLFormatter = C_format.OpenSSL = {
/**
* Converts a cipher params object to an OpenSSL-compatible string.
*
* @param {CipherParams} cipherParams The cipher params object.
*
* @return {string} The OpenSSL-compatible string.
*
* @static
*
* @example
*
* var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
*/
stringify: function (cipherParams) {
// Shortcuts
var ciphertext = cipherParams.ciphertext;
var salt = cipherParams.salt;
// Format
if (salt) {
var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
} else {
var wordArray = ciphertext;
}
return wordArray.toString(Base64);
},
/**
* Converts an OpenSSL-compatible string to a cipher params object.
*
* @param {string} openSSLStr The OpenSSL-compatible string.
*
* @return {CipherParams} The cipher params object.
*
* @static
*
* @example
*
* var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
*/
parse: function (openSSLStr) {
// Parse base64
var ciphertext = Base64.parse(openSSLStr);
// Shortcut
var ciphertextWords = ciphertext.words;
// Test for salt
if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
// Extract salt
var salt = WordArray.create(ciphertextWords.slice(2, 4));
// Remove salt from ciphertext
ciphertextWords.splice(0, 4);
ciphertext.sigBytes -= 16;
}
return CipherParams.create({ ciphertext: ciphertext, salt: salt });
}
};
/**
* A cipher wrapper that returns ciphertext as a serializable cipher params object.
*/
var SerializableCipher = C_lib.SerializableCipher = Base.extend({
/**
* Configuration options.
*
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
*/
cfg: Base.extend({
format: OpenSSLFormatter
}),
/**
* Encrypts a message.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {WordArray|string} message The message to encrypt.
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {CipherParams} A cipher params object.
*
* @static
*
* @example
*
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
*/
encrypt: function (cipher, message, key, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Encrypt
var encryptor = cipher.createEncryptor(key, cfg);
var ciphertext = encryptor.finalize(message);
// Shortcut
var cipherCfg = encryptor.cfg;
// Create and return serializable cipher params
return CipherParams.create({
ciphertext: ciphertext,
key: key,
iv: cipherCfg.iv,
algorithm: cipher,
mode: cipherCfg.mode,
padding: cipherCfg.padding,
blockSize: cipher.blockSize,
formatter: cfg.format
});
},
/**
* Decrypts serialized ciphertext.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {WordArray} The plaintext.
*
* @static
*
* @example
*
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
*/
decrypt: function (cipher, ciphertext, key, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Convert string to CipherParams
ciphertext = this._parse(ciphertext, cfg.format);
// Decrypt
var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
return plaintext;
},
/**
* Converts serialized ciphertext to CipherParams,
* else assumed CipherParams already and returns ciphertext unchanged.
*
* @param {CipherParams|string} ciphertext The ciphertext.
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
*
* @return {CipherParams} The unserialized ciphertext.
*
* @static
*
* @example
*
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
*/
_parse: function (ciphertext, format) {
if (typeof ciphertext == 'string') {
return format.parse(ciphertext, this);
} else {
return ciphertext;
}
}
});
/**
* Key derivation function namespace.
*/
var C_kdf = C.kdf = {};
/**
* OpenSSL key derivation function.
*/
var OpenSSLKdf = C_kdf.OpenSSL = {
/**
* Derives a key and IV from a password.
*
* @param {string} password The password to derive from.
* @param {number} keySize The size in words of the key to generate.
* @param {number} ivSize The size in words of the IV to generate.
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
*
* @return {CipherParams} A cipher params object with the key, IV, and salt.
*
* @static
*
* @example
*
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
*/
execute: function (password, keySize, ivSize, salt) {
// Generate random salt
if (!salt) {
salt = WordArray.random(64/8);
}
// Derive key and IV
var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
// Separate key and IV
var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
key.sigBytes = keySize * 4;
// Return params
return CipherParams.create({ key: key, iv: iv, salt: salt });
}
};
/**
* A serializable cipher wrapper that derives the key from a password,
* and returns ciphertext as a serializable cipher params object.
*/
var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
/**
* Configuration options.
*
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
*/
cfg: SerializableCipher.cfg.extend({
kdf: OpenSSLKdf
}),
/**
* Encrypts a message using a password.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {WordArray|string} message The message to encrypt.
* @param {string} password The password.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {CipherParams} A cipher params object.
*
* @static
*
* @example
*
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
*/
encrypt: function (cipher, message, password, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Derive key and other params
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
// Add IV to config
cfg.iv = derivedParams.iv;
// Encrypt
var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
// Mix in derived params
ciphertext.mixIn(derivedParams);
return ciphertext;
},
/**
* Decrypts serialized ciphertext using a password.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
* @param {string} password The password.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {WordArray} The plaintext.
*
* @static
*
* @example
*
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
*/
decrypt: function (cipher, ciphertext, password, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Convert string to CipherParams
ciphertext = this._parse(ciphertext, cfg.format);
// Derive key and other params
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
// Add IV to config
cfg.iv = derivedParams.iv;
// Decrypt
var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
return plaintext;
}
});
}());
}));
},{"./core":44}],44:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory();
}
else if (typeof define === "function" && define.amd) {
// AMD
define([], factory);
}
else {
// Global (browser)
root.CryptoJS = factory();
}
}(this, function () {
/**
* CryptoJS core components.
*/
var CryptoJS = CryptoJS || (function (Math, undefined) {
/**
* CryptoJS namespace.
*/
var C = {};
/**
* Library namespace.
*/
var C_lib = C.lib = {};
/**
* Base object for prototypal inheritance.
*/
var Base = C_lib.Base = (function () {
function F() {}
return {
/**
* Creates a new object that inherits from this object.
*
* @param {Object} overrides Properties to copy into the new object.
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* field: 'value',
*
* method: function () {
* }
* });
*/
extend: function (overrides) {
// Spawn
F.prototype = this;
var subtype = new F();
// Augment
if (overrides) {
subtype.mixIn(overrides);
}
// Create default initializer
if (!subtype.hasOwnProperty('init')) {
subtype.init = function () {
subtype.$super.init.apply(this, arguments);
};
}
// Initializer's prototype is the subtype object
subtype.init.prototype = subtype;
// Reference supertype
subtype.$super = this;
return subtype;
},
/**
* Extends this object and runs the init method.
* Arguments to create() will be passed to init().
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var instance = MyType.create();
*/
create: function () {
var instance = this.extend();
instance.init.apply(instance, arguments);
return instance;
},
/**
* Initializes a newly created object.
* Override this method to add some logic when your objects are created.
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* init: function () {
* // ...
* }
* });
*/
init: function () {
},
/**
* Copies properties into this object.
*
* @param {Object} properties The properties to mix in.
*
* @example
*
* MyType.mixIn({
* field: 'value'
* });
*/
mixIn: function (properties) {
for (var propertyName in properties) {
if (properties.hasOwnProperty(propertyName)) {
this[propertyName] = properties[propertyName];
}
}
// IE won't copy toString using the loop above
if (properties.hasOwnProperty('toString')) {
this.toString = properties.toString;
}
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function () {
return this.init.prototype.extend(this);
}
};
}());
/**
* An array of 32-bit words.
*
* @property {Array} words The array of 32-bit words.
* @property {number} sigBytes The number of significant bytes in this word array.
*/
var WordArray = C_lib.WordArray = Base.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of 32-bit words.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.create();
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
*/
init: function (words, sigBytes) {
words = this.words = words || [];
if (sigBytes != undefined) {
this.sigBytes = sigBytes;
} else {
this.sigBytes = words.length * 4;
}
},
/**
* Converts this word array to a string.
*
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
*
* @return {string} The stringified word array.
*
* @example
*
* var string = wordArray + '';
* var string = wordArray.toString();
* var string = wordArray.toString(CryptoJS.enc.Utf8);
*/
toString: function (encoder) {
return (encoder || Hex).stringify(this);
},
/**
* Concatenates a word array to this word array.
*
* @param {WordArray} wordArray The word array to append.
*
* @return {WordArray} This word array.
*
* @example
*
* wordArray1.concat(wordArray2);
*/
concat: function (wordArray) {
// Shortcuts
var thisWords = this.words;
var thatWords = wordArray.words;
var thisSigBytes = this.sigBytes;
var thatSigBytes = wordArray.sigBytes;
// Clamp excess bits
this.clamp();
// Concat
if (thisSigBytes % 4) {
// Copy one byte at a time
for (var i = 0; i < thatSigBytes; i++) {
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
}
} else {
// Copy one word at a time
for (var i = 0; i < thatSigBytes; i += 4) {
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
}
}
this.sigBytes += thatSigBytes;
// Chainable
return this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function () {
// Shortcuts
var words = this.words;
var sigBytes = this.sigBytes;
// Clamp
words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
words.length = Math.ceil(sigBytes / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
clone.words = this.words.slice(0);
return clone;
},
/**
* Creates a word array filled with random bytes.
*
* @param {number} nBytes The number of random bytes to generate.
*
* @return {WordArray} The random word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.random(16);
*/
random: function (nBytes) {
var words = [];
var r = (function (m_w) {
var m_w = m_w;
var m_z = 0x3ade68b1;
var mask = 0xffffffff;
return function () {
m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
var result = ((m_z << 0x10) + m_w) & mask;
result /= 0x100000000;
result += 0.5;
return result * (Math.random() > .5 ? 1 : -1);
}
});
for (var i = 0, rcache; i < nBytes; i += 4) {
var _r = r((rcache || Math.random()) * 0x100000000);
rcache = _r() * 0x3ade67b7;
words.push((_r() * 0x100000000) | 0);
}
return new WordArray.init(words, nBytes);
}
});
/**
* Encoder namespace.
*/
var C_enc = C.enc = {};
/**
* Hex encoding strategy.
*/
var Hex = C_enc.Hex = {
/**
* Converts a word array to a hex string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The hex string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var hexChars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
hexChars.push((bite >>> 4).toString(16));
hexChars.push((bite & 0x0f).toString(16));
}
return hexChars.join('');
},
/**
* Converts a hex string to a word array.
*
* @param {string} hexStr The hex string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
*/
parse: function (hexStr) {
// Shortcut
var hexStrLength = hexStr.length;
// Convert
var words = [];
for (var i = 0; i < hexStrLength; i += 2) {
words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
}
return new WordArray.init(words, hexStrLength / 2);
}
};
/**
* Latin1 encoding strategy.
*/
var Latin1 = C_enc.Latin1 = {
/**
* Converts a word array to a Latin1 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Latin1 string.
*
* @static
*
* @example
*
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var latin1Chars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
latin1Chars.push(String.fromCharCode(bite));
}
return latin1Chars.join('');
},
/**
* Converts a Latin1 string to a word array.
*
* @param {string} latin1Str The Latin1 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
*/
parse: function (latin1Str) {
// Shortcut
var latin1StrLength = latin1Str.length;
// Convert
var words = [];
for (var i = 0; i < latin1StrLength; i++) {
words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
}
return new WordArray.init(words, latin1StrLength);
}
};
/**
* UTF-8 encoding strategy.
*/
var Utf8 = C_enc.Utf8 = {
/**
* Converts a word array to a UTF-8 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-8 string.
*
* @static
*
* @example
*
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
*/
stringify: function (wordArray) {
try {
return decodeURIComponent(escape(Latin1.stringify(wordArray)));
} catch (e) {
throw new Error('Malformed UTF-8 data');
}
},
/**
* Converts a UTF-8 string to a word array.
*
* @param {string} utf8Str The UTF-8 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
*/
parse: function (utf8Str) {
return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
}
};
/**
* Abstract buffered block algorithm template.
*
* The property blockSize must be implemented in a concrete subtype.
*
* @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
*/
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function () {
// Initial values
this._data = new WordArray.init();
this._nDataBytes = 0;
},
/**
* Adds new data to this block algorithm's buffer.
*
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
*
* @example
*
* bufferedBlockAlgorithm._append('data');
* bufferedBlockAlgorithm._append(wordArray);
*/
_append: function (data) {
// Convert string to WordArray, else assume WordArray already
if (typeof data == 'string') {
data = Utf8.parse(data);
}
// Append
this._data.concat(data);
this._nDataBytes += data.sigBytes;
},
/**
* Processes available data blocks.
*
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
*
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
*
* @return {WordArray} The processed data.
*
* @example
*
* var processedData = bufferedBlockAlgorithm._process();
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
*/
_process: function (doFlush) {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var dataSigBytes = data.sigBytes;
var blockSize = this.blockSize;
var blockSizeBytes = blockSize * 4;
// Count blocks ready
var nBlocksReady = dataSigBytes / blockSizeBytes;
if (doFlush) {
// Round up to include partial blocks
nBlocksReady = Math.ceil(nBlocksReady);
} else {
// Round down to include only full blocks,
// less the number of blocks that must remain in the buffer
nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
}
// Count words ready
var nWordsReady = nBlocksReady * blockSize;
// Count bytes ready
var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
// Process blocks
if (nWordsReady) {
for (var offset = 0; offset < nWordsReady; offset += blockSize) {
// Perform concrete-algorithm logic
this._doProcessBlock(dataWords, offset);
}
// Remove processed words
var processedWords = dataWords.splice(0, nWordsReady);
data.sigBytes -= nBytesReady;
}
// Return processed words
return new WordArray.init(processedWords, nBytesReady);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
clone._data = this._data.clone();
return clone;
},
_minBufferSize: 0
});
/**
* Abstract hasher template.
*
* @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
*/
var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
/**
* Configuration options.
*/
cfg: Base.extend(),
/**
* Initializes a newly created hasher.
*
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
*
* @example
*
* var hasher = CryptoJS.algo.SHA256.create();
*/
init: function (cfg) {
// Apply config defaults
this.cfg = this.cfg.extend(cfg);
// Set initial values
this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function () {
// Reset data buffer
BufferedBlockAlgorithm.reset.call(this);
// Perform concrete-hasher logic
this._doReset();
},
/**
* Updates this hasher with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {Hasher} This hasher.
*
* @example
*
* hasher.update('message');
* hasher.update(wordArray);
*/
update: function (messageUpdate) {
// Append
this._append(messageUpdate);
// Update the hash
this._process();
// Chainable
return this;
},
/**
* Finalizes the hash computation.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} messageUpdate (Optional) A final message update.
*
* @return {WordArray} The hash.
*
* @example
*
* var hash = hasher.finalize();
* var hash = hasher.finalize('message');
* var hash = hasher.finalize(wordArray);
*/
finalize: function (messageUpdate) {
// Final message update
if (messageUpdate) {
this._append(messageUpdate);
}
// Perform concrete-hasher logic
var hash = this._doFinalize();
return hash;
},
blockSize: 512/32,
/**
* Creates a shortcut function to a hasher's object interface.
*
* @param {Hasher} hasher The hasher to create a helper for.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
*/
_createHelper: function (hasher) {
return function (message, cfg) {
return new hasher.init(cfg).finalize(message);
};
},
/**
* Creates a shortcut function to the HMAC's object interface.
*
* @param {Hasher} hasher The hasher to use in this HMAC helper.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
*/
_createHmacHelper: function (hasher) {
return function (message, key) {
return new C_algo.HMAC.init(hasher, key).finalize(message);
};
}
});
/**
* Algorithm namespace.
*/
var C_algo = C.algo = {};
return C;
}(Math));
return CryptoJS;
}));
},{}],45:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var C_enc = C.enc;
/**
* Base64 encoding strategy.
*/
var Base64 = C_enc.Base64 = {
/**
* Converts a word array to a Base64 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Base64 string.
*
* @static
*
* @example
*
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var map = this._map;
// Clamp excess bits
wordArray.clamp();
// Convert
var base64Chars = [];
for (var i = 0; i < sigBytes; i += 3) {
var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
}
}
// Add padding
var paddingChar = map.charAt(64);
if (paddingChar) {
while (base64Chars.length % 4) {
base64Chars.push(paddingChar);
}
}
return base64Chars.join('');
},
/**
* Converts a Base64 string to a word array.
*
* @param {string} base64Str The Base64 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
*/
parse: function (base64Str) {
// Shortcuts
var base64StrLength = base64Str.length;
var map = this._map;
// Ignore padding
var paddingChar = map.charAt(64);
if (paddingChar) {
var paddingIndex = base64Str.indexOf(paddingChar);
if (paddingIndex != -1) {
base64StrLength = paddingIndex;
}
}
// Convert
var words = [];
var nBytes = 0;
for (var i = 0; i < base64StrLength; i++) {
if (i % 4) {
var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
nBytes++;
}
}
return WordArray.create(words, nBytes);
},
_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
};
}());
return CryptoJS.enc.Base64;
}));
},{"./core":44}],46:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var C_enc = C.enc;
/**
* UTF-16 BE encoding strategy.
*/
var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
/**
* Converts a word array to a UTF-16 BE string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-16 BE string.
*
* @static
*
* @example
*
* var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var utf16Chars = [];
for (var i = 0; i < sigBytes; i += 2) {
var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
utf16Chars.push(String.fromCharCode(codePoint));
}
return utf16Chars.join('');
},
/**
* Converts a UTF-16 BE string to a word array.
*
* @param {string} utf16Str The UTF-16 BE string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
*/
parse: function (utf16Str) {
// Shortcut
var utf16StrLength = utf16Str.length;
// Convert
var words = [];
for (var i = 0; i < utf16StrLength; i++) {
words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
}
return WordArray.create(words, utf16StrLength * 2);
}
};
/**
* UTF-16 LE encoding strategy.
*/
C_enc.Utf16LE = {
/**
* Converts a word array to a UTF-16 LE string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-16 LE string.
*
* @static
*
* @example
*
* var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var utf16Chars = [];
for (var i = 0; i < sigBytes; i += 2) {
var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
utf16Chars.push(String.fromCharCode(codePoint));
}
return utf16Chars.join('');
},
/**
* Converts a UTF-16 LE string to a word array.
*
* @param {string} utf16Str The UTF-16 LE string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
*/
parse: function (utf16Str) {
// Shortcut
var utf16StrLength = utf16Str.length;
// Convert
var words = [];
for (var i = 0; i < utf16StrLength; i++) {
words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
}
return WordArray.create(words, utf16StrLength * 2);
}
};
function swapEndian(word) {
return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
}
}());
return CryptoJS.enc.Utf16;
}));
},{"./core":44}],47:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./sha1", "./hmac"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var WordArray = C_lib.WordArray;
var C_algo = C.algo;
var MD5 = C_algo.MD5;
/**
* This key derivation function is meant to conform with EVP_BytesToKey.
* www.openssl.org/docs/crypto/EVP_BytesToKey.html
*/
var EvpKDF = C_algo.EvpKDF = Base.extend({
/**
* Configuration options.
*
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
* @property {Hasher} hasher The hash algorithm to use. Default: MD5
* @property {number} iterations The number of iterations to perform. Default: 1
*/
cfg: Base.extend({
keySize: 128/32,
hasher: MD5,
iterations: 1
}),
/**
* Initializes a newly created key derivation function.
*
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
*
* @example
*
* var kdf = CryptoJS.algo.EvpKDF.create();
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
*/
init: function (cfg) {
this.cfg = this.cfg.extend(cfg);
},
/**
* Derives a key from a password.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
*
* @return {WordArray} The derived key.
*
* @example
*
* var key = kdf.compute(password, salt);
*/
compute: function (password, salt) {
// Shortcut
var cfg = this.cfg;
// Init hasher
var hasher = cfg.hasher.create();
// Initial values
var derivedKey = WordArray.create();
// Shortcuts
var derivedKeyWords = derivedKey.words;
var keySize = cfg.keySize;
var iterations = cfg.iterations;
// Generate key
while (derivedKeyWords.length < keySize) {
if (block) {
hasher.update(block);
}
var block = hasher.update(password).finalize(salt);
hasher.reset();
// Iterations
for (var i = 1; i < iterations; i++) {
block = hasher.finalize(block);
hasher.reset();
}
derivedKey.concat(block);
}
derivedKey.sigBytes = keySize * 4;
return derivedKey;
}
});
/**
* Derives a key from a password.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
* @param {Object} cfg (Optional) The configuration options to use for this computation.
*
* @return {WordArray} The derived key.
*
* @static
*
* @example
*
* var key = CryptoJS.EvpKDF(password, salt);
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
*/
C.EvpKDF = function (password, salt, cfg) {
return EvpKDF.create(cfg).compute(password, salt);
};
}());
return CryptoJS.EvpKDF;
}));
},{"./core":44,"./hmac":49,"./sha1":68}],48:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function (undefined) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var CipherParams = C_lib.CipherParams;
var C_enc = C.enc;
var Hex = C_enc.Hex;
var C_format = C.format;
var HexFormatter = C_format.Hex = {
/**
* Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
*
* @param {CipherParams} cipherParams The cipher params object.
*
* @return {string} The hexadecimally encoded string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.format.Hex.stringify(cipherParams);
*/
stringify: function (cipherParams) {
return cipherParams.ciphertext.toString(Hex);
},
/**
* Converts a hexadecimally encoded ciphertext string to a cipher params object.
*
* @param {string} input The hexadecimally encoded string.
*
* @return {CipherParams} The cipher params object.
*
* @static
*
* @example
*
* var cipherParams = CryptoJS.format.Hex.parse(hexString);
*/
parse: function (input) {
var ciphertext = Hex.parse(input);
return CipherParams.create({ ciphertext: ciphertext });
}
};
}());
return CryptoJS.format.Hex;
}));
},{"./cipher-core":43,"./core":44}],49:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var C_enc = C.enc;
var Utf8 = C_enc.Utf8;
var C_algo = C.algo;
/**
* HMAC algorithm.
*/
var HMAC = C_algo.HMAC = Base.extend({
/**
* Initializes a newly created HMAC.
*
* @param {Hasher} hasher The hash algorithm to use.
* @param {WordArray|string} key The secret key.
*
* @example
*
* var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
*/
init: function (hasher, key) {
// Init hasher
hasher = this._hasher = new hasher.init();
// Convert string to WordArray, else assume WordArray already
if (typeof key == 'string') {
key = Utf8.parse(key);
}
// Shortcuts
var hasherBlockSize = hasher.blockSize;
var hasherBlockSizeBytes = hasherBlockSize * 4;
// Allow arbitrary length keys
if (key.sigBytes > hasherBlockSizeBytes) {
key = hasher.finalize(key);
}
// Clamp excess bits
key.clamp();
// Clone key for inner and outer pads
var oKey = this._oKey = key.clone();
var iKey = this._iKey = key.clone();
// Shortcuts
var oKeyWords = oKey.words;
var iKeyWords = iKey.words;
// XOR keys with pad constants
for (var i = 0; i < hasherBlockSize; i++) {
oKeyWords[i] ^= 0x5c5c5c5c;
iKeyWords[i] ^= 0x36363636;
}
oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
// Set initial values
this.reset();
},
/**
* Resets this HMAC to its initial state.
*
* @example
*
* hmacHasher.reset();
*/
reset: function () {
// Shortcut
var hasher = this._hasher;
// Reset
hasher.reset();
hasher.update(this._iKey);
},
/**
* Updates this HMAC with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {HMAC} This HMAC instance.
*
* @example
*
* hmacHasher.update('message');
* hmacHasher.update(wordArray);
*/
update: function (messageUpdate) {
this._hasher.update(messageUpdate);
// Chainable
return this;
},
/**
* Finalizes the HMAC computation.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} messageUpdate (Optional) A final message update.
*
* @return {WordArray} The HMAC.
*
* @example
*
* var hmac = hmacHasher.finalize();
* var hmac = hmacHasher.finalize('message');
* var hmac = hmacHasher.finalize(wordArray);
*/
finalize: function (messageUpdate) {
// Shortcut
var hasher = this._hasher;
// Compute HMAC
var innerHash = hasher.finalize(messageUpdate);
hasher.reset();
var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
return hmac;
}
});
}());
}));
},{"./core":44}],50:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"), _dereq_("./lib-typedarrays"), _dereq_("./enc-utf16"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./sha1"), _dereq_("./sha256"), _dereq_("./sha224"), _dereq_("./sha512"), _dereq_("./sha384"), _dereq_("./sha3"), _dereq_("./ripemd160"), _dereq_("./hmac"), _dereq_("./pbkdf2"), _dereq_("./evpkdf"), _dereq_("./cipher-core"), _dereq_("./mode-cfb"), _dereq_("./mode-ctr"), _dereq_("./mode-ctr-gladman"), _dereq_("./mode-ofb"), _dereq_("./mode-ecb"), _dereq_("./pad-ansix923"), _dereq_("./pad-iso10126"), _dereq_("./pad-iso97971"), _dereq_("./pad-zeropadding"), _dereq_("./pad-nopadding"), _dereq_("./format-hex"), _dereq_("./aes"), _dereq_("./tripledes"), _dereq_("./rc4"), _dereq_("./rabbit"), _dereq_("./rabbit-legacy"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], factory);
}
else {
// Global (browser)
root.CryptoJS = factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
return CryptoJS;
}));
},{"./aes":42,"./cipher-core":43,"./core":44,"./enc-base64":45,"./enc-utf16":46,"./evpkdf":47,"./format-hex":48,"./hmac":49,"./lib-typedarrays":51,"./md5":52,"./mode-cfb":53,"./mode-ctr":55,"./mode-ctr-gladman":54,"./mode-ecb":56,"./mode-ofb":57,"./pad-ansix923":58,"./pad-iso10126":59,"./pad-iso97971":60,"./pad-nopadding":61,"./pad-zeropadding":62,"./pbkdf2":63,"./rabbit":65,"./rabbit-legacy":64,"./rc4":66,"./ripemd160":67,"./sha1":68,"./sha224":69,"./sha256":70,"./sha3":71,"./sha384":72,"./sha512":73,"./tripledes":74,"./x64-core":75}],51:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Check if typed arrays are supported
if (typeof ArrayBuffer != 'function') {
return;
}
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
// Reference original init
var superInit = WordArray.init;
// Augment WordArray.init to handle typed arrays
var subInit = WordArray.init = function (typedArray) {
// Convert buffers to uint8
if (typedArray instanceof ArrayBuffer) {
typedArray = new Uint8Array(typedArray);
}
// Convert other array views to uint8
if (
typedArray instanceof Int8Array ||
(typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) ||
typedArray instanceof Int16Array ||
typedArray instanceof Uint16Array ||
typedArray instanceof Int32Array ||
typedArray instanceof Uint32Array ||
typedArray instanceof Float32Array ||
typedArray instanceof Float64Array
) {
typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
}
// Handle Uint8Array
if (typedArray instanceof Uint8Array) {
// Shortcut
var typedArrayByteLength = typedArray.byteLength;
// Extract bytes
var words = [];
for (var i = 0; i < typedArrayByteLength; i++) {
words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
}
// Initialize this word array
superInit.call(this, words, typedArrayByteLength);
} else {
// Else call normal init
superInit.apply(this, arguments);
}
};
subInit.prototype = WordArray;
}());
return CryptoJS.lib.WordArray;
}));
},{"./core":44}],52:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function (Math) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_algo = C.algo;
// Constants table
var T = [];
// Compute constants
(function () {
for (var i = 0; i < 64; i++) {
T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
}
}());
/**
* MD5 hash algorithm.
*/
var MD5 = C_algo.MD5 = Hasher.extend({
_doReset: function () {
this._hash = new WordArray.init([
0x67452301, 0xefcdab89,
0x98badcfe, 0x10325476
]);
},
_doProcessBlock: function (M, offset) {
// Swap endian
for (var i = 0; i < 16; i++) {
// Shortcuts
var offset_i = offset + i;
var M_offset_i = M[offset_i];
M[offset_i] = (
(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
);
}
// Shortcuts
var H = this._hash.words;
var M_offset_0 = M[offset + 0];
var M_offset_1 = M[offset + 1];
var M_offset_2 = M[offset + 2];
var M_offset_3 = M[offset + 3];
var M_offset_4 = M[offset + 4];
var M_offset_5 = M[offset + 5];
var M_offset_6 = M[offset + 6];
var M_offset_7 = M[offset + 7];
var M_offset_8 = M[offset + 8];
var M_offset_9 = M[offset + 9];
var M_offset_10 = M[offset + 10];
var M_offset_11 = M[offset + 11];
var M_offset_12 = M[offset + 12];
var M_offset_13 = M[offset + 13];
var M_offset_14 = M[offset + 14];
var M_offset_15 = M[offset + 15];
// Working varialbes
var a = H[0];
var b = H[1];
var c = H[2];
var d = H[3];
// Computation
a = FF(a, b, c, d, M_offset_0, 7, T[0]);
d = FF(d, a, b, c, M_offset_1, 12, T[1]);
c = FF(c, d, a, b, M_offset_2, 17, T[2]);
b = FF(b, c, d, a, M_offset_3, 22, T[3]);
a = FF(a, b, c, d, M_offset_4, 7, T[4]);
d = FF(d, a, b, c, M_offset_5, 12, T[5]);
c = FF(c, d, a, b, M_offset_6, 17, T[6]);
b = FF(b, c, d, a, M_offset_7, 22, T[7]);
a = FF(a, b, c, d, M_offset_8, 7, T[8]);
d = FF(d, a, b, c, M_offset_9, 12, T[9]);
c = FF(c, d, a, b, M_offset_10, 17, T[10]);
b = FF(b, c, d, a, M_offset_11, 22, T[11]);
a = FF(a, b, c, d, M_offset_12, 7, T[12]);
d = FF(d, a, b, c, M_offset_13, 12, T[13]);
c = FF(c, d, a, b, M_offset_14, 17, T[14]);
b = FF(b, c, d, a, M_offset_15, 22, T[15]);
a = GG(a, b, c, d, M_offset_1, 5, T[16]);
d = GG(d, a, b, c, M_offset_6, 9, T[17]);
c = GG(c, d, a, b, M_offset_11, 14, T[18]);
b = GG(b, c, d, a, M_offset_0, 20, T[19]);
a = GG(a, b, c, d, M_offset_5, 5, T[20]);
d = GG(d, a, b, c, M_offset_10, 9, T[21]);
c = GG(c, d, a, b, M_offset_15, 14, T[22]);
b = GG(b, c, d, a, M_offset_4, 20, T[23]);
a = GG(a, b, c, d, M_offset_9, 5, T[24]);
d = GG(d, a, b, c, M_offset_14, 9, T[25]);
c = GG(c, d, a, b, M_offset_3, 14, T[26]);
b = GG(b, c, d, a, M_offset_8, 20, T[27]);
a = GG(a, b, c, d, M_offset_13, 5, T[28]);
d = GG(d, a, b, c, M_offset_2, 9, T[29]);
c = GG(c, d, a, b, M_offset_7, 14, T[30]);
b = GG(b, c, d, a, M_offset_12, 20, T[31]);
a = HH(a, b, c, d, M_offset_5, 4, T[32]);
d = HH(d, a, b, c, M_offset_8, 11, T[33]);
c = HH(c, d, a, b, M_offset_11, 16, T[34]);
b = HH(b, c, d, a, M_offset_14, 23, T[35]);
a = HH(a, b, c, d, M_offset_1, 4, T[36]);
d = HH(d, a, b, c, M_offset_4, 11, T[37]);
c = HH(c, d, a, b, M_offset_7, 16, T[38]);
b = HH(b, c, d, a, M_offset_10, 23, T[39]);
a = HH(a, b, c, d, M_offset_13, 4, T[40]);
d = HH(d, a, b, c, M_offset_0, 11, T[41]);
c = HH(c, d, a, b, M_offset_3, 16, T[42]);
b = HH(b, c, d, a, M_offset_6, 23, T[43]);
a = HH(a, b, c, d, M_offset_9, 4, T[44]);
d = HH(d, a, b, c, M_offset_12, 11, T[45]);
c = HH(c, d, a, b, M_offset_15, 16, T[46]);
b = HH(b, c, d, a, M_offset_2, 23, T[47]);
a = II(a, b, c, d, M_offset_0, 6, T[48]);
d = II(d, a, b, c, M_offset_7, 10, T[49]);
c = II(c, d, a, b, M_offset_14, 15, T[50]);
b = II(b, c, d, a, M_offset_5, 21, T[51]);
a = II(a, b, c, d, M_offset_12, 6, T[52]);
d = II(d, a, b, c, M_offset_3, 10, T[53]);
c = II(c, d, a, b, M_offset_10, 15, T[54]);
b = II(b, c, d, a, M_offset_1, 21, T[55]);
a = II(a, b, c, d, M_offset_8, 6, T[56]);
d = II(d, a, b, c, M_offset_15, 10, T[57]);
c = II(c, d, a, b, M_offset_6, 15, T[58]);
b = II(b, c, d, a, M_offset_13, 21, T[59]);
a = II(a, b, c, d, M_offset_4, 6, T[60]);
d = II(d, a, b, c, M_offset_11, 10, T[61]);
c = II(c, d, a, b, M_offset_2, 15, T[62]);
b = II(b, c, d, a, M_offset_9, 21, T[63]);
// Intermediate hash value
H[0] = (H[0] + a) | 0;
H[1] = (H[1] + b) | 0;
H[2] = (H[2] + c) | 0;
H[3] = (H[3] + d) | 0;
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
var nBitsTotalL = nBitsTotal;
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
(((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
(((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
(((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
(((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
);
data.sigBytes = (dataWords.length + 1) * 4;
// Hash final blocks
this._process();
// Shortcuts
var hash = this._hash;
var H = hash.words;
// Swap endian
for (var i = 0; i < 4; i++) {
// Shortcut
var H_i = H[i];
H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
}
// Return final computed hash
return hash;
},
clone: function () {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
}
});
function FF(a, b, c, d, x, s, t) {
var n = a + ((b & c) | (~b & d)) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
function GG(a, b, c, d, x, s, t) {
var n = a + ((b & d) | (c & ~d)) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
function HH(a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
function II(a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.MD5('message');
* var hash = CryptoJS.MD5(wordArray);
*/
C.MD5 = Hasher._createHelper(MD5);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacMD5(message, key);
*/
C.HmacMD5 = Hasher._createHmacHelper(MD5);
}(Math));
return CryptoJS.MD5;
}));
},{"./core":44}],53:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* Cipher Feedback block mode.
*/
CryptoJS.mode.CFB = (function () {
var CFB = CryptoJS.lib.BlockCipherMode.extend();
CFB.Encryptor = CFB.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
// Remember this block to use with next block
this._prevBlock = words.slice(offset, offset + blockSize);
}
});
CFB.Decryptor = CFB.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
// Remember this block to use with next block
var thisBlock = words.slice(offset, offset + blockSize);
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
// This block becomes the previous block
this._prevBlock = thisBlock;
}
});
function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
// Shortcut
var iv = this._iv;
// Generate keystream
if (iv) {
var keystream = iv.slice(0);
// Remove IV for subsequent blocks
this._iv = undefined;
} else {
var keystream = this._prevBlock;
}
cipher.encryptBlock(keystream, 0);
// Encrypt
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= keystream[i];
}
}
return CFB;
}());
return CryptoJS.mode.CFB;
}));
},{"./cipher-core":43,"./core":44}],54:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby [email protected]
*/
CryptoJS.mode.CTRGladman = (function () {
var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
function incWord(word)
{
if (((word >> 24) & 0xff) === 0xff) { //overflow
var b1 = (word >> 16)&0xff;
var b2 = (word >> 8)&0xff;
var b3 = word & 0xff;
if (b1 === 0xff) // overflow b1
{
b1 = 0;
if (b2 === 0xff)
{
b2 = 0;
if (b3 === 0xff)
{
b3 = 0;
}
else
{
++b3;
}
}
else
{
++b2;
}
}
else
{
++b1;
}
word = 0;
word += (b1 << 16);
word += (b2 << 8);
word += b3;
}
else
{
word += (0x01 << 24);
}
return word;
}
function incCounter(counter)
{
if ((counter[0] = incWord(counter[0])) === 0)
{
// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
counter[1] = incWord(counter[1]);
}
return counter;
}
var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher
var blockSize = cipher.blockSize;
var iv = this._iv;
var counter = this._counter;
// Generate keystream
if (iv) {
counter = this._counter = iv.slice(0);
// Remove IV for subsequent blocks
this._iv = undefined;
}
incCounter(counter);
var keystream = counter.slice(0);
cipher.encryptBlock(keystream, 0);
// Encrypt
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= keystream[i];
}
}
});
CTRGladman.Decryptor = Encryptor;
return CTRGladman;
}());
return CryptoJS.mode.CTRGladman;
}));
},{"./cipher-core":43,"./core":44}],55:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* Counter block mode.
*/
CryptoJS.mode.CTR = (function () {
var CTR = CryptoJS.lib.BlockCipherMode.extend();
var Encryptor = CTR.Encryptor = CTR.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher
var blockSize = cipher.blockSize;
var iv = this._iv;
var counter = this._counter;
// Generate keystream
if (iv) {
counter = this._counter = iv.slice(0);
// Remove IV for subsequent blocks
this._iv = undefined;
}
var keystream = counter.slice(0);
cipher.encryptBlock(keystream, 0);
// Increment counter
counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
// Encrypt
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= keystream[i];
}
}
});
CTR.Decryptor = Encryptor;
return CTR;
}());
return CryptoJS.mode.CTR;
}));
},{"./cipher-core":43,"./core":44}],56:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* Electronic Codebook block mode.
*/
CryptoJS.mode.ECB = (function () {
var ECB = CryptoJS.lib.BlockCipherMode.extend();
ECB.Encryptor = ECB.extend({
processBlock: function (words, offset) {
this._cipher.encryptBlock(words, offset);
}
});
ECB.Decryptor = ECB.extend({
processBlock: function (words, offset) {
this._cipher.decryptBlock(words, offset);
}
});
return ECB;
}());
return CryptoJS.mode.ECB;
}));
},{"./cipher-core":43,"./core":44}],57:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* Output Feedback block mode.
*/
CryptoJS.mode.OFB = (function () {
var OFB = CryptoJS.lib.BlockCipherMode.extend();
var Encryptor = OFB.Encryptor = OFB.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher
var blockSize = cipher.blockSize;
var iv = this._iv;
var keystream = this._keystream;
// Generate keystream
if (iv) {
keystream = this._keystream = iv.slice(0);
// Remove IV for subsequent blocks
this._iv = undefined;
}
cipher.encryptBlock(keystream, 0);
// Encrypt
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= keystream[i];
}
}
});
OFB.Decryptor = Encryptor;
return OFB;
}());
return CryptoJS.mode.OFB;
}));
},{"./cipher-core":43,"./core":44}],58:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* ANSI X.923 padding strategy.
*/
CryptoJS.pad.AnsiX923 = {
pad: function (data, blockSize) {
// Shortcuts
var dataSigBytes = data.sigBytes;
var blockSizeBytes = blockSize * 4;
// Count padding bytes
var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
// Compute last byte position
var lastBytePos = dataSigBytes + nPaddingBytes - 1;
// Pad
data.clamp();
data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
data.sigBytes += nPaddingBytes;
},
unpad: function (data) {
// Get number of padding bytes from last byte
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
// Remove padding
data.sigBytes -= nPaddingBytes;
}
};
return CryptoJS.pad.Ansix923;
}));
},{"./cipher-core":43,"./core":44}],59:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* ISO 10126 padding strategy.
*/
CryptoJS.pad.Iso10126 = {
pad: function (data, blockSize) {
// Shortcut
var blockSizeBytes = blockSize * 4;
// Count padding bytes
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
// Pad
data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
},
unpad: function (data) {
// Get number of padding bytes from last byte
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
// Remove padding
data.sigBytes -= nPaddingBytes;
}
};
return CryptoJS.pad.Iso10126;
}));
},{"./cipher-core":43,"./core":44}],60:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* ISO/IEC 9797-1 Padding Method 2.
*/
CryptoJS.pad.Iso97971 = {
pad: function (data, blockSize) {
// Add 0x80 byte
data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
// Zero pad the rest
CryptoJS.pad.ZeroPadding.pad(data, blockSize);
},
unpad: function (data) {
// Remove zero padding
CryptoJS.pad.ZeroPadding.unpad(data);
// Remove one more byte -- the 0x80 byte
data.sigBytes--;
}
};
return CryptoJS.pad.Iso97971;
}));
},{"./cipher-core":43,"./core":44}],61:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* A noop padding strategy.
*/
CryptoJS.pad.NoPadding = {
pad: function () {
},
unpad: function () {
}
};
return CryptoJS.pad.NoPadding;
}));
},{"./cipher-core":43,"./core":44}],62:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* Zero padding strategy.
*/
CryptoJS.pad.ZeroPadding = {
pad: function (data, blockSize) {
// Shortcut
var blockSizeBytes = blockSize * 4;
// Pad
data.clamp();
data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
},
unpad: function (data) {
// Shortcut
var dataWords = data.words;
// Unpad
var i = data.sigBytes - 1;
while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
i--;
}
data.sigBytes = i + 1;
}
};
return CryptoJS.pad.ZeroPadding;
}));
},{"./cipher-core":43,"./core":44}],63:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./sha1", "./hmac"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var WordArray = C_lib.WordArray;
var C_algo = C.algo;
var SHA1 = C_algo.SHA1;
var HMAC = C_algo.HMAC;
/**
* Password-Based Key Derivation Function 2 algorithm.
*/
var PBKDF2 = C_algo.PBKDF2 = Base.extend({
/**
* Configuration options.
*
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
* @property {Hasher} hasher The hasher to use. Default: SHA1
* @property {number} iterations The number of iterations to perform. Default: 1
*/
cfg: Base.extend({
keySize: 128/32,
hasher: SHA1,
iterations: 1
}),
/**
* Initializes a newly created key derivation function.
*
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
*
* @example
*
* var kdf = CryptoJS.algo.PBKDF2.create();
* var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
* var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
*/
init: function (cfg) {
this.cfg = this.cfg.extend(cfg);
},
/**
* Computes the Password-Based Key Derivation Function 2.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
*
* @return {WordArray} The derived key.
*
* @example
*
* var key = kdf.compute(password, salt);
*/
compute: function (password, salt) {
// Shortcut
var cfg = this.cfg;
// Init HMAC
var hmac = HMAC.create(cfg.hasher, password);
// Initial values
var derivedKey = WordArray.create();
var blockIndex = WordArray.create([0x00000001]);
// Shortcuts
var derivedKeyWords = derivedKey.words;
var blockIndexWords = blockIndex.words;
var keySize = cfg.keySize;
var iterations = cfg.iterations;
// Generate key
while (derivedKeyWords.length < keySize) {
var block = hmac.update(salt).finalize(blockIndex);
hmac.reset();
// Shortcuts
var blockWords = block.words;
var blockWordsLength = blockWords.length;
// Iterations
var intermediate = block;
for (var i = 1; i < iterations; i++) {
intermediate = hmac.finalize(intermediate);
hmac.reset();
// Shortcut
var intermediateWords = intermediate.words;
// XOR intermediate with block
for (var j = 0; j < blockWordsLength; j++) {
blockWords[j] ^= intermediateWords[j];
}
}
derivedKey.concat(block);
blockIndexWords[0]++;
}
derivedKey.sigBytes = keySize * 4;
return derivedKey;
}
});
/**
* Computes the Password-Based Key Derivation Function 2.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
* @param {Object} cfg (Optional) The configuration options to use for this computation.
*
* @return {WordArray} The derived key.
*
* @static
*
* @example
*
* var key = CryptoJS.PBKDF2(password, salt);
* var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
* var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
*/
C.PBKDF2 = function (password, salt, cfg) {
return PBKDF2.create(cfg).compute(password, salt);
};
}());
return CryptoJS.PBKDF2;
}));
},{"./core":44,"./hmac":49,"./sha1":68}],64:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var StreamCipher = C_lib.StreamCipher;
var C_algo = C.algo;
// Reusable objects
var S = [];
var C_ = [];
var G = [];
/**
* Rabbit stream cipher algorithm.
*
* This is a legacy version that neglected to convert the key to little-endian.
* This error doesn't affect the cipher's security,
* but it does affect its compatibility with other implementations.
*/
var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
_doReset: function () {
// Shortcuts
var K = this._key.words;
var iv = this.cfg.iv;
// Generate initial state values
var X = this._X = [
K[0], (K[3] << 16) | (K[2] >>> 16),
K[1], (K[0] << 16) | (K[3] >>> 16),
K[2], (K[1] << 16) | (K[0] >>> 16),
K[3], (K[2] << 16) | (K[1] >>> 16)
];
// Generate initial counter values
var C = this._C = [
(K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
(K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
(K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
(K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
];
// Carry bit
this._b = 0;
// Iterate the system four times
for (var i = 0; i < 4; i++) {
nextState.call(this);
}
// Modify the counters
for (var i = 0; i < 8; i++) {
C[i] ^= X[(i + 4) & 7];
}
// IV setup
if (iv) {
// Shortcuts
var IV = iv.words;
var IV_0 = IV[0];
var IV_1 = IV[1];
// Generate four subvectors
var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
var i3 = (i2 << 16) | (i0 & 0x0000ffff);
// Modify counter values
C[0] ^= i0;
C[1] ^= i1;
C[2] ^= i2;
C[3] ^= i3;
C[4] ^= i0;
C[5] ^= i1;
C[6] ^= i2;
C[7] ^= i3;
// Iterate the system four times
for (var i = 0; i < 4; i++) {
nextState.call(this);
}
}
},
_doProcessBlock: function (M, offset) {
// Shortcut
var X = this._X;
// Iterate the system
nextState.call(this);
// Generate four keystream words
S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
for (var i = 0; i < 4; i++) {
// Swap endian
S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
(((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
// Encrypt
M[offset + i] ^= S[i];
}
},
blockSize: 128/32,
ivSize: 64/32
});
function nextState() {
// Shortcuts
var X = this._X;
var C = this._C;
// Save old counter values
for (var i = 0; i < 8; i++) {
C_[i] = C[i];
}
// Calculate new counter values
C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
// Calculate the g-values
for (var i = 0; i < 8; i++) {
var gx = X[i] + C[i];
// Construct high and low argument for squaring
var ga = gx & 0xffff;
var gb = gx >>> 16;
// Calculate high and low result of squaring
var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
// High XOR low
G[i] = gh ^ gl;
}
// Calculate new state values
X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
}
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
* var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
*/
C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
}());
return CryptoJS.RabbitLegacy;
}));
},{"./cipher-core":43,"./core":44,"./enc-base64":45,"./evpkdf":47,"./md5":52}],65:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var StreamCipher = C_lib.StreamCipher;
var C_algo = C.algo;
// Reusable objects
var S = [];
var C_ = [];
var G = [];
/**
* Rabbit stream cipher algorithm
*/
var Rabbit = C_algo.Rabbit = StreamCipher.extend({
_doReset: function () {
// Shortcuts
var K = this._key.words;
var iv = this.cfg.iv;
// Swap endian
for (var i = 0; i < 4; i++) {
K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
(((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
}
// Generate initial state values
var X = this._X = [
K[0], (K[3] << 16) | (K[2] >>> 16),
K[1], (K[0] << 16) | (K[3] >>> 16),
K[2], (K[1] << 16) | (K[0] >>> 16),
K[3], (K[2] << 16) | (K[1] >>> 16)
];
// Generate initial counter values
var C = this._C = [
(K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
(K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
(K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
(K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
];
// Carry bit
this._b = 0;
// Iterate the system four times
for (var i = 0; i < 4; i++) {
nextState.call(this);
}
// Modify the counters
for (var i = 0; i < 8; i++) {
C[i] ^= X[(i + 4) & 7];
}
// IV setup
if (iv) {
// Shortcuts
var IV = iv.words;
var IV_0 = IV[0];
var IV_1 = IV[1];
// Generate four subvectors
var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
var i3 = (i2 << 16) | (i0 & 0x0000ffff);
// Modify counter values
C[0] ^= i0;
C[1] ^= i1;
C[2] ^= i2;
C[3] ^= i3;
C[4] ^= i0;
C[5] ^= i1;
C[6] ^= i2;
C[7] ^= i3;
// Iterate the system four times
for (var i = 0; i < 4; i++) {
nextState.call(this);
}
}
},
_doProcessBlock: function (M, offset) {
// Shortcut
var X = this._X;
// Iterate the system
nextState.call(this);
// Generate four keystream words
S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
for (var i = 0; i < 4; i++) {
// Swap endian
S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
(((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
// Encrypt
M[offset + i] ^= S[i];
}
},
blockSize: 128/32,
ivSize: 64/32
});
function nextState() {
// Shortcuts
var X = this._X;
var C = this._C;
// Save old counter values
for (var i = 0; i < 8; i++) {
C_[i] = C[i];
}
// Calculate new counter values
C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
// Calculate the g-values
for (var i = 0; i < 8; i++) {
var gx = X[i] + C[i];
// Construct high and low argument for squaring
var ga = gx & 0xffff;
var gb = gx >>> 16;
// Calculate high and low result of squaring
var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
// High XOR low
G[i] = gh ^ gl;
}
// Calculate new state values
X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
}
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
* var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
*/
C.Rabbit = StreamCipher._createHelper(Rabbit);
}());
return CryptoJS.Rabbit;
}));
},{"./cipher-core":43,"./core":44,"./enc-base64":45,"./evpkdf":47,"./md5":52}],66:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var StreamCipher = C_lib.StreamCipher;
var C_algo = C.algo;
/**
* RC4 stream cipher algorithm.
*/
var RC4 = C_algo.RC4 = StreamCipher.extend({
_doReset: function () {
// Shortcuts
var key = this._key;
var keyWords = key.words;
var keySigBytes = key.sigBytes;
// Init sbox
var S = this._S = [];
for (var i = 0; i < 256; i++) {
S[i] = i;
}
// Key setup
for (var i = 0, j = 0; i < 256; i++) {
var keyByteIndex = i % keySigBytes;
var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
j = (j + S[i] + keyByte) % 256;
// Swap
var t = S[i];
S[i] = S[j];
S[j] = t;
}
// Counters
this._i = this._j = 0;
},
_doProcessBlock: function (M, offset) {
M[offset] ^= generateKeystreamWord.call(this);
},
keySize: 256/32,
ivSize: 0
});
function generateKeystreamWord() {
// Shortcuts
var S = this._S;
var i = this._i;
var j = this._j;
// Generate keystream word
var keystreamWord = 0;
for (var n = 0; n < 4; n++) {
i = (i + 1) % 256;
j = (j + S[i]) % 256;
// Swap
var t = S[i];
S[i] = S[j];
S[j] = t;
keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
}
// Update counters
this._i = i;
this._j = j;
return keystreamWord;
}
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
* var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
*/
C.RC4 = StreamCipher._createHelper(RC4);
/**
* Modified RC4 stream cipher algorithm.
*/
var RC4Drop = C_algo.RC4Drop = RC4.extend({
/**
* Configuration options.
*
* @property {number} drop The number of keystream words to drop. Default 192
*/
cfg: RC4.cfg.extend({
drop: 192
}),
_doReset: function () {
RC4._doReset.call(this);
// Drop
for (var i = this.cfg.drop; i > 0; i--) {
generateKeystreamWord.call(this);
}
}
});
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
* var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
*/
C.RC4Drop = StreamCipher._createHelper(RC4Drop);
}());
return CryptoJS.RC4;
}));
},{"./cipher-core":43,"./core":44,"./enc-base64":45,"./evpkdf":47,"./md5":52}],67:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function (Math) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_algo = C.algo;
// Constants table
var _zl = WordArray.create([
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
var _zr = WordArray.create([
5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
var _sl = WordArray.create([
11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);
var _sr = WordArray.create([
8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);
var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
/**
* RIPEMD160 hash algorithm.
*/
var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
_doReset: function () {
this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
},
_doProcessBlock: function (M, offset) {
// Swap endian
for (var i = 0; i < 16; i++) {
// Shortcuts
var offset_i = offset + i;
var M_offset_i = M[offset_i];
// Swap
M[offset_i] = (
(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
);
}
// Shortcut
var H = this._hash.words;
var hl = _hl.words;
var hr = _hr.words;
var zl = _zl.words;
var zr = _zr.words;
var sl = _sl.words;
var sr = _sr.words;
// Working variables
var al, bl, cl, dl, el;
var ar, br, cr, dr, er;
ar = al = H[0];
br = bl = H[1];
cr = cl = H[2];
dr = dl = H[3];
er = el = H[4];
// Computation
var t;
for (var i = 0; i < 80; i += 1) {
t = (al + M[offset+zl[i]])|0;
if (i<16){
t += f1(bl,cl,dl) + hl[0];
} else if (i<32) {
t += f2(bl,cl,dl) + hl[1];
} else if (i<48) {
t += f3(bl,cl,dl) + hl[2];
} else if (i<64) {
t += f4(bl,cl,dl) + hl[3];
} else {// if (i<80) {
t += f5(bl,cl,dl) + hl[4];
}
t = t|0;
t = rotl(t,sl[i]);
t = (t+el)|0;
al = el;
el = dl;
dl = rotl(cl, 10);
cl = bl;
bl = t;
t = (ar + M[offset+zr[i]])|0;
if (i<16){
t += f5(br,cr,dr) + hr[0];
} else if (i<32) {
t += f4(br,cr,dr) + hr[1];
} else if (i<48) {
t += f3(br,cr,dr) + hr[2];
} else if (i<64) {
t += f2(br,cr,dr) + hr[3];
} else {// if (i<80) {
t += f1(br,cr,dr) + hr[4];
}
t = t|0;
t = rotl(t,sr[i]) ;
t = (t+er)|0;
ar = er;
er = dr;
dr = rotl(cr, 10);
cr = br;
br = t;
}
// Intermediate hash value
t = (H[1] + cl + dr)|0;
H[1] = (H[2] + dl + er)|0;
H[2] = (H[3] + el + ar)|0;
H[3] = (H[4] + al + br)|0;
H[4] = (H[0] + bl + cr)|0;
H[0] = t;
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
(((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
(((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
);
data.sigBytes = (dataWords.length + 1) * 4;
// Hash final blocks
this._process();
// Shortcuts
var hash = this._hash;
var H = hash.words;
// Swap endian
for (var i = 0; i < 5; i++) {
// Shortcut
var H_i = H[i];
// Swap
H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
}
// Return final computed hash
return hash;
},
clone: function () {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
}
});
function f1(x, y, z) {
return ((x) ^ (y) ^ (z));
}
function f2(x, y, z) {
return (((x)&(y)) | ((~x)&(z)));
}
function f3(x, y, z) {
return (((x) | (~(y))) ^ (z));
}
function f4(x, y, z) {
return (((x) & (z)) | ((y)&(~(z))));
}
function f5(x, y, z) {
return ((x) ^ ((y) |(~(z))));
}
function rotl(x,n) {
return (x<<n) | (x>>>(32-n));
}
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.RIPEMD160('message');
* var hash = CryptoJS.RIPEMD160(wordArray);
*/
C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacRIPEMD160(message, key);
*/
C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
}(Math));
return CryptoJS.RIPEMD160;
}));
},{"./core":44}],68:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_algo = C.algo;
// Reusable object
var W = [];
/**
* SHA-1 hash algorithm.
*/
var SHA1 = C_algo.SHA1 = Hasher.extend({
_doReset: function () {
this._hash = new WordArray.init([
0x67452301, 0xefcdab89,
0x98badcfe, 0x10325476,
0xc3d2e1f0
]);
},
_doProcessBlock: function (M, offset) {
// Shortcut
var H = this._hash.words;
// Working variables
var a = H[0];
var b = H[1];
var c = H[2];
var d = H[3];
var e = H[4];
// Computation
for (var i = 0; i < 80; i++) {
if (i < 16) {
W[i] = M[offset + i] | 0;
} else {
var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
W[i] = (n << 1) | (n >>> 31);
}
var t = ((a << 5) | (a >>> 27)) + e + W[i];
if (i < 20) {
t += ((b & c) | (~b & d)) + 0x5a827999;
} else if (i < 40) {
t += (b ^ c ^ d) + 0x6ed9eba1;
} else if (i < 60) {
t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
} else /* if (i < 80) */ {
t += (b ^ c ^ d) - 0x359d3e2a;
}
e = d;
d = c;
c = (b << 30) | (b >>> 2);
b = a;
a = t;
}
// Intermediate hash value
H[0] = (H[0] + a) | 0;
H[1] = (H[1] + b) | 0;
H[2] = (H[2] + c) | 0;
H[3] = (H[3] + d) | 0;
H[4] = (H[4] + e) | 0;
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
data.sigBytes = dataWords.length * 4;
// Hash final blocks
this._process();
// Return final computed hash
return this._hash;
},
clone: function () {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
}
});
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.SHA1('message');
* var hash = CryptoJS.SHA1(wordArray);
*/
C.SHA1 = Hasher._createHelper(SHA1);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacSHA1(message, key);
*/
C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
}());
return CryptoJS.SHA1;
}));
},{"./core":44}],69:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha256"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./sha256"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var C_algo = C.algo;
var SHA256 = C_algo.SHA256;
/**
* SHA-224 hash algorithm.
*/
var SHA224 = C_algo.SHA224 = SHA256.extend({
_doReset: function () {
this._hash = new WordArray.init([
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
]);
},
_doFinalize: function () {
var hash = SHA256._doFinalize.call(this);
hash.sigBytes -= 4;
return hash;
}
});
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.SHA224('message');
* var hash = CryptoJS.SHA224(wordArray);
*/
C.SHA224 = SHA256._createHelper(SHA224);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacSHA224(message, key);
*/
C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
}());
return CryptoJS.SHA224;
}));
},{"./core":44,"./sha256":70}],70:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function (Math) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_algo = C.algo;
// Initialization and round constants tables
var H = [];
var K = [];
// Compute constants
(function () {
function isPrime(n) {
var sqrtN = Math.sqrt(n);
for (var factor = 2; factor <= sqrtN; factor++) {
if (!(n % factor)) {
return false;
}
}
return true;
}
function getFractionalBits(n) {
return ((n - (n | 0)) * 0x100000000) | 0;
}
var n = 2;
var nPrime = 0;
while (nPrime < 64) {
if (isPrime(n)) {
if (nPrime < 8) {
H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
}
K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
nPrime++;
}
n++;
}
}());
// Reusable object
var W = [];
/**
* SHA-256 hash algorithm.
*/
var SHA256 = C_algo.SHA256 = Hasher.extend({
_doReset: function () {
this._hash = new WordArray.init(H.slice(0));
},
_doProcessBlock: function (M, offset) {
// Shortcut
var H = this._hash.words;
// Working variables
var a = H[0];
var b = H[1];
var c = H[2];
var d = H[3];
var e = H[4];
var f = H[5];
var g = H[6];
var h = H[7];
// Computation
for (var i = 0; i < 64; i++) {
if (i < 16) {
W[i] = M[offset + i] | 0;
} else {
var gamma0x = W[i - 15];
var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
((gamma0x << 14) | (gamma0x >>> 18)) ^
(gamma0x >>> 3);
var gamma1x = W[i - 2];
var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
((gamma1x << 13) | (gamma1x >>> 19)) ^
(gamma1x >>> 10);
W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
}
var ch = (e & f) ^ (~e & g);
var maj = (a & b) ^ (a & c) ^ (b & c);
var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
var t1 = h + sigma1 + ch + K[i] + W[i];
var t2 = sigma0 + maj;
h = g;
g = f;
f = e;
e = (d + t1) | 0;
d = c;
c = b;
b = a;
a = (t1 + t2) | 0;
}
// Intermediate hash value
H[0] = (H[0] + a) | 0;
H[1] = (H[1] + b) | 0;
H[2] = (H[2] + c) | 0;
H[3] = (H[3] + d) | 0;
H[4] = (H[4] + e) | 0;
H[5] = (H[5] + f) | 0;
H[6] = (H[6] + g) | 0;
H[7] = (H[7] + h) | 0;
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
data.sigBytes = dataWords.length * 4;
// Hash final blocks
this._process();
// Return final computed hash
return this._hash;
},
clone: function () {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
}
});
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.SHA256('message');
* var hash = CryptoJS.SHA256(wordArray);
*/
C.SHA256 = Hasher._createHelper(SHA256);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacSHA256(message, key);
*/
C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
}(Math));
return CryptoJS.SHA256;
}));
},{"./core":44}],71:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./x64-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function (Math) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_x64 = C.x64;
var X64Word = C_x64.Word;
var C_algo = C.algo;
// Constants tables
var RHO_OFFSETS = [];
var PI_INDEXES = [];
var ROUND_CONSTANTS = [];
// Compute Constants
(function () {
// Compute rho offset constants
var x = 1, y = 0;
for (var t = 0; t < 24; t++) {
RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
var newX = y % 5;
var newY = (2 * x + 3 * y) % 5;
x = newX;
y = newY;
}
// Compute pi index constants
for (var x = 0; x < 5; x++) {
for (var y = 0; y < 5; y++) {
PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
}
}
// Compute round constants
var LFSR = 0x01;
for (var i = 0; i < 24; i++) {
var roundConstantMsw = 0;
var roundConstantLsw = 0;
for (var j = 0; j < 7; j++) {
if (LFSR & 0x01) {
var bitPosition = (1 << j) - 1;
if (bitPosition < 32) {
roundConstantLsw ^= 1 << bitPosition;
} else /* if (bitPosition >= 32) */ {
roundConstantMsw ^= 1 << (bitPosition - 32);
}
}
// Compute next LFSR
if (LFSR & 0x80) {
// Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
LFSR = (LFSR << 1) ^ 0x71;
} else {
LFSR <<= 1;
}
}
ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
}
}());
// Reusable objects for temporary values
var T = [];
(function () {
for (var i = 0; i < 25; i++) {
T[i] = X64Word.create();
}
}());
/**
* SHA-3 hash algorithm.
*/
var SHA3 = C_algo.SHA3 = Hasher.extend({
/**
* Configuration options.
*
* @property {number} outputLength
* The desired number of bits in the output hash.
* Only values permitted are: 224, 256, 384, 512.
* Default: 512
*/
cfg: Hasher.cfg.extend({
outputLength: 512
}),
_doReset: function () {
var state = this._state = []
for (var i = 0; i < 25; i++) {
state[i] = new X64Word.init();
}
this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
},
_doProcessBlock: function (M, offset) {
// Shortcuts
var state = this._state;
var nBlockSizeLanes = this.blockSize / 2;
// Absorb
for (var i = 0; i < nBlockSizeLanes; i++) {
// Shortcuts
var M2i = M[offset + 2 * i];
var M2i1 = M[offset + 2 * i + 1];
// Swap endian
M2i = (
(((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
(((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
);
M2i1 = (
(((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
(((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
);
// Absorb message into state
var lane = state[i];
lane.high ^= M2i1;
lane.low ^= M2i;
}
// Rounds
for (var round = 0; round < 24; round++) {
// Theta
for (var x = 0; x < 5; x++) {
// Mix column lanes
var tMsw = 0, tLsw = 0;
for (var y = 0; y < 5; y++) {
var lane = state[x + 5 * y];
tMsw ^= lane.high;
tLsw ^= lane.low;
}
// Temporary values
var Tx = T[x];
Tx.high = tMsw;
Tx.low = tLsw;
}
for (var x = 0; x < 5; x++) {
// Shortcuts
var Tx4 = T[(x + 4) % 5];
var Tx1 = T[(x + 1) % 5];
var Tx1Msw = Tx1.high;
var Tx1Lsw = Tx1.low;
// Mix surrounding columns
var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
for (var y = 0; y < 5; y++) {
var lane = state[x + 5 * y];
lane.high ^= tMsw;
lane.low ^= tLsw;
}
}
// Rho Pi
for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
// Shortcuts
var lane = state[laneIndex];
var laneMsw = lane.high;
var laneLsw = lane.low;
var rhoOffset = RHO_OFFSETS[laneIndex];
// Rotate lanes
if (rhoOffset < 32) {
var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
} else /* if (rhoOffset >= 32) */ {
var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
}
// Transpose lanes
var TPiLane = T[PI_INDEXES[laneIndex]];
TPiLane.high = tMsw;
TPiLane.low = tLsw;
}
// Rho pi at x = y = 0
var T0 = T[0];
var state0 = state[0];
T0.high = state0.high;
T0.low = state0.low;
// Chi
for (var x = 0; x < 5; x++) {
for (var y = 0; y < 5; y++) {
// Shortcuts
var laneIndex = x + 5 * y;
var lane = state[laneIndex];
var TLane = T[laneIndex];
var Tx1Lane = T[((x + 1) % 5) + 5 * y];
var Tx2Lane = T[((x + 2) % 5) + 5 * y];
// Mix rows
lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
}
}
// Iota
var lane = state[0];
var roundConstant = ROUND_CONSTANTS[round];
lane.high ^= roundConstant.high;
lane.low ^= roundConstant.low;;
}
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
var blockSizeBits = this.blockSize * 32;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
data.sigBytes = dataWords.length * 4;
// Hash final blocks
this._process();
// Shortcuts
var state = this._state;
var outputLengthBytes = this.cfg.outputLength / 8;
var outputLengthLanes = outputLengthBytes / 8;
// Squeeze
var hashWords = [];
for (var i = 0; i < outputLengthLanes; i++) {
// Shortcuts
var lane = state[i];
var laneMsw = lane.high;
var laneLsw = lane.low;
// Swap endian
laneMsw = (
(((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
(((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
);
laneLsw = (
(((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
(((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
);
// Squeeze state to retrieve hash
hashWords.push(laneLsw);
hashWords.push(laneMsw);
}
// Return final computed hash
return new WordArray.init(hashWords, outputLengthBytes);
},
clone: function () {
var clone = Hasher.clone.call(this);
var state = clone._state = this._state.slice(0);
for (var i = 0; i < 25; i++) {
state[i] = state[i].clone();
}
return clone;
}
});
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.SHA3('message');
* var hash = CryptoJS.SHA3(wordArray);
*/
C.SHA3 = Hasher._createHelper(SHA3);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacSHA3(message, key);
*/
C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
}(Math));
return CryptoJS.SHA3;
}));
},{"./core":44,"./x64-core":75}],72:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"), _dereq_("./sha512"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./x64-core", "./sha512"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_x64 = C.x64;
var X64Word = C_x64.Word;
var X64WordArray = C_x64.WordArray;
var C_algo = C.algo;
var SHA512 = C_algo.SHA512;
/**
* SHA-384 hash algorithm.
*/
var SHA384 = C_algo.SHA384 = SHA512.extend({
_doReset: function () {
this._hash = new X64WordArray.init([
new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
]);
},
_doFinalize: function () {
var hash = SHA512._doFinalize.call(this);
hash.sigBytes -= 16;
return hash;
}
});
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.SHA384('message');
* var hash = CryptoJS.SHA384(wordArray);
*/
C.SHA384 = SHA512._createHelper(SHA384);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacSHA384(message, key);
*/
C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
}());
return CryptoJS.SHA384;
}));
},{"./core":44,"./sha512":73,"./x64-core":75}],73:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./x64-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Hasher = C_lib.Hasher;
var C_x64 = C.x64;
var X64Word = C_x64.Word;
var X64WordArray = C_x64.WordArray;
var C_algo = C.algo;
function X64Word_create() {
return X64Word.create.apply(X64Word, arguments);
}
// Constants
var K = [
X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
];
// Reusable objects
var W = [];
(function () {
for (var i = 0; i < 80; i++) {
W[i] = X64Word_create();
}
}());
/**
* SHA-512 hash algorithm.
*/
var SHA512 = C_algo.SHA512 = Hasher.extend({
_doReset: function () {
this._hash = new X64WordArray.init([
new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
]);
},
_doProcessBlock: function (M, offset) {
// Shortcuts
var H = this._hash.words;
var H0 = H[0];
var H1 = H[1];
var H2 = H[2];
var H3 = H[3];
var H4 = H[4];
var H5 = H[5];
var H6 = H[6];
var H7 = H[7];
var H0h = H0.high;
var H0l = H0.low;
var H1h = H1.high;
var H1l = H1.low;
var H2h = H2.high;
var H2l = H2.low;
var H3h = H3.high;
var H3l = H3.low;
var H4h = H4.high;
var H4l = H4.low;
var H5h = H5.high;
var H5l = H5.low;
var H6h = H6.high;
var H6l = H6.low;
var H7h = H7.high;
var H7l = H7.low;
// Working variables
var ah = H0h;
var al = H0l;
var bh = H1h;
var bl = H1l;
var ch = H2h;
var cl = H2l;
var dh = H3h;
var dl = H3l;
var eh = H4h;
var el = H4l;
var fh = H5h;
var fl = H5l;
var gh = H6h;
var gl = H6l;
var hh = H7h;
var hl = H7l;
// Rounds
for (var i = 0; i < 80; i++) {
// Shortcut
var Wi = W[i];
// Extend message
if (i < 16) {
var Wih = Wi.high = M[offset + i * 2] | 0;
var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
} else {
// Gamma0
var gamma0x = W[i - 15];
var gamma0xh = gamma0x.high;
var gamma0xl = gamma0x.low;
var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
// Gamma1
var gamma1x = W[i - 2];
var gamma1xh = gamma1x.high;
var gamma1xl = gamma1x.low;
var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
// W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
var Wi7 = W[i - 7];
var Wi7h = Wi7.high;
var Wi7l = Wi7.low;
var Wi16 = W[i - 16];
var Wi16h = Wi16.high;
var Wi16l = Wi16.low;
var Wil = gamma0l + Wi7l;
var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
var Wil = Wil + gamma1l;
var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
var Wil = Wil + Wi16l;
var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
Wi.high = Wih;
Wi.low = Wil;
}
var chh = (eh & fh) ^ (~eh & gh);
var chl = (el & fl) ^ (~el & gl);
var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
// t1 = h + sigma1 + ch + K[i] + W[i]
var Ki = K[i];
var Kih = Ki.high;
var Kil = Ki.low;
var t1l = hl + sigma1l;
var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
var t1l = t1l + chl;
var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
var t1l = t1l + Kil;
var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
var t1l = t1l + Wil;
var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
// t2 = sigma0 + maj
var t2l = sigma0l + majl;
var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
// Update working variables
hh = gh;
hl = gl;
gh = fh;
gl = fl;
fh = eh;
fl = el;
el = (dl + t1l) | 0;
eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
dh = ch;
dl = cl;
ch = bh;
cl = bl;
bh = ah;
bl = al;
al = (t1l + t2l) | 0;
ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
}
// Intermediate hash value
H0l = H0.low = (H0l + al);
H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
H1l = H1.low = (H1l + bl);
H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
H2l = H2.low = (H2l + cl);
H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
H3l = H3.low = (H3l + dl);
H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
H4l = H4.low = (H4l + el);
H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
H5l = H5.low = (H5l + fl);
H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
H6l = H6.low = (H6l + gl);
H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
H7l = H7.low = (H7l + hl);
H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
data.sigBytes = dataWords.length * 4;
// Hash final blocks
this._process();
// Convert hash to 32-bit word array before returning
var hash = this._hash.toX32();
// Return final computed hash
return hash;
},
clone: function () {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
},
blockSize: 1024/32
});
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.SHA512('message');
* var hash = CryptoJS.SHA512(wordArray);
*/
C.SHA512 = Hasher._createHelper(SHA512);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacSHA512(message, key);
*/
C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
}());
return CryptoJS.SHA512;
}));
},{"./core":44,"./x64-core":75}],74:[function(_dereq_,module,exports){
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var BlockCipher = C_lib.BlockCipher;
var C_algo = C.algo;
// Permuted Choice 1 constants
var PC1 = [
57, 49, 41, 33, 25, 17, 9, 1,
58, 50, 42, 34, 26, 18, 10, 2,
59, 51, 43, 35, 27, 19, 11, 3,
60, 52, 44, 36, 63, 55, 47, 39,
31, 23, 15, 7, 62, 54, 46, 38,
30, 22, 14, 6, 61, 53, 45, 37,
29, 21, 13, 5, 28, 20, 12, 4
];
// Permuted Choice 2 constants
var PC2 = [
14, 17, 11, 24, 1, 5,
3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8,
16, 7, 27, 20, 13, 2,
41, 52, 31, 37, 47, 55,
30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53,
46, 42, 50, 36, 29, 32
];
// Cumulative bit shift constants
var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
// SBOXes and round permutation constants
var SBOX_P = [
{
0x0: 0x808200,
0x10000000: 0x8000,
0x20000000: 0x808002,
0x30000000: 0x2,
0x40000000: 0x200,
0x50000000: 0x808202,
0x60000000: 0x800202,
0x70000000: 0x800000,
0x80000000: 0x202,
0x90000000: 0x800200,
0xa0000000: 0x8200,
0xb0000000: 0x808000,
0xc0000000: 0x8002,
0xd0000000: 0x800002,
0xe0000000: 0x0,
0xf0000000: 0x8202,
0x8000000: 0x0,
0x18000000: 0x808202,
0x28000000: 0x8202,
0x38000000: 0x8000,
0x48000000: 0x808200,
0x58000000: 0x200,
0x68000000: 0x808002,
0x78000000: 0x2,
0x88000000: 0x800200,
0x98000000: 0x8200,
0xa8000000: 0x808000,
0xb8000000: 0x800202,
0xc8000000: 0x800002,
0xd8000000: 0x8002,
0xe8000000: 0x202,
0xf8000000: 0x800000,
0x1: 0x8000,
0x10000001: 0x2,
0x20000001: 0x808200,
0x30000001: 0x800000,
0x40000001: 0x808002,
0x50000001: 0x8200,
0x60000001: 0x200,
0x70000001: 0x800202,
0x80000001: 0x808202,
0x90000001: 0x808000,
0xa0000001: 0x800002,
0xb0000001: 0x8202,
0xc0000001: 0x202,
0xd0000001: 0x800200,
0xe0000001: 0x8002,
0xf0000001: 0x0,
0x8000001: 0x808202,
0x18000001: 0x808000,
0x28000001: 0x800000,
0x38000001: 0x200,
0x48000001: 0x8000,
0x58000001: 0x800002,
0x68000001: 0x2,
0x78000001: 0x8202,
0x88000001: 0x8002,
0x98000001: 0x800202,
0xa8000001: 0x202,
0xb8000001: 0x808200,
0xc8000001: 0x800200,
0xd8000001: 0x0,
0xe8000001: 0x8200,
0xf8000001: 0x808002
},
{
0x0: 0x40084010,
0x1000000: 0x4000,
0x2000000: 0x80000,
0x3000000: 0x40080010,
0x4000000: 0x40000010,
0x5000000: 0x40084000,
0x6000000: 0x40004000,
0x7000000: 0x10,
0x8000000: 0x84000,
0x9000000: 0x40004010,
0xa000000: 0x40000000,
0xb000000: 0x84010,
0xc000000: 0x80010,
0xd000000: 0x0,
0xe000000: 0x4010,
0xf000000: 0x40080000,
0x800000: 0x40004000,
0x1800000: 0x84010,
0x2800000: 0x10,
0x3800000: 0x40004010,
0x4800000: 0x40084010,
0x5800000: 0x40000000,
0x6800000: 0x80000,
0x7800000: 0x40080010,
0x8800000: 0x80010,
0x9800000: 0x0,
0xa800000: 0x4000,
0xb800000: 0x40080000,
0xc800000: 0x40000010,
0xd800000: 0x84000,
0xe800000: 0x40084000,
0xf800000: 0x4010,
0x10000000: 0x0,
0x11000000: 0x40080010,
0x12000000: 0x40004010,
0x13000000: 0x40084000,
0x14000000: 0x40080000,
0x15000000: 0x10,
0x16000000: 0x84010,
0x17000000: 0x4000,
0x18000000: 0x4010,
0x19000000: 0x80000,
0x1a000000: 0x80010,
0x1b000000: 0x40000010,
0x1c000000: 0x84000,
0x1d000000: 0x40004000,
0x1e000000: 0x40000000,
0x1f000000: 0x40084010,
0x10800000: 0x84010,
0x11800000: 0x80000,
0x12800000: 0x40080000,
0x13800000: 0x4000,
0x14800000: 0x40004000,
0x15800000: 0x40084010,
0x16800000: 0x10,
0x17800000: 0x40000000,
0x18800000: 0x40084000,
0x19800000: 0x40000010,
0x1a800000: 0x40004010,
0x1b800000: 0x80010,
0x1c800000: 0x0,
0x1d800000: 0x4010,
0x1e800000: 0x40080010,
0x1f800000: 0x84000
},
{
0x0: 0x104,
0x100000: 0x0,
0x200000: 0x4000100,
0x300000: 0x10104,
0x400000: 0x10004,
0x500000: 0x4000004,
0x600000: 0x4010104,
0x700000: 0x4010000,
0x800000: 0x4000000,
0x900000: 0x4010100,
0xa00000: 0x10100,
0xb00000: 0x4010004,
0xc00000: 0x4000104,
0xd00000: 0x10000,
0xe00000: 0x4,
0xf00000: 0x100,
0x80000: 0x4010100,
0x180000: 0x4010004,
0x280000: 0x0,
0x380000: 0x4000100,
0x480000: 0x4000004,
0x580000: 0x10000,
0x680000: 0x10004,
0x780000: 0x104,
0x880000: 0x4,
0x980000: 0x100,
0xa80000: 0x4010000,
0xb80000: 0x10104,
0xc80000: 0x10100,
0xd80000: 0x4000104,
0xe80000: 0x4010104,
0xf80000: 0x4000000,
0x1000000: 0x4010100,
0x1100000: 0x10004,
0x1200000: 0x10000,
0x1300000: 0x4000100,
0x1400000: 0x100,
0x1500000: 0x4010104,
0x1600000: 0x4000004,
0x1700000: 0x0,
0x1800000: 0x4000104,
0x1900000: 0x4000000,
0x1a00000: 0x4,
0x1b00000: 0x10100,
0x1c00000: 0x4010000,
0x1d00000: 0x104,
0x1e00000: 0x10104,
0x1f00000: 0x4010004,
0x1080000: 0x4000000,
0x1180000: 0x104,
0x1280000: 0x4010100,
0x1380000: 0x0,
0x1480000: 0x10004,
0x1580000: 0x4000100,
0x1680000: 0x100,
0x1780000: 0x4010004,
0x1880000: 0x10000,
0x1980000: 0x4010104,
0x1a80000: 0x10104,
0x1b80000: 0x4000004,
0x1c80000: 0x4000104,
0x1d80000: 0x4010000,
0x1e80000: 0x4,
0x1f80000: 0x10100
},
{
0x0: 0x80401000,
0x10000: 0x80001040,
0x20000: 0x401040,
0x30000: 0x80400000,
0x40000: 0x0,
0x50000: 0x401000,
0x60000: 0x80000040,
0x70000: 0x400040,
0x80000: 0x80000000,
0x90000: 0x400000,
0xa0000: 0x40,
0xb0000: 0x80001000,
0xc0000: 0x80400040,
0xd0000: 0x1040,
0xe0000: 0x1000,
0xf0000: 0x80401040,
0x8000: 0x80001040,
0x18000: 0x40,
0x28000: 0x80400040,
0x38000: 0x80001000,
0x48000: 0x401000,
0x58000: 0x80401040,
0x68000: 0x0,
0x78000: 0x80400000,
0x88000: 0x1000,
0x98000: 0x80401000,
0xa8000: 0x400000,
0xb8000: 0x1040,
0xc8000: 0x80000000,
0xd8000: 0x400040,
0xe8000: 0x401040,
0xf8000: 0x80000040,
0x100000: 0x400040,
0x110000: 0x401000,
0x120000: 0x80000040,
0x130000: 0x0,
0x140000: 0x1040,
0x150000: 0x80400040,
0x160000: 0x80401000,
0x170000: 0x80001040,
0x180000: 0x80401040,
0x190000: 0x80000000,
0x1a0000: 0x80400000,
0x1b0000: 0x401040,
0x1c0000: 0x80001000,
0x1d0000: 0x400000,
0x1e0000: 0x40,
0x1f0000: 0x1000,
0x108000: 0x80400000,
0x118000: 0x80401040,
0x128000: 0x0,
0x138000: 0x401000,
0x148000: 0x400040,
0x158000: 0x80000000,
0x168000: 0x80001040,
0x178000: 0x40,
0x188000: 0x80000040,
0x198000: 0x1000,
0x1a8000: 0x80001000,
0x1b8000: 0x80400040,
0x1c8000: 0x1040,
0x1d8000: 0x80401000,
0x1e8000: 0x400000,
0x1f8000: 0x401040
},
{
0x0: 0x80,
0x1000: 0x1040000,
0x2000: 0x40000,
0x3000: 0x20000000,
0x4000: 0x20040080,
0x5000: 0x1000080,
0x6000: 0x21000080,
0x7000: 0x40080,
0x8000: 0x1000000,
0x9000: 0x20040000,
0xa000: 0x20000080,
0xb000: 0x21040080,
0xc000: 0x21040000,
0xd000: 0x0,
0xe000: 0x1040080,
0xf000: 0x21000000,
0x800: 0x1040080,
0x1800: 0x21000080,
0x2800: 0x80,
0x3800: 0x1040000,
0x4800: 0x40000,
0x5800: 0x20040080,
0x6800: 0x21040000,
0x7800: 0x20000000,
0x8800: 0x20040000,
0x9800: 0x0,
0xa800: 0x21040080,
0xb800: 0x1000080,
0xc800: 0x20000080,
0xd800: 0x21000000,
0xe800: 0x1000000,
0xf800: 0x40080,
0x10000: 0x40000,
0x11000: 0x80,
0x12000: 0x20000000,
0x13000: 0x21000080,
0x14000: 0x1000080,
0x15000: 0x21040000,
0x16000: 0x20040080,
0x17000: 0x1000000,
0x18000: 0x21040080,
0x19000: 0x21000000,
0x1a000: 0x1040000,
0x1b000: 0x20040000,
0x1c000: 0x40080,
0x1d000: 0x20000080,
0x1e000: 0x0,
0x1f000: 0x1040080,
0x10800: 0x21000080,
0x11800: 0x1000000,
0x12800: 0x1040000,
0x13800: 0x20040080,
0x14800: 0x20000000,
0x15800: 0x1040080,
0x16800: 0x80,
0x17800: 0x21040000,
0x18800: 0x40080,
0x19800: 0x21040080,
0x1a800: 0x0,
0x1b800: 0x21000000,
0x1c800: 0x1000080,
0x1d800: 0x40000,
0x1e800: 0x20040000,
0x1f800: 0x20000080
},
{
0x0: 0x10000008,
0x100: 0x2000,
0x200: 0x10200000,
0x300: 0x10202008,
0x400: 0x10002000,
0x500: 0x200000,
0x600: 0x200008,
0x700: 0x10000000,
0x800: 0x0,
0x900: 0x10002008,
0xa00: 0x202000,
0xb00: 0x8,
0xc00: 0x10200008,
0xd00: 0x202008,
0xe00: 0x2008,
0xf00: 0x10202000,
0x80: 0x10200000,
0x180: 0x10202008,
0x280: 0x8,
0x380: 0x200000,
0x480: 0x202008,
0x580: 0x10000008,
0x680: 0x10002000,
0x780: 0x2008,
0x880: 0x200008,
0x980: 0x2000,
0xa80: 0x10002008,
0xb80: 0x10200008,
0xc80: 0x0,
0xd80: 0x10202000,
0xe80: 0x202000,
0xf80: 0x10000000,
0x1000: 0x10002000,
0x1100: 0x10200008,
0x1200: 0x10202008,
0x1300: 0x2008,
0x1400: 0x200000,
0x1500: 0x10000000,
0x1600: 0x10000008,
0x1700: 0x202000,
0x1800: 0x202008,
0x1900: 0x0,
0x1a00: 0x8,
0x1b00: 0x10200000,
0x1c00: 0x2000,
0x1d00: 0x10002008,
0x1e00: 0x10202000,
0x1f00: 0x200008,
0x1080: 0x8,
0x1180: 0x202000,
0x1280: 0x200000,
0x1380: 0x10000008,
0x1480: 0x10002000,
0x1580: 0x2008,
0x1680: 0x10202008,
0x1780: 0x10200000,
0x1880: 0x10202000,
0x1980: 0x10200008,
0x1a80: 0x2000,
0x1b80: 0x202008,
0x1c80: 0x200008,
0x1d80: 0x0,
0x1e80: 0x10000000,
0x1f80: 0x10002008
},
{
0x0: 0x100000,
0x10: 0x2000401,
0x20: 0x400,
0x30: 0x100401,
0x40: 0x2100401,
0x50: 0x0,
0x60: 0x1,
0x70: 0x2100001,
0x80: 0x2000400,
0x90: 0x100001,
0xa0: 0x2000001,
0xb0: 0x2100400,
0xc0: 0x2100000,
0xd0: 0x401,
0xe0: 0x100400,
0xf0: 0x2000000,
0x8: 0x2100001,
0x18: 0x0,
0x28: 0x2000401,
0x38: 0x2100400,
0x48: 0x100000,
0x58: 0x2000001,
0x68: 0x2000000,
0x78: 0x401,
0x88: 0x100401,
0x98: 0x2000400,
0xa8: 0x2100000,
0xb8: 0x100001,
0xc8: 0x400,
0xd8: 0x2100401,
0xe8: 0x1,
0xf8: 0x100400,
0x100: 0x2000000,
0x110: 0x100000,
0x120: 0x2000401,
0x130: 0x2100001,
0x140: 0x100001,
0x150: 0x2000400,
0x160: 0x2100400,
0x170: 0x100401,
0x180: 0x401,
0x190: 0x2100401,
0x1a0: 0x100400,
0x1b0: 0x1,
0x1c0: 0x0,
0x1d0: 0x2100000,
0x1e0: 0x2000001,
0x1f0: 0x400,
0x108: 0x100400,
0x118: 0x2000401,
0x128: 0x2100001,
0x138: 0x1,
0x148: 0x2000000,
0x158: 0x100000,
0x168: 0x401,
0x178: 0x2100400,
0x188: 0x2000001,
0x198: 0x2100000,
0x1a8: 0x0,
0x1b8: 0x2100401,
0x1c8: 0x100401,
0x1d8: 0x400,
0x1e8: 0x2000400,
0x1f8: 0x100001
},
{
0x0: 0x8000820,
0x1: 0x20000,
0x2: 0x8000000,
0x3: 0x20,
0x4: 0x20020,
0x5: 0x8020820,
0x6: 0x8020800,
0x7: 0x800,
0x8: 0x8020000,
0x9: 0x8000800,
0xa: 0x20800,
0xb: 0x8020020,
0xc: 0x820,
0xd: 0x0,
0xe: 0x8000020,
0xf: 0x20820,
0x80000000: 0x800,
0x80000001: 0x8020820,
0x80000002: 0x8000820,
0x80000003: 0x8000000,
0x80000004: 0x8020000,
0x80000005: 0x20800,
0x80000006: 0x20820,
0x80000007: 0x20,
0x80000008: 0x8000020,
0x80000009: 0x820,
0x8000000a: 0x20020,
0x8000000b: 0x8020800,
0x8000000c: 0x0,
0x8000000d: 0x8020020,
0x8000000e: 0x8000800,
0x8000000f: 0x20000,
0x10: 0x20820,
0x11: 0x8020800,
0x12: 0x20,
0x13: 0x800,
0x14: 0x8000800,
0x15: 0x8000020,
0x16: 0x8020020,
0x17: 0x20000,
0x18: 0x0,
0x19: 0x20020,
0x1a: 0x8020000,
0x1b: 0x8000820,
0x1c: 0x8020820,
0x1d: 0x20800,
0x1e: 0x820,
0x1f: 0x8000000,
0x80000010: 0x20000,
0x80000011: 0x800,
0x80000012: 0x8020020,
0x80000013: 0x20820,
0x80000014: 0x20,
0x80000015: 0x8020000,
0x80000016: 0x8000000,
0x80000017: 0x8000820,
0x80000018: 0x8020820,
0x80000019: 0x8000020,
0x8000001a: 0x8000800,
0x8000001b: 0x0,
0x8000001c: 0x20800,
0x8000001d: 0x820,
0x8000001e: 0x20020,
0x8000001f: 0x8020800
}
];
// Masks that select the SBOX input
var SBOX_MASK = [
0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
];
/**
* DES block cipher algorithm.
*/
var DES = C_algo.DES = BlockCipher.extend({
_doReset: function () {
// Shortcuts
var key = this._key;
var keyWords = key.words;
// Select 56 bits according to PC1
var keyBits = [];
for (var i = 0; i < 56; i++) {
var keyBitPos = PC1[i] - 1;
keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
}
// Assemble 16 subkeys
var subKeys = this._subKeys = [];
for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
// Create subkey
var subKey = subKeys[nSubKey] = [];
// Shortcut
var bitShift = BIT_SHIFTS[nSubKey];
// Select 48 bits according to PC2
for (var i = 0; i < 24; i++) {
// Select from the left 28 key bits
subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
// Select from the right 28 key bits
subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
}
// Since each subkey is applied to an expanded 32-bit input,
// the subkey can be broken into 8 values scaled to 32-bits,
// which allows the key to be used without expansion
subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
for (var i = 1; i < 7; i++) {
subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
}
subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
}
// Compute inverse subkeys
var invSubKeys = this._invSubKeys = [];
for (var i = 0; i < 16; i++) {
invSubKeys[i] = subKeys[15 - i];
}
},
encryptBlock: function (M, offset) {
this._doCryptBlock(M, offset, this._subKeys);
},
decryptBlock: function (M, offset) {
this._doCryptBlock(M, offset, this._invSubKeys);
},
_doCryptBlock: function (M, offset, subKeys) {
// Get input
this._lBlock = M[offset];
this._rBlock = M[offset + 1];
// Initial permutation
exchangeLR.call(this, 4, 0x0f0f0f0f);
exchangeLR.call(this, 16, 0x0000ffff);
exchangeRL.call(this, 2, 0x33333333);
exchangeRL.call(this, 8, 0x00ff00ff);
exchangeLR.call(this, 1, 0x55555555);
// Rounds
for (var round = 0; round < 16; round++) {
// Shortcuts
var subKey = subKeys[round];
var lBlock = this._lBlock;
var rBlock = this._rBlock;
// Feistel function
var f = 0;
for (var i = 0; i < 8; i++) {
f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
}
this._lBlock = rBlock;
this._rBlock = lBlock ^ f;
}
// Undo swap from last round
var t = this._lBlock;
this._lBlock = this._rBlock;
this._rBlock = t;
// Final permutation
exchangeLR.call(this, 1, 0x55555555);
exchangeRL.call(this, 8, 0x00ff00ff);
exchangeRL.call(this, 2, 0x33333333);
exchangeLR.call(this, 16, 0x0000ffff);
exchangeLR.call(this, 4, 0x0f0f0f0f);
// Set output
M[offset] = this._lBlock;
M[offset + 1] = this._rBlock;
},
keySize: 64/32,
ivSize: 64/32,
blockSize: 64/32
});
// Swap bits across the left and right words
function exchangeLR(offset, mask) {
var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
this._rBlock ^= t;
this._lBlock ^= t << offset;
}
function exchangeRL(offset, mask) {
var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
this._lBlock ^= t;
this._rBlock ^= t << offset;
}
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
* var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
*/
C.DES = BlockCipher._createHelper(DES);
/**
* Triple-DES block cipher algorithm.
*/
var TripleDES = C_algo.TripleDES = BlockCipher.extend({
_doReset: function () {
// Shortcuts
var key = this._key;
var keyWords = key.words;
// Create DES instances
this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
},
encryptBlock: function (M, offset) {
this._des1.encryptBlock(M, offset);
this._des2.decryptBlock(M, offset);
this._des3.encryptBlock(M, offset);
},
decryptBlock: function (M, offset) {
this._des3.decryptBlock(M, offset);
this._des2.encryptBlock(M, offset);
this._des1.decryptBlock(M, offset);
},
keySize: 192/32,
ivSize: 64/32,
blockSize: 64/32
});
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
* var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
*/
C.TripleDES = BlockCipher._createHelper(TripleDES);
}());
return CryptoJS.TripleDES;
}));
},{"./cipher-core":43,"./core":44,"./enc-base64":45,"./evpkdf":47,"./md5":52}],75:[function(_dereq_,module,exports){
;(function (root, factory) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(_dereq_("./core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function (undefined) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var X32WordArray = C_lib.WordArray;
/**
* x64 namespace.
*/
var C_x64 = C.x64 = {};
/**
* A 64-bit word.
*/
var X64Word = C_x64.Word = Base.extend({
/**
* Initializes a newly created 64-bit word.
*
* @param {number} high The high 32 bits.
* @param {number} low The low 32 bits.
*
* @example
*
* var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
*/
init: function (high, low) {
this.high = high;
this.low = low;
}
/**
* Bitwise NOTs this word.
*
* @return {X64Word} A new x64-Word object after negating.
*
* @example
*
* var negated = x64Word.not();
*/
// not: function () {
// var high = ~this.high;
// var low = ~this.low;
// return X64Word.create(high, low);
// },
/**
* Bitwise ANDs this word with the passed word.
*
* @param {X64Word} word The x64-Word to AND with this word.
*
* @return {X64Word} A new x64-Word object after ANDing.
*
* @example
*
* var anded = x64Word.and(anotherX64Word);
*/
// and: function (word) {
// var high = this.high & word.high;
// var low = this.low & word.low;
// return X64Word.create(high, low);
// },
/**
* Bitwise ORs this word with the passed word.
*
* @param {X64Word} word The x64-Word to OR with this word.
*
* @return {X64Word} A new x64-Word object after ORing.
*
* @example
*
* var ored = x64Word.or(anotherX64Word);
*/
// or: function (word) {
// var high = this.high | word.high;
// var low = this.low | word.low;
// return X64Word.create(high, low);
// },
/**
* Bitwise XORs this word with the passed word.
*
* @param {X64Word} word The x64-Word to XOR with this word.
*
* @return {X64Word} A new x64-Word object after XORing.
*
* @example
*
* var xored = x64Word.xor(anotherX64Word);
*/
// xor: function (word) {
// var high = this.high ^ word.high;
// var low = this.low ^ word.low;
// return X64Word.create(high, low);
// },
/**
* Shifts this word n bits to the left.
*
* @param {number} n The number of bits to shift.
*
* @return {X64Word} A new x64-Word object after shifting.
*
* @example
*
* var shifted = x64Word.shiftL(25);
*/
// shiftL: function (n) {
// if (n < 32) {
// var high = (this.high << n) | (this.low >>> (32 - n));
// var low = this.low << n;
// } else {
// var high = this.low << (n - 32);
// var low = 0;
// }
// return X64Word.create(high, low);
// },
/**
* Shifts this word n bits to the right.
*
* @param {number} n The number of bits to shift.
*
* @return {X64Word} A new x64-Word object after shifting.
*
* @example
*
* var shifted = x64Word.shiftR(7);
*/
// shiftR: function (n) {
// if (n < 32) {
// var low = (this.low >>> n) | (this.high << (32 - n));
// var high = this.high >>> n;
// } else {
// var low = this.high >>> (n - 32);
// var high = 0;
// }
// return X64Word.create(high, low);
// },
/**
* Rotates this word n bits to the left.
*
* @param {number} n The number of bits to rotate.
*
* @return {X64Word} A new x64-Word object after rotating.
*
* @example
*
* var rotated = x64Word.rotL(25);
*/
// rotL: function (n) {
// return this.shiftL(n).or(this.shiftR(64 - n));
// },
/**
* Rotates this word n bits to the right.
*
* @param {number} n The number of bits to rotate.
*
* @return {X64Word} A new x64-Word object after rotating.
*
* @example
*
* var rotated = x64Word.rotR(7);
*/
// rotR: function (n) {
// return this.shiftR(n).or(this.shiftL(64 - n));
// },
/**
* Adds this word with the passed word.
*
* @param {X64Word} word The x64-Word to add with this word.
*
* @return {X64Word} A new x64-Word object after adding.
*
* @example
*
* var added = x64Word.add(anotherX64Word);
*/
// add: function (word) {
// var low = (this.low + word.low) | 0;
// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
// var high = (this.high + word.high + carry) | 0;
// return X64Word.create(high, low);
// }
});
/**
* An array of 64-bit words.
*
* @property {Array} words The array of CryptoJS.x64.Word objects.
* @property {number} sigBytes The number of significant bytes in this word array.
*/
var X64WordArray = C_x64.WordArray = Base.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.x64.WordArray.create();
*
* var wordArray = CryptoJS.x64.WordArray.create([
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
* ]);
*
* var wordArray = CryptoJS.x64.WordArray.create([
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
* ], 10);
*/
init: function (words, sigBytes) {
words = this.words = words || [];
if (sigBytes != undefined) {
this.sigBytes = sigBytes;
} else {
this.sigBytes = words.length * 8;
}
},
/**
* Converts this 64-bit word array to a 32-bit word array.
*
* @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
*
* @example
*
* var x32WordArray = x64WordArray.toX32();
*/
toX32: function () {
// Shortcuts
var x64Words = this.words;
var x64WordsLength = x64Words.length;
// Convert
var x32Words = [];
for (var i = 0; i < x64WordsLength; i++) {
var x64Word = x64Words[i];
x32Words.push(x64Word.high);
x32Words.push(x64Word.low);
}
return X32WordArray.create(x32Words, this.sigBytes);
},
/**
* Creates a copy of this word array.
*
* @return {X64WordArray} The clone.
*
* @example
*
* var clone = x64WordArray.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
// Clone "words" array
var words = clone.words = this.words.slice(0);
// Clone each X64Word object
var wordsLength = words.length;
for (var i = 0; i < wordsLength; i++) {
words[i] = words[i].clone();
}
return clone;
}
});
}());
return CryptoJS;
}));
},{"./core":44}],76:[function(_dereq_,module,exports){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(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;
clearTimeout(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) {
setTimeout(drainQueue, 0);
}
};
// 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; };
},{}],77:[function(_dereq_,module,exports){
'use strict';
var asap = _dereq_('asap')
module.exports = Promise
function Promise(fn) {
if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new')
if (typeof fn !== 'function') throw new TypeError('not a function')
var state = null
var value = null
var deferreds = []
var self = this
this.then = function(onFulfilled, onRejected) {
return new Promise(function(resolve, reject) {
handle(new Handler(onFulfilled, onRejected, resolve, reject))
})
}
function handle(deferred) {
if (state === null) {
deferreds.push(deferred)
return
}
asap(function() {
var cb = state ? deferred.onFulfilled : deferred.onRejected
if (cb === null) {
(state ? deferred.resolve : deferred.reject)(value)
return
}
var ret
try {
ret = cb(value)
}
catch (e) {
deferred.reject(e)
return
}
deferred.resolve(ret)
})
}
function resolve(newValue) {
try { //Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.')
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
var then = newValue.then
if (typeof then === 'function') {
doResolve(then.bind(newValue), resolve, reject)
return
}
}
state = true
value = newValue
finale()
} catch (e) { reject(e) }
}
function reject(newValue) {
state = false
value = newValue
finale()
}
function finale() {
for (var i = 0, len = deferreds.length; i < len; i++)
handle(deferreds[i])
deferreds = null
}
doResolve(fn, resolve, reject)
}
function Handler(onFulfilled, onRejected, resolve, reject){
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null
this.onRejected = typeof onRejected === 'function' ? onRejected : null
this.resolve = resolve
this.reject = reject
}
/**
* Take a potentially misbehaving resolver function and make sure
* onFulfilled and onRejected are only called once.
*
* Makes no guarantees about asynchrony.
*/
function doResolve(fn, onFulfilled, onRejected) {
var done = false;
try {
fn(function (value) {
if (done) return
done = true
onFulfilled(value)
}, function (reason) {
if (done) return
done = true
onRejected(reason)
})
} catch (ex) {
if (done) return
done = true
onRejected(ex)
}
}
},{"asap":79}],78:[function(_dereq_,module,exports){
'use strict';
//This file contains then/promise specific extensions to the core promise API
var Promise = _dereq_('./core.js')
var asap = _dereq_('asap')
module.exports = Promise
/* Static Functions */
function ValuePromise(value) {
this.then = function (onFulfilled) {
if (typeof onFulfilled !== 'function') return this
return new Promise(function (resolve, reject) {
asap(function () {
try {
resolve(onFulfilled(value))
} catch (ex) {
reject(ex);
}
})
})
}
}
ValuePromise.prototype = Object.create(Promise.prototype)
var TRUE = new ValuePromise(true)
var FALSE = new ValuePromise(false)
var NULL = new ValuePromise(null)
var UNDEFINED = new ValuePromise(undefined)
var ZERO = new ValuePromise(0)
var EMPTYSTRING = new ValuePromise('')
Promise.resolve = function (value) {
if (value instanceof Promise) return value
if (value === null) return NULL
if (value === undefined) return UNDEFINED
if (value === true) return TRUE
if (value === false) return FALSE
if (value === 0) return ZERO
if (value === '') return EMPTYSTRING
if (typeof value === 'object' || typeof value === 'function') {
try {
var then = value.then
if (typeof then === 'function') {
return new Promise(then.bind(value))
}
} catch (ex) {
return new Promise(function (resolve, reject) {
reject(ex)
})
}
}
return new ValuePromise(value)
}
Promise.from = Promise.cast = function (value) {
var err = new Error('Promise.from and Promise.cast are deprecated, use Promise.resolve instead')
err.name = 'Warning'
console.warn(err.stack)
return Promise.resolve(value)
}
Promise.denodeify = function (fn, argumentCount) {
argumentCount = argumentCount || Infinity
return function () {
var self = this
var args = Array.prototype.slice.call(arguments)
return new Promise(function (resolve, reject) {
while (args.length && args.length > argumentCount) {
args.pop()
}
args.push(function (err, res) {
if (err) reject(err)
else resolve(res)
})
fn.apply(self, args)
})
}
}
Promise.nodeify = function (fn) {
return function () {
var args = Array.prototype.slice.call(arguments)
var callback = typeof args[args.length - 1] === 'function' ? args.pop() : null
try {
return fn.apply(this, arguments).nodeify(callback)
} catch (ex) {
if (callback === null || typeof callback == 'undefined') {
return new Promise(function (resolve, reject) { reject(ex) })
} else {
asap(function () {
callback(ex)
})
}
}
}
}
Promise.all = function () {
var calledWithArray = arguments.length === 1 && Array.isArray(arguments[0])
var args = Array.prototype.slice.call(calledWithArray ? arguments[0] : arguments)
if (!calledWithArray) {
var err = new Error('Promise.all should be called with a single array, calling it with multiple arguments is deprecated')
err.name = 'Warning'
console.warn(err.stack)
}
return new Promise(function (resolve, reject) {
if (args.length === 0) return resolve([])
var remaining = args.length
function res(i, val) {
try {
if (val && (typeof val === 'object' || typeof val === 'function')) {
var then = val.then
if (typeof then === 'function') {
then.call(val, function (val) { res(i, val) }, reject)
return
}
}
args[i] = val
if (--remaining === 0) {
resolve(args);
}
} catch (ex) {
reject(ex)
}
}
for (var i = 0; i < args.length; i++) {
res(i, args[i])
}
})
}
Promise.reject = function (value) {
return new Promise(function (resolve, reject) {
reject(value);
});
}
Promise.race = function (values) {
return new Promise(function (resolve, reject) {
values.forEach(function(value){
Promise.resolve(value).then(resolve, reject);
})
});
}
/* Prototype Methods */
Promise.prototype.done = function (onFulfilled, onRejected) {
var self = arguments.length ? this.then.apply(this, arguments) : this
self.then(null, function (err) {
asap(function () {
throw err
})
})
}
Promise.prototype.nodeify = function (callback) {
if (typeof callback != 'function') return this
this.then(function (value) {
asap(function () {
callback(null, value)
})
}, function (err) {
asap(function () {
callback(err)
})
})
}
Promise.prototype['catch'] = function (onRejected) {
return this.then(null, onRejected);
}
},{"./core.js":77,"asap":79}],79:[function(_dereq_,module,exports){
(function (process){
// Use the fastest possible means to execute a task in a future turn
// of the event loop.
// linked list of tasks (single, with head node)
var head = {task: void 0, next: null};
var tail = head;
var flushing = false;
var requestFlush = void 0;
var isNodeJS = false;
function flush() {
/* jshint loopfunc: true */
while (head.next) {
head = head.next;
var task = head.task;
head.task = void 0;
var domain = head.domain;
if (domain) {
head.domain = void 0;
domain.enter();
}
try {
task();
} catch (e) {
if (isNodeJS) {
// In node, uncaught exceptions are considered fatal errors.
// Re-throw them synchronously to interrupt flushing!
// Ensure continuation if the uncaught exception is suppressed
// listening "uncaughtException" events (as domains does).
// Continue in next event to avoid tick recursion.
if (domain) {
domain.exit();
}
setTimeout(flush, 0);
if (domain) {
domain.enter();
}
throw e;
} else {
// In browsers, uncaught exceptions are not fatal.
// Re-throw them asynchronously to avoid slow-downs.
setTimeout(function() {
throw e;
}, 0);
}
}
if (domain) {
domain.exit();
}
}
flushing = false;
}
if (typeof process !== "undefined" && process.nextTick) {
// Node.js before 0.9. Note that some fake-Node environments, like the
// Mocha test runner, introduce a `process` global without a `nextTick`.
isNodeJS = true;
requestFlush = function () {
process.nextTick(flush);
};
} else if (typeof setImmediate === "function") {
// In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate
if (typeof window !== "undefined") {
requestFlush = setImmediate.bind(window, flush);
} else {
requestFlush = function () {
setImmediate(flush);
};
}
} else if (typeof MessageChannel !== "undefined") {
// modern browsers
// http://www.nonblocking.io/2011/06/windownexttick.html
var channel = new MessageChannel();
channel.port1.onmessage = flush;
requestFlush = function () {
channel.port2.postMessage(0);
};
} else {
// old browsers
requestFlush = function () {
setTimeout(flush, 0);
};
}
function asap(task) {
tail = tail.next = {
task: task,
domain: isNodeJS && process.domain,
next: null
};
if (!flushing) {
flushing = true;
requestFlush();
}
};
module.exports = asap;
}).call(this,_dereq_('_process'))
},{"_process":76}],80:[function(_dereq_,module,exports){
// Some code originally from async_storage.js in
// [Gaia](https://github.com/mozilla-b2g/gaia).
(function() {
'use strict';
// Originally found in https://github.com/mozilla-b2g/gaia/blob/e8f624e4cc9ea945727278039b3bc9bcb9f8667a/shared/js/async_storage.js
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') ?
_dereq_('promise') : this.Promise;
// Initialize IndexedDB; fall back to vendor-prefixed versions if needed.
var indexedDB = indexedDB || this.indexedDB || this.webkitIndexedDB ||
this.mozIndexedDB || this.OIndexedDB ||
this.msIndexedDB;
// If IndexedDB isn't available, we get outta here!
if (!indexedDB) {
return;
}
var DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';
var supportsBlobs;
// Abstracts constructing a Blob object, so it also works in older
// browsers that don't support the native Blob constructor. (i.e.
// old QtWebKit versions, at least).
function _createBlob(parts, properties) {
parts = parts || [];
properties = properties || {};
try {
return new Blob(parts, properties);
} catch (e) {
if (e.name !== 'TypeError') {
throw e;
}
var BlobBuilder = window.BlobBuilder ||
window.MSBlobBuilder ||
window.MozBlobBuilder ||
window.WebKitBlobBuilder;
var builder = new BlobBuilder();
for (var i = 0; i < parts.length; i += 1) {
builder.append(parts[i]);
}
return builder.getBlob(properties.type);
}
}
// Transform a binary string to an array buffer, because otherwise
// weird stuff happens when you try to work with the binary string directly.
// It is known.
// From http://stackoverflow.com/questions/14967647/ (continues on next line)
// encode-decode-image-with-base64-breaks-image (2013-04-21)
function _binStringToArrayBuffer(bin) {
var length = bin.length;
var buf = new ArrayBuffer(length);
var arr = new Uint8Array(buf);
for (var i = 0; i < length; i++) {
arr[i] = bin.charCodeAt(i);
}
return buf;
}
// Fetch a blob using ajax. This reveals bugs in Chrome < 43.
// For details on all this junk:
// https://github.com/nolanlawson/state-of-binary-data-in-the-browser#readme
function _blobAjax(url) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.withCredentials = true;
xhr.responseType = 'arraybuffer';
xhr.onreadystatechange = function() {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status === 200) {
return resolve({
response: xhr.response,
type: xhr.getResponseHeader('Content-Type')
});
}
reject({status: xhr.status, response: xhr.response});
};
xhr.send();
});
}
//
// Detect blob support. Chrome didn't support it until version 38.
// In version 37 they had a broken version where PNGs (and possibly
// other binary types) aren't stored correctly, because when you fetch
// them, the content type is always null.
//
// Furthermore, they have some outstanding bugs where blobs occasionally
// are read by FileReader as null, or by ajax as 404s.
//
// Sadly we use the 404 bug to detect the FileReader bug, so if they
// get fixed independently and released in different versions of Chrome,
// then the bug could come back. So it's worthwhile to watch these issues:
// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916
// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836
//
function _checkBlobSupportWithoutCaching(idb) {
return new Promise(function(resolve, reject) {
var blob = _createBlob([''], {type: 'image/png'});
var txn = idb.transaction([DETECT_BLOB_SUPPORT_STORE], 'readwrite');
txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');
txn.oncomplete = function() {
// have to do it in a separate transaction, else the correct
// content type is always returned
var blobTxn = idb.transaction([DETECT_BLOB_SUPPORT_STORE],
'readwrite');
var getBlobReq = blobTxn.objectStore(
DETECT_BLOB_SUPPORT_STORE).get('key');
getBlobReq.onerror = reject;
getBlobReq.onsuccess = function(e) {
var storedBlob = e.target.result;
var url = URL.createObjectURL(storedBlob);
_blobAjax(url).then(function(res) {
resolve(!!(res && res.type === 'image/png'));
}, function() {
resolve(false);
}).then(function() {
URL.revokeObjectURL(url);
});
};
};
})['catch'](function() {
return false; // error, so assume unsupported
});
}
function _checkBlobSupport(idb) {
if (typeof supportsBlobs === 'boolean') {
return Promise.resolve(supportsBlobs);
}
return _checkBlobSupportWithoutCaching(idb).then(function(value) {
supportsBlobs = value;
return supportsBlobs;
});
}
// encode a blob for indexeddb engines that don't support blobs
function _encodeBlob(blob) {
return new Promise(function(resolve, reject) {
var reader = new FileReader();
reader.onerror = reject;
reader.onloadend = function(e) {
var base64 = btoa(e.target.result || '');
resolve({
__local_forage_encoded_blob: true,
data: base64,
type: blob.type
});
};
reader.readAsBinaryString(blob);
});
}
// decode an encoded blob
function _decodeBlob(encodedBlob) {
var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));
return _createBlob([arrayBuff], { type: encodedBlob.type});
}
// is this one of our fancy encoded blobs?
function _isEncodedBlob(value) {
return value && value.__local_forage_encoded_blob;
}
// Open the IndexedDB database (automatically creates one if one didn't
// previously exist), using any options set in the config.
function _initStorage(options) {
var self = this;
var dbInfo = {
db: null
};
if (options) {
for (var i in options) {
dbInfo[i] = options[i];
}
}
return new Promise(function(resolve, reject) {
var openreq = indexedDB.open(dbInfo.name, dbInfo.version);
openreq.onerror = function() {
reject(openreq.error);
};
openreq.onupgradeneeded = function(e) {
// First time setup: create an empty object store
openreq.result.createObjectStore(dbInfo.storeName);
if (e.oldVersion <= 1) {
// added when support for blob shims was added
openreq.result.createObjectStore(DETECT_BLOB_SUPPORT_STORE);
}
};
openreq.onsuccess = function() {
dbInfo.db = openreq.result;
self._dbInfo = dbInfo;
resolve();
};
});
}
function getItem(key, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
.objectStore(dbInfo.storeName);
var req = store.get(key);
req.onsuccess = function() {
var value = req.result;
if (value === undefined) {
value = null;
}
if (_isEncodedBlob(value)) {
value = _decodeBlob(value);
}
resolve(value);
};
req.onerror = function() {
reject(req.error);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
// Iterate over all items stored in database.
function iterate(iterator, callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
.objectStore(dbInfo.storeName);
var req = store.openCursor();
var iterationNumber = 1;
req.onsuccess = function() {
var cursor = req.result;
if (cursor) {
var value = cursor.value;
if (_isEncodedBlob(value)) {
value = _decodeBlob(value);
}
var result = iterator(value, cursor.key, iterationNumber++);
if (result !== void(0)) {
resolve(result);
} else {
cursor['continue']();
}
} else {
resolve();
}
};
req.onerror = function() {
reject(req.error);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function setItem(key, value, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = new Promise(function(resolve, reject) {
var dbInfo;
self.ready().then(function() {
dbInfo = self._dbInfo;
return _checkBlobSupport(dbInfo.db);
}).then(function(blobSupport) {
if (!blobSupport && value instanceof Blob) {
return _encodeBlob(value);
}
return value;
}).then(function(value) {
var transaction = dbInfo.db.transaction(dbInfo.storeName, 'readwrite');
var store = transaction.objectStore(dbInfo.storeName);
// The reason we don't _save_ null is because IE 10 does
// not support saving the `null` type in IndexedDB. How
// ironic, given the bug below!
// See: https://github.com/mozilla/localForage/issues/161
if (value === null) {
value = undefined;
}
var req = store.put(value, key);
transaction.oncomplete = function() {
// Cast to undefined so the value passed to
// callback/promise is the same as what one would get out
// of `getItem()` later. This leads to some weirdness
// (setItem('foo', undefined) will return `null`), but
// it's not my fault localStorage is our baseline and that
// it's weird.
if (value === undefined) {
value = null;
}
resolve(value);
};
transaction.onabort = transaction.onerror = function() {
var err = req.error ? req.error : req.transaction.error;
reject(err);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function removeItem(key, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
var transaction = dbInfo.db.transaction(dbInfo.storeName, 'readwrite');
var store = transaction.objectStore(dbInfo.storeName);
// We use a Grunt task to make this safe for IE and some
// versions of Android (including those used by Cordova).
// Normally IE won't like `['delete']()` and will insist on
// using `['delete']()`, but we have a build step that
// fixes this for us now.
var req = store['delete'](key);
transaction.oncomplete = function() {
resolve();
};
transaction.onerror = function() {
reject(req.error);
};
// The request will be also be aborted if we've exceeded our storage
// space.
transaction.onabort = function() {
var err = req.error ? req.error : req.transaction.error;
reject(err);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function clear(callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
var transaction = dbInfo.db.transaction(dbInfo.storeName, 'readwrite');
var store = transaction.objectStore(dbInfo.storeName);
var req = store.clear();
transaction.oncomplete = function() {
resolve();
};
transaction.onabort = transaction.onerror = function() {
var err = req.error ? req.error : req.transaction.error;
reject(err);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function length(callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
.objectStore(dbInfo.storeName);
var req = store.count();
req.onsuccess = function() {
resolve(req.result);
};
req.onerror = function() {
reject(req.error);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function key(n, callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
if (n < 0) {
resolve(null);
return;
}
self.ready().then(function() {
var dbInfo = self._dbInfo;
var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
.objectStore(dbInfo.storeName);
var advanced = false;
var req = store.openCursor();
req.onsuccess = function() {
var cursor = req.result;
if (!cursor) {
// this means there weren't enough keys
resolve(null);
return;
}
if (n === 0) {
// We have the first key, return it if that's what they
// wanted.
resolve(cursor.key);
} else {
if (!advanced) {
// Otherwise, ask the cursor to skip ahead n
// records.
advanced = true;
cursor.advance(n);
} else {
// When we get here, we've got the nth key.
resolve(cursor.key);
}
}
};
req.onerror = function() {
reject(req.error);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function keys(callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly')
.objectStore(dbInfo.storeName);
var req = store.openCursor();
var keys = [];
req.onsuccess = function() {
var cursor = req.result;
if (!cursor) {
resolve(keys);
return;
}
keys.push(cursor.key);
cursor['continue']();
};
req.onerror = function() {
reject(req.error);
};
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function executeCallback(promise, callback) {
if (callback) {
promise.then(function(result) {
callback(null, result);
}, function(error) {
callback(error);
});
}
}
var asyncStorage = {
_driver: 'asyncStorage',
_initStorage: _initStorage,
iterate: iterate,
getItem: getItem,
setItem: setItem,
removeItem: removeItem,
clear: clear,
length: length,
key: key,
keys: keys
};
if (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') {
module.exports = asyncStorage;
} else if (typeof define === 'function' && define.amd) {
define('asyncStorage', function() {
return asyncStorage;
});
} else {
this.asyncStorage = asyncStorage;
}
}).call(window);
},{"promise":78}],81:[function(_dereq_,module,exports){
// If IndexedDB isn't available, we'll fall back to localStorage.
// Note that this will have considerable performance and storage
// side-effects (all data will be serialized on save and only data that
// can be converted to a string via `JSON.stringify()` will be saved).
(function() {
'use strict';
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') ?
_dereq_('promise') : this.Promise;
var globalObject = this;
var serializer = null;
var localStorage = null;
// If the app is running inside a Google Chrome packaged webapp, or some
// other context where localStorage isn't available, we don't use
// localStorage. This feature detection is preferred over the old
// `if (window.chrome && window.chrome.runtime)` code.
// See: https://github.com/mozilla/localForage/issues/68
try {
// If localStorage isn't available, we get outta here!
// This should be inside a try catch
if (!this.localStorage || !('setItem' in this.localStorage)) {
return;
}
// Initialize localStorage and create a variable to use throughout
// the code.
localStorage = this.localStorage;
} catch (e) {
return;
}
var ModuleType = {
DEFINE: 1,
EXPORT: 2,
WINDOW: 3
};
// Attaching to window (i.e. no module loader) is the assumed,
// simple default.
var moduleType = ModuleType.WINDOW;
// Find out what kind of module setup we have; if none, we'll just attach
// localForage to the main window.
if (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') {
moduleType = ModuleType.EXPORT;
} else if (typeof define === 'function' && define.amd) {
moduleType = ModuleType.DEFINE;
}
// Config the localStorage backend, using options set in the config.
function _initStorage(options) {
var self = this;
var dbInfo = {};
if (options) {
for (var i in options) {
dbInfo[i] = options[i];
}
}
dbInfo.keyPrefix = dbInfo.name + '/';
self._dbInfo = dbInfo;
var serializerPromise = new Promise(function(resolve/*, reject*/) {
// We allow localForage to be declared as a module or as a
// library available without AMD/require.js.
if (moduleType === ModuleType.DEFINE) {
_dereq_(['localforageSerializer'], resolve);
} else if (moduleType === ModuleType.EXPORT) {
// Making it browserify friendly
resolve(_dereq_('./../utils/serializer'));
} else {
resolve(globalObject.localforageSerializer);
}
});
return serializerPromise.then(function(lib) {
serializer = lib;
return Promise.resolve();
});
}
// Remove all keys from the datastore, effectively destroying all data in
// the app's key/value store!
function clear(callback) {
var self = this;
var promise = self.ready().then(function() {
var keyPrefix = self._dbInfo.keyPrefix;
for (var i = localStorage.length - 1; i >= 0; i--) {
var key = localStorage.key(i);
if (key.indexOf(keyPrefix) === 0) {
localStorage.removeItem(key);
}
}
});
executeCallback(promise, callback);
return promise;
}
// Retrieve an item from the store. Unlike the original async_storage
// library in Gaia, we don't modify return values at all. If a key's value
// is `undefined`, we pass that value to the callback function.
function getItem(key, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var result = localStorage.getItem(dbInfo.keyPrefix + key);
// If a result was found, parse it from the serialized
// string into a JS object. If result isn't truthy, the key
// is likely undefined and we'll pass it straight to the
// callback.
if (result) {
result = serializer.deserialize(result);
}
return result;
});
executeCallback(promise, callback);
return promise;
}
// Iterate over all items in the store.
function iterate(iterator, callback) {
var self = this;
var promise = self.ready().then(function() {
var keyPrefix = self._dbInfo.keyPrefix;
var keyPrefixLength = keyPrefix.length;
var length = localStorage.length;
for (var i = 0; i < length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
// If a result was found, parse it from the serialized
// string into a JS object. If result isn't truthy, the
// key is likely undefined and we'll pass it straight
// to the iterator.
if (value) {
value = serializer.deserialize(value);
}
value = iterator(value, key.substring(keyPrefixLength), i + 1);
if (value !== void(0)) {
return value;
}
}
});
executeCallback(promise, callback);
return promise;
}
// Same as localStorage's key() method, except takes a callback.
function key(n, callback) {
var self = this;
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var result;
try {
result = localStorage.key(n);
} catch (error) {
result = null;
}
// Remove the prefix from the key, if a key is found.
if (result) {
result = result.substring(dbInfo.keyPrefix.length);
}
return result;
});
executeCallback(promise, callback);
return promise;
}
function keys(callback) {
var self = this;
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
var length = localStorage.length;
var keys = [];
for (var i = 0; i < length; i++) {
if (localStorage.key(i).indexOf(dbInfo.keyPrefix) === 0) {
keys.push(localStorage.key(i).substring(dbInfo.keyPrefix.length));
}
}
return keys;
});
executeCallback(promise, callback);
return promise;
}
// Supply the number of keys in the datastore to the callback function.
function length(callback) {
var self = this;
var promise = self.keys().then(function(keys) {
return keys.length;
});
executeCallback(promise, callback);
return promise;
}
// Remove an item from the store, nice and simple.
function removeItem(key, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = self.ready().then(function() {
var dbInfo = self._dbInfo;
localStorage.removeItem(dbInfo.keyPrefix + key);
});
executeCallback(promise, callback);
return promise;
}
// Set a key's value and run an optional callback once the value is set.
// Unlike Gaia's implementation, the callback function is passed the value,
// in case you want to operate on that value only after you're sure it
// saved, or something like that.
function setItem(key, value, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = self.ready().then(function() {
// Convert undefined values to null.
// https://github.com/mozilla/localForage/pull/42
if (value === undefined) {
value = null;
}
// Save the original value to pass to the callback.
var originalValue = value;
return new Promise(function(resolve, reject) {
serializer.serialize(value, function(value, error) {
if (error) {
reject(error);
} else {
try {
var dbInfo = self._dbInfo;
localStorage.setItem(dbInfo.keyPrefix + key, value);
resolve(originalValue);
} catch (e) {
// localStorage capacity exceeded.
// TODO: Make this a specific error/event.
if (e.name === 'QuotaExceededError' ||
e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
reject(e);
}
reject(e);
}
}
});
});
});
executeCallback(promise, callback);
return promise;
}
function executeCallback(promise, callback) {
if (callback) {
promise.then(function(result) {
callback(null, result);
}, function(error) {
callback(error);
});
}
}
var localStorageWrapper = {
_driver: 'localStorageWrapper',
_initStorage: _initStorage,
// Default API, from Gaia/localStorage.
iterate: iterate,
getItem: getItem,
setItem: setItem,
removeItem: removeItem,
clear: clear,
length: length,
key: key,
keys: keys
};
if (moduleType === ModuleType.EXPORT) {
module.exports = localStorageWrapper;
} else if (moduleType === ModuleType.DEFINE) {
define('localStorageWrapper', function() {
return localStorageWrapper;
});
} else {
this.localStorageWrapper = localStorageWrapper;
}
}).call(window);
},{"./../utils/serializer":84,"promise":78}],82:[function(_dereq_,module,exports){
/*
* Includes code from:
*
* base64-arraybuffer
* https://github.com/niklasvh/base64-arraybuffer
*
* Copyright (c) 2012 Niklas von Hertzen
* Licensed under the MIT license.
*/
(function() {
'use strict';
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') ?
_dereq_('promise') : this.Promise;
var globalObject = this;
var serializer = null;
var openDatabase = this.openDatabase;
// If WebSQL methods aren't available, we can stop now.
if (!openDatabase) {
return;
}
var ModuleType = {
DEFINE: 1,
EXPORT: 2,
WINDOW: 3
};
// Attaching to window (i.e. no module loader) is the assumed,
// simple default.
var moduleType = ModuleType.WINDOW;
// Find out what kind of module setup we have; if none, we'll just attach
// localForage to the main window.
if (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') {
moduleType = ModuleType.EXPORT;
} else if (typeof define === 'function' && define.amd) {
moduleType = ModuleType.DEFINE;
}
// Open the WebSQL database (automatically creates one if one didn't
// previously exist), using any options set in the config.
function _initStorage(options) {
var self = this;
var dbInfo = {
db: null
};
if (options) {
for (var i in options) {
dbInfo[i] = typeof(options[i]) !== 'string' ?
options[i].toString() : options[i];
}
}
var serializerPromise = new Promise(function(resolve/*, reject*/) {
// We allow localForage to be declared as a module or as a
// library available without AMD/require.js.
if (moduleType === ModuleType.DEFINE) {
_dereq_(['localforageSerializer'], resolve);
} else if (moduleType === ModuleType.EXPORT) {
// Making it browserify friendly
resolve(_dereq_('./../utils/serializer'));
} else {
resolve(globalObject.localforageSerializer);
}
});
var dbInfoPromise = new Promise(function(resolve, reject) {
// Open the database; the openDatabase API will automatically
// create it for us if it doesn't exist.
try {
dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version),
dbInfo.description, dbInfo.size);
} catch (e) {
return self.setDriver(self.LOCALSTORAGE).then(function() {
return self._initStorage(options);
}).then(resolve)['catch'](reject);
}
// Create our key/value table if it doesn't exist.
dbInfo.db.transaction(function(t) {
t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName +
' (id INTEGER PRIMARY KEY, key unique, value)', [],
function() {
self._dbInfo = dbInfo;
resolve();
}, function(t, error) {
reject(error);
});
});
});
return serializerPromise.then(function(lib) {
serializer = lib;
return dbInfoPromise;
});
}
function getItem(key, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('SELECT * FROM ' + dbInfo.storeName +
' WHERE key = ? LIMIT 1', [key],
function(t, results) {
var result = results.rows.length ?
results.rows.item(0).value : null;
// Check to see if this is serialized content we need to
// unpack.
if (result) {
result = serializer.deserialize(result);
}
resolve(result);
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function iterate(iterator, callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('SELECT * FROM ' + dbInfo.storeName, [],
function(t, results) {
var rows = results.rows;
var length = rows.length;
for (var i = 0; i < length; i++) {
var item = rows.item(i);
var result = item.value;
// Check to see if this is serialized content
// we need to unpack.
if (result) {
result = serializer.deserialize(result);
}
result = iterator(result, item.key, i + 1);
// void(0) prevents problems with redefinition
// of `undefined`.
if (result !== void(0)) {
resolve(result);
return;
}
}
resolve();
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function setItem(key, value, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
// The localStorage API doesn't return undefined values in an
// "expected" way, so undefined is always cast to null in all
// drivers. See: https://github.com/mozilla/localForage/pull/42
if (value === undefined) {
value = null;
}
// Save the original value to pass to the callback.
var originalValue = value;
serializer.serialize(value, function(value, error) {
if (error) {
reject(error);
} else {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('INSERT OR REPLACE INTO ' +
dbInfo.storeName +
' (key, value) VALUES (?, ?)',
[key, value], function() {
resolve(originalValue);
}, function(t, error) {
reject(error);
});
}, function(sqlError) {
// The transaction failed; check
// to see if it's a quota error.
if (sqlError.code === sqlError.QUOTA_ERR) {
// We reject the callback outright for now, but
// it's worth trying to re-run the transaction.
// Even if the user accepts the prompt to use
// more storage on Safari, this error will
// be called.
//
// TODO: Try to re-run the transaction.
reject(sqlError);
}
});
}
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function removeItem(key, callback) {
var self = this;
// Cast the key to a string, as that's all we can set as a key.
if (typeof key !== 'string') {
window.console.warn(key +
' used as a key, but it is not a string.');
key = String(key);
}
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('DELETE FROM ' + dbInfo.storeName +
' WHERE key = ?', [key],
function() {
resolve();
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
// Deletes every item in the table.
// TODO: Find out if this resets the AUTO_INCREMENT number.
function clear(callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('DELETE FROM ' + dbInfo.storeName, [],
function() {
resolve();
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
// Does a simple `COUNT(key)` to get the number of items stored in
// localForage.
function length(callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
// Ahhh, SQL makes this one soooooo easy.
t.executeSql('SELECT COUNT(key) as c FROM ' +
dbInfo.storeName, [], function(t, results) {
var result = results.rows.item(0).c;
resolve(result);
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
// Return the key located at key index X; essentially gets the key from a
// `WHERE id = ?`. This is the most efficient way I can think to implement
// this rarely-used (in my experience) part of the API, but it can seem
// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so
// the ID of each key will change every time it's updated. Perhaps a stored
// procedure for the `setItem()` SQL would solve this problem?
// TODO: Don't change ID on `setItem()`.
function key(n, callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('SELECT key FROM ' + dbInfo.storeName +
' WHERE id = ? LIMIT 1', [n + 1],
function(t, results) {
var result = results.rows.length ?
results.rows.item(0).key : null;
resolve(result);
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function keys(callback) {
var self = this;
var promise = new Promise(function(resolve, reject) {
self.ready().then(function() {
var dbInfo = self._dbInfo;
dbInfo.db.transaction(function(t) {
t.executeSql('SELECT key FROM ' + dbInfo.storeName, [],
function(t, results) {
var keys = [];
for (var i = 0; i < results.rows.length; i++) {
keys.push(results.rows.item(i).key);
}
resolve(keys);
}, function(t, error) {
reject(error);
});
});
})['catch'](reject);
});
executeCallback(promise, callback);
return promise;
}
function executeCallback(promise, callback) {
if (callback) {
promise.then(function(result) {
callback(null, result);
}, function(error) {
callback(error);
});
}
}
var webSQLStorage = {
_driver: 'webSQLStorage',
_initStorage: _initStorage,
iterate: iterate,
getItem: getItem,
setItem: setItem,
removeItem: removeItem,
clear: clear,
length: length,
key: key,
keys: keys
};
if (moduleType === ModuleType.DEFINE) {
define('webSQLStorage', function() {
return webSQLStorage;
});
} else if (moduleType === ModuleType.EXPORT) {
module.exports = webSQLStorage;
} else {
this.webSQLStorage = webSQLStorage;
}
}).call(window);
},{"./../utils/serializer":84,"promise":78}],83:[function(_dereq_,module,exports){
(function() {
'use strict';
// Promises!
var Promise = (typeof module !== 'undefined' && module.exports &&
typeof _dereq_ !== 'undefined') ?
_dereq_('promise') : this.Promise;
// Custom drivers are stored here when `defineDriver()` is called.
// They are shared across all instances of localForage.
var CustomDrivers = {};
var DriverType = {
INDEXEDDB: 'asyncStorage',
LOCALSTORAGE: 'localStorageWrapper',
WEBSQL: 'webSQLStorage'
};
var DefaultDriverOrder = [
DriverType.INDEXEDDB,
DriverType.WEBSQL,
DriverType.LOCALSTORAGE
];
var LibraryMethods = [
'clear',
'getItem',
'iterate',
'key',
'keys',
'length',
'removeItem',
'setItem'
];
var ModuleType = {
DEFINE: 1,
EXPORT: 2,
WINDOW: 3
};
var DefaultConfig = {
description: '',
driver: DefaultDriverOrder.slice(),
name: 'localforage',
// Default DB size is _JUST UNDER_ 5MB, as it's the highest size
// we can use without a prompt.
size: 4980736,
storeName: 'keyvaluepairs',
version: 1.0
};
// Attaching to window (i.e. no module loader) is the assumed,
// simple default.
var moduleType = ModuleType.WINDOW;
// Find out what kind of module setup we have; if none, we'll just attach
// localForage to the main window.
if (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') {
moduleType = ModuleType.EXPORT;
} else if (typeof define === 'function' && define.amd) {
moduleType = ModuleType.DEFINE;
}
// Check to see if IndexedDB is available and if it is the latest
// implementation; it's our preferred backend library. We use "_spec_test"
// as the name of the database because it's not the one we'll operate on,
// but it's useful to make sure its using the right spec.
// See: https://github.com/mozilla/localForage/issues/128
var driverSupport = (function(self) {
// Initialize IndexedDB; fall back to vendor-prefixed versions
// if needed.
var indexedDB = indexedDB || self.indexedDB || self.webkitIndexedDB ||
self.mozIndexedDB || self.OIndexedDB ||
self.msIndexedDB;
var result = {};
result[DriverType.WEBSQL] = !!self.openDatabase;
result[DriverType.INDEXEDDB] = !!(function() {
// We mimic PouchDB here; just UA test for Safari (which, as of
// iOS 8/Yosemite, doesn't properly support IndexedDB).
// IndexedDB support is broken and different from Blink's.
// This is faster than the test case (and it's sync), so we just
// do this. *SIGH*
// http://bl.ocks.org/nolanlawson/raw/c83e9039edf2278047e9/
//
// We test for openDatabase because IE Mobile identifies itself
// as Safari. Oh the lulz...
if (typeof self.openDatabase !== 'undefined' && self.navigator &&
self.navigator.userAgent &&
/Safari/.test(self.navigator.userAgent) &&
!/Chrome/.test(self.navigator.userAgent)) {
return false;
}
try {
return indexedDB &&
typeof indexedDB.open === 'function' &&
// Some Samsung/HTC Android 4.0-4.3 devices
// have older IndexedDB specs; if this isn't available
// their IndexedDB is too old for us to use.
// (Replaces the onupgradeneeded test.)
typeof self.IDBKeyRange !== 'undefined';
} catch (e) {
return false;
}
})();
result[DriverType.LOCALSTORAGE] = !!(function() {
try {
return (self.localStorage &&
('setItem' in self.localStorage) &&
(self.localStorage.setItem));
} catch (e) {
return false;
}
})();
return result;
})(this);
var isArray = Array.isArray || function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
function callWhenReady(localForageInstance, libraryMethod) {
localForageInstance[libraryMethod] = function() {
var _args = arguments;
return localForageInstance.ready().then(function() {
return localForageInstance[libraryMethod].apply(localForageInstance, _args);
});
};
}
function extend() {
for (var i = 1; i < arguments.length; i++) {
var arg = arguments[i];
if (arg) {
for (var key in arg) {
if (arg.hasOwnProperty(key)) {
if (isArray(arg[key])) {
arguments[0][key] = arg[key].slice();
} else {
arguments[0][key] = arg[key];
}
}
}
}
}
return arguments[0];
}
function isLibraryDriver(driverName) {
for (var driver in DriverType) {
if (DriverType.hasOwnProperty(driver) &&
DriverType[driver] === driverName) {
return true;
}
}
return false;
}
var globalObject = this;
function LocalForage(options) {
this._config = extend({}, DefaultConfig, options);
this._driverSet = null;
this._ready = false;
this._dbInfo = null;
// Add a stub for each driver API method that delays the call to the
// corresponding driver method until localForage is ready. These stubs
// will be replaced by the driver methods as soon as the driver is
// loaded, so there is no performance impact.
for (var i = 0; i < LibraryMethods.length; i++) {
callWhenReady(this, LibraryMethods[i]);
}
this.setDriver(this._config.driver);
}
LocalForage.prototype.INDEXEDDB = DriverType.INDEXEDDB;
LocalForage.prototype.LOCALSTORAGE = DriverType.LOCALSTORAGE;
LocalForage.prototype.WEBSQL = DriverType.WEBSQL;
// Set any config values for localForage; can be called anytime before
// the first API call (e.g. `getItem`, `setItem`).
// We loop through options so we don't overwrite existing config
// values.
LocalForage.prototype.config = function(options) {
// If the options argument is an object, we use it to set values.
// Otherwise, we return either a specified config value or all
// config values.
if (typeof(options) === 'object') {
// If localforage is ready and fully initialized, we can't set
// any new configuration values. Instead, we return an error.
if (this._ready) {
return new Error("Can't call config() after localforage " +
'has been used.');
}
for (var i in options) {
if (i === 'storeName') {
options[i] = options[i].replace(/\W/g, '_');
}
this._config[i] = options[i];
}
// after all config options are set and
// the driver option is used, try setting it
if ('driver' in options && options.driver) {
this.setDriver(this._config.driver);
}
return true;
} else if (typeof(options) === 'string') {
return this._config[options];
} else {
return this._config;
}
};
// Used to define a custom driver, shared across all instances of
// localForage.
LocalForage.prototype.defineDriver = function(driverObject, callback,
errorCallback) {
var defineDriver = new Promise(function(resolve, reject) {
try {
var driverName = driverObject._driver;
var complianceError = new Error(
'Custom driver not compliant; see ' +
'https://mozilla.github.io/localForage/#definedriver'
);
var namingError = new Error(
'Custom driver name already in use: ' + driverObject._driver
);
// A driver name should be defined and not overlap with the
// library-defined, default drivers.
if (!driverObject._driver) {
reject(complianceError);
return;
}
if (isLibraryDriver(driverObject._driver)) {
reject(namingError);
return;
}
var customDriverMethods = LibraryMethods.concat('_initStorage');
for (var i = 0; i < customDriverMethods.length; i++) {
var customDriverMethod = customDriverMethods[i];
if (!customDriverMethod ||
!driverObject[customDriverMethod] ||
typeof driverObject[customDriverMethod] !== 'function') {
reject(complianceError);
return;
}
}
var supportPromise = Promise.resolve(true);
if ('_support' in driverObject) {
if (driverObject._support && typeof driverObject._support === 'function') {
supportPromise = driverObject._support();
} else {
supportPromise = Promise.resolve(!!driverObject._support);
}
}
supportPromise.then(function(supportResult) {
driverSupport[driverName] = supportResult;
CustomDrivers[driverName] = driverObject;
resolve();
}, reject);
} catch (e) {
reject(e);
}
});
defineDriver.then(callback, errorCallback);
return defineDriver;
};
LocalForage.prototype.driver = function() {
return this._driver || null;
};
LocalForage.prototype.ready = function(callback) {
var self = this;
var ready = new Promise(function(resolve, reject) {
self._driverSet.then(function() {
if (self._ready === null) {
self._ready = self._initStorage(self._config);
}
self._ready.then(resolve, reject);
})['catch'](reject);
});
ready.then(callback, callback);
return ready;
};
LocalForage.prototype.setDriver = function(drivers, callback,
errorCallback) {
var self = this;
if (typeof drivers === 'string') {
drivers = [drivers];
}
this._driverSet = new Promise(function(resolve, reject) {
var driverName = self._getFirstSupportedDriver(drivers);
var error = new Error('No available storage method found.');
if (!driverName) {
self._driverSet = Promise.reject(error);
reject(error);
return;
}
self._dbInfo = null;
self._ready = null;
if (isLibraryDriver(driverName)) {
var driverPromise = new Promise(function(resolve/*, reject*/) {
// We allow localForage to be declared as a module or as a
// library available without AMD/require.js.
if (moduleType === ModuleType.DEFINE) {
_dereq_([driverName], resolve);
} else if (moduleType === ModuleType.EXPORT) {
// Making it browserify friendly
switch (driverName) {
case self.INDEXEDDB:
resolve(_dereq_('./drivers/indexeddb'));
break;
case self.LOCALSTORAGE:
resolve(_dereq_('./drivers/localstorage'));
break;
case self.WEBSQL:
resolve(_dereq_('./drivers/websql'));
break;
}
} else {
resolve(globalObject[driverName]);
}
});
driverPromise.then(function(driver) {
self._extend(driver);
resolve();
});
} else if (CustomDrivers[driverName]) {
self._extend(CustomDrivers[driverName]);
resolve();
} else {
self._driverSet = Promise.reject(error);
reject(error);
}
});
function setDriverToConfig() {
self._config.driver = self.driver();
}
this._driverSet.then(setDriverToConfig, setDriverToConfig);
this._driverSet.then(callback, errorCallback);
return this._driverSet;
};
LocalForage.prototype.supports = function(driverName) {
return !!driverSupport[driverName];
};
LocalForage.prototype._extend = function(libraryMethodsAndProperties) {
extend(this, libraryMethodsAndProperties);
};
// Used to determine which driver we should use as the backend for this
// instance of localForage.
LocalForage.prototype._getFirstSupportedDriver = function(drivers) {
if (drivers && isArray(drivers)) {
for (var i = 0; i < drivers.length; i++) {
var driver = drivers[i];
if (this.supports(driver)) {
return driver;
}
}
}
return null;
};
LocalForage.prototype.createInstance = function(options) {
return new LocalForage(options);
};
// The actual localForage object that we expose as a module or via a
// global. It's extended by pulling in one of our other libraries.
var localForage = new LocalForage();
// We allow localForage to be declared as a module or as a library
// available without AMD/require.js.
if (moduleType === ModuleType.DEFINE) {
define('localforage', function() {
return localForage;
});
} else if (moduleType === ModuleType.EXPORT) {
module.exports = localForage;
} else {
this.localforage = localForage;
}
}).call(window);
},{"./drivers/indexeddb":80,"./drivers/localstorage":81,"./drivers/websql":82,"promise":78}],84:[function(_dereq_,module,exports){
(function() {
'use strict';
// Sadly, the best way to save binary data in WebSQL/localStorage is serializing
// it to Base64, so this is how we store it to prevent very strange errors with less
// verbose ways of binary <-> string data storage.
var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var BLOB_TYPE_PREFIX = '~~local_forage_type~';
var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
var SERIALIZED_MARKER = '__lfsc__:';
var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;
// OMG the serializations!
var TYPE_ARRAYBUFFER = 'arbf';
var TYPE_BLOB = 'blob';
var TYPE_INT8ARRAY = 'si08';
var TYPE_UINT8ARRAY = 'ui08';
var TYPE_UINT8CLAMPEDARRAY = 'uic8';
var TYPE_INT16ARRAY = 'si16';
var TYPE_INT32ARRAY = 'si32';
var TYPE_UINT16ARRAY = 'ur16';
var TYPE_UINT32ARRAY = 'ui32';
var TYPE_FLOAT32ARRAY = 'fl32';
var TYPE_FLOAT64ARRAY = 'fl64';
var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH +
TYPE_ARRAYBUFFER.length;
// Get out of our habit of using `window` inline, at least.
var globalObject = this;
// Abstracts constructing a Blob object, so it also works in older
// browsers that don't support the native Blob constructor. (i.e.
// old QtWebKit versions, at least).
function _createBlob(parts, properties) {
parts = parts || [];
properties = properties || {};
try {
return new Blob(parts, properties);
} catch (err) {
if (err.name !== 'TypeError') {
throw err;
}
var BlobBuilder = globalObject.BlobBuilder ||
globalObject.MSBlobBuilder ||
globalObject.MozBlobBuilder ||
globalObject.WebKitBlobBuilder;
var builder = new BlobBuilder();
for (var i = 0; i < parts.length; i += 1) {
builder.append(parts[i]);
}
return builder.getBlob(properties.type);
}
}
// Serialize a value, afterwards executing a callback (which usually
// instructs the `setItem()` callback/promise to be executed). This is how
// we store binary data with localStorage.
function serialize(value, callback) {
var valueString = '';
if (value) {
valueString = value.toString();
}
// Cannot use `value instanceof ArrayBuffer` or such here, as these
// checks fail when running the tests using casper.js...
//
// TODO: See why those tests fail and use a better solution.
if (value && (value.toString() === '[object ArrayBuffer]' ||
value.buffer &&
value.buffer.toString() === '[object ArrayBuffer]')) {
// Convert binary arrays to a string and prefix the string with
// a special marker.
var buffer;
var marker = SERIALIZED_MARKER;
if (value instanceof ArrayBuffer) {
buffer = value;
marker += TYPE_ARRAYBUFFER;
} else {
buffer = value.buffer;
if (valueString === '[object Int8Array]') {
marker += TYPE_INT8ARRAY;
} else if (valueString === '[object Uint8Array]') {
marker += TYPE_UINT8ARRAY;
} else if (valueString === '[object Uint8ClampedArray]') {
marker += TYPE_UINT8CLAMPEDARRAY;
} else if (valueString === '[object Int16Array]') {
marker += TYPE_INT16ARRAY;
} else if (valueString === '[object Uint16Array]') {
marker += TYPE_UINT16ARRAY;
} else if (valueString === '[object Int32Array]') {
marker += TYPE_INT32ARRAY;
} else if (valueString === '[object Uint32Array]') {
marker += TYPE_UINT32ARRAY;
} else if (valueString === '[object Float32Array]') {
marker += TYPE_FLOAT32ARRAY;
} else if (valueString === '[object Float64Array]') {
marker += TYPE_FLOAT64ARRAY;
} else {
callback(new Error('Failed to get type for BinaryArray'));
}
}
callback(marker + bufferToString(buffer));
} else if (valueString === '[object Blob]') {
// Conver the blob to a binaryArray and then to a string.
var fileReader = new FileReader();
fileReader.onload = function() {
// Backwards-compatible prefix for the blob type.
var str = BLOB_TYPE_PREFIX + value.type + '~' +
bufferToString(this.result);
callback(SERIALIZED_MARKER + TYPE_BLOB + str);
};
fileReader.readAsArrayBuffer(value);
} else {
try {
callback(JSON.stringify(value));
} catch (e) {
console.error("Couldn't convert value into a JSON string: ",
value);
callback(null, e);
}
}
}
// Deserialize data we've inserted into a value column/field. We place
// special markers into our strings to mark them as encoded; this isn't
// as nice as a meta field, but it's the only sane thing we can do whilst
// keeping localStorage support intact.
//
// Oftentimes this will just deserialize JSON content, but if we have a
// special marker (SERIALIZED_MARKER, defined above), we will extract
// some kind of arraybuffer/binary data/typed array out of the string.
function deserialize(value) {
// If we haven't marked this string as being specially serialized (i.e.
// something other than serialized JSON), we can just return it and be
// done with it.
if (value.substring(0,
SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
return JSON.parse(value);
}
// The following code deals with deserializing some kind of Blob or
// TypedArray. First we separate out the type of data we're dealing
// with from the data itself.
var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
var type = value.substring(SERIALIZED_MARKER_LENGTH,
TYPE_SERIALIZED_MARKER_LENGTH);
var blobType;
// Backwards-compatible blob type serialization strategy.
// DBs created with older versions of localForage will simply not have the blob type.
if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
blobType = matcher[1];
serializedString = serializedString.substring(matcher[0].length);
}
var buffer = stringToBuffer(serializedString);
// Return the right type based on the code/type set during
// serialization.
switch (type) {
case TYPE_ARRAYBUFFER:
return buffer;
case TYPE_BLOB:
return _createBlob([buffer], {type: blobType});
case TYPE_INT8ARRAY:
return new Int8Array(buffer);
case TYPE_UINT8ARRAY:
return new Uint8Array(buffer);
case TYPE_UINT8CLAMPEDARRAY:
return new Uint8ClampedArray(buffer);
case TYPE_INT16ARRAY:
return new Int16Array(buffer);
case TYPE_UINT16ARRAY:
return new Uint16Array(buffer);
case TYPE_INT32ARRAY:
return new Int32Array(buffer);
case TYPE_UINT32ARRAY:
return new Uint32Array(buffer);
case TYPE_FLOAT32ARRAY:
return new Float32Array(buffer);
case TYPE_FLOAT64ARRAY:
return new Float64Array(buffer);
default:
throw new Error('Unkown type: ' + type);
}
}
function stringToBuffer(serializedString) {
// Fill the string into a ArrayBuffer.
var bufferLength = serializedString.length * 0.75;
var len = serializedString.length;
var i;
var p = 0;
var encoded1, encoded2, encoded3, encoded4;
if (serializedString[serializedString.length - 1] === '=') {
bufferLength--;
if (serializedString[serializedString.length - 2] === '=') {
bufferLength--;
}
}
var buffer = new ArrayBuffer(bufferLength);
var bytes = new Uint8Array(buffer);
for (i = 0; i < len; i+=4) {
encoded1 = BASE_CHARS.indexOf(serializedString[i]);
encoded2 = BASE_CHARS.indexOf(serializedString[i+1]);
encoded3 = BASE_CHARS.indexOf(serializedString[i+2]);
encoded4 = BASE_CHARS.indexOf(serializedString[i+3]);
/*jslint bitwise: true */
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
}
return buffer;
}
// Converts a buffer to a string to store, serialized, in the backend
// storage library.
function bufferToString(buffer) {
// base64-arraybuffer
var bytes = new Uint8Array(buffer);
var base64String = '';
var i;
for (i = 0; i < bytes.length; i += 3) {
/*jslint bitwise: true */
base64String += BASE_CHARS[bytes[i] >> 2];
base64String += BASE_CHARS[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
base64String += BASE_CHARS[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
base64String += BASE_CHARS[bytes[i + 2] & 63];
}
if ((bytes.length % 3) === 2) {
base64String = base64String.substring(0, base64String.length - 1) + '=';
} else if (bytes.length % 3 === 1) {
base64String = base64String.substring(0, base64String.length - 2) + '==';
}
return base64String;
}
var localforageSerializer = {
serialize: serialize,
deserialize: deserialize,
stringToBuffer: stringToBuffer,
bufferToString: bufferToString
};
if (typeof module !== 'undefined' && module.exports && typeof _dereq_ !== 'undefined') {
module.exports = localforageSerializer;
} else if (typeof define === 'function' && define.amd) {
define('localforageSerializer', function() {
return localforageSerializer;
});
} else {
this.localforageSerializer = localforageSerializer;
}
}).call(window);
},{}],85:[function(_dereq_,module,exports){
// Top level file is just a mixin of submodules & constants
'use strict';
var assign = _dereq_('./lib/utils/common').assign;
var deflate = _dereq_('./lib/deflate');
var inflate = _dereq_('./lib/inflate');
var constants = _dereq_('./lib/zlib/constants');
var pako = {};
assign(pako, deflate, inflate, constants);
module.exports = pako;
},{"./lib/deflate":86,"./lib/inflate":87,"./lib/utils/common":88,"./lib/zlib/constants":91}],86:[function(_dereq_,module,exports){
'use strict';
var zlib_deflate = _dereq_('./zlib/deflate.js');
var utils = _dereq_('./utils/common');
var strings = _dereq_('./utils/strings');
var msg = _dereq_('./zlib/messages');
var zstream = _dereq_('./zlib/zstream');
var toString = Object.prototype.toString;
/* Public constants ==========================================================*/
/* ===========================================================================*/
var Z_NO_FLUSH = 0;
var Z_FINISH = 4;
var Z_OK = 0;
var Z_STREAM_END = 1;
var Z_SYNC_FLUSH = 2;
var Z_DEFAULT_COMPRESSION = -1;
var Z_DEFAULT_STRATEGY = 0;
var Z_DEFLATED = 8;
/* ===========================================================================*/
/**
* class Deflate
*
* Generic JS-style wrapper for zlib calls. If you don't need
* streaming behaviour - use more simple functions: [[deflate]],
* [[deflateRaw]] and [[gzip]].
**/
/* internal
* Deflate.chunks -> Array
*
* Chunks of output data, if [[Deflate#onData]] not overriden.
**/
/**
* Deflate.result -> Uint8Array|Array
*
* Compressed result, generated by default [[Deflate#onData]]
* and [[Deflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Deflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
* Deflate.err -> Number
*
* Error code after deflate finished. 0 (Z_OK) on success.
* You will not need it in real life, because deflate errors
* are possible only on wrong options or bad `onData` / `onEnd`
* custom handlers.
**/
/**
* Deflate.msg -> String
*
* Error message, if [[Deflate.err]] != 0
**/
/**
* new Deflate(options)
* - options (Object): zlib deflate options.
*
* Creates new deflator instance with specified params. Throws exception
* on bad params. Supported options:
*
* - `level`
* - `windowBits`
* - `memLevel`
* - `strategy`
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Additional options, for internal needs:
*
* - `chunkSize` - size of generated data chunks (16K by default)
* - `raw` (Boolean) - do raw deflate
* - `gzip` (Boolean) - create gzip wrapper
* - `to` (String) - if equal to 'string', then result will be "binary string"
* (each char code [0..255])
* - `header` (Object) - custom header for gzip
* - `text` (Boolean) - true if compressed data believed to be text
* - `time` (Number) - modification time, unix timestamp
* - `os` (Number) - operation system code
* - `extra` (Array) - array of bytes with extra data (max 65536)
* - `name` (String) - file name (binary string)
* - `comment` (String) - comment (binary string)
* - `hcrc` (Boolean) - true if header crc should be added
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
*
* var deflate = new pako.Deflate({ level: 3});
*
* deflate.push(chunk1, false);
* deflate.push(chunk2, true); // true -> last chunk
*
* if (deflate.err) { throw new Error(deflate.err); }
*
* console.log(deflate.result);
* ```
**/
var Deflate = function(options) {
this.options = utils.assign({
level: Z_DEFAULT_COMPRESSION,
method: Z_DEFLATED,
chunkSize: 16384,
windowBits: 15,
memLevel: 8,
strategy: Z_DEFAULT_STRATEGY,
to: ''
}, options || {});
var opt = this.options;
if (opt.raw && (opt.windowBits > 0)) {
opt.windowBits = -opt.windowBits;
}
else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
opt.windowBits += 16;
}
this.err = 0; // error code, if happens (0 = Z_OK)
this.msg = ''; // error message
this.ended = false; // used to avoid multiple onEnd() calls
this.chunks = []; // chunks of compressed data
this.strm = new zstream();
this.strm.avail_out = 0;
var status = zlib_deflate.deflateInit2(
this.strm,
opt.level,
opt.method,
opt.windowBits,
opt.memLevel,
opt.strategy
);
if (status !== Z_OK) {
throw new Error(msg[status]);
}
if (opt.header) {
zlib_deflate.deflateSetHeader(this.strm, opt.header);
}
};
/**
* Deflate#push(data[, mode]) -> Boolean
* - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
* converted to utf8 byte sequence.
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
*
* Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
* new compressed chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the compression context.
*
* On fail call [[Deflate#onEnd]] with error code and return false.
*
* We strongly recommend to use `Uint8Array` on input for best speed (output
* array format is detected automatically). Also, don't skip last param and always
* use the same type in your code (boolean or number). That will improve JS speed.
*
* For regular `Array`-s make sure all elements are [0..255].
*
* ##### Example
*
* ```javascript
* push(chunk, false); // push one of data chunks
* ...
* push(chunk, true); // push last chunk
* ```
**/
Deflate.prototype.push = function(data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var status, _mode;
if (this.ended) { return false; }
_mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
// Convert data if needed
if (typeof data === 'string') {
// If we need to compress text, change encoding to utf8.
strm.input = strings.string2buf(data);
} else if (toString.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
}
strm.next_in = 0;
strm.avail_in = strm.input.length;
do {
if (strm.avail_out === 0) {
strm.output = new utils.Buf8(chunkSize);
strm.next_out = 0;
strm.avail_out = chunkSize;
}
status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
if (status !== Z_STREAM_END && status !== Z_OK) {
this.onEnd(status);
this.ended = true;
return false;
}
if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
if (this.options.to === 'string') {
this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
} else {
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
}
}
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
// Finalize on the last chunk.
if (_mode === Z_FINISH) {
status = zlib_deflate.deflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return status === Z_OK;
}
// callback interim results if Z_SYNC_FLUSH.
if (_mode === Z_SYNC_FLUSH) {
this.onEnd(Z_OK);
strm.avail_out = 0;
return true;
}
return true;
};
/**
* Deflate#onData(chunk) -> Void
* - chunk (Uint8Array|Array|String): ouput data. Type of array depends
* on js engine support. When string output requested, each chunk
* will be string.
*
* By default, stores data blocks in `chunks[]` property and glue
* those in `onEnd`. Override this handler, if you need another behaviour.
**/
Deflate.prototype.onData = function(chunk) {
this.chunks.push(chunk);
};
/**
* Deflate#onEnd(status) -> Void
* - status (Number): deflate status. 0 (Z_OK) on success,
* other if not.
*
* Called once after you tell deflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Deflate.prototype.onEnd = function(status) {
// On success - join
if (status === Z_OK) {
if (this.options.to === 'string') {
this.result = this.chunks.join('');
} else {
this.result = utils.flattenChunks(this.chunks);
}
}
this.chunks = [];
this.err = status;
this.msg = this.strm.msg;
};
/**
* deflate(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to compress.
* - options (Object): zlib deflate options.
*
* Compress `data` with deflate alrorythm and `options`.
*
* Supported options are:
*
* - level
* - windowBits
* - memLevel
* - strategy
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Sugar (options):
*
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
* negative windowBits implicitly.
* - `to` (String) - if equal to 'string', then result will be "binary string"
* (each char code [0..255])
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
*
* console.log(pako.deflate(data));
* ```
**/
function deflate(input, options) {
var deflator = new Deflate(options);
deflator.push(input, true);
// That will never happens, if you don't cheat with options :)
if (deflator.err) { throw deflator.msg; }
return deflator.result;
}
/**
* deflateRaw(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to compress.
* - options (Object): zlib deflate options.
*
* The same as [[deflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function deflateRaw(input, options) {
options = options || {};
options.raw = true;
return deflate(input, options);
}
/**
* gzip(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to compress.
* - options (Object): zlib deflate options.
*
* The same as [[deflate]], but create gzip wrapper instead of
* deflate one.
**/
function gzip(input, options) {
options = options || {};
options.gzip = true;
return deflate(input, options);
}
exports.Deflate = Deflate;
exports.deflate = deflate;
exports.deflateRaw = deflateRaw;
exports.gzip = gzip;
},{"./utils/common":88,"./utils/strings":89,"./zlib/deflate.js":93,"./zlib/messages":98,"./zlib/zstream":100}],87:[function(_dereq_,module,exports){
'use strict';
var zlib_inflate = _dereq_('./zlib/inflate.js');
var utils = _dereq_('./utils/common');
var strings = _dereq_('./utils/strings');
var c = _dereq_('./zlib/constants');
var msg = _dereq_('./zlib/messages');
var zstream = _dereq_('./zlib/zstream');
var gzheader = _dereq_('./zlib/gzheader');
var toString = Object.prototype.toString;
/**
* class Inflate
*
* Generic JS-style wrapper for zlib calls. If you don't need
* streaming behaviour - use more simple functions: [[inflate]]
* and [[inflateRaw]].
**/
/* internal
* inflate.chunks -> Array
*
* Chunks of output data, if [[Inflate#onData]] not overriden.
**/
/**
* Inflate.result -> Uint8Array|Array|String
*
* Uncompressed result, generated by default [[Inflate#onData]]
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Inflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
* Inflate.err -> Number
*
* Error code after inflate finished. 0 (Z_OK) on success.
* Should be checked if broken data possible.
**/
/**
* Inflate.msg -> String
*
* Error message, if [[Inflate.err]] != 0
**/
/**
* new Inflate(options)
* - options (Object): zlib inflate options.
*
* Creates new inflator instance with specified params. Throws exception
* on bad params. Supported options:
*
* - `windowBits`
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Additional options, for internal needs:
*
* - `chunkSize` - size of generated data chunks (16K by default)
* - `raw` (Boolean) - do raw inflate
* - `to` (String) - if equal to 'string', then result will be converted
* from utf8 to utf16 (javascript) string. When string output requested,
* chunk length can differ from `chunkSize`, depending on content.
*
* By default, when no options set, autodetect deflate/gzip data format via
* wrapper header.
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
*
* var inflate = new pako.Inflate({ level: 3});
*
* inflate.push(chunk1, false);
* inflate.push(chunk2, true); // true -> last chunk
*
* if (inflate.err) { throw new Error(inflate.err); }
*
* console.log(inflate.result);
* ```
**/
var Inflate = function(options) {
this.options = utils.assign({
chunkSize: 16384,
windowBits: 0,
to: ''
}, options || {});
var opt = this.options;
// Force window size for `raw` data, if not set directly,
// because we have no header for autodetect.
if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
opt.windowBits = -opt.windowBits;
if (opt.windowBits === 0) { opt.windowBits = -15; }
}
// If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
!(options && options.windowBits)) {
opt.windowBits += 32;
}
// Gzip header has no info about windows size, we can do autodetect only
// for deflate. So, if window size not set, force it to max when gzip possible
if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
// bit 3 (16) -> gzipped data
// bit 4 (32) -> autodetect gzip/deflate
if ((opt.windowBits & 15) === 0) {
opt.windowBits |= 15;
}
}
this.err = 0; // error code, if happens (0 = Z_OK)
this.msg = ''; // error message
this.ended = false; // used to avoid multiple onEnd() calls
this.chunks = []; // chunks of compressed data
this.strm = new zstream();
this.strm.avail_out = 0;
var status = zlib_inflate.inflateInit2(
this.strm,
opt.windowBits
);
if (status !== c.Z_OK) {
throw new Error(msg[status]);
}
this.header = new gzheader();
zlib_inflate.inflateGetHeader(this.strm, this.header);
};
/**
* Inflate#push(data[, mode]) -> Boolean
* - data (Uint8Array|Array|ArrayBuffer|String): input data
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
*
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
* new output chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
*
* On fail call [[Inflate#onEnd]] with error code and return false.
*
* We strongly recommend to use `Uint8Array` on input for best speed (output
* format is detected automatically). Also, don't skip last param and always
* use the same type in your code (boolean or number). That will improve JS speed.
*
* For regular `Array`-s make sure all elements are [0..255].
*
* ##### Example
*
* ```javascript
* push(chunk, false); // push one of data chunks
* ...
* push(chunk, true); // push last chunk
* ```
**/
Inflate.prototype.push = function(data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var status, _mode;
var next_out_utf8, tail, utf8str;
// Flag to properly process Z_BUF_ERROR on testing inflate call
// when we check that all output data was flushed.
var allowBufError = false;
if (this.ended) { return false; }
_mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
// Convert data if needed
if (typeof data === 'string') {
// Only binary strings can be decompressed on practice
strm.input = strings.binstring2buf(data);
} else if (toString.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
}
strm.next_in = 0;
strm.avail_in = strm.input.length;
do {
if (strm.avail_out === 0) {
strm.output = new utils.Buf8(chunkSize);
strm.next_out = 0;
strm.avail_out = chunkSize;
}
status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
if (status === c.Z_BUF_ERROR && allowBufError === true) {
status = c.Z_OK;
allowBufError = false;
}
if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
this.onEnd(status);
this.ended = true;
return false;
}
if (strm.next_out) {
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
if (this.options.to === 'string') {
next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
tail = strm.next_out - next_out_utf8;
utf8str = strings.buf2string(strm.output, next_out_utf8);
// move tail
strm.next_out = tail;
strm.avail_out = chunkSize - tail;
if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
this.onData(utf8str);
} else {
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
}
}
}
// When no more input data, we should check that internal inflate buffers
// are flushed. The only way to do it when avail_out = 0 - run one more
// inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
// Here we set flag to process this error properly.
//
// NOTE. Deflate does not return error in this case and does not needs such
// logic.
if (strm.avail_in === 0 && strm.avail_out === 0) {
allowBufError = true;
}
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
if (status === c.Z_STREAM_END) {
_mode = c.Z_FINISH;
}
// Finalize on the last chunk.
if (_mode === c.Z_FINISH) {
status = zlib_inflate.inflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return status === c.Z_OK;
}
// callback interim results if Z_SYNC_FLUSH.
if (_mode === c.Z_SYNC_FLUSH) {
this.onEnd(c.Z_OK);
strm.avail_out = 0;
return true;
}
return true;
};
/**
* Inflate#onData(chunk) -> Void
* - chunk (Uint8Array|Array|String): ouput data. Type of array depends
* on js engine support. When string output requested, each chunk
* will be string.
*
* By default, stores data blocks in `chunks[]` property and glue
* those in `onEnd`. Override this handler, if you need another behaviour.
**/
Inflate.prototype.onData = function(chunk) {
this.chunks.push(chunk);
};
/**
* Inflate#onEnd(status) -> Void
* - status (Number): inflate status. 0 (Z_OK) on success,
* other if not.
*
* Called either after you tell inflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Inflate.prototype.onEnd = function(status) {
// On success - join
if (status === c.Z_OK) {
if (this.options.to === 'string') {
// Glue & convert here, until we teach pako to send
// utf8 alligned strings to onData
this.result = this.chunks.join('');
} else {
this.result = utils.flattenChunks(this.chunks);
}
}
this.chunks = [];
this.err = status;
this.msg = this.strm.msg;
};
/**
* inflate(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* Decompress `data` with inflate/ungzip and `options`. Autodetect
* format via wrapper header by default. That's why we don't provide
* separate `ungzip` method.
*
* Supported options are:
*
* - windowBits
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information.
*
* Sugar (options):
*
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
* negative windowBits implicitly.
* - `to` (String) - if equal to 'string', then result will be converted
* from utf8 to utf16 (javascript) string. When string output requested,
* chunk length can differ from `chunkSize`, depending on content.
*
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , input = pako.deflate([1,2,3,4,5,6,7,8,9])
* , output;
*
* try {
* output = pako.inflate(input);
* } catch (err)
* console.log(err);
* }
* ```
**/
function inflate(input, options) {
var inflator = new Inflate(options);
inflator.push(input, true);
// That will never happens, if you don't cheat with options :)
if (inflator.err) { throw inflator.msg; }
return inflator.result;
}
/**
* inflateRaw(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* The same as [[inflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function inflateRaw(input, options) {
options = options || {};
options.raw = true;
return inflate(input, options);
}
/**
* ungzip(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* Just shortcut to [[inflate]], because it autodetects format
* by header.content. Done for convenience.
**/
exports.Inflate = Inflate;
exports.inflate = inflate;
exports.inflateRaw = inflateRaw;
exports.ungzip = inflate;
},{"./utils/common":88,"./utils/strings":89,"./zlib/constants":91,"./zlib/gzheader":94,"./zlib/inflate.js":96,"./zlib/messages":98,"./zlib/zstream":100}],88:[function(_dereq_,module,exports){
'use strict';
var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
(typeof Uint16Array !== 'undefined') &&
(typeof Int32Array !== 'undefined');
exports.assign = function (obj /*from1, from2, from3, ...*/) {
var sources = Array.prototype.slice.call(arguments, 1);
while (sources.length) {
var source = sources.shift();
if (!source) { continue; }
if (typeof source !== 'object') {
throw new TypeError(source + 'must be non-object');
}
for (var p in source) {
if (source.hasOwnProperty(p)) {
obj[p] = source[p];
}
}
}
return obj;
};
// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
if (buf.length === size) { return buf; }
if (buf.subarray) { return buf.subarray(0, size); }
buf.length = size;
return buf;
};
var fnTyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
if (src.subarray && dest.subarray) {
dest.set(src.subarray(src_offs, src_offs+len), dest_offs);
return;
}
// Fallback to ordinary array
for (var i=0; i<len; i++) {
dest[dest_offs + i] = src[src_offs + i];
}
},
// Join array of chunks to single array.
flattenChunks: function(chunks) {
var i, l, len, pos, chunk, result;
// calculate data length
len = 0;
for (i=0, l=chunks.length; i<l; i++) {
len += chunks[i].length;
}
// join chunks
result = new Uint8Array(len);
pos = 0;
for (i=0, l=chunks.length; i<l; i++) {
chunk = chunks[i];
result.set(chunk, pos);
pos += chunk.length;
}
return result;
}
};
var fnUntyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
for (var i=0; i<len; i++) {
dest[dest_offs + i] = src[src_offs + i];
}
},
// Join array of chunks to single array.
flattenChunks: function(chunks) {
return [].concat.apply([], chunks);
}
};
// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
if (on) {
exports.Buf8 = Uint8Array;
exports.Buf16 = Uint16Array;
exports.Buf32 = Int32Array;
exports.assign(exports, fnTyped);
} else {
exports.Buf8 = Array;
exports.Buf16 = Array;
exports.Buf32 = Array;
exports.assign(exports, fnUntyped);
}
};
exports.setTyped(TYPED_OK);
},{}],89:[function(_dereq_,module,exports){
// String encode/decode helpers
'use strict';
var utils = _dereq_('./common');
// Quick check if we can use fast array to bin string conversion
//
// - apply(Array) can fail on Android 2.2
// - apply(Uint8Array) can fail on iOS 5.1 Safary
//
var STR_APPLY_OK = true;
var STR_APPLY_UIA_OK = true;
try { String.fromCharCode.apply(null, [0]); } catch(__) { STR_APPLY_OK = false; }
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch(__) { STR_APPLY_UIA_OK = false; }
// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new utils.Buf8(256);
for (var q=0; q<256; q++) {
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
}
_utf8len[254]=_utf8len[254]=1; // Invalid sequence start
// convert string to array (typed, when possible)
exports.string2buf = function (str) {
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
// count binary size
for (m_pos = 0; m_pos < str_len; m_pos++) {
c = str.charCodeAt(m_pos);
if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
c2 = str.charCodeAt(m_pos+1);
if ((c2 & 0xfc00) === 0xdc00) {
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
m_pos++;
}
}
buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
}
// allocate buffer
buf = new utils.Buf8(buf_len);
// convert
for (i=0, m_pos = 0; i < buf_len; m_pos++) {
c = str.charCodeAt(m_pos);
if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
c2 = str.charCodeAt(m_pos+1);
if ((c2 & 0xfc00) === 0xdc00) {
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
m_pos++;
}
}
if (c < 0x80) {
/* one byte */
buf[i++] = c;
} else if (c < 0x800) {
/* two bytes */
buf[i++] = 0xC0 | (c >>> 6);
buf[i++] = 0x80 | (c & 0x3f);
} else if (c < 0x10000) {
/* three bytes */
buf[i++] = 0xE0 | (c >>> 12);
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
buf[i++] = 0x80 | (c & 0x3f);
} else {
/* four bytes */
buf[i++] = 0xf0 | (c >>> 18);
buf[i++] = 0x80 | (c >>> 12 & 0x3f);
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
buf[i++] = 0x80 | (c & 0x3f);
}
}
return buf;
};
// Helper (used in 2 places)
function buf2binstring(buf, len) {
// use fallback for big arrays to avoid stack overflow
if (len < 65537) {
if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
}
}
var result = '';
for (var i=0; i < len; i++) {
result += String.fromCharCode(buf[i]);
}
return result;
}
// Convert byte array to binary string
exports.buf2binstring = function(buf) {
return buf2binstring(buf, buf.length);
};
// Convert binary string (typed, when possible)
exports.binstring2buf = function(str) {
var buf = new utils.Buf8(str.length);
for (var i=0, len=buf.length; i < len; i++) {
buf[i] = str.charCodeAt(i);
}
return buf;
};
// convert array to string
exports.buf2string = function (buf, max) {
var i, out, c, c_len;
var len = max || buf.length;
// Reserve max possible length (2 words per char)
// NB: by unknown reasons, Array is significantly faster for
// String.fromCharCode.apply than Uint16Array.
var utf16buf = new Array(len*2);
for (out=0, i=0; i<len;) {
c = buf[i++];
// quick process ascii
if (c < 0x80) { utf16buf[out++] = c; continue; }
c_len = _utf8len[c];
// skip 5 & 6 byte codes
if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
// apply mask on first byte
c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
// join the rest
while (c_len > 1 && i < len) {
c = (c << 6) | (buf[i++] & 0x3f);
c_len--;
}
// terminated by end of string?
if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
if (c < 0x10000) {
utf16buf[out++] = c;
} else {
c -= 0x10000;
utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
utf16buf[out++] = 0xdc00 | (c & 0x3ff);
}
}
return buf2binstring(utf16buf, out);
};
// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max - length limit (mandatory);
exports.utf8border = function(buf, max) {
var pos;
max = max || buf.length;
if (max > buf.length) { max = buf.length; }
// go back from last position, until start of sequence found
pos = max-1;
while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
// Fuckup - very small and broken sequence,
// return max, because we should return something anyway.
if (pos < 0) { return max; }
// If we came to start of buffer - that means vuffer is too small,
// return max too.
if (pos === 0) { return max; }
return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};
},{"./common":88}],90:[function(_dereq_,module,exports){
'use strict';
// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It doesn't worth to make additional optimizationa as in original.
// Small size is preferable.
function adler32(adler, buf, len, pos) {
var s1 = (adler & 0xffff) |0,
s2 = ((adler >>> 16) & 0xffff) |0,
n = 0;
while (len !== 0) {
// Set limit ~ twice less than 5552, to keep
// s2 in 31-bits, because we force signed ints.
// in other case %= will fail.
n = len > 2000 ? 2000 : len;
len -= n;
do {
s1 = (s1 + buf[pos++]) |0;
s2 = (s2 + s1) |0;
} while (--n);
s1 %= 65521;
s2 %= 65521;
}
return (s1 | (s2 << 16)) |0;
}
module.exports = adler32;
},{}],91:[function(_dereq_,module,exports){
module.exports = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
//Z_MEM_ERROR: -4,
Z_BUF_ERROR: -5,
//Z_VERSION_ERROR: -6,
/* compression levels */
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
/* Possible values of the data_type field (though see inflate()) */
Z_BINARY: 0,
Z_TEXT: 1,
//Z_ASCII: 1, // = Z_TEXT (deprecated)
Z_UNKNOWN: 2,
/* The deflate compression method */
Z_DEFLATED: 8
//Z_NULL: null // Use -1 or null inline, depending on var type
};
},{}],92:[function(_dereq_,module,exports){
'use strict';
// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.
// Use ordinary array, since untyped makes no boost here
function makeTable() {
var c, table = [];
for (var n =0; n < 256; n++) {
c = n;
for (var k =0; k < 8; k++) {
c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
}
table[n] = c;
}
return table;
}
// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();
function crc32(crc, buf, len, pos) {
var t = crcTable,
end = pos + len;
crc = crc ^ (-1);
for (var i = pos; i < end; i++) {
crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
}
return (crc ^ (-1)); // >>> 0;
}
module.exports = crc32;
},{}],93:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
var trees = _dereq_('./trees');
var adler32 = _dereq_('./adler32');
var crc32 = _dereq_('./crc32');
var msg = _dereq_('./messages');
/* Public constants ==========================================================*/
/* ===========================================================================*/
/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
//var Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
//var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
//var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
/* compression levels */
//var Z_NO_COMPRESSION = 0;
//var Z_BEST_SPEED = 1;
//var Z_BEST_COMPRESSION = 9;
var Z_DEFAULT_COMPRESSION = -1;
var Z_FILTERED = 1;
var Z_HUFFMAN_ONLY = 2;
var Z_RLE = 3;
var Z_FIXED = 4;
var Z_DEFAULT_STRATEGY = 0;
/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY = 0;
//var Z_TEXT = 1;
//var Z_ASCII = 1; // = Z_TEXT
var Z_UNKNOWN = 2;
/* The deflate compression method */
var Z_DEFLATED = 8;
/*============================================================================*/
var MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_MEM_LEVEL = 8;
var LENGTH_CODES = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS = 256;
/* number of literal bytes 0..255 */
var L_CODES = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES = 30;
/* number of distance codes */
var BL_CODES = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE = 2*L_CODES + 1;
/* maximum heap size */
var MAX_BITS = 15;
/* All codes must not exceed MAX_BITS bits */
var MIN_MATCH = 3;
var MAX_MATCH = 258;
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
var PRESET_DICT = 0x20;
var INIT_STATE = 42;
var EXTRA_STATE = 69;
var NAME_STATE = 73;
var COMMENT_STATE = 91;
var HCRC_STATE = 103;
var BUSY_STATE = 113;
var FINISH_STATE = 666;
var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
var BS_BLOCK_DONE = 2; /* block flush performed */
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
function err(strm, errorCode) {
strm.msg = msg[errorCode];
return errorCode;
}
function rank(f) {
return ((f) << 1) - ((f) > 4 ? 9 : 0);
}
function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
/* =========================================================================
* Flush as much pending output as possible. All deflate() output goes
* through this function so some applications may wish to modify it
* to avoid allocating a large strm->output buffer and copying into it.
* (See also read_buf()).
*/
function flush_pending(strm) {
var s = strm.state;
//_tr_flush_bits(s);
var len = s.pending;
if (len > strm.avail_out) {
len = strm.avail_out;
}
if (len === 0) { return; }
utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
strm.next_out += len;
s.pending_out += len;
strm.total_out += len;
strm.avail_out -= len;
s.pending -= len;
if (s.pending === 0) {
s.pending_out = 0;
}
}
function flush_block_only (s, last) {
trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
s.block_start = s.strstart;
flush_pending(s.strm);
}
function put_byte(s, b) {
s.pending_buf[s.pending++] = b;
}
/* =========================================================================
* Put a short in the pending buffer. The 16-bit value is put in MSB order.
* IN assertion: the stream state is correct and there is enough room in
* pending_buf.
*/
function putShortMSB(s, b) {
// put_byte(s, (Byte)(b >> 8));
// put_byte(s, (Byte)(b & 0xff));
s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
s.pending_buf[s.pending++] = b & 0xff;
}
/* ===========================================================================
* Read a new buffer from the current input stream, update the adler32
* and total number of bytes read. All deflate() input goes through
* this function so some applications may wish to modify it to avoid
* allocating a large strm->input buffer and copying from it.
* (See also flush_pending()).
*/
function read_buf(strm, buf, start, size) {
var len = strm.avail_in;
if (len > size) { len = size; }
if (len === 0) { return 0; }
strm.avail_in -= len;
utils.arraySet(buf, strm.input, strm.next_in, len, start);
if (strm.state.wrap === 1) {
strm.adler = adler32(strm.adler, buf, len, start);
}
else if (strm.state.wrap === 2) {
strm.adler = crc32(strm.adler, buf, len, start);
}
strm.next_in += len;
strm.total_in += len;
return len;
}
/* ===========================================================================
* Set match_start to the longest match starting at the given string and
* return its length. Matches shorter or equal to prev_length are discarded,
* in which case the result is equal to prev_length and match_start is
* garbage.
* IN assertions: cur_match is the head of the hash chain for the current
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
* OUT assertion: the match length is not greater than s->lookahead.
*/
function longest_match(s, cur_match) {
var chain_length = s.max_chain_length; /* max hash chain length */
var scan = s.strstart; /* current string */
var match; /* matched string */
var len; /* length of current match */
var best_len = s.prev_length; /* best match length so far */
var nice_match = s.nice_match; /* stop if match long enough */
var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
var _win = s.window; // shortcut
var wmask = s.w_mask;
var prev = s.prev;
/* Stop when cur_match becomes <= limit. To simplify the code,
* we prevent matches with the string of window index 0.
*/
var strend = s.strstart + MAX_MATCH;
var scan_end1 = _win[scan + best_len - 1];
var scan_end = _win[scan + best_len];
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
* It is easy to get rid of this optimization if necessary.
*/
// Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
/* Do not waste too much time if we already have a good match: */
if (s.prev_length >= s.good_match) {
chain_length >>= 2;
}
/* Do not look for matches beyond the end of the input. This is necessary
* to make deflate deterministic.
*/
if (nice_match > s.lookahead) { nice_match = s.lookahead; }
// Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
do {
// Assert(cur_match < s->strstart, "no future");
match = cur_match;
/* Skip to next match if the match length cannot increase
* or if the match length is less than 2. Note that the checks below
* for insufficient lookahead only occur occasionally for performance
* reasons. Therefore uninitialized memory will be accessed, and
* conditional jumps will be made that depend on those values.
* However the length of the match is limited to the lookahead, so
* the output of deflate is not affected by the uninitialized values.
*/
if (_win[match + best_len] !== scan_end ||
_win[match + best_len - 1] !== scan_end1 ||
_win[match] !== _win[scan] ||
_win[++match] !== _win[scan + 1]) {
continue;
}
/* The check at best_len-1 can be removed because it will be made
* again later. (This heuristic is not always a win.)
* It is not necessary to compare scan[2] and match[2] since they
* are always equal when the other bytes match, given that
* the hash keys are equal and that HASH_BITS >= 8.
*/
scan += 2;
match++;
// Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
* the 256th check will be made at strstart+258.
*/
do {
/*jshint noempty:false*/
} while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
scan < strend);
// Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
len = MAX_MATCH - (strend - scan);
scan = strend - MAX_MATCH;
if (len > best_len) {
s.match_start = cur_match;
best_len = len;
if (len >= nice_match) {
break;
}
scan_end1 = _win[scan + best_len - 1];
scan_end = _win[scan + best_len];
}
} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
if (best_len <= s.lookahead) {
return best_len;
}
return s.lookahead;
}
/* ===========================================================================
* Fill the window when the lookahead becomes insufficient.
* Updates strstart and lookahead.
*
* IN assertion: lookahead < MIN_LOOKAHEAD
* OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
* At least one byte has been read, or avail_in == 0; reads are
* performed for at least two bytes (required for the zip translate_eol
* option -- not supported here).
*/
function fill_window(s) {
var _w_size = s.w_size;
var p, n, m, more, str;
//Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
do {
more = s.window_size - s.lookahead - s.strstart;
// JS ints have 32 bit, block below not needed
/* Deal with !@#$% 64K limit: */
//if (sizeof(int) <= 2) {
// if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
// more = wsize;
//
// } else if (more == (unsigned)(-1)) {
// /* Very unlikely, but possible on 16 bit machine if
// * strstart == 0 && lookahead == 1 (input done a byte at time)
// */
// more--;
// }
//}
/* If the window is almost full and there is insufficient lookahead,
* move the upper half to the lower one to make room in the upper half.
*/
if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
s.match_start -= _w_size;
s.strstart -= _w_size;
/* we now have strstart >= MAX_DIST */
s.block_start -= _w_size;
/* Slide the hash table (could be avoided with 32 bit values
at the expense of memory usage). We slide even when level == 0
to keep the hash table consistent if we switch back to level > 0
later. (Using level 0 permanently is not an optimal usage of
zlib, so we don't care about this pathological case.)
*/
n = s.hash_size;
p = n;
do {
m = s.head[--p];
s.head[p] = (m >= _w_size ? m - _w_size : 0);
} while (--n);
n = _w_size;
p = n;
do {
m = s.prev[--p];
s.prev[p] = (m >= _w_size ? m - _w_size : 0);
/* If n is not on any hash chain, prev[n] is garbage but
* its value will never be used.
*/
} while (--n);
more += _w_size;
}
if (s.strm.avail_in === 0) {
break;
}
/* If there was no sliding:
* strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
* more == window_size - lookahead - strstart
* => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
* => more >= window_size - 2*WSIZE + 2
* In the BIG_MEM or MMAP case (not yet supported),
* window_size == input_size + MIN_LOOKAHEAD &&
* strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
* Otherwise, window_size == 2*WSIZE so more >= 2.
* If there was sliding, more >= WSIZE. So in all cases, more >= 2.
*/
//Assert(more >= 2, "more < 2");
n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
s.lookahead += n;
/* Initialize the hash value now that we have some input: */
if (s.lookahead + s.insert >= MIN_MATCH) {
str = s.strstart - s.insert;
s.ins_h = s.window[str];
/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
// Call update_hash() MIN_MATCH-3 more times
//#endif
while (s.insert) {
/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask;
s.prev[str & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = str;
str++;
s.insert--;
if (s.lookahead + s.insert < MIN_MATCH) {
break;
}
}
}
/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
* but this is not important since only literal bytes will be emitted.
*/
} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
/* If the WIN_INIT bytes after the end of the current data have never been
* written, then zero those bytes in order to avoid memory check reports of
* the use of uninitialized (or uninitialised as Julian writes) bytes by
* the longest match routines. Update the high water mark for the next
* time through here. WIN_INIT is set to MAX_MATCH since the longest match
* routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
*/
// if (s.high_water < s.window_size) {
// var curr = s.strstart + s.lookahead;
// var init = 0;
//
// if (s.high_water < curr) {
// /* Previous high water mark below current data -- zero WIN_INIT
// * bytes or up to end of window, whichever is less.
// */
// init = s.window_size - curr;
// if (init > WIN_INIT)
// init = WIN_INIT;
// zmemzero(s->window + curr, (unsigned)init);
// s->high_water = curr + init;
// }
// else if (s->high_water < (ulg)curr + WIN_INIT) {
// /* High water mark at or above current data, but below current data
// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
// * to end of window, whichever is less.
// */
// init = (ulg)curr + WIN_INIT - s->high_water;
// if (init > s->window_size - s->high_water)
// init = s->window_size - s->high_water;
// zmemzero(s->window + s->high_water, (unsigned)init);
// s->high_water += init;
// }
// }
//
// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
// "not enough room for search");
}
/* ===========================================================================
* Copy without compression as much as possible from the input stream, return
* the current block state.
* This function does not insert new strings in the dictionary since
* uncompressible data is probably not useful. This function is used
* only for the level=0 compression option.
* NOTE: this function should be optimized to avoid extra copying from
* window to pending_buf.
*/
function deflate_stored(s, flush) {
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
* to pending_buf_size, and each stored block has a 5 byte header:
*/
var max_block_size = 0xffff;
if (max_block_size > s.pending_buf_size - 5) {
max_block_size = s.pending_buf_size - 5;
}
/* Copy as much as possible from input to output: */
for (;;) {
/* Fill the window as much as possible: */
if (s.lookahead <= 1) {
//Assert(s->strstart < s->w_size+MAX_DIST(s) ||
// s->block_start >= (long)s->w_size, "slide too late");
// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
// s.block_start >= s.w_size)) {
// throw new Error("slide too late");
// }
fill_window(s);
if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) {
break;
}
/* flush the current block */
}
//Assert(s->block_start >= 0L, "block gone");
// if (s.block_start < 0) throw new Error("block gone");
s.strstart += s.lookahead;
s.lookahead = 0;
/* Emit a stored block if pending_buf will be full: */
var max_start = s.block_start + max_block_size;
if (s.strstart === 0 || s.strstart >= max_start) {
/* strstart == 0 is possible when wraparound on 16-bit machine */
s.lookahead = s.strstart - max_start;
s.strstart = max_start;
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
/* Flush if we may have to slide, otherwise block_start may become
* negative and the data will be gone:
*/
if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = 0;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.strstart > s.block_start) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_NEED_MORE;
}
/* ===========================================================================
* Compress as much as possible from the input stream, return the current
* block state.
* This function does not perform lazy evaluation of matches and inserts
* new strings in the dictionary only for unmatched strings or for short
* matches. It is used only for the fast compression options.
*/
function deflate_fast(s, flush) {
var hash_head; /* head of the hash chain */
var bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
* for the next match, plus MIN_MATCH bytes to insert the
* string following the next match.
*/
if (s.lookahead < MIN_LOOKAHEAD) {
fill_window(s);
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) {
break; /* flush the current block */
}
}
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = 0/*NIL*/;
if (s.lookahead >= MIN_MATCH) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
}
/* Find the longest match, discarding those <= prev_length.
* At this point we have always match_length < MIN_MATCH
*/
if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
s.match_length = longest_match(s, hash_head);
/* longest_match() sets match_start */
}
if (s.match_length >= MIN_MATCH) {
// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
/*** _tr_tally_dist(s, s.strstart - s.match_start,
s.match_length - MIN_MATCH, bflush); ***/
bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
s.lookahead -= s.match_length;
/* Insert new strings in the hash table only if the match length
* is not too large. This saves time but degrades compression.
*/
if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
s.match_length--; /* string at strstart already in table */
do {
s.strstart++;
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
/* strstart never exceeds WSIZE-MAX_MATCH, so there are
* always MIN_MATCH bytes ahead.
*/
} while (--s.match_length !== 0);
s.strstart++;
} else
{
s.strstart += s.match_length;
s.match_length = 0;
s.ins_h = s.window[s.strstart];
/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
// Call UPDATE_HASH() MIN_MATCH-3 more times
//#endif
/* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
* matter since it will be recomputed at next deflate call.
*/
}
} else {
/* No match, output a literal byte */
//Tracevv((stderr,"%c", s.window[s.strstart]));
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
}
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* ===========================================================================
* Same as above, but achieves better compression. We use a lazy
* evaluation for matches: a match is finally adopted only if there is
* no better match at the next window position.
*/
function deflate_slow(s, flush) {
var hash_head; /* head of hash chain */
var bflush; /* set if current block must be flushed */
var max_insert;
/* Process the input block. */
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
* for the next match, plus MIN_MATCH bytes to insert the
* string following the next match.
*/
if (s.lookahead < MIN_LOOKAHEAD) {
fill_window(s);
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) { break; } /* flush the current block */
}
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = 0/*NIL*/;
if (s.lookahead >= MIN_MATCH) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
}
/* Find the longest match, discarding those <= prev_length.
*/
s.prev_length = s.match_length;
s.prev_match = s.match_start;
s.match_length = MIN_MATCH-1;
if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
s.match_length = longest_match(s, hash_head);
/* longest_match() sets match_start */
if (s.match_length <= 5 &&
(s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
/* If prev_match is also MIN_MATCH, match_start is garbage
* but we will ignore the current match anyway.
*/
s.match_length = MIN_MATCH-1;
}
}
/* If there was a match at the previous step and the current
* match is not better, output the previous match:
*/
if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
max_insert = s.strstart + s.lookahead - MIN_MATCH;
/* Do not insert strings in hash table beyond this. */
//check_match(s, s.strstart-1, s.prev_match, s.prev_length);
/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
s.prev_length - MIN_MATCH, bflush);***/
bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);
/* Insert in hash table all strings up to the end of the match.
* strstart-1 and strstart are already inserted. If there is not
* enough lookahead, the last two strings are not inserted in
* the hash table.
*/
s.lookahead -= s.prev_length-1;
s.prev_length -= 2;
do {
if (++s.strstart <= max_insert) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
}
} while (--s.prev_length !== 0);
s.match_available = 0;
s.match_length = MIN_MATCH-1;
s.strstart++;
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
} else if (s.match_available) {
/* If there was no match at the previous position, output a
* single literal. If there was a match but the current match
* is longer, truncate the previous match to a single literal.
*/
//Tracevv((stderr,"%c", s->window[s->strstart-1]));
/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
if (bflush) {
/*** FLUSH_BLOCK_ONLY(s, 0) ***/
flush_block_only(s, false);
/***/
}
s.strstart++;
s.lookahead--;
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
} else {
/* There is no previous match to compare with, wait for
* the next step to decide.
*/
s.match_available = 1;
s.strstart++;
s.lookahead--;
}
}
//Assert (flush != Z_NO_FLUSH, "no flush?");
if (s.match_available) {
//Tracevv((stderr,"%c", s->window[s->strstart-1]));
/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
s.match_available = 0;
}
s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* ===========================================================================
* For Z_RLE, simply look for runs of bytes, generate matches only of distance
* one. Do not maintain a hash table. (It will be regenerated if this run of
* deflate switches away from Z_RLE.)
*/
function deflate_rle(s, flush) {
var bflush; /* set if current block must be flushed */
var prev; /* byte at distance one to match */
var scan, strend; /* scan goes up to strend for length of run */
var _win = s.window;
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
* for the longest run, plus one for the unrolled loop.
*/
if (s.lookahead <= MAX_MATCH) {
fill_window(s);
if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) { break; } /* flush the current block */
}
/* See how many times the previous byte repeats */
s.match_length = 0;
if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
scan = s.strstart - 1;
prev = _win[scan];
if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
strend = s.strstart + MAX_MATCH;
do {
/*jshint noempty:false*/
} while (prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
scan < strend);
s.match_length = MAX_MATCH - (strend - scan);
if (s.match_length > s.lookahead) {
s.match_length = s.lookahead;
}
}
//Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
if (s.match_length >= MIN_MATCH) {
//check_match(s, s.strstart, s.strstart - 1, s.match_length);
/*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
s.lookahead -= s.match_length;
s.strstart += s.match_length;
s.match_length = 0;
} else {
/* No match, output a literal byte */
//Tracevv((stderr,"%c", s->window[s->strstart]));
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
}
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = 0;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* ===========================================================================
* For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
* (It will be regenerated if this run of deflate switches away from Huffman.)
*/
function deflate_huff(s, flush) {
var bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
if (s.lookahead === 0) {
fill_window(s);
if (s.lookahead === 0) {
if (flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
break; /* flush the current block */
}
}
/* Output a literal byte */
s.match_length = 0;
//Tracevv((stderr,"%c", s->window[s->strstart]));
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = 0;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* Values for max_lazy_match, good_match and max_chain_length, depending on
* the desired pack level (0..9). The values given below have been tuned to
* exclude worst case performance for pathological files. Better values may be
* found for specific files.
*/
var Config = function (good_length, max_lazy, nice_length, max_chain, func) {
this.good_length = good_length;
this.max_lazy = max_lazy;
this.nice_length = nice_length;
this.max_chain = max_chain;
this.func = func;
};
var configuration_table;
configuration_table = [
/* good lazy nice chain */
new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
new Config(4, 5, 16, 8, deflate_fast), /* 2 */
new Config(4, 6, 32, 32, deflate_fast), /* 3 */
new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
new Config(8, 16, 32, 32, deflate_slow), /* 5 */
new Config(8, 16, 128, 128, deflate_slow), /* 6 */
new Config(8, 32, 128, 256, deflate_slow), /* 7 */
new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
];
/* ===========================================================================
* Initialize the "longest match" routines for a new zlib stream
*/
function lm_init(s) {
s.window_size = 2 * s.w_size;
/*** CLEAR_HASH(s); ***/
zero(s.head); // Fill with NIL (= 0);
/* Set the default configuration parameters:
*/
s.max_lazy_match = configuration_table[s.level].max_lazy;
s.good_match = configuration_table[s.level].good_length;
s.nice_match = configuration_table[s.level].nice_length;
s.max_chain_length = configuration_table[s.level].max_chain;
s.strstart = 0;
s.block_start = 0;
s.lookahead = 0;
s.insert = 0;
s.match_length = s.prev_length = MIN_MATCH - 1;
s.match_available = 0;
s.ins_h = 0;
}
function DeflateState() {
this.strm = null; /* pointer back to this zlib stream */
this.status = 0; /* as the name implies */
this.pending_buf = null; /* output still pending */
this.pending_buf_size = 0; /* size of pending_buf */
this.pending_out = 0; /* next pending byte to output to the stream */
this.pending = 0; /* nb of bytes in the pending buffer */
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
this.gzhead = null; /* gzip header information to write */
this.gzindex = 0; /* where in extra, name, or comment */
this.method = Z_DEFLATED; /* can only be DEFLATED */
this.last_flush = -1; /* value of flush param for previous deflate call */
this.w_size = 0; /* LZ77 window size (32K by default) */
this.w_bits = 0; /* log2(w_size) (8..16) */
this.w_mask = 0; /* w_size - 1 */
this.window = null;
/* Sliding window. Input bytes are read into the second half of the window,
* and move to the first half later to keep a dictionary of at least wSize
* bytes. With this organization, matches are limited to a distance of
* wSize-MAX_MATCH bytes, but this ensures that IO is always
* performed with a length multiple of the block size.
*/
this.window_size = 0;
/* Actual size of window: 2*wSize, except when the user input buffer
* is directly used as sliding window.
*/
this.prev = null;
/* Link to older string with same hash index. To limit the size of this
* array to 64K, this link is maintained only for the last 32K strings.
* An index in this array is thus a window index modulo 32K.
*/
this.head = null; /* Heads of the hash chains or NIL. */
this.ins_h = 0; /* hash index of string to be inserted */
this.hash_size = 0; /* number of elements in hash table */
this.hash_bits = 0; /* log2(hash_size) */
this.hash_mask = 0; /* hash_size-1 */
this.hash_shift = 0;
/* Number of bits by which ins_h must be shifted at each input
* step. It must be such that after MIN_MATCH steps, the oldest
* byte no longer takes part in the hash key, that is:
* hash_shift * MIN_MATCH >= hash_bits
*/
this.block_start = 0;
/* Window position at the beginning of the current output block. Gets
* negative when the window is moved backwards.
*/
this.match_length = 0; /* length of best match */
this.prev_match = 0; /* previous match */
this.match_available = 0; /* set if previous match exists */
this.strstart = 0; /* start of string to insert */
this.match_start = 0; /* start of matching string */
this.lookahead = 0; /* number of valid bytes ahead in window */
this.prev_length = 0;
/* Length of the best match at previous step. Matches not greater than this
* are discarded. This is used in the lazy match evaluation.
*/
this.max_chain_length = 0;
/* To speed up deflation, hash chains are never searched beyond this
* length. A higher limit improves compression ratio but degrades the
* speed.
*/
this.max_lazy_match = 0;
/* Attempt to find a better match only when the current match is strictly
* smaller than this value. This mechanism is used only for compression
* levels >= 4.
*/
// That's alias to max_lazy_match, don't use directly
//this.max_insert_length = 0;
/* Insert new strings in the hash table only if the match length is not
* greater than this length. This saves time but degrades compression.
* max_insert_length is used only for compression levels <= 3.
*/
this.level = 0; /* compression level (1..9) */
this.strategy = 0; /* favor or force Huffman coding*/
this.good_match = 0;
/* Use a faster search when the previous match is longer than this */
this.nice_match = 0; /* Stop searching when current match exceeds this */
/* used by trees.c: */
/* Didn't use ct_data typedef below to suppress compiler warning */
// struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
// struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
// struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
// Use flat array of DOUBLE size, with interleaved fata,
// because JS does not support effective
this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
this.dyn_dtree = new utils.Buf16((2*D_CODES+1) * 2);
this.bl_tree = new utils.Buf16((2*BL_CODES+1) * 2);
zero(this.dyn_ltree);
zero(this.dyn_dtree);
zero(this.bl_tree);
this.l_desc = null; /* desc. for literal tree */
this.d_desc = null; /* desc. for distance tree */
this.bl_desc = null; /* desc. for bit length tree */
//ush bl_count[MAX_BITS+1];
this.bl_count = new utils.Buf16(MAX_BITS+1);
/* number of codes at each bit length for an optimal tree */
//int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
this.heap = new utils.Buf16(2*L_CODES+1); /* heap used to build the Huffman trees */
zero(this.heap);
this.heap_len = 0; /* number of elements in the heap */
this.heap_max = 0; /* element of largest frequency */
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
* The same heap array is used to build all trees.
*/
this.depth = new utils.Buf16(2*L_CODES+1); //uch depth[2*L_CODES+1];
zero(this.depth);
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
this.l_buf = 0; /* buffer index for literals or lengths */
this.lit_bufsize = 0;
/* Size of match buffer for literals/lengths. There are 4 reasons for
* limiting lit_bufsize to 64K:
* - frequencies can be kept in 16 bit counters
* - if compression is not successful for the first block, all input
* data is still in the window so we can still emit a stored block even
* when input comes from standard input. (This can also be done for
* all blocks if lit_bufsize is not greater than 32K.)
* - if compression is not successful for a file smaller than 64K, we can
* even emit a stored file instead of a stored block (saving 5 bytes).
* This is applicable only for zip (not gzip or zlib).
* - creating new Huffman trees less frequently may not provide fast
* adaptation to changes in the input data statistics. (Take for
* example a binary file with poorly compressible code followed by
* a highly compressible string table.) Smaller buffer sizes give
* fast adaptation but have of course the overhead of transmitting
* trees more frequently.
* - I can't count above 4
*/
this.last_lit = 0; /* running index in l_buf */
this.d_buf = 0;
/* Buffer index for distances. To simplify the code, d_buf and l_buf have
* the same number of elements. To use different lengths, an extra flag
* array would be necessary.
*/
this.opt_len = 0; /* bit length of current block with optimal trees */
this.static_len = 0; /* bit length of current block with static trees */
this.matches = 0; /* number of string matches in current block */
this.insert = 0; /* bytes at end of window left to insert */
this.bi_buf = 0;
/* Output buffer. bits are inserted starting at the bottom (least
* significant bits).
*/
this.bi_valid = 0;
/* Number of valid bits in bi_buf. All bits above the last valid bit
* are always zero.
*/
// Used for window memory init. We safely ignore it for JS. That makes
// sense only for pointers and memory check tools.
//this.high_water = 0;
/* High water mark offset in window for initialized bytes -- bytes above
* this are set to zero in order to avoid memory check warnings when
* longest match routines access bytes past the input. This is then
* updated to the new high water mark.
*/
}
function deflateResetKeep(strm) {
var s;
if (!strm || !strm.state) {
return err(strm, Z_STREAM_ERROR);
}
strm.total_in = strm.total_out = 0;
strm.data_type = Z_UNKNOWN;
s = strm.state;
s.pending = 0;
s.pending_out = 0;
if (s.wrap < 0) {
s.wrap = -s.wrap;
/* was made negative by deflate(..., Z_FINISH); */
}
s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
strm.adler = (s.wrap === 2) ?
0 // crc32(0, Z_NULL, 0)
:
1; // adler32(0, Z_NULL, 0)
s.last_flush = Z_NO_FLUSH;
trees._tr_init(s);
return Z_OK;
}
function deflateReset(strm) {
var ret = deflateResetKeep(strm);
if (ret === Z_OK) {
lm_init(strm.state);
}
return ret;
}
function deflateSetHeader(strm, head) {
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
strm.state.gzhead = head;
return Z_OK;
}
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
if (!strm) { // === Z_NULL
return Z_STREAM_ERROR;
}
var wrap = 1;
if (level === Z_DEFAULT_COMPRESSION) {
level = 6;
}
if (windowBits < 0) { /* suppress zlib wrapper */
wrap = 0;
windowBits = -windowBits;
}
else if (windowBits > 15) {
wrap = 2; /* write gzip wrapper instead */
windowBits -= 16;
}
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
strategy < 0 || strategy > Z_FIXED) {
return err(strm, Z_STREAM_ERROR);
}
if (windowBits === 8) {
windowBits = 9;
}
/* until 256-byte window bug fixed */
var s = new DeflateState();
strm.state = s;
s.strm = strm;
s.wrap = wrap;
s.gzhead = null;
s.w_bits = windowBits;
s.w_size = 1 << s.w_bits;
s.w_mask = s.w_size - 1;
s.hash_bits = memLevel + 7;
s.hash_size = 1 << s.hash_bits;
s.hash_mask = s.hash_size - 1;
s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
s.window = new utils.Buf8(s.w_size * 2);
s.head = new utils.Buf16(s.hash_size);
s.prev = new utils.Buf16(s.w_size);
// Don't need mem init magic for JS.
//s.high_water = 0; /* nothing written to s->window yet */
s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
s.pending_buf_size = s.lit_bufsize * 4;
s.pending_buf = new utils.Buf8(s.pending_buf_size);
s.d_buf = s.lit_bufsize >> 1;
s.l_buf = (1 + 2) * s.lit_bufsize;
s.level = level;
s.strategy = strategy;
s.method = method;
return deflateReset(strm);
}
function deflateInit(strm, level) {
return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}
function deflate(strm, flush) {
var old_flush, s;
var beg, val; // for gzip header write only
if (!strm || !strm.state ||
flush > Z_BLOCK || flush < 0) {
return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
}
s = strm.state;
if (!strm.output ||
(!strm.input && strm.avail_in !== 0) ||
(s.status === FINISH_STATE && flush !== Z_FINISH)) {
return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
}
s.strm = strm; /* just in case */
old_flush = s.last_flush;
s.last_flush = flush;
/* Write the header */
if (s.status === INIT_STATE) {
if (s.wrap === 2) { // GZIP header
strm.adler = 0; //crc32(0L, Z_NULL, 0);
put_byte(s, 31);
put_byte(s, 139);
put_byte(s, 8);
if (!s.gzhead) { // s->gzhead == Z_NULL
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, s.level === 9 ? 2 :
(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
4 : 0));
put_byte(s, OS_CODE);
s.status = BUSY_STATE;
}
else {
put_byte(s, (s.gzhead.text ? 1 : 0) +
(s.gzhead.hcrc ? 2 : 0) +
(!s.gzhead.extra ? 0 : 4) +
(!s.gzhead.name ? 0 : 8) +
(!s.gzhead.comment ? 0 : 16)
);
put_byte(s, s.gzhead.time & 0xff);
put_byte(s, (s.gzhead.time >> 8) & 0xff);
put_byte(s, (s.gzhead.time >> 16) & 0xff);
put_byte(s, (s.gzhead.time >> 24) & 0xff);
put_byte(s, s.level === 9 ? 2 :
(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
4 : 0));
put_byte(s, s.gzhead.os & 0xff);
if (s.gzhead.extra && s.gzhead.extra.length) {
put_byte(s, s.gzhead.extra.length & 0xff);
put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
}
if (s.gzhead.hcrc) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
}
s.gzindex = 0;
s.status = EXTRA_STATE;
}
}
else // DEFLATE header
{
var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
var level_flags = -1;
if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
level_flags = 0;
} else if (s.level < 6) {
level_flags = 1;
} else if (s.level === 6) {
level_flags = 2;
} else {
level_flags = 3;
}
header |= (level_flags << 6);
if (s.strstart !== 0) { header |= PRESET_DICT; }
header += 31 - (header % 31);
s.status = BUSY_STATE;
putShortMSB(s, header);
/* Save the adler32 of the preset dictionary: */
if (s.strstart !== 0) {
putShortMSB(s, strm.adler >>> 16);
putShortMSB(s, strm.adler & 0xffff);
}
strm.adler = 1; // adler32(0L, Z_NULL, 0);
}
}
//#ifdef GZIP
if (s.status === EXTRA_STATE) {
if (s.gzhead.extra/* != Z_NULL*/) {
beg = s.pending; /* start of bytes to update crc */
while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
if (s.pending === s.pending_buf_size) {
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
flush_pending(strm);
beg = s.pending;
if (s.pending === s.pending_buf_size) {
break;
}
}
put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
s.gzindex++;
}
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
if (s.gzindex === s.gzhead.extra.length) {
s.gzindex = 0;
s.status = NAME_STATE;
}
}
else {
s.status = NAME_STATE;
}
}
if (s.status === NAME_STATE) {
if (s.gzhead.name/* != Z_NULL*/) {
beg = s.pending; /* start of bytes to update crc */
//int val;
do {
if (s.pending === s.pending_buf_size) {
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
flush_pending(strm);
beg = s.pending;
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
}
// JS specific: little magic to add zero terminator to end of string
if (s.gzindex < s.gzhead.name.length) {
val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
} else {
val = 0;
}
put_byte(s, val);
} while (val !== 0);
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
if (val === 0) {
s.gzindex = 0;
s.status = COMMENT_STATE;
}
}
else {
s.status = COMMENT_STATE;
}
}
if (s.status === COMMENT_STATE) {
if (s.gzhead.comment/* != Z_NULL*/) {
beg = s.pending; /* start of bytes to update crc */
//int val;
do {
if (s.pending === s.pending_buf_size) {
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
flush_pending(strm);
beg = s.pending;
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
}
// JS specific: little magic to add zero terminator to end of string
if (s.gzindex < s.gzhead.comment.length) {
val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
} else {
val = 0;
}
put_byte(s, val);
} while (val !== 0);
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
if (val === 0) {
s.status = HCRC_STATE;
}
}
else {
s.status = HCRC_STATE;
}
}
if (s.status === HCRC_STATE) {
if (s.gzhead.hcrc) {
if (s.pending + 2 > s.pending_buf_size) {
flush_pending(strm);
}
if (s.pending + 2 <= s.pending_buf_size) {
put_byte(s, strm.adler & 0xff);
put_byte(s, (strm.adler >> 8) & 0xff);
strm.adler = 0; //crc32(0L, Z_NULL, 0);
s.status = BUSY_STATE;
}
}
else {
s.status = BUSY_STATE;
}
}
//#endif
/* Flush as much pending output as possible */
if (s.pending !== 0) {
flush_pending(strm);
if (strm.avail_out === 0) {
/* Since avail_out is 0, deflate will be called again with
* more output space, but possibly with both pending and
* avail_in equal to zero. There won't be anything to do,
* but this is not an error situation so make sure we
* return OK instead of BUF_ERROR at next call of deflate:
*/
s.last_flush = -1;
return Z_OK;
}
/* Make sure there is something to do and avoid duplicate consecutive
* flushes. For repeated and useless calls with Z_FINISH, we keep
* returning Z_STREAM_END instead of Z_BUF_ERROR.
*/
} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
flush !== Z_FINISH) {
return err(strm, Z_BUF_ERROR);
}
/* User must not provide more input after the first FINISH: */
if (s.status === FINISH_STATE && strm.avail_in !== 0) {
return err(strm, Z_BUF_ERROR);
}
/* Start a new block or continue the current one.
*/
if (strm.avail_in !== 0 || s.lookahead !== 0 ||
(flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
(s.strategy === Z_RLE ? deflate_rle(s, flush) :
configuration_table[s.level].func(s, flush));
if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
s.status = FINISH_STATE;
}
if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
if (strm.avail_out === 0) {
s.last_flush = -1;
/* avoid BUF_ERROR next call, see above */
}
return Z_OK;
/* If flush != Z_NO_FLUSH && avail_out == 0, the next call
* of deflate should use the same flush parameter to make sure
* that the flush is complete. So we don't have to output an
* empty block here, this will be done at next call. This also
* ensures that for a very small output buffer, we emit at most
* one empty block.
*/
}
if (bstate === BS_BLOCK_DONE) {
if (flush === Z_PARTIAL_FLUSH) {
trees._tr_align(s);
}
else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
trees._tr_stored_block(s, 0, 0, false);
/* For a full flush, this empty block will be recognized
* as a special marker by inflate_sync().
*/
if (flush === Z_FULL_FLUSH) {
/*** CLEAR_HASH(s); ***/ /* forget history */
zero(s.head); // Fill with NIL (= 0);
if (s.lookahead === 0) {
s.strstart = 0;
s.block_start = 0;
s.insert = 0;
}
}
}
flush_pending(strm);
if (strm.avail_out === 0) {
s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
return Z_OK;
}
}
}
//Assert(strm->avail_out > 0, "bug2");
//if (strm.avail_out <= 0) { throw new Error("bug2");}
if (flush !== Z_FINISH) { return Z_OK; }
if (s.wrap <= 0) { return Z_STREAM_END; }
/* Write the trailer */
if (s.wrap === 2) {
put_byte(s, strm.adler & 0xff);
put_byte(s, (strm.adler >> 8) & 0xff);
put_byte(s, (strm.adler >> 16) & 0xff);
put_byte(s, (strm.adler >> 24) & 0xff);
put_byte(s, strm.total_in & 0xff);
put_byte(s, (strm.total_in >> 8) & 0xff);
put_byte(s, (strm.total_in >> 16) & 0xff);
put_byte(s, (strm.total_in >> 24) & 0xff);
}
else
{
putShortMSB(s, strm.adler >>> 16);
putShortMSB(s, strm.adler & 0xffff);
}
flush_pending(strm);
/* If avail_out is zero, the application will call deflate again
* to flush the rest.
*/
if (s.wrap > 0) { s.wrap = -s.wrap; }
/* write the trailer only once! */
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
}
function deflateEnd(strm) {
var status;
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
return Z_STREAM_ERROR;
}
status = strm.state.status;
if (status !== INIT_STATE &&
status !== EXTRA_STATE &&
status !== NAME_STATE &&
status !== COMMENT_STATE &&
status !== HCRC_STATE &&
status !== BUSY_STATE &&
status !== FINISH_STATE
) {
return err(strm, Z_STREAM_ERROR);
}
strm.state = null;
return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
}
/* =========================================================================
* Copy the source state to the destination state
*/
//function deflateCopy(dest, source) {
//
//}
exports.deflateInit = deflateInit;
exports.deflateInit2 = deflateInit2;
exports.deflateReset = deflateReset;
exports.deflateResetKeep = deflateResetKeep;
exports.deflateSetHeader = deflateSetHeader;
exports.deflate = deflate;
exports.deflateEnd = deflateEnd;
exports.deflateInfo = 'pako deflate (from Nodeca project)';
/* Not implemented
exports.deflateBound = deflateBound;
exports.deflateCopy = deflateCopy;
exports.deflateSetDictionary = deflateSetDictionary;
exports.deflateParams = deflateParams;
exports.deflatePending = deflatePending;
exports.deflatePrime = deflatePrime;
exports.deflateTune = deflateTune;
*/
},{"../utils/common":88,"./adler32":90,"./crc32":92,"./messages":98,"./trees":99}],94:[function(_dereq_,module,exports){
'use strict';
function GZheader() {
/* true if compressed data believed to be text */
this.text = 0;
/* modification time */
this.time = 0;
/* extra flags (not used when writing a gzip file) */
this.xflags = 0;
/* operating system */
this.os = 0;
/* pointer to extra field or Z_NULL if none */
this.extra = null;
/* extra field length (valid if extra != Z_NULL) */
this.extra_len = 0; // Actually, we don't need it in JS,
// but leave for few code modifications
//
// Setup limits is not necessary because in js we should not preallocate memory
// for inflate use constant limit in 65536 bytes
//
/* space at extra (only when reading header) */
// this.extra_max = 0;
/* pointer to zero-terminated file name or Z_NULL */
this.name = '';
/* space at name (only when reading header) */
// this.name_max = 0;
/* pointer to zero-terminated comment or Z_NULL */
this.comment = '';
/* space at comment (only when reading header) */
// this.comm_max = 0;
/* true if there was or will be a header crc */
this.hcrc = 0;
/* true when done reading gzip header (not used when writing a gzip file) */
this.done = false;
}
module.exports = GZheader;
},{}],95:[function(_dereq_,module,exports){
'use strict';
// See state defs from inflate.js
var BAD = 30; /* got a data error -- remain here until reset */
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
inflate execution time is spent in this routine.
Entry assumptions:
state.mode === LEN
strm.avail_in >= 6
strm.avail_out >= 258
start >= strm.avail_out
state.bits < 8
On return, state.mode is one of:
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
BAD -- error in block data
Notes:
- The maximum input bits used by a length/distance pair is 15 bits for the
length code, 5 bits for the length extra, 15 bits for the distance code,
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
Therefore if strm.avail_in >= 6, then there is enough input to avoid
checking for available input while decoding.
- The maximum bytes that a single length/distance pair can output is 258
bytes, which is the maximum length that can be coded. inflate_fast()
requires strm.avail_out >= 258 for each loop to avoid checking for
output space.
*/
module.exports = function inflate_fast(strm, start) {
var state;
var _in; /* local strm.input */
var last; /* have enough input while in < last */
var _out; /* local strm.output */
var beg; /* inflate()'s initial strm.output */
var end; /* while out < end, enough space available */
//#ifdef INFLATE_STRICT
var dmax; /* maximum distance from zlib header */
//#endif
var wsize; /* window size or zero if not using window */
var whave; /* valid bytes in the window */
var wnext; /* window write index */
// Use `s_window` instead `window`, avoid conflict with instrumentation tools
var s_window; /* allocated sliding window, if wsize != 0 */
var hold; /* local strm.hold */
var bits; /* local strm.bits */
var lcode; /* local strm.lencode */
var dcode; /* local strm.distcode */
var lmask; /* mask for first level of length codes */
var dmask; /* mask for first level of distance codes */
var here; /* retrieved table entry */
var op; /* code bits, operation, extra bits, or */
/* window position, window bytes to copy */
var len; /* match length, unused bytes */
var dist; /* match distance */
var from; /* where to copy match from */
var from_source;
var input, output; // JS specific, because we have no pointers
/* copy state to local variables */
state = strm.state;
//here = state.here;
_in = strm.next_in;
input = strm.input;
last = _in + (strm.avail_in - 5);
_out = strm.next_out;
output = strm.output;
beg = _out - (start - strm.avail_out);
end = _out + (strm.avail_out - 257);
//#ifdef INFLATE_STRICT
dmax = state.dmax;
//#endif
wsize = state.wsize;
whave = state.whave;
wnext = state.wnext;
s_window = state.window;
hold = state.hold;
bits = state.bits;
lcode = state.lencode;
dcode = state.distcode;
lmask = (1 << state.lenbits) - 1;
dmask = (1 << state.distbits) - 1;
/* decode literals and length/distances until end-of-block or not enough
input data or output space */
top:
do {
if (bits < 15) {
hold += input[_in++] << bits;
bits += 8;
hold += input[_in++] << bits;
bits += 8;
}
here = lcode[hold & lmask];
dolen:
for (;;) { // Goto emulation
op = here >>> 24/*here.bits*/;
hold >>>= op;
bits -= op;
op = (here >>> 16) & 0xff/*here.op*/;
if (op === 0) { /* literal */
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
// "inflate: literal '%c'\n" :
// "inflate: literal 0x%02x\n", here.val));
output[_out++] = here & 0xffff/*here.val*/;
}
else if (op & 16) { /* length base */
len = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (op) {
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
len += hold & ((1 << op) - 1);
hold >>>= op;
bits -= op;
}
//Tracevv((stderr, "inflate: length %u\n", len));
if (bits < 15) {
hold += input[_in++] << bits;
bits += 8;
hold += input[_in++] << bits;
bits += 8;
}
here = dcode[hold & dmask];
dodist:
for (;;) { // goto emulation
op = here >>> 24/*here.bits*/;
hold >>>= op;
bits -= op;
op = (here >>> 16) & 0xff/*here.op*/;
if (op & 16) { /* distance base */
dist = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
}
dist += hold & ((1 << op) - 1);
//#ifdef INFLATE_STRICT
if (dist > dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break top;
}
//#endif
hold >>>= op;
bits -= op;
//Tracevv((stderr, "inflate: distance %u\n", dist));
op = _out - beg; /* max distance in output */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break top;
}
// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
// if (len <= op - whave) {
// do {
// output[_out++] = 0;
// } while (--len);
// continue top;
// }
// len -= op - whave;
// do {
// output[_out++] = 0;
// } while (--op > whave);
// if (op === 0) {
// from = _out - dist;
// do {
// output[_out++] = output[from++];
// } while (--len);
// continue top;
// }
//#endif
}
from = 0; // window index
from_source = s_window;
if (wnext === 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
else if (wnext < op) { /* wrap around window */
from += wsize + wnext - op;
op -= wnext;
if (op < len) { /* some from end of window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = 0;
if (wnext < len) { /* some from start of window */
op = wnext;
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
}
else { /* contiguous in window */
from += wnext - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
while (len > 2) {
output[_out++] = from_source[from++];
output[_out++] = from_source[from++];
output[_out++] = from_source[from++];
len -= 3;
}
if (len) {
output[_out++] = from_source[from++];
if (len > 1) {
output[_out++] = from_source[from++];
}
}
}
else {
from = _out - dist; /* copy direct from output */
do { /* minimum length is three */
output[_out++] = output[from++];
output[_out++] = output[from++];
output[_out++] = output[from++];
len -= 3;
} while (len > 2);
if (len) {
output[_out++] = output[from++];
if (len > 1) {
output[_out++] = output[from++];
}
}
}
}
else if ((op & 64) === 0) { /* 2nd level distance code */
here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue dodist;
}
else {
strm.msg = 'invalid distance code';
state.mode = BAD;
break top;
}
break; // need to emulate goto via "continue"
}
}
else if ((op & 64) === 0) { /* 2nd level length code */
here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue dolen;
}
else if (op & 32) { /* end-of-block */
//Tracevv((stderr, "inflate: end of block\n"));
state.mode = TYPE;
break top;
}
else {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
break top;
}
break; // need to emulate goto via "continue"
}
} while (_in < last && _out < end);
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
len = bits >> 3;
_in -= len;
bits -= len << 3;
hold &= (1 << bits) - 1;
/* update state and return */
strm.next_in = _in;
strm.next_out = _out;
strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
state.hold = hold;
state.bits = bits;
return;
};
},{}],96:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
var adler32 = _dereq_('./adler32');
var crc32 = _dereq_('./crc32');
var inflate_fast = _dereq_('./inffast');
var inflate_table = _dereq_('./inftrees');
var CODES = 0;
var LENS = 1;
var DISTS = 2;
/* Public constants ==========================================================*/
/* ===========================================================================*/
/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
//var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
var Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
/* The deflate compression method */
var Z_DEFLATED = 8;
/* STATES ====================================================================*/
/* ===========================================================================*/
var HEAD = 1; /* i: waiting for magic header */
var FLAGS = 2; /* i: waiting for method and flags (gzip) */
var TIME = 3; /* i: waiting for modification time (gzip) */
var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
var EXLEN = 5; /* i: waiting for extra length (gzip) */
var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
var NAME = 7; /* i: waiting for end of file name (gzip) */
var COMMENT = 8; /* i: waiting for end of comment (gzip) */
var HCRC = 9; /* i: waiting for header crc (gzip) */
var DICTID = 10; /* i: waiting for dictionary check value */
var DICT = 11; /* waiting for inflateSetDictionary() call */
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
var STORED = 14; /* i: waiting for stored size (length and complement) */
var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
var COPY = 16; /* i/o: waiting for input or output to copy stored block */
var TABLE = 17; /* i: waiting for dynamic block table lengths */
var LENLENS = 18; /* i: waiting for code length code lengths */
var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
var LEN_ = 20; /* i: same as LEN below, but only first time in */
var LEN = 21; /* i: waiting for length/lit/eob code */
var LENEXT = 22; /* i: waiting for length extra bits */
var DIST = 23; /* i: waiting for distance code */
var DISTEXT = 24; /* i: waiting for distance extra bits */
var MATCH = 25; /* o: waiting for output space to copy string */
var LIT = 26; /* o: waiting for output space to write literal */
var CHECK = 27; /* i: waiting for 32-bit check value */
var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
var DONE = 29; /* finished check, done -- remain here until reset */
var BAD = 30; /* got a data error -- remain here until reset */
var MEM = 31; /* got an inflate() memory error -- remain here until reset */
var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
/* ===========================================================================*/
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_WBITS = MAX_WBITS;
function ZSWAP32(q) {
return (((q >>> 24) & 0xff) +
((q >>> 8) & 0xff00) +
((q & 0xff00) << 8) +
((q & 0xff) << 24));
}
function InflateState() {
this.mode = 0; /* current inflate mode */
this.last = false; /* true if processing last block */
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
this.havedict = false; /* true if dictionary provided */
this.flags = 0; /* gzip header method and flags (0 if zlib) */
this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
this.check = 0; /* protected copy of check value */
this.total = 0; /* protected copy of output count */
// TODO: may be {}
this.head = null; /* where to save gzip header information */
/* sliding window */
this.wbits = 0; /* log base 2 of requested window size */
this.wsize = 0; /* window size or zero if not using window */
this.whave = 0; /* valid bytes in the window */
this.wnext = 0; /* window write index */
this.window = null; /* allocated sliding window, if needed */
/* bit accumulator */
this.hold = 0; /* input bit accumulator */
this.bits = 0; /* number of bits in "in" */
/* for string and stored block copying */
this.length = 0; /* literal or length of data to copy */
this.offset = 0; /* distance back to copy string from */
/* for table and code decoding */
this.extra = 0; /* extra bits needed */
/* fixed and dynamic code tables */
this.lencode = null; /* starting table for length/literal codes */
this.distcode = null; /* starting table for distance codes */
this.lenbits = 0; /* index bits for lencode */
this.distbits = 0; /* index bits for distcode */
/* dynamic table building */
this.ncode = 0; /* number of code length code lengths */
this.nlen = 0; /* number of length code lengths */
this.ndist = 0; /* number of distance code lengths */
this.have = 0; /* number of code lengths in lens[] */
this.next = null; /* next available space in codes[] */
this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
this.work = new utils.Buf16(288); /* work area for code table building */
/*
because we don't have pointers in js, we use lencode and distcode directly
as buffers so we don't need codes
*/
//this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
this.distdyn = null; /* dynamic table for distance codes (JS specific) */
this.sane = 0; /* if false, allow invalid distance too far */
this.back = 0; /* bits back of last unprocessed length/lit */
this.was = 0; /* initial length of match */
}
function inflateResetKeep(strm) {
var state;
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
strm.total_in = strm.total_out = state.total = 0;
strm.msg = ''; /*Z_NULL*/
if (state.wrap) { /* to support ill-conceived Java test suite */
strm.adler = state.wrap & 1;
}
state.mode = HEAD;
state.last = 0;
state.havedict = 0;
state.dmax = 32768;
state.head = null/*Z_NULL*/;
state.hold = 0;
state.bits = 0;
//state.lencode = state.distcode = state.next = state.codes;
state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
state.sane = 1;
state.back = -1;
//Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
function inflateReset(strm) {
var state;
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
state.wsize = 0;
state.whave = 0;
state.wnext = 0;
return inflateResetKeep(strm);
}
function inflateReset2(strm, windowBits) {
var wrap;
var state;
/* get the state */
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
/* extract wrap request from windowBits parameter */
if (windowBits < 0) {
wrap = 0;
windowBits = -windowBits;
}
else {
wrap = (windowBits >> 4) + 1;
if (windowBits < 48) {
windowBits &= 15;
}
}
/* set number of window bits, free window if different */
if (windowBits && (windowBits < 8 || windowBits > 15)) {
return Z_STREAM_ERROR;
}
if (state.window !== null && state.wbits !== windowBits) {
state.window = null;
}
/* update state and reset the rest of it */
state.wrap = wrap;
state.wbits = windowBits;
return inflateReset(strm);
}
function inflateInit2(strm, windowBits) {
var ret;
var state;
if (!strm) { return Z_STREAM_ERROR; }
//strm.msg = Z_NULL; /* in case we return an error */
state = new InflateState();
//if (state === Z_NULL) return Z_MEM_ERROR;
//Tracev((stderr, "inflate: allocated\n"));
strm.state = state;
state.window = null/*Z_NULL*/;
ret = inflateReset2(strm, windowBits);
if (ret !== Z_OK) {
strm.state = null/*Z_NULL*/;
}
return ret;
}
function inflateInit(strm) {
return inflateInit2(strm, DEF_WBITS);
}
/*
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. Normally this returns fixed tables from inffixed.h.
If BUILDFIXED is defined, then instead this routine builds the tables the
first time it's called, and returns those tables the first time and
thereafter. This reduces the size of the code by about 2K bytes, in
exchange for a little execution time. However, BUILDFIXED should not be
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
var virgin = true;
var lenfix, distfix; // We have no pointers in JS, so keep tables separate
function fixedtables(state) {
/* build fixed huffman tables if first call (may not be thread safe) */
if (virgin) {
var sym;
lenfix = new utils.Buf32(512);
distfix = new utils.Buf32(32);
/* literal/length table */
sym = 0;
while (sym < 144) { state.lens[sym++] = 8; }
while (sym < 256) { state.lens[sym++] = 9; }
while (sym < 280) { state.lens[sym++] = 7; }
while (sym < 288) { state.lens[sym++] = 8; }
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9});
/* distance table */
sym = 0;
while (sym < 32) { state.lens[sym++] = 5; }
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5});
/* do this just once */
virgin = false;
}
state.lencode = lenfix;
state.lenbits = 9;
state.distcode = distfix;
state.distbits = 5;
}
/*
Update the window with the last wsize (normally 32K) bytes written before
returning. If window does not exist yet, create it. This is only called
when a window is already in use, or when output has been written during this
inflate call, but the end of the deflate stream has not been reached yet.
It is also called to create a window for dictionary data when a dictionary
is loaded.
Providing output buffers larger than 32K to inflate() should provide a speed
advantage, since only the last 32K of output is copied to the sliding window
upon return from inflate(), and since all distances after the first 32K of
output will fall in the output data, making match copies simpler and faster.
The advantage may be dependent on the size of the processor's data caches.
*/
function updatewindow(strm, src, end, copy) {
var dist;
var state = strm.state;
/* if it hasn't been done already, allocate space for the window */
if (state.window === null) {
state.wsize = 1 << state.wbits;
state.wnext = 0;
state.whave = 0;
state.window = new utils.Buf8(state.wsize);
}
/* copy state->wsize or less output bytes into the circular window */
if (copy >= state.wsize) {
utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0);
state.wnext = 0;
state.whave = state.wsize;
}
else {
dist = state.wsize - state.wnext;
if (dist > copy) {
dist = copy;
}
//zmemcpy(state->window + state->wnext, end - copy, dist);
utils.arraySet(state.window,src, end - copy, dist, state.wnext);
copy -= dist;
if (copy) {
//zmemcpy(state->window, end - copy, copy);
utils.arraySet(state.window,src, end - copy, copy, 0);
state.wnext = copy;
state.whave = state.wsize;
}
else {
state.wnext += dist;
if (state.wnext === state.wsize) { state.wnext = 0; }
if (state.whave < state.wsize) { state.whave += dist; }
}
}
return 0;
}
function inflate(strm, flush) {
var state;
var input, output; // input/output buffers
var next; /* next input INDEX */
var put; /* next output INDEX */
var have, left; /* available input and output */
var hold; /* bit buffer */
var bits; /* bits in bit buffer */
var _in, _out; /* save starting available input and output */
var copy; /* number of stored or match bytes to copy */
var from; /* where to copy match bytes from */
var from_source;
var here = 0; /* current decoding table entry */
var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
//var last; /* parent table entry */
var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
var len; /* length to copy for repeats, bits to drop */
var ret; /* return code */
var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
var opts;
var n; // temporary var for NEED_BITS
var order = /* permutation of code lengths */
[16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
if (!strm || !strm.state || !strm.output ||
(!strm.input && strm.avail_in !== 0)) {
return Z_STREAM_ERROR;
}
state = strm.state;
if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
//--- LOAD() ---
put = strm.next_out;
output = strm.output;
left = strm.avail_out;
next = strm.next_in;
input = strm.input;
have = strm.avail_in;
hold = state.hold;
bits = state.bits;
//---
_in = have;
_out = left;
ret = Z_OK;
inf_leave: // goto emulation
for (;;) {
switch (state.mode) {
case HEAD:
if (state.wrap === 0) {
state.mode = TYPEDO;
break;
}
//=== NEEDBITS(16);
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
state.check = 0/*crc32(0L, Z_NULL, 0)*/;
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = FLAGS;
break;
}
state.flags = 0; /* expect zlib header */
if (state.head) {
state.head.done = false;
}
if (!(state.wrap & 1) || /* check if zlib header allowed */
(((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
strm.msg = 'incorrect header check';
state.mode = BAD;
break;
}
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
strm.msg = 'unknown compression method';
state.mode = BAD;
break;
}
//--- DROPBITS(4) ---//
hold >>>= 4;
bits -= 4;
//---//
len = (hold & 0x0f)/*BITS(4)*/ + 8;
if (state.wbits === 0) {
state.wbits = len;
}
else if (len > state.wbits) {
strm.msg = 'invalid window size';
state.mode = BAD;
break;
}
state.dmax = 1 << len;
//Tracev((stderr, "inflate: zlib header ok\n"));
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = hold & 0x200 ? DICTID : TYPE;
//=== INITBITS();
hold = 0;
bits = 0;
//===//
break;
case FLAGS:
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.flags = hold;
if ((state.flags & 0xff) !== Z_DEFLATED) {
strm.msg = 'unknown compression method';
state.mode = BAD;
break;
}
if (state.flags & 0xe000) {
strm.msg = 'unknown header flags set';
state.mode = BAD;
break;
}
if (state.head) {
state.head.text = ((hold >> 8) & 1);
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = TIME;
/* falls through */
case TIME:
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (state.head) {
state.head.time = hold;
}
if (state.flags & 0x0200) {
//=== CRC4(state.check, hold)
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
hbuf[2] = (hold >>> 16) & 0xff;
hbuf[3] = (hold >>> 24) & 0xff;
state.check = crc32(state.check, hbuf, 4, 0);
//===
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = OS;
/* falls through */
case OS:
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (state.head) {
state.head.xflags = (hold & 0xff);
state.head.os = (hold >> 8);
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = EXLEN;
/* falls through */
case EXLEN:
if (state.flags & 0x0400) {
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.length = hold;
if (state.head) {
state.head.extra_len = hold;
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
}
else if (state.head) {
state.head.extra = null/*Z_NULL*/;
}
state.mode = EXTRA;
/* falls through */
case EXTRA:
if (state.flags & 0x0400) {
copy = state.length;
if (copy > have) { copy = have; }
if (copy) {
if (state.head) {
len = state.head.extra_len - state.length;
if (!state.head.extra) {
// Use untyped array for more conveniend processing later
state.head.extra = new Array(state.head.extra_len);
}
utils.arraySet(
state.head.extra,
input,
next,
// extra field is limited to 65536 bytes
// - no need for additional size check
copy,
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
len
);
//zmemcpy(state.head.extra + len, next,
// len + copy > state.head.extra_max ?
// state.head.extra_max - len : copy);
}
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
state.length -= copy;
}
if (state.length) { break inf_leave; }
}
state.length = 0;
state.mode = NAME;
/* falls through */
case NAME:
if (state.flags & 0x0800) {
if (have === 0) { break inf_leave; }
copy = 0;
do {
// TODO: 2 or 1 bytes?
len = input[next + copy++];
/* use constant limit because in js we should not preallocate memory */
if (state.head && len &&
(state.length < 65536 /*state.head.name_max*/)) {
state.head.name += String.fromCharCode(len);
}
} while (len && copy < have);
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
if (len) { break inf_leave; }
}
else if (state.head) {
state.head.name = null;
}
state.length = 0;
state.mode = COMMENT;
/* falls through */
case COMMENT:
if (state.flags & 0x1000) {
if (have === 0) { break inf_leave; }
copy = 0;
do {
len = input[next + copy++];
/* use constant limit because in js we should not preallocate memory */
if (state.head && len &&
(state.length < 65536 /*state.head.comm_max*/)) {
state.head.comment += String.fromCharCode(len);
}
} while (len && copy < have);
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
if (len) { break inf_leave; }
}
else if (state.head) {
state.head.comment = null;
}
state.mode = HCRC;
/* falls through */
case HCRC:
if (state.flags & 0x0200) {
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (hold !== (state.check & 0xffff)) {
strm.msg = 'header crc mismatch';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
}
if (state.head) {
state.head.hcrc = ((state.flags >> 9) & 1);
state.head.done = true;
}
strm.adler = state.check = 0 /*crc32(0L, Z_NULL, 0)*/;
state.mode = TYPE;
break;
case DICTID:
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
strm.adler = state.check = ZSWAP32(hold);
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = DICT;
/* falls through */
case DICT:
if (state.havedict === 0) {
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
return Z_NEED_DICT;
}
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = TYPE;
/* falls through */
case TYPE:
if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
/* falls through */
case TYPEDO:
if (state.last) {
//--- BYTEBITS() ---//
hold >>>= bits & 7;
bits -= bits & 7;
//---//
state.mode = CHECK;
break;
}
//=== NEEDBITS(3); */
while (bits < 3) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.last = (hold & 0x01)/*BITS(1)*/;
//--- DROPBITS(1) ---//
hold >>>= 1;
bits -= 1;
//---//
switch ((hold & 0x03)/*BITS(2)*/) {
case 0: /* stored block */
//Tracev((stderr, "inflate: stored block%s\n",
// state.last ? " (last)" : ""));
state.mode = STORED;
break;
case 1: /* fixed block */
fixedtables(state);
//Tracev((stderr, "inflate: fixed codes block%s\n",
// state.last ? " (last)" : ""));
state.mode = LEN_; /* decode codes */
if (flush === Z_TREES) {
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
break inf_leave;
}
break;
case 2: /* dynamic block */
//Tracev((stderr, "inflate: dynamic codes block%s\n",
// state.last ? " (last)" : ""));
state.mode = TABLE;
break;
case 3:
strm.msg = 'invalid block type';
state.mode = BAD;
}
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
break;
case STORED:
//--- BYTEBITS() ---// /* go to byte boundary */
hold >>>= bits & 7;
bits -= bits & 7;
//---//
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
strm.msg = 'invalid stored block lengths';
state.mode = BAD;
break;
}
state.length = hold & 0xffff;
//Tracev((stderr, "inflate: stored length %u\n",
// state.length));
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = COPY_;
if (flush === Z_TREES) { break inf_leave; }
/* falls through */
case COPY_:
state.mode = COPY;
/* falls through */
case COPY:
copy = state.length;
if (copy) {
if (copy > have) { copy = have; }
if (copy > left) { copy = left; }
if (copy === 0) { break inf_leave; }
//--- zmemcpy(put, next, copy); ---
utils.arraySet(output, input, next, copy, put);
//---//
have -= copy;
next += copy;
left -= copy;
put += copy;
state.length -= copy;
break;
}
//Tracev((stderr, "inflate: stored end\n"));
state.mode = TYPE;
break;
case TABLE:
//=== NEEDBITS(14); */
while (bits < 14) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
//--- DROPBITS(5) ---//
hold >>>= 5;
bits -= 5;
//---//
state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
//--- DROPBITS(5) ---//
hold >>>= 5;
bits -= 5;
//---//
state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
//--- DROPBITS(4) ---//
hold >>>= 4;
bits -= 4;
//---//
//#ifndef PKZIP_BUG_WORKAROUND
if (state.nlen > 286 || state.ndist > 30) {
strm.msg = 'too many length or distance symbols';
state.mode = BAD;
break;
}
//#endif
//Tracev((stderr, "inflate: table sizes ok\n"));
state.have = 0;
state.mode = LENLENS;
/* falls through */
case LENLENS:
while (state.have < state.ncode) {
//=== NEEDBITS(3);
while (bits < 3) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
//--- DROPBITS(3) ---//
hold >>>= 3;
bits -= 3;
//---//
}
while (state.have < 19) {
state.lens[order[state.have++]] = 0;
}
// We have separate tables & no pointers. 2 commented lines below not needed.
//state.next = state.codes;
//state.lencode = state.next;
// Switch to use dynamic table
state.lencode = state.lendyn;
state.lenbits = 7;
opts = {bits: state.lenbits};
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
state.lenbits = opts.bits;
if (ret) {
strm.msg = 'invalid code lengths set';
state.mode = BAD;
break;
}
//Tracev((stderr, "inflate: code lengths ok\n"));
state.have = 0;
state.mode = CODELENS;
/* falls through */
case CODELENS:
while (state.have < state.nlen + state.ndist) {
for (;;) {
here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if (here_val < 16) {
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.lens[state.have++] = here_val;
}
else {
if (here_val === 16) {
//=== NEEDBITS(here.bits + 2);
n = here_bits + 2;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
if (state.have === 0) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
len = state.lens[state.have - 1];
copy = 3 + (hold & 0x03);//BITS(2);
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
}
else if (here_val === 17) {
//=== NEEDBITS(here.bits + 3);
n = here_bits + 3;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
len = 0;
copy = 3 + (hold & 0x07);//BITS(3);
//--- DROPBITS(3) ---//
hold >>>= 3;
bits -= 3;
//---//
}
else {
//=== NEEDBITS(here.bits + 7);
n = here_bits + 7;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
len = 0;
copy = 11 + (hold & 0x7f);//BITS(7);
//--- DROPBITS(7) ---//
hold >>>= 7;
bits -= 7;
//---//
}
if (state.have + copy > state.nlen + state.ndist) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
while (copy--) {
state.lens[state.have++] = len;
}
}
}
/* handle error breaks in while */
if (state.mode === BAD) { break; }
/* check for end-of-block code (better have one) */
if (state.lens[256] === 0) {
strm.msg = 'invalid code -- missing end-of-block';
state.mode = BAD;
break;
}
/* build code tables -- note: do not change the lenbits or distbits
values here (9 and 6) without reading the comments in inftrees.h
concerning the ENOUGH constants, which depend on those values */
state.lenbits = 9;
opts = {bits: state.lenbits};
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
// We have separate tables & no pointers. 2 commented lines below not needed.
// state.next_index = opts.table_index;
state.lenbits = opts.bits;
// state.lencode = state.next;
if (ret) {
strm.msg = 'invalid literal/lengths set';
state.mode = BAD;
break;
}
state.distbits = 6;
//state.distcode.copy(state.codes);
// Switch to use dynamic table
state.distcode = state.distdyn;
opts = {bits: state.distbits};
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
// We have separate tables & no pointers. 2 commented lines below not needed.
// state.next_index = opts.table_index;
state.distbits = opts.bits;
// state.distcode = state.next;
if (ret) {
strm.msg = 'invalid distances set';
state.mode = BAD;
break;
}
//Tracev((stderr, 'inflate: codes ok\n'));
state.mode = LEN_;
if (flush === Z_TREES) { break inf_leave; }
/* falls through */
case LEN_:
state.mode = LEN;
/* falls through */
case LEN:
if (have >= 6 && left >= 258) {
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
inflate_fast(strm, _out);
//--- LOAD() ---
put = strm.next_out;
output = strm.output;
left = strm.avail_out;
next = strm.next_in;
input = strm.input;
have = strm.avail_in;
hold = state.hold;
bits = state.bits;
//---
if (state.mode === TYPE) {
state.back = -1;
}
break;
}
state.back = 0;
for (;;) {
here = state.lencode[hold & ((1 << state.lenbits) -1)]; /*BITS(state.lenbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if (here_bits <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if (here_op && (here_op & 0xf0) === 0) {
last_bits = here_bits;
last_op = here_op;
last_val = here_val;
for (;;) {
here = state.lencode[last_val +
((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((last_bits + here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
//--- DROPBITS(last.bits) ---//
hold >>>= last_bits;
bits -= last_bits;
//---//
state.back += last_bits;
}
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.back += here_bits;
state.length = here_val;
if (here_op === 0) {
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
// "inflate: literal '%c'\n" :
// "inflate: literal 0x%02x\n", here.val));
state.mode = LIT;
break;
}
if (here_op & 32) {
//Tracevv((stderr, "inflate: end of block\n"));
state.back = -1;
state.mode = TYPE;
break;
}
if (here_op & 64) {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
break;
}
state.extra = here_op & 15;
state.mode = LENEXT;
/* falls through */
case LENEXT:
if (state.extra) {
//=== NEEDBITS(state.extra);
n = state.extra;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.length += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
//--- DROPBITS(state.extra) ---//
hold >>>= state.extra;
bits -= state.extra;
//---//
state.back += state.extra;
}
//Tracevv((stderr, "inflate: length %u\n", state.length));
state.was = state.length;
state.mode = DIST;
/* falls through */
case DIST:
for (;;) {
here = state.distcode[hold & ((1 << state.distbits) -1)];/*BITS(state.distbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if ((here_op & 0xf0) === 0) {
last_bits = here_bits;
last_op = here_op;
last_val = here_val;
for (;;) {
here = state.distcode[last_val +
((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((last_bits + here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
//--- DROPBITS(last.bits) ---//
hold >>>= last_bits;
bits -= last_bits;
//---//
state.back += last_bits;
}
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.back += here_bits;
if (here_op & 64) {
strm.msg = 'invalid distance code';
state.mode = BAD;
break;
}
state.offset = here_val;
state.extra = (here_op) & 15;
state.mode = DISTEXT;
/* falls through */
case DISTEXT:
if (state.extra) {
//=== NEEDBITS(state.extra);
n = state.extra;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.offset += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
//--- DROPBITS(state.extra) ---//
hold >>>= state.extra;
bits -= state.extra;
//---//
state.back += state.extra;
}
//#ifdef INFLATE_STRICT
if (state.offset > state.dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
//#endif
//Tracevv((stderr, "inflate: distance %u\n", state.offset));
state.mode = MATCH;
/* falls through */
case MATCH:
if (left === 0) { break inf_leave; }
copy = _out - left;
if (state.offset > copy) { /* copy from window */
copy = state.offset - copy;
if (copy > state.whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
// Trace((stderr, "inflate.c too far\n"));
// copy -= state.whave;
// if (copy > state.length) { copy = state.length; }
// if (copy > left) { copy = left; }
// left -= copy;
// state.length -= copy;
// do {
// output[put++] = 0;
// } while (--copy);
// if (state.length === 0) { state.mode = LEN; }
// break;
//#endif
}
if (copy > state.wnext) {
copy -= state.wnext;
from = state.wsize - copy;
}
else {
from = state.wnext - copy;
}
if (copy > state.length) { copy = state.length; }
from_source = state.window;
}
else { /* copy from output */
from_source = output;
from = put - state.offset;
copy = state.length;
}
if (copy > left) { copy = left; }
left -= copy;
state.length -= copy;
do {
output[put++] = from_source[from++];
} while (--copy);
if (state.length === 0) { state.mode = LEN; }
break;
case LIT:
if (left === 0) { break inf_leave; }
output[put++] = state.length;
left--;
state.mode = LEN;
break;
case CHECK:
if (state.wrap) {
//=== NEEDBITS(32);
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
// Use '|' insdead of '+' to make sure that result is signed
hold |= input[next++] << bits;
bits += 8;
}
//===//
_out -= left;
strm.total_out += _out;
state.total += _out;
if (_out) {
strm.adler = state.check =
/*UPDATE(state.check, put - _out, _out);*/
(state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
}
_out = left;
// NB: crc32 stored as signed 32-bit int, ZSWAP32 returns signed too
if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) {
strm.msg = 'incorrect data check';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
//Tracev((stderr, "inflate: check matches trailer\n"));
}
state.mode = LENGTH;
/* falls through */
case LENGTH:
if (state.wrap && state.flags) {
//=== NEEDBITS(32);
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (hold !== (state.total & 0xffffffff)) {
strm.msg = 'incorrect length check';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
//Tracev((stderr, "inflate: length matches trailer\n"));
}
state.mode = DONE;
/* falls through */
case DONE:
ret = Z_STREAM_END;
break inf_leave;
case BAD:
ret = Z_DATA_ERROR;
break inf_leave;
case MEM:
return Z_MEM_ERROR;
case SYNC:
/* falls through */
default:
return Z_STREAM_ERROR;
}
}
// inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
/*
Return from inflate(), updating the total counts and the check value.
If there was no progress during the inflate() call, return a buffer
error. Call updatewindow() to create and/or update the window state.
Note: a memory error from inflate() is non-recoverable.
*/
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
(state.mode < CHECK || flush !== Z_FINISH))) {
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
state.mode = MEM;
return Z_MEM_ERROR;
}
}
_in -= strm.avail_in;
_out -= strm.avail_out;
strm.total_in += _in;
strm.total_out += _out;
state.total += _out;
if (state.wrap && _out) {
strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
(state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
}
strm.data_type = state.bits + (state.last ? 64 : 0) +
(state.mode === TYPE ? 128 : 0) +
(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
ret = Z_BUF_ERROR;
}
return ret;
}
function inflateEnd(strm) {
if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
return Z_STREAM_ERROR;
}
var state = strm.state;
if (state.window) {
state.window = null;
}
strm.state = null;
return Z_OK;
}
function inflateGetHeader(strm, head) {
var state;
/* check state */
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
/* save header structure */
state.head = head;
head.done = false;
return Z_OK;
}
exports.inflateReset = inflateReset;
exports.inflateReset2 = inflateReset2;
exports.inflateResetKeep = inflateResetKeep;
exports.inflateInit = inflateInit;
exports.inflateInit2 = inflateInit2;
exports.inflate = inflate;
exports.inflateEnd = inflateEnd;
exports.inflateGetHeader = inflateGetHeader;
exports.inflateInfo = 'pako inflate (from Nodeca project)';
/* Not implemented
exports.inflateCopy = inflateCopy;
exports.inflateGetDictionary = inflateGetDictionary;
exports.inflateMark = inflateMark;
exports.inflatePrime = inflatePrime;
exports.inflateSetDictionary = inflateSetDictionary;
exports.inflateSync = inflateSync;
exports.inflateSyncPoint = inflateSyncPoint;
exports.inflateUndermine = inflateUndermine;
*/
},{"../utils/common":88,"./adler32":90,"./crc32":92,"./inffast":95,"./inftrees":97}],97:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
var MAXBITS = 15;
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
var CODES = 0;
var LENS = 1;
var DISTS = 2;
var lbase = [ /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
];
var lext = [ /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
];
var dbase = [ /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577, 0, 0
];
var dext = [ /* Distance codes 0..29 extra */
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
28, 28, 29, 29, 64, 64
];
module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
var bits = opts.bits;
//here = opts.here; /* table entry for duplication */
var len = 0; /* a code's length in bits */
var sym = 0; /* index of code symbols */
var min = 0, max = 0; /* minimum and maximum code lengths */
var root = 0; /* number of index bits for root table */
var curr = 0; /* number of index bits for current table */
var drop = 0; /* code bits to drop for sub-table */
var left = 0; /* number of prefix codes available */
var used = 0; /* code entries in table used */
var huff = 0; /* Huffman code */
var incr; /* for incrementing code, index */
var fill; /* index for replicating entries */
var low; /* low bits for current root entry */
var mask; /* mask for low root bits */
var next; /* next available space in table */
var base = null; /* base value table to use */
var base_index = 0;
// var shoextra; /* extra bits table to use */
var end; /* use base and extra for symbol > end */
var count = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* number of codes of each length */
var offs = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* offsets in table for each length */
var extra = null;
var extra_index = 0;
var here_bits, here_op, here_val;
/*
Process a set of code lengths to create a canonical Huffman code. The
code lengths are lens[0..codes-1]. Each length corresponds to the
symbols 0..codes-1. The Huffman code is generated by first sorting the
symbols by length from short to long, and retaining the symbol order
for codes with equal lengths. Then the code starts with all zero bits
for the first code of the shortest length, and the codes are integer
increments for the same length, and zeros are appended as the length
increases. For the deflate format, these bits are stored backwards
from their more natural integer increment ordering, and so when the
decoding tables are built in the large loop below, the integer codes
are incremented backwards.
This routine assumes, but does not check, that all of the entries in
lens[] are in the range 0..MAXBITS. The caller must assure this.
1..MAXBITS is interpreted as that code length. zero means that that
symbol does not occur in this code.
The codes are sorted by computing a count of codes for each length,
creating from that a table of starting indices for each length in the
sorted table, and then entering the symbols in order in the sorted
table. The sorted table is work[], with that space being provided by
the caller.
The length counts are used for other purposes as well, i.e. finding
the minimum and maximum length codes, determining if there are any
codes at all, checking for a valid set of lengths, and looking ahead
at length counts to determine sub-table sizes when building the
decoding tables.
*/
/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
for (len = 0; len <= MAXBITS; len++) {
count[len] = 0;
}
for (sym = 0; sym < codes; sym++) {
count[lens[lens_index + sym]]++;
}
/* bound code lengths, force root to be within code lengths */
root = bits;
for (max = MAXBITS; max >= 1; max--) {
if (count[max] !== 0) { break; }
}
if (root > max) {
root = max;
}
if (max === 0) { /* no symbols to code at all */
//table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
//table.bits[opts.table_index] = 1; //here.bits = (var char)1;
//table.val[opts.table_index++] = 0; //here.val = (var short)0;
table[table_index++] = (1 << 24) | (64 << 16) | 0;
//table.op[opts.table_index] = 64;
//table.bits[opts.table_index] = 1;
//table.val[opts.table_index++] = 0;
table[table_index++] = (1 << 24) | (64 << 16) | 0;
opts.bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
for (min = 1; min < max; min++) {
if (count[min] !== 0) { break; }
}
if (root < min) {
root = min;
}
/* check for an over-subscribed or incomplete set of lengths */
left = 1;
for (len = 1; len <= MAXBITS; len++) {
left <<= 1;
left -= count[len];
if (left < 0) {
return -1;
} /* over-subscribed */
}
if (left > 0 && (type === CODES || max !== 1)) {
return -1; /* incomplete set */
}
/* generate offsets into symbol table for each length for sorting */
offs[1] = 0;
for (len = 1; len < MAXBITS; len++) {
offs[len + 1] = offs[len] + count[len];
}
/* sort symbols by length, by symbol order within each length */
for (sym = 0; sym < codes; sym++) {
if (lens[lens_index + sym] !== 0) {
work[offs[lens[lens_index + sym]]++] = sym;
}
}
/*
Create and fill in decoding tables. In this loop, the table being
filled is at next and has curr index bits. The code being used is huff
with length len. That code is converted to an index by dropping drop
bits off of the bottom. For codes where len is less than drop + curr,
those top drop + curr - len bits are incremented through all values to
fill the table with replicated entries.
root is the number of index bits for the root table. When len exceeds
root, sub-tables are created pointed to by the root entry with an index
of the low root bits of huff. This is saved in low to check for when a
new sub-table should be started. drop is zero when the root table is
being filled, and drop is root when sub-tables are being filled.
When a new sub-table is needed, it is necessary to look ahead in the
code lengths to determine what size sub-table is needed. The length
counts are used for this, and so count[] is decremented as codes are
entered in the tables.
used keeps track of how many table entries have been allocated from the
provided *table space. It is checked for LENS and DIST tables against
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
the initial root table size constants. See the comments in inftrees.h
for more information.
sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This
routine permits incomplete codes, so another loop after this one fills
in the rest of the decoding tables with invalid code markers.
*/
/* set up for code type */
// poor man optimization - use if-else instead of switch,
// to avoid deopts in old v8
if (type === CODES) {
base = extra = work; /* dummy value--not used */
end = 19;
} else if (type === LENS) {
base = lbase;
base_index -= 257;
extra = lext;
extra_index -= 257;
end = 256;
} else { /* DISTS */
base = dbase;
extra = dext;
end = -1;
}
/* initialize opts for loop */
huff = 0; /* starting code */
sym = 0; /* starting code symbol */
len = min; /* starting code length */
next = table_index; /* current table to fill in */
curr = root; /* current table index bits */
drop = 0; /* current bits to drop from code for index */
low = -1; /* trigger new sub-table when len > root */
used = 1 << root; /* use root table entries */
mask = used - 1; /* mask for comparing low */
/* check available table space */
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
var i=0;
/* process all codes and make table entries */
for (;;) {
i++;
/* create table entry */
here_bits = len - drop;
if (work[sym] < end) {
here_op = 0;
here_val = work[sym];
}
else if (work[sym] > end) {
here_op = extra[extra_index + work[sym]];
here_val = base[base_index + work[sym]];
}
else {
here_op = 32 + 64; /* end of block */
here_val = 0;
}
/* replicate for those indices with low len bits equal to huff */
incr = 1 << (len - drop);
fill = 1 << curr;
min = fill; /* save offset to next table */
do {
fill -= incr;
table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
} while (fill !== 0);
/* backwards increment the len-bit code huff */
incr = 1 << (len - 1);
while (huff & incr) {
incr >>= 1;
}
if (incr !== 0) {
huff &= incr - 1;
huff += incr;
} else {
huff = 0;
}
/* go to next symbol, update count, len */
sym++;
if (--count[len] === 0) {
if (len === max) { break; }
len = lens[lens_index + work[sym]];
}
/* create new sub-table if needed */
if (len > root && (huff & mask) !== low) {
/* if first time, transition to sub-tables */
if (drop === 0) {
drop = root;
}
/* increment past last table */
next += min; /* here min is 1 << curr */
/* determine length of next table */
curr = len - drop;
left = 1 << curr;
while (curr + drop < max) {
left -= count[curr + drop];
if (left <= 0) { break; }
curr++;
left <<= 1;
}
/* check for enough space */
used += 1 << curr;
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
/* point entry in root table to sub-table */
low = huff & mask;
/*table.op[low] = curr;
table.bits[low] = root;
table.val[low] = next - opts.table_index;*/
table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
}
}
/* fill in remaining table entry if code is incomplete (guaranteed to have
at most one remaining entry, since if the code is incomplete, the
maximum code length that was allowed to get this far is one bit) */
if (huff !== 0) {
//table.op[next + huff] = 64; /* invalid code marker */
//table.bits[next + huff] = len - drop;
//table.val[next + huff] = 0;
table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
}
/* set return parameters */
//opts.table_index += used;
opts.bits = root;
return 0;
};
},{"../utils/common":88}],98:[function(_dereq_,module,exports){
'use strict';
module.exports = {
'2': 'need dictionary', /* Z_NEED_DICT 2 */
'1': 'stream end', /* Z_STREAM_END 1 */
'0': '', /* Z_OK 0 */
'-1': 'file error', /* Z_ERRNO (-1) */
'-2': 'stream error', /* Z_STREAM_ERROR (-2) */
'-3': 'data error', /* Z_DATA_ERROR (-3) */
'-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
};
},{}],99:[function(_dereq_,module,exports){
'use strict';
var utils = _dereq_('../utils/common');
/* Public constants ==========================================================*/
/* ===========================================================================*/
//var Z_FILTERED = 1;
//var Z_HUFFMAN_ONLY = 2;
//var Z_RLE = 3;
var Z_FIXED = 4;
//var Z_DEFAULT_STRATEGY = 0;
/* Possible values of the data_type field (though see inflate()) */
var Z_BINARY = 0;
var Z_TEXT = 1;
//var Z_ASCII = 1; // = Z_TEXT
var Z_UNKNOWN = 2;
/*============================================================================*/
function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
// From zutil.h
var STORED_BLOCK = 0;
var STATIC_TREES = 1;
var DYN_TREES = 2;
/* The three kinds of block type */
var MIN_MATCH = 3;
var MAX_MATCH = 258;
/* The minimum and maximum match lengths */
// From deflate.h
/* ===========================================================================
* Internal compression state.
*/
var LENGTH_CODES = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS = 256;
/* number of literal bytes 0..255 */
var L_CODES = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES = 30;
/* number of distance codes */
var BL_CODES = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE = 2*L_CODES + 1;
/* maximum heap size */
var MAX_BITS = 15;
/* All codes must not exceed MAX_BITS bits */
var Buf_size = 16;
/* size of bit buffer in bi_buf */
/* ===========================================================================
* Constants
*/
var MAX_BL_BITS = 7;
/* Bit length codes must not exceed MAX_BL_BITS bits */
var END_BLOCK = 256;
/* end of block literal code */
var REP_3_6 = 16;
/* repeat previous bit length 3-6 times (2 bits of repeat count) */
var REPZ_3_10 = 17;
/* repeat a zero length 3-10 times (3 bits of repeat count) */
var REPZ_11_138 = 18;
/* repeat a zero length 11-138 times (7 bits of repeat count) */
var extra_lbits = /* extra bits for each length code */
[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
var extra_dbits = /* extra bits for each distance code */
[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
var extra_blbits = /* extra bits for each bit length code */
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
var bl_order =
[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
/* The lengths of the bit length codes are sent in order of decreasing
* probability, to avoid transmitting the lengths for unused bit length codes.
*/
/* ===========================================================================
* Local data. These are initialized only once.
*/
// We pre-fill arrays with 0 to avoid uninitialized gaps
var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
var static_ltree = new Array((L_CODES+2) * 2);
zero(static_ltree);
/* The static literal tree. Since the bit lengths are imposed, there is no
* need for the L_CODES extra codes used during heap construction. However
* The codes 286 and 287 are needed to build a canonical tree (see _tr_init
* below).
*/
var static_dtree = new Array(D_CODES * 2);
zero(static_dtree);
/* The static distance tree. (Actually a trivial tree since all codes use
* 5 bits.)
*/
var _dist_code = new Array(DIST_CODE_LEN);
zero(_dist_code);
/* Distance codes. The first 256 values correspond to the distances
* 3 .. 258, the last 256 values correspond to the top 8 bits of
* the 15 bit distances.
*/
var _length_code = new Array(MAX_MATCH-MIN_MATCH+1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */
var base_length = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */
var base_dist = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */
var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) {
this.static_tree = static_tree; /* static tree or NULL */
this.extra_bits = extra_bits; /* extra bits for each code or NULL */
this.extra_base = extra_base; /* base index for extra_bits */
this.elems = elems; /* max number of elements in the tree */
this.max_length = max_length; /* max bit length for the codes */
// show if `static_tree` has data or dummy - needed for monomorphic objects
this.has_stree = static_tree && static_tree.length;
};
var static_l_desc;
var static_d_desc;
var static_bl_desc;
var TreeDesc = function(dyn_tree, stat_desc) {
this.dyn_tree = dyn_tree; /* the dynamic tree */
this.max_code = 0; /* largest code with non zero frequency */
this.stat_desc = stat_desc; /* the corresponding static tree */
};
function d_code(dist) {
return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
}
/* ===========================================================================
* Output a short LSB first on the stream.
* IN assertion: there is enough room in pendingBuf.
*/
function put_short (s, w) {
// put_byte(s, (uch)((w) & 0xff));
// put_byte(s, (uch)((ush)(w) >> 8));
s.pending_buf[s.pending++] = (w) & 0xff;
s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
}
/* ===========================================================================
* Send a value on a given number of bits.
* IN assertion: length <= 16 and value fits in length bits.
*/
function send_bits(s, value, length) {
if (s.bi_valid > (Buf_size - length)) {
s.bi_buf |= (value << s.bi_valid) & 0xffff;
put_short(s, s.bi_buf);
s.bi_buf = value >> (Buf_size - s.bi_valid);
s.bi_valid += length - Buf_size;
} else {
s.bi_buf |= (value << s.bi_valid) & 0xffff;
s.bi_valid += length;
}
}
function send_code(s, c, tree) {
send_bits(s, tree[c*2]/*.Code*/, tree[c*2 + 1]/*.Len*/);
}
/* ===========================================================================
* Reverse the first len bits of a code, using straightforward code (a faster
* method would use a table)
* IN assertion: 1 <= len <= 15
*/
function bi_reverse(code, len) {
var res = 0;
do {
res |= code & 1;
code >>>= 1;
res <<= 1;
} while (--len > 0);
return res >>> 1;
}
/* ===========================================================================
* Flush the bit buffer, keeping at most 7 bits in it.
*/
function bi_flush(s) {
if (s.bi_valid === 16) {
put_short(s, s.bi_buf);
s.bi_buf = 0;
s.bi_valid = 0;
} else if (s.bi_valid >= 8) {
s.pending_buf[s.pending++] = s.bi_buf & 0xff;
s.bi_buf >>= 8;
s.bi_valid -= 8;
}
}
/* ===========================================================================
* Compute the optimal bit lengths for a tree and update the total bit length
* for the current block.
* IN assertion: the fields freq and dad are set, heap[heap_max] and
* above are the tree nodes sorted by increasing frequency.
* OUT assertions: the field len is set to the optimal bit length, the
* array bl_count contains the frequencies for each bit length.
* The length opt_len is updated; static_len is also updated if stree is
* not null.
*/
function gen_bitlen(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
var max_code = desc.max_code;
var stree = desc.stat_desc.static_tree;
var has_stree = desc.stat_desc.has_stree;
var extra = desc.stat_desc.extra_bits;
var base = desc.stat_desc.extra_base;
var max_length = desc.stat_desc.max_length;
var h; /* heap index */
var n, m; /* iterate over the tree elements */
var bits; /* bit length */
var xbits; /* extra bits */
var f; /* frequency */
var overflow = 0; /* number of elements with bit length too large */
for (bits = 0; bits <= MAX_BITS; bits++) {
s.bl_count[bits] = 0;
}
/* In a first pass, compute the optimal bit lengths (which may
* overflow in the case of the bit length tree).
*/
tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */
for (h = s.heap_max+1; h < HEAP_SIZE; h++) {
n = s.heap[h];
bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
if (bits > max_length) {
bits = max_length;
overflow++;
}
tree[n*2 + 1]/*.Len*/ = bits;
/* We overwrite tree[n].Dad which is no longer needed */
if (n > max_code) { continue; } /* not a leaf node */
s.bl_count[bits]++;
xbits = 0;
if (n >= base) {
xbits = extra[n-base];
}
f = tree[n * 2]/*.Freq*/;
s.opt_len += f * (bits + xbits);
if (has_stree) {
s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits);
}
}
if (overflow === 0) { return; }
// Trace((stderr,"\nbit length overflow\n"));
/* This happens for example on obj2 and pic of the Calgary corpus */
/* Find the first bit length which could increase: */
do {
bits = max_length-1;
while (s.bl_count[bits] === 0) { bits--; }
s.bl_count[bits]--; /* move one leaf down the tree */
s.bl_count[bits+1] += 2; /* move one overflow item as its brother */
s.bl_count[max_length]--;
/* The brother of the overflow item also moves one step up,
* but this does not affect bl_count[max_length]
*/
overflow -= 2;
} while (overflow > 0);
/* Now recompute all bit lengths, scanning in increasing frequency.
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
* lengths instead of fixing only the wrong ones. This idea is taken
* from 'ar' written by Haruhiko Okumura.)
*/
for (bits = max_length; bits !== 0; bits--) {
n = s.bl_count[bits];
while (n !== 0) {
m = s.heap[--h];
if (m > max_code) { continue; }
if (tree[m*2 + 1]/*.Len*/ !== bits) {
// Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/;
tree[m*2 + 1]/*.Len*/ = bits;
}
n--;
}
}
}
/* ===========================================================================
* Generate the codes for a given tree and bit counts (which need not be
* optimal).
* IN assertion: the array bl_count contains the bit length statistics for
* the given tree and the field len is set for all tree elements.
* OUT assertion: the field code is set for all tree elements of non
* zero code length.
*/
function gen_codes(tree, max_code, bl_count)
// ct_data *tree; /* the tree to decorate */
// int max_code; /* largest code with non zero frequency */
// ushf *bl_count; /* number of codes at each bit length */
{
var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */
var code = 0; /* running code value */
var bits; /* bit index */
var n; /* code index */
/* The distribution counts are first used to generate the code values
* without bit reversal.
*/
for (bits = 1; bits <= MAX_BITS; bits++) {
next_code[bits] = code = (code + bl_count[bits-1]) << 1;
}
/* Check that the bit counts in bl_count are consistent. The last code
* must be all ones.
*/
//Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
// "inconsistent bit counts");
//Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
for (n = 0; n <= max_code; n++) {
var len = tree[n*2 + 1]/*.Len*/;
if (len === 0) { continue; }
/* Now reverse the bits */
tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len);
//Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
// n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
}
}
/* ===========================================================================
* Initialize the various 'constant' tables.
*/
function tr_static_init() {
var n; /* iterates over tree elements */
var bits; /* bit counter */
var length; /* length value */
var code; /* code value */
var dist; /* distance index */
var bl_count = new Array(MAX_BITS+1);
/* number of codes at each bit length for an optimal tree */
// do check in _tr_init()
//if (static_init_done) return;
/* For some embedded targets, global variables are not initialized: */
/*#ifdef NO_INIT_GLOBAL_POINTERS
static_l_desc.static_tree = static_ltree;
static_l_desc.extra_bits = extra_lbits;
static_d_desc.static_tree = static_dtree;
static_d_desc.extra_bits = extra_dbits;
static_bl_desc.extra_bits = extra_blbits;
#endif*/
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
for (code = 0; code < LENGTH_CODES-1; code++) {
base_length[code] = length;
for (n = 0; n < (1<<extra_lbits[code]); n++) {
_length_code[length++] = code;
}
}
//Assert (length == 256, "tr_static_init: length != 256");
/* Note that the length 255 (match length 258) can be represented
* in two different ways: code 284 + 5 bits or code 285, so we
* overwrite length_code[255] to use the best encoding:
*/
_length_code[length-1] = code;
/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
dist = 0;
for (code = 0 ; code < 16; code++) {
base_dist[code] = dist;
for (n = 0; n < (1<<extra_dbits[code]); n++) {
_dist_code[dist++] = code;
}
}
//Assert (dist == 256, "tr_static_init: dist != 256");
dist >>= 7; /* from now on, all distances are divided by 128 */
for (; code < D_CODES; code++) {
base_dist[code] = dist << 7;
for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
_dist_code[256 + dist++] = code;
}
}
//Assert (dist == 256, "tr_static_init: 256+dist != 512");
/* Construct the codes of the static literal tree */
for (bits = 0; bits <= MAX_BITS; bits++) {
bl_count[bits] = 0;
}
n = 0;
while (n <= 143) {
static_ltree[n*2 + 1]/*.Len*/ = 8;
n++;
bl_count[8]++;
}
while (n <= 255) {
static_ltree[n*2 + 1]/*.Len*/ = 9;
n++;
bl_count[9]++;
}
while (n <= 279) {
static_ltree[n*2 + 1]/*.Len*/ = 7;
n++;
bl_count[7]++;
}
while (n <= 287) {
static_ltree[n*2 + 1]/*.Len*/ = 8;
n++;
bl_count[8]++;
}
/* Codes 286 and 287 do not exist, but we must include them in the
* tree construction to get a canonical Huffman tree (longest code
* all ones)
*/
gen_codes(static_ltree, L_CODES+1, bl_count);
/* The static distance tree is trivial: */
for (n = 0; n < D_CODES; n++) {
static_dtree[n*2 + 1]/*.Len*/ = 5;
static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);
}
// Now data ready and we can init static trees
static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);
static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
//static_init_done = true;
}
/* ===========================================================================
* Initialize a new block.
*/
function init_block(s) {
var n; /* iterates over tree elements */
/* Initialize the trees. */
for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }
for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }
for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }
s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;
s.opt_len = s.static_len = 0;
s.last_lit = s.matches = 0;
}
/* ===========================================================================
* Flush the bit buffer and align the output on a byte boundary
*/
function bi_windup(s)
{
if (s.bi_valid > 8) {
put_short(s, s.bi_buf);
} else if (s.bi_valid > 0) {
//put_byte(s, (Byte)s->bi_buf);
s.pending_buf[s.pending++] = s.bi_buf;
}
s.bi_buf = 0;
s.bi_valid = 0;
}
/* ===========================================================================
* Copy a stored block, storing first the length and its
* one's complement if requested.
*/
function copy_block(s, buf, len, header)
//DeflateState *s;
//charf *buf; /* the input data */
//unsigned len; /* its length */
//int header; /* true if block header must be written */
{
bi_windup(s); /* align on byte boundary */
if (header) {
put_short(s, len);
put_short(s, ~len);
}
// while (len--) {
// put_byte(s, *buf++);
// }
utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
s.pending += len;
}
/* ===========================================================================
* Compares to subtrees, using the tree depth as tie breaker when
* the subtrees have equal frequency. This minimizes the worst case length.
*/
function smaller(tree, n, m, depth) {
var _n2 = n*2;
var _m2 = m*2;
return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
(tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
}
/* ===========================================================================
* Restore the heap property by moving down the tree starting at node k,
* exchanging a node with the smallest of its two sons if necessary, stopping
* when the heap property is re-established (each father smaller than its
* two sons).
*/
function pqdownheap(s, tree, k)
// deflate_state *s;
// ct_data *tree; /* the tree to restore */
// int k; /* node to move down */
{
var v = s.heap[k];
var j = k << 1; /* left son of k */
while (j <= s.heap_len) {
/* Set j to the smallest of the two sons: */
if (j < s.heap_len &&
smaller(tree, s.heap[j+1], s.heap[j], s.depth)) {
j++;
}
/* Exit if v is smaller than both sons */
if (smaller(tree, v, s.heap[j], s.depth)) { break; }
/* Exchange v with the smallest son */
s.heap[k] = s.heap[j];
k = j;
/* And continue down the tree, setting j to the left son of k */
j <<= 1;
}
s.heap[k] = v;
}
// inlined manually
// var SMALLEST = 1;
/* ===========================================================================
* Send the block data compressed using the given Huffman trees
*/
function compress_block(s, ltree, dtree)
// deflate_state *s;
// const ct_data *ltree; /* literal tree */
// const ct_data *dtree; /* distance tree */
{
var dist; /* distance of matched string */
var lc; /* match length or unmatched char (if dist == 0) */
var lx = 0; /* running index in l_buf */
var code; /* the code to send */
var extra; /* number of extra bits to send */
if (s.last_lit !== 0) {
do {
dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]);
lc = s.pending_buf[s.l_buf + lx];
lx++;
if (dist === 0) {
send_code(s, lc, ltree); /* send a literal byte */
//Tracecv(isgraph(lc), (stderr," '%c' ", lc));
} else {
/* Here, lc is the match length - MIN_MATCH */
code = _length_code[lc];
send_code(s, code+LITERALS+1, ltree); /* send the length code */
extra = extra_lbits[code];
if (extra !== 0) {
lc -= base_length[code];
send_bits(s, lc, extra); /* send the extra length bits */
}
dist--; /* dist is now the match distance - 1 */
code = d_code(dist);
//Assert (code < D_CODES, "bad d_code");
send_code(s, code, dtree); /* send the distance code */
extra = extra_dbits[code];
if (extra !== 0) {
dist -= base_dist[code];
send_bits(s, dist, extra); /* send the extra distance bits */
}
} /* literal or match pair ? */
/* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
//Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
// "pendingBuf overflow");
} while (lx < s.last_lit);
}
send_code(s, END_BLOCK, ltree);
}
/* ===========================================================================
* Construct one Huffman tree and assigns the code bit strings and lengths.
* Update the total bit length for the current block.
* IN assertion: the field freq is set for all tree elements.
* OUT assertions: the fields len and code are set to the optimal bit length
* and corresponding code. The length opt_len is updated; static_len is
* also updated if stree is not null. The field max_code is set.
*/
function build_tree(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
var stree = desc.stat_desc.static_tree;
var has_stree = desc.stat_desc.has_stree;
var elems = desc.stat_desc.elems;
var n, m; /* iterate over heap elements */
var max_code = -1; /* largest code with non zero frequency */
var node; /* new node being created */
/* Construct the initial heap, with least frequent element in
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
* heap[0] is not used.
*/
s.heap_len = 0;
s.heap_max = HEAP_SIZE;
for (n = 0; n < elems; n++) {
if (tree[n * 2]/*.Freq*/ !== 0) {
s.heap[++s.heap_len] = max_code = n;
s.depth[n] = 0;
} else {
tree[n*2 + 1]/*.Len*/ = 0;
}
}
/* The pkzip format requires that at least one distance code exists,
* and that at least one bit should be sent even if there is only one
* possible code. So to avoid special checks later on we force at least
* two codes of non zero frequency.
*/
while (s.heap_len < 2) {
node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
tree[node * 2]/*.Freq*/ = 1;
s.depth[node] = 0;
s.opt_len--;
if (has_stree) {
s.static_len -= stree[node*2 + 1]/*.Len*/;
}
/* node is 0 or 1 so it does not have extra bits */
}
desc.max_code = max_code;
/* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
* establish sub-heaps of increasing lengths:
*/
for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
/* Construct the Huffman tree by repeatedly combining the least two
* frequent nodes.
*/
node = elems; /* next internal node of the tree */
do {
//pqremove(s, tree, n); /* n = node of least frequency */
/*** pqremove ***/
n = s.heap[1/*SMALLEST*/];
s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
pqdownheap(s, tree, 1/*SMALLEST*/);
/***/
m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
s.heap[--s.heap_max] = m;
/* Create a new node father of n and m */
tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node;
/* and insert the new node in the heap */
s.heap[1/*SMALLEST*/] = node++;
pqdownheap(s, tree, 1/*SMALLEST*/);
} while (s.heap_len >= 2);
s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
/* At this point, the fields freq and dad are set. We can now
* generate the bit lengths.
*/
gen_bitlen(s, desc);
/* The field len is now set, we can generate the bit codes */
gen_codes(tree, max_code, s.bl_count);
}
/* ===========================================================================
* Scan a literal or distance tree to determine the frequencies of the codes
* in the bit length tree.
*/
function scan_tree(s, tree, max_code)
// deflate_state *s;
// ct_data *tree; /* the tree to be scanned */
// int max_code; /* and its largest code of non zero frequency */
{
var n; /* iterates over all tree elements */
var prevlen = -1; /* last emitted length */
var curlen; /* length of current code */
var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
var count = 0; /* repeat count of the current code */
var max_count = 7; /* max repeat count */
var min_count = 4; /* min repeat count */
if (nextlen === 0) {
max_count = 138;
min_count = 3;
}
tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */
for (n = 0; n <= max_code; n++) {
curlen = nextlen;
nextlen = tree[(n+1)*2 + 1]/*.Len*/;
if (++count < max_count && curlen === nextlen) {
continue;
} else if (count < min_count) {
s.bl_tree[curlen * 2]/*.Freq*/ += count;
} else if (curlen !== 0) {
if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
s.bl_tree[REP_3_6*2]/*.Freq*/++;
} else if (count <= 10) {
s.bl_tree[REPZ_3_10*2]/*.Freq*/++;
} else {
s.bl_tree[REPZ_11_138*2]/*.Freq*/++;
}
count = 0;
prevlen = curlen;
if (nextlen === 0) {
max_count = 138;
min_count = 3;
} else if (curlen === nextlen) {
max_count = 6;
min_count = 3;
} else {
max_count = 7;
min_count = 4;
}
}
}
/* ===========================================================================
* Send a literal or distance tree in compressed form, using the codes in
* bl_tree.
*/
function send_tree(s, tree, max_code)
// deflate_state *s;
// ct_data *tree; /* the tree to be scanned */
// int max_code; /* and its largest code of non zero frequency */
{
var n; /* iterates over all tree elements */
var prevlen = -1; /* last emitted length */
var curlen; /* length of current code */
var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
var count = 0; /* repeat count of the current code */
var max_count = 7; /* max repeat count */
var min_count = 4; /* min repeat count */
/* tree[max_code+1].Len = -1; */ /* guard already set */
if (nextlen === 0) {
max_count = 138;
min_count = 3;
}
for (n = 0; n <= max_code; n++) {
curlen = nextlen;
nextlen = tree[(n+1)*2 + 1]/*.Len*/;
if (++count < max_count && curlen === nextlen) {
continue;
} else if (count < min_count) {
do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
} else if (curlen !== 0) {
if (curlen !== prevlen) {
send_code(s, curlen, s.bl_tree);
count--;
}
//Assert(count >= 3 && count <= 6, " 3_6?");
send_code(s, REP_3_6, s.bl_tree);
send_bits(s, count-3, 2);
} else if (count <= 10) {
send_code(s, REPZ_3_10, s.bl_tree);
send_bits(s, count-3, 3);
} else {
send_code(s, REPZ_11_138, s.bl_tree);
send_bits(s, count-11, 7);
}
count = 0;
prevlen = curlen;
if (nextlen === 0) {
max_count = 138;
min_count = 3;
} else if (curlen === nextlen) {
max_count = 6;
min_count = 3;
} else {
max_count = 7;
min_count = 4;
}
}
}
/* ===========================================================================
* Construct the Huffman tree for the bit lengths and return the index in
* bl_order of the last bit length code to send.
*/
function build_bl_tree(s) {
var max_blindex; /* index of last bit length code of non zero freq */
/* Determine the bit length frequencies for literal and distance trees */
scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
/* Build the bit length tree: */
build_tree(s, s.bl_desc);
/* opt_len now includes the length of the tree representations, except
* the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
*/
/* Determine the number of bit length codes to send. The pkzip format
* requires that at least 4 bit length codes be sent. (appnote.txt says
* 3 but the actual value used is 4.)
*/
for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) {
break;
}
}
/* Update opt_len to include the bit length tree and counts */
s.opt_len += 3*(max_blindex+1) + 5+5+4;
//Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
// s->opt_len, s->static_len));
return max_blindex;
}
/* ===========================================================================
* Send the header for a block using dynamic Huffman trees: the counts, the
* lengths of the bit length codes, the literal tree and the distance tree.
* IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
*/
function send_all_trees(s, lcodes, dcodes, blcodes)
// deflate_state *s;
// int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
var rank; /* index in bl_order */
//Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
//Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
// "too many codes");
//Tracev((stderr, "\nbl counts: "));
send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
send_bits(s, dcodes-1, 5);
send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
for (rank = 0; rank < blcodes; rank++) {
//Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);
}
//Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */
//Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */
//Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}
/* ===========================================================================
* Check if the data type is TEXT or BINARY, using the following algorithm:
* - TEXT if the two conditions below are satisfied:
* a) There are no non-portable control characters belonging to the
* "black list" (0..6, 14..25, 28..31).
* b) There is at least one printable character belonging to the
* "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
* - BINARY otherwise.
* - The following partially-portable control characters form a
* "gray list" that is ignored in this detection algorithm:
* (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
* IN assertion: the fields Freq of dyn_ltree are set.
*/
function detect_data_type(s) {
/* black_mask is the bit mask of black-listed bytes
* set bits 0..6, 14..25, and 28..31
* 0xf3ffc07f = binary 11110011111111111100000001111111
*/
var black_mask = 0xf3ffc07f;
var n;
/* Check for non-textual ("black-listed") bytes. */
for (n = 0; n <= 31; n++, black_mask >>>= 1) {
if ((black_mask & 1) && (s.dyn_ltree[n*2]/*.Freq*/ !== 0)) {
return Z_BINARY;
}
}
/* Check for textual ("white-listed") bytes. */
if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
return Z_TEXT;
}
for (n = 32; n < LITERALS; n++) {
if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
return Z_TEXT;
}
}
/* There are no "black-listed" or "white-listed" bytes:
* this stream either is empty or has tolerated ("gray-listed") bytes only.
*/
return Z_BINARY;
}
var static_init_done = false;
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
function _tr_init(s)
{
if (!static_init_done) {
tr_static_init();
static_init_done = true;
}
s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
s.bi_buf = 0;
s.bi_valid = 0;
/* Initialize the first block of the first file: */
init_block(s);
}
/* ===========================================================================
* Send a stored block
*/
function _tr_stored_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf; /* input block */
//ulg stored_len; /* length of input block */
//int last; /* one if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */
copy_block(s, buf, stored_len, true); /* with header */
}
/* ===========================================================================
* Send one empty static block to give enough lookahead for inflate.
* This takes 10 bits, of which 7 may remain in the bit buffer.
*/
function _tr_align(s) {
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
bi_flush(s);
}
/* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static
* trees or store, and output the encoded block to the zip file.
*/
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf; /* input block, or NULL if too old */
//ulg stored_len; /* length of input block */
//int last; /* one if this is the last block for a file */
{
var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
var max_blindex = 0; /* index of last bit length code of non zero freq */
/* Build the Huffman trees unless a stored block is forced */
if (s.level > 0) {
/* Check if the file is binary or text */
if (s.strm.data_type === Z_UNKNOWN) {
s.strm.data_type = detect_data_type(s);
}
/* Construct the literal and distance trees */
build_tree(s, s.l_desc);
// Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
// s->static_len));
build_tree(s, s.d_desc);
// Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
// s->static_len));
/* At this point, opt_len and static_len are the total bit lengths of
* the compressed block data, excluding the tree representations.
*/
/* Build the bit length tree for the above two trees, and get the index
* in bl_order of the last bit length code to send.
*/
max_blindex = build_bl_tree(s);
/* Determine the best encoding. Compute the block lengths in bytes. */
opt_lenb = (s.opt_len+3+7) >>> 3;
static_lenb = (s.static_len+3+7) >>> 3;
// Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
// opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
// s->last_lit));
if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
} else {
// Assert(buf != (char*)0, "lost buf");
opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
}
if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {
/* 4: two words for the lengths */
/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
* Otherwise we can't have processed more than WSIZE input bytes since
* the last block flush, because compression would have been
* successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
* transform a block into a stored block.
*/
_tr_stored_block(s, buf, stored_len, last);
} else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);
compress_block(s, static_ltree, static_dtree);
} else {
send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);
send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);
compress_block(s, s.dyn_ltree, s.dyn_dtree);
}
// Assert (s->compressed_len == s->bits_sent, "bad compressed size");
/* The above check is made mod 2^32, for files larger than 512 MB
* and uLong implemented on 32 bits.
*/
init_block(s);
if (last) {
bi_windup(s);
}
// Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
// s->compressed_len-7*last));
}
/* ===========================================================================
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
function _tr_tally(s, dist, lc)
// deflate_state *s;
// unsigned dist; /* distance of matched string */
// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
//var out_length, in_length, dcode;
s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
s.last_lit++;
if (dist === 0) {
/* lc is the unmatched char */
s.dyn_ltree[lc*2]/*.Freq*/++;
} else {
s.matches++;
/* Here, lc is the match length - MIN_MATCH */
dist--; /* dist = match distance - 1 */
//Assert((ush)dist < (ush)MAX_DIST(s) &&
// (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
// (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;
s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
}
// (!) This block is disabled in zlib defailts,
// don't enable it for binary compatibility
//#ifdef TRUNCATE_BLOCK
// /* Try to guess if it is profitable to stop the current block here */
// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
// /* Compute an upper bound for the compressed length */
// out_length = s.last_lit*8;
// in_length = s.strstart - s.block_start;
//
// for (dcode = 0; dcode < D_CODES; dcode++) {
// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
// }
// out_length >>>= 3;
// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
// // s->last_lit, in_length, out_length,
// // 100L - out_length*100L/in_length));
// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
// return true;
// }
// }
//#endif
return (s.last_lit === s.lit_bufsize-1);
/* We avoid equality with lit_bufsize because of wraparound at 64K
* on 16 bit machines and because stored blocks are restricted to
* 64K-1 bytes.
*/
}
exports._tr_init = _tr_init;
exports._tr_stored_block = _tr_stored_block;
exports._tr_flush_block = _tr_flush_block;
exports._tr_tally = _tr_tally;
exports._tr_align = _tr_align;
},{"../utils/common":88}],100:[function(_dereq_,module,exports){
'use strict';
function ZStream() {
/* next input byte */
this.input = null; // JS specific, because we have no pointers
this.next_in = 0;
/* number of bytes available at input */
this.avail_in = 0;
/* total number of input bytes read so far */
this.total_in = 0;
/* next output byte should be put there */
this.output = null; // JS specific, because we have no pointers
this.next_out = 0;
/* remaining free space at output */
this.avail_out = 0;
/* total number of bytes output so far */
this.total_out = 0;
/* last error message, NULL if no error */
this.msg = ''/*Z_NULL*/;
/* not visible by applications */
this.state = null;
/* best guess about the data type: binary or text */
this.data_type = 2/*Z_UNKNOWN*/;
/* adler32 value of the uncompressed data */
this.adler = 0;
}
module.exports = ZStream;
},{}],101:[function(_dereq_,module,exports){
/*
* Copyright 2012-2013 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define, location) {
'use strict';
var undef;
define(function (_dereq_) {
var mixin, origin, urlRE, absoluteUrlRE, fullyQualifiedUrlRE;
mixin = _dereq_('./util/mixin');
urlRE = /([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?(\/[^?#]*)?(\?[^#]*)?(#\S*)?/i;
absoluteUrlRE = /^([a-z][a-z0-9\-\+\.]*:\/\/|\/)/i;
fullyQualifiedUrlRE = /([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?\//i;
/**
* Apply params to the template to create a URL.
*
* Parameters that are not applied directly to the template, are appended
* to the URL as query string parameters.
*
* @param {string} template the URI template
* @param {Object} params parameters to apply to the template
* @return {string} the resulting URL
*/
function buildUrl(template, params) {
// internal builder to convert template with params.
var url, name, queryStringParams, re;
url = template;
queryStringParams = {};
if (params) {
for (name in params) {
/*jshint forin:false */
re = new RegExp('\\{' + name + '\\}');
if (re.test(url)) {
url = url.replace(re, encodeURIComponent(params[name]), 'g');
}
else {
queryStringParams[name] = params[name];
}
}
for (name in queryStringParams) {
url += url.indexOf('?') === -1 ? '?' : '&';
url += encodeURIComponent(name);
if (queryStringParams[name] !== null && queryStringParams[name] !== undefined) {
url += '=';
url += encodeURIComponent(queryStringParams[name]);
}
}
}
return url;
}
function startsWith(str, test) {
return str.indexOf(test) === 0;
}
/**
* Create a new URL Builder
*
* @param {string|UrlBuilder} template the base template to build from, may be another UrlBuilder
* @param {Object} [params] base parameters
* @constructor
*/
function UrlBuilder(template, params) {
if (!(this instanceof UrlBuilder)) {
// invoke as a constructor
return new UrlBuilder(template, params);
}
if (template instanceof UrlBuilder) {
this._template = template.template;
this._params = mixin({}, this._params, params);
}
else {
this._template = (template || '').toString();
this._params = params || {};
}
}
UrlBuilder.prototype = {
/**
* Create a new UrlBuilder instance that extends the current builder.
* The current builder is unmodified.
*
* @param {string} [template] URL template to append to the current template
* @param {Object} [params] params to combine with current params. New params override existing params
* @return {UrlBuilder} the new builder
*/
append: function (template, params) {
// TODO consider query strings and fragments
return new UrlBuilder(this._template + template, mixin({}, this._params, params));
},
/**
* Create a new UrlBuilder with a fully qualified URL based on the
* window's location or base href and the current templates relative URL.
*
* Path variables are preserved.
*
* *Browser only*
*
* @return {UrlBuilder} the fully qualified URL template
*/
fullyQualify: function () {
if (!location) { return this; }
if (this.isFullyQualified()) { return this; }
var template = this._template;
if (startsWith(template, '//')) {
template = origin.protocol + template;
}
else if (startsWith(template, '/')) {
template = origin.origin + template;
}
else if (!this.isAbsolute()) {
template = origin.origin + origin.pathname.substring(0, origin.pathname.lastIndexOf('/') + 1);
}
if (template.indexOf('/', 8) === -1) {
// default the pathname to '/'
template = template + '/';
}
return new UrlBuilder(template, this._params);
},
/**
* True if the URL is absolute
*
* @return {boolean}
*/
isAbsolute: function () {
return absoluteUrlRE.test(this.build());
},
/**
* True if the URL is fully qualified
*
* @return {boolean}
*/
isFullyQualified: function () {
return fullyQualifiedUrlRE.test(this.build());
},
/**
* True if the URL is cross origin. The protocol, host and port must not be
* the same in order to be cross origin,
*
* @return {boolean}
*/
isCrossOrigin: function () {
if (!origin) {
return true;
}
var url = this.parts();
return url.protocol !== origin.protocol ||
url.hostname !== origin.hostname ||
url.port !== origin.port;
},
/**
* Split a URL into its consituent parts following the naming convention of
* 'window.location'. One difference is that the port will contain the
* protocol default if not specified.
*
* @see https://developer.mozilla.org/en-US/docs/DOM/window.location
*
* @returns {Object} a 'window.location'-like object
*/
parts: function () {
/*jshint maxcomplexity:20 */
var url, parts;
url = this.fullyQualify().build().match(urlRE);
parts = {
href: url[0],
protocol: url[1],
host: url[3] || '',
hostname: url[4] || '',
port: url[6],
pathname: url[7] || '',
search: url[8] || '',
hash: url[9] || ''
};
parts.origin = parts.protocol + '//' + parts.host;
parts.port = parts.port || (parts.protocol === 'https:' ? '443' : parts.protocol === 'http:' ? '80' : '');
return parts;
},
/**
* Expand the template replacing path variables with parameters
*
* @param {Object} [params] params to combine with current params. New params override existing params
* @return {string} the expanded URL
*/
build: function (params) {
return buildUrl(this._template, mixin({}, this._params, params));
},
/**
* @see build
*/
toString: function () {
return this.build();
}
};
origin = location ? new UrlBuilder(location.href).parts() : undef;
return UrlBuilder;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); },
typeof window !== 'undefined' ? window.location : void 0
// Boilerplate for AMD and Node
));
},{"./util/mixin":137}],102:[function(_dereq_,module,exports){
/*
* Copyright 2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var rest = _dereq_('./client/default'),
browser = _dereq_('./client/xhr');
rest.setPlatformDefaultClient(browser);
return rest;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"./client/default":104,"./client/xhr":105}],103:[function(_dereq_,module,exports){
/*
* Copyright 2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
/**
* Add common helper methods to a client impl
*
* @param {function} impl the client implementation
* @param {Client} [target] target of this client, used when wrapping other clients
* @returns {Client} the client impl with additional methods
*/
return function client(impl, target) {
if (target) {
/**
* @returns {Client} the target client
*/
impl.skip = function skip() {
return target;
};
}
/**
* Allow a client to easily be wrapped by an interceptor
*
* @param {Interceptor} interceptor the interceptor to wrap this client with
* @param [config] configuration for the interceptor
* @returns {Client} the newly wrapped client
*/
impl.wrap = function wrap(interceptor, config) {
return interceptor(impl, config);
};
/**
* @deprecated
*/
impl.chain = function chain() {
if (typeof console !== 'undefined') {
console.log('rest.js: client.chain() is deprecated, use client.wrap() instead');
}
return impl.wrap.apply(this, arguments);
};
return impl;
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],104:[function(_dereq_,module,exports){
/*
* Copyright 2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
var undef;
define(function (_dereq_) {
/**
* Plain JS Object containing properties that represent an HTTP request.
*
* Depending on the capabilities of the underlying client, a request
* may be cancelable. If a request may be canceled, the client will add
* a canceled flag and cancel function to the request object. Canceling
* the request will put the response into an error state.
*
* @field {string} [method='GET'] HTTP method, commonly GET, POST, PUT, DELETE or HEAD
* @field {string|UrlBuilder} [path=''] path template with optional path variables
* @field {Object} [params] parameters for the path template and query string
* @field {Object} [headers] custom HTTP headers to send, in addition to the clients default headers
* @field [entity] the HTTP entity, common for POST or PUT requests
* @field {boolean} [canceled] true if the request has been canceled, set by the client
* @field {Function} [cancel] cancels the request if invoked, provided by the client
* @field {Client} [originator] the client that first handled this request, provided by the interceptor
*
* @class Request
*/
/**
* Plain JS Object containing properties that represent an HTTP response
*
* @field {Object} [request] the request object as received by the root client
* @field {Object} [raw] the underlying request object, like XmlHttpRequest in a browser
* @field {number} [status.code] status code of the response (i.e. 200, 404)
* @field {string} [status.text] status phrase of the response
* @field {Object] [headers] response headers hash of normalized name, value pairs
* @field [entity] the response body
*
* @class Response
*/
/**
* HTTP client particularly suited for RESTful operations.
*
* @field {function} wrap wraps this client with a new interceptor returning the wrapped client
*
* @param {Request} the HTTP request
* @returns {ResponsePromise<Response>} a promise the resolves to the HTTP response
*
* @class Client
*/
/**
* Extended when.js Promises/A+ promise with HTTP specific helpers
*q
* @method entity promise for the HTTP entity
* @method status promise for the HTTP status code
* @method headers promise for the HTTP response headers
* @method header promise for a specific HTTP response header
*
* @class ResponsePromise
* @extends Promise
*/
var client, target, platformDefault;
client = _dereq_('../client');
/**
* Make a request with the default client
* @param {Request} the HTTP request
* @returns {Promise<Response>} a promise the resolves to the HTTP response
*/
function defaultClient() {
return target.apply(undef, arguments);
}
/**
* Change the default client
* @param {Client} client the new default client
*/
defaultClient.setDefaultClient = function setDefaultClient(client) {
target = client;
};
/**
* Obtain a direct reference to the current default client
* @returns {Client} the default client
*/
defaultClient.getDefaultClient = function getDefaultClient() {
return target;
};
/**
* Reset the default client to the platform default
*/
defaultClient.resetDefaultClient = function resetDefaultClient() {
target = platformDefault;
};
/**
* @private
*/
defaultClient.setPlatformDefaultClient = function setPlatformDefaultClient(client) {
if (platformDefault) {
throw new Error('Unable to redefine platformDefaultClient');
}
target = platformDefault = client;
};
return client(defaultClient);
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"../client":103}],105:[function(_dereq_,module,exports){
/*
* Copyright 2012-2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define, global) {
'use strict';
define(function (_dereq_) {
var when, UrlBuilder, normalizeHeaderName, responsePromise, client, headerSplitRE;
when = _dereq_('when');
UrlBuilder = _dereq_('../UrlBuilder');
normalizeHeaderName = _dereq_('../util/normalizeHeaderName');
responsePromise = _dereq_('../util/responsePromise');
client = _dereq_('../client');
// according to the spec, the line break is '\r\n', but doesn't hold true in practice
headerSplitRE = /[\r|\n]+/;
function parseHeaders(raw) {
// Note: Set-Cookie will be removed by the browser
var headers = {};
if (!raw) { return headers; }
raw.trim().split(headerSplitRE).forEach(function (header) {
var boundary, name, value;
boundary = header.indexOf(':');
name = normalizeHeaderName(header.substring(0, boundary).trim());
value = header.substring(boundary + 1).trim();
if (headers[name]) {
if (Array.isArray(headers[name])) {
// add to an existing array
headers[name].push(value);
}
else {
// convert single value to array
headers[name] = [headers[name], value];
}
}
else {
// new, single value
headers[name] = value;
}
});
return headers;
}
function safeMixin(target, source) {
Object.keys(source || {}).forEach(function (prop) {
// make sure the property already exists as
// IE 6 will blow up if we add a new prop
if (source.hasOwnProperty(prop) && prop in target) {
try {
target[prop] = source[prop];
}
catch (e) {
// ignore, expected for some properties at some points in the request lifecycle
}
}
});
return target;
}
return client(function xhr(request) {
return responsePromise.promise(function (resolve, reject) {
/*jshint maxcomplexity:20 */
var client, method, url, headers, entity, headerName, response, XMLHttpRequest;
request = typeof request === 'string' ? { path: request } : request || {};
response = { request: request };
if (request.canceled) {
response.error = 'precanceled';
reject(response);
return;
}
XMLHttpRequest = request.engine || global.XMLHttpRequest;
if (!XMLHttpRequest) {
reject({ request: request, error: 'xhr-not-available' });
return;
}
entity = request.entity;
request.method = request.method || (entity ? 'POST' : 'GET');
method = request.method;
url = new UrlBuilder(request.path || '', request.params).build();
try {
client = response.raw = new XMLHttpRequest();
// mixin extra request properties before and after opening the request as some properties require being set at different phases of the request
safeMixin(client, request.mixin);
client.open(method, url, true);
safeMixin(client, request.mixin);
headers = request.headers;
for (headerName in headers) {
/*jshint forin:false */
if (headerName === 'Content-Type' && headers[headerName] === 'multipart/form-data') {
// XMLHttpRequest generates its own Content-Type header with the
// appropriate multipart boundary when sending multipart/form-data.
continue;
}
client.setRequestHeader(headerName, headers[headerName]);
}
request.canceled = false;
request.cancel = function cancel() {
request.canceled = true;
client.abort();
reject(response);
};
client.onreadystatechange = function (/* e */) {
if (request.canceled) { return; }
if (client.readyState === (XMLHttpRequest.DONE || 4)) {
response.status = {
code: client.status,
text: client.statusText
};
response.headers = parseHeaders(client.getAllResponseHeaders());
response.entity = client.responseText;
if (response.status.code > 0) {
// check status code as readystatechange fires before error event
resolve(response);
}
else {
// give the error callback a chance to fire before resolving
// requests for file:// URLs do not have a status code
setTimeout(function () {
resolve(response);
}, 0);
}
}
};
try {
client.onerror = function (/* e */) {
response.error = 'loaderror';
reject(response);
};
}
catch (e) {
// IE 6 will not support error handling
}
client.send(entity);
}
catch (e) {
response.error = 'loaderror';
reject(response);
}
});
});
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); },
typeof window !== 'undefined' ? window : void 0
// Boilerplate for AMD and Node
));
},{"../UrlBuilder":101,"../client":103,"../util/normalizeHeaderName":138,"../util/responsePromise":139,"when":134}],106:[function(_dereq_,module,exports){
/*
* Copyright 2012-2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var defaultClient, mixin, responsePromise, client, when;
defaultClient = _dereq_('./client/default');
mixin = _dereq_('./util/mixin');
responsePromise = _dereq_('./util/responsePromise');
client = _dereq_('./client');
when = _dereq_('when');
/**
* Interceptors have the ability to intercept the request and/org response
* objects. They may augment, prune, transform or replace the
* request/response as needed. Clients may be composed by wrapping
* together multiple interceptors.
*
* Configured interceptors are functional in nature. Wrapping a client in
* an interceptor will not affect the client, merely the data that flows in
* and out of that client. A common configuration can be created once and
* shared; specialization can be created by further wrapping that client
* with custom interceptors.
*
* @param {Client} [target] client to wrap
* @param {Object} [config] configuration for the interceptor, properties will be specific to the interceptor implementation
* @returns {Client} A client wrapped with the interceptor
*
* @class Interceptor
*/
function defaultInitHandler(config) {
return config;
}
function defaultRequestHandler(request /*, config, meta */) {
return request;
}
function defaultResponseHandler(response /*, config, meta */) {
return response;
}
function race(promisesOrValues) {
// this function is different than when.any as the first to reject also wins
return when.promise(function (resolve, reject) {
promisesOrValues.forEach(function (promiseOrValue) {
when(promiseOrValue, resolve, reject);
});
});
}
/**
* Alternate return type for the request handler that allows for more complex interactions.
*
* @param properties.request the traditional request return object
* @param {Promise} [properties.abort] promise that resolves if/when the request is aborted
* @param {Client} [properties.client] override the defined client with an alternate client
* @param [properties.response] response for the request, short circuit the request
*/
function ComplexRequest(properties) {
if (!(this instanceof ComplexRequest)) {
// in case users forget the 'new' don't mix into the interceptor
return new ComplexRequest(properties);
}
mixin(this, properties);
}
/**
* Create a new interceptor for the provided handlers.
*
* @param {Function} [handlers.init] one time intialization, must return the config object
* @param {Function} [handlers.request] request handler
* @param {Function} [handlers.response] response handler regardless of error state
* @param {Function} [handlers.success] response handler when the request is not in error
* @param {Function} [handlers.error] response handler when the request is in error, may be used to 'unreject' an error state
* @param {Function} [handlers.client] the client to use if otherwise not specified, defaults to platform default client
*
* @returns {Interceptor}
*/
function interceptor(handlers) {
var initHandler, requestHandler, successResponseHandler, errorResponseHandler;
handlers = handlers || {};
initHandler = handlers.init || defaultInitHandler;
requestHandler = handlers.request || defaultRequestHandler;
successResponseHandler = handlers.success || handlers.response || defaultResponseHandler;
errorResponseHandler = handlers.error || function () {
// Propagate the rejection, with the result of the handler
return when((handlers.response || defaultResponseHandler).apply(this, arguments), when.reject, when.reject);
};
return function (target, config) {
if (typeof target === 'object') {
config = target;
}
if (typeof target !== 'function') {
target = handlers.client || defaultClient;
}
config = initHandler(config || {});
function interceptedClient(request) {
var context, meta;
context = {};
meta = { 'arguments': Array.prototype.slice.call(arguments), client: interceptedClient };
request = typeof request === 'string' ? { path: request } : request || {};
request.originator = request.originator || interceptedClient;
return responsePromise(
requestHandler.call(context, request, config, meta),
function (request) {
var response, abort, next;
next = target;
if (request instanceof ComplexRequest) {
// unpack request
abort = request.abort;
next = request.client || next;
response = request.response;
// normalize request, must be last
request = request.request;
}
response = response || when(request, function (request) {
return when(
next(request),
function (response) {
return successResponseHandler.call(context, response, config, meta);
},
function (response) {
return errorResponseHandler.call(context, response, config, meta);
}
);
});
return abort ? race([response, abort]) : response;
},
function (error) {
return when.reject({ request: request, error: error });
}
);
}
return client(interceptedClient, target);
};
}
interceptor.ComplexRequest = ComplexRequest;
return interceptor;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"./client":103,"./client/default":104,"./util/mixin":137,"./util/responsePromise":139,"when":134}],107:[function(_dereq_,module,exports){
/*
* Copyright 2012-2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var interceptor, mime, registry, noopConverter, when;
interceptor = _dereq_('../interceptor');
mime = _dereq_('../mime');
registry = _dereq_('../mime/registry');
when = _dereq_('when');
noopConverter = {
read: function (obj) { return obj; },
write: function (obj) { return obj; }
};
/**
* MIME type support for request and response entities. Entities are
* (de)serialized using the converter for the MIME type.
*
* Request entities are converted using the desired converter and the
* 'Accept' request header prefers this MIME.
*
* Response entities are converted based on the Content-Type response header.
*
* @param {Client} [client] client to wrap
* @param {string} [config.mime='text/plain'] MIME type to encode the request
* entity
* @param {string} [config.accept] Accept header for the request
* @param {Client} [config.client=<request.originator>] client passed to the
* converter, defaults to the client originating the request
* @param {Registry} [config.registry] MIME registry, defaults to the root
* registry
* @param {boolean} [config.permissive] Allow an unkown request MIME type
*
* @returns {Client}
*/
return interceptor({
init: function (config) {
config.registry = config.registry || registry;
return config;
},
request: function (request, config) {
var type, headers;
headers = request.headers || (request.headers = {});
type = mime.parse(headers['Content-Type'] = headers['Content-Type'] || config.mime || 'text/plain');
headers.Accept = headers.Accept || config.accept || type.raw + ', application/json;q=0.8, text/plain;q=0.5, */*;q=0.2';
if (!('entity' in request)) {
return request;
}
return config.registry.lookup(type).otherwise(function () {
// failed to resolve converter
if (config.permissive) {
return noopConverter;
}
throw 'mime-unknown';
}).then(function (converter) {
var client = config.client || request.originator;
return when.attempt(converter.write, request.entity, { client: client, request: request, mime: type, registry: config.registry })
.otherwise(function() {
throw 'mime-serialization';
})
.then(function(entity) {
request.entity = entity;
return request;
});
});
},
response: function (response, config) {
if (!(response.headers && response.headers['Content-Type'] && response.entity)) {
return response;
}
var type = mime.parse(response.headers['Content-Type']);
return config.registry.lookup(type).otherwise(function () { return noopConverter; }).then(function (converter) {
var client = config.client || response.request && response.request.originator;
return when.attempt(converter.read, response.entity, { client: client, response: response, mime: type, registry: config.registry })
.otherwise(function (e) {
response.error = 'mime-deserialization';
response.cause = e;
throw response;
})
.then(function (entity) {
response.entity = entity;
return response;
});
});
}
});
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"../interceptor":106,"../mime":110,"../mime/registry":111,"when":134}],108:[function(_dereq_,module,exports){
/*
* Copyright 2012-2013 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var interceptor, UrlBuilder;
interceptor = _dereq_('../interceptor');
UrlBuilder = _dereq_('../UrlBuilder');
function startsWith(str, prefix) {
return str.indexOf(prefix) === 0;
}
function endsWith(str, suffix) {
return str.lastIndexOf(suffix) + suffix.length === str.length;
}
/**
* Prefixes the request path with a common value.
*
* @param {Client} [client] client to wrap
* @param {number} [config.prefix] path prefix
*
* @returns {Client}
*/
return interceptor({
request: function (request, config) {
var path;
if (config.prefix && !(new UrlBuilder(request.path).isFullyQualified())) {
path = config.prefix;
if (request.path) {
if (!endsWith(path, '/') && !startsWith(request.path, '/')) {
// add missing '/' between path sections
path += '/';
}
path += request.path;
}
request.path = path;
}
return request;
}
});
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"../UrlBuilder":101,"../interceptor":106}],109:[function(_dereq_,module,exports){
/*
* Copyright 2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var interceptor, uriTemplate, mixin;
interceptor = _dereq_('../interceptor');
uriTemplate = _dereq_('../util/uriTemplate');
mixin = _dereq_('../util/mixin');
/**
* Applies request params to the path as a URI Template
*
* Params are removed from the request object, as they have been consumed.
*
* @param {Client} [client] client to wrap
* @param {Object} [config.params] default param values
* @param {string} [config.template] default template
*
* @returns {Client}
*/
return interceptor({
init: function (config) {
config.params = config.params || {};
config.template = config.template || '';
return config;
},
request: function (request, config) {
var template, params;
template = request.path || config.template;
params = mixin({}, request.params, config.params);
request.path = uriTemplate.expand(template, params);
delete request.params;
return request;
}
});
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"../interceptor":106,"../util/mixin":137,"../util/uriTemplate":141}],110:[function(_dereq_,module,exports){
/*
* Copyright 2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
var undef;
define(function (/* require */) {
/**
* Parse a MIME type into it's constituent parts
*
* @param {string} mime MIME type to parse
* @return {{
* {string} raw the original MIME type
* {string} type the type and subtype
* {string} [suffix] mime suffix, including the plus, if any
* {Object} params key/value pair of attributes
* }}
*/
function parse(mime) {
var params, type;
params = mime.split(';');
type = params[0].trim().split('+');
return {
raw: mime,
type: type[0],
suffix: type[1] ? '+' + type[1] : '',
params: params.slice(1).reduce(function (params, pair) {
pair = pair.split('=');
params[pair[0].trim()] = pair[1] ? pair[1].trim() : undef;
return params;
}, {})
};
}
return {
parse: parse
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],111:[function(_dereq_,module,exports){
/*
* Copyright 2012-2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var mime, when, registry;
mime = _dereq_('../mime');
when = _dereq_('when');
function Registry(mimes) {
/**
* Lookup the converter for a MIME type
*
* @param {string} type the MIME type
* @return a promise for the converter
*/
this.lookup = function lookup(type) {
var parsed;
parsed = typeof type === 'string' ? mime.parse(type) : type;
if (mimes[parsed.raw]) {
return mimes[parsed.raw];
}
if (mimes[parsed.type + parsed.suffix]) {
return mimes[parsed.type + parsed.suffix];
}
if (mimes[parsed.type]) {
return mimes[parsed.type];
}
if (mimes[parsed.suffix]) {
return mimes[parsed.suffix];
}
return when.reject(new Error('Unable to locate converter for mime "' + parsed.raw + '"'));
};
/**
* Create a late dispatched proxy to the target converter.
*
* Common when a converter is registered under multiple names and
* should be kept in sync if updated.
*
* @param {string} type mime converter to dispatch to
* @returns converter whose read/write methods target the desired mime converter
*/
this.delegate = function delegate(type) {
return {
read: function () {
var args = arguments;
return this.lookup(type).then(function (converter) {
return converter.read.apply(this, args);
}.bind(this));
}.bind(this),
write: function () {
var args = arguments;
return this.lookup(type).then(function (converter) {
return converter.write.apply(this, args);
}.bind(this));
}.bind(this)
};
};
/**
* Register a custom converter for a MIME type
*
* @param {string} type the MIME type
* @param converter the converter for the MIME type
* @return a promise for the converter
*/
this.register = function register(type, converter) {
mimes[type] = when(converter);
return mimes[type];
};
/**
* Create a child registry whoes registered converters remain local, while
* able to lookup converters from its parent.
*
* @returns child MIME registry
*/
this.child = function child() {
return new Registry(Object.create(mimes));
};
}
registry = new Registry({});
// include provided serializers
registry.register('application/hal', _dereq_('./type/application/hal'));
registry.register('application/json', _dereq_('./type/application/json'));
registry.register('application/x-www-form-urlencoded', _dereq_('./type/application/x-www-form-urlencoded'));
registry.register('multipart/form-data', _dereq_('./type/multipart/form-data'));
registry.register('text/plain', _dereq_('./type/text/plain'));
registry.register('+json', registry.delegate('application/json'));
return registry;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"../mime":110,"./type/application/hal":112,"./type/application/json":113,"./type/application/x-www-form-urlencoded":114,"./type/multipart/form-data":115,"./type/text/plain":116,"when":134}],112:[function(_dereq_,module,exports){
/*
* Copyright 2013-2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var pathPrefix, template, find, lazyPromise, responsePromise, when;
pathPrefix = _dereq_('../../../interceptor/pathPrefix');
template = _dereq_('../../../interceptor/template');
find = _dereq_('../../../util/find');
lazyPromise = _dereq_('../../../util/lazyPromise');
responsePromise = _dereq_('../../../util/responsePromise');
when = _dereq_('when');
function defineProperty(obj, name, value) {
Object.defineProperty(obj, name, {
value: value,
configurable: true,
enumerable: false,
writeable: true
});
}
/**
* Hypertext Application Language serializer
*
* Implemented to https://tools.ietf.org/html/draft-kelly-json-hal-06
*
* As the spec is still a draft, this implementation will be updated as the
* spec evolves
*
* Objects are read as HAL indexing links and embedded objects on to the
* resource. Objects are written as plain JSON.
*
* Embedded relationships are indexed onto the resource by the relationship
* as a promise for the related resource.
*
* Links are indexed onto the resource as a lazy promise that will GET the
* resource when a handler is first registered on the promise.
*
* A `requestFor` method is added to the entity to make a request for the
* relationship.
*
* A `clientFor` method is added to the entity to get a full Client for a
* relationship.
*
* The `_links` and `_embedded` properties on the resource are made
* non-enumerable.
*/
return {
read: function (str, opts) {
var client, console;
opts = opts || {};
client = opts.client;
console = opts.console || console;
function deprecationWarning(relationship, deprecation) {
if (deprecation && console && console.warn || console.log) {
(console.warn || console.log).call(console, 'Relationship \'' + relationship + '\' is deprecated, see ' + deprecation);
}
}
return opts.registry.lookup(opts.mime.suffix).then(function (converter) {
return when(converter.read(str, opts)).then(function (root) {
find.findProperties(root, '_embedded', function (embedded, resource, name) {
Object.keys(embedded).forEach(function (relationship) {
if (relationship in resource) { return; }
var related = responsePromise({
entity: embedded[relationship]
});
defineProperty(resource, relationship, related);
});
defineProperty(resource, name, embedded);
});
find.findProperties(root, '_links', function (links, resource, name) {
Object.keys(links).forEach(function (relationship) {
var link = links[relationship];
if (relationship in resource) { return; }
defineProperty(resource, relationship, responsePromise.make(lazyPromise(function () {
if (link.deprecation) { deprecationWarning(relationship, link.deprecation); }
if (link.templated === true) {
return template(client)({ path: link.href });
}
return client({ path: link.href });
})));
});
defineProperty(resource, name, links);
defineProperty(resource, 'clientFor', function (relationship, clientOverride) {
var link = links[relationship];
if (!link) {
throw new Error('Unknown relationship: ' + relationship);
}
if (link.deprecation) { deprecationWarning(relationship, link.deprecation); }
if (link.templated === true) {
return template(
clientOverride || client,
{ template: link.href }
);
}
return pathPrefix(
clientOverride || client,
{ prefix: link.href }
);
});
defineProperty(resource, 'requestFor', function (relationship, request, clientOverride) {
var client = this.clientFor(relationship, clientOverride);
return client(request);
});
});
return root;
});
});
},
write: function (obj, opts) {
return opts.registry.lookup(opts.mime.suffix).then(function (converter) {
return converter.write(obj, opts);
});
}
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"../../../interceptor/pathPrefix":108,"../../../interceptor/template":109,"../../../util/find":135,"../../../util/lazyPromise":136,"../../../util/responsePromise":139,"when":134}],113:[function(_dereq_,module,exports){
/*
* Copyright 2012-2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
/**
* Create a new JSON converter with custom reviver/replacer.
*
* The extended converter must be published to a MIME registry in order
* to be used. The existing converter will not be modified.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
*
* @param {function} [reviver=undefined] custom JSON.parse reviver
* @param {function|Array} [replacer=undefined] custom JSON.stringify replacer
*/
function createConverter(reviver, replacer) {
return {
read: function (str) {
return JSON.parse(str, reviver);
},
write: function (obj) {
return JSON.stringify(obj, replacer);
},
extend: createConverter
};
}
return createConverter();
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],114:[function(_dereq_,module,exports){
/*
* Copyright 2012 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
var encodedSpaceRE, urlEncodedSpaceRE;
encodedSpaceRE = /%20/g;
urlEncodedSpaceRE = /\+/g;
function urlEncode(str) {
str = encodeURIComponent(str);
// spec says space should be encoded as '+'
return str.replace(encodedSpaceRE, '+');
}
function urlDecode(str) {
// spec says space should be encoded as '+'
str = str.replace(urlEncodedSpaceRE, ' ');
return decodeURIComponent(str);
}
function append(str, name, value) {
if (Array.isArray(value)) {
value.forEach(function (value) {
str = append(str, name, value);
});
}
else {
if (str.length > 0) {
str += '&';
}
str += urlEncode(name);
if (value !== undefined && value !== null) {
str += '=' + urlEncode(value);
}
}
return str;
}
return {
read: function (str) {
var obj = {};
str.split('&').forEach(function (entry) {
var pair, name, value;
pair = entry.split('=');
name = urlDecode(pair[0]);
if (pair.length === 2) {
value = urlDecode(pair[1]);
}
else {
value = null;
}
if (name in obj) {
if (!Array.isArray(obj[name])) {
// convert to an array, perserving currnent value
obj[name] = [obj[name]];
}
obj[name].push(value);
}
else {
obj[name] = value;
}
});
return obj;
},
write: function (obj) {
var str = '';
Object.keys(obj).forEach(function (name) {
str = append(str, name, obj[name]);
});
return str;
}
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],115:[function(_dereq_,module,exports){
/*
* Copyright 2014 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Michael Jackson
*/
/* global FormData, File, Blob */
(function (define) {
'use strict';
define(function (/* require */) {
function isFormElement(object) {
return object &&
object.nodeType === 1 && // Node.ELEMENT_NODE
object.tagName === 'FORM';
}
function createFormDataFromObject(object) {
var formData = new FormData();
var value;
for (var property in object) {
if (object.hasOwnProperty(property)) {
value = object[property];
if (value instanceof File) {
formData.append(property, value, value.name);
} else if (value instanceof Blob) {
formData.append(property, value);
} else {
formData.append(property, String(value));
}
}
}
return formData;
}
return {
write: function (object) {
if (typeof FormData === 'undefined') {
throw new Error('The multipart/form-data mime serializer requires FormData support');
}
// Support FormData directly.
if (object instanceof FormData) {
return object;
}
// Support <form> elements.
if (isFormElement(object)) {
return new FormData(object);
}
// Support plain objects, may contain File/Blob as value.
if (typeof object === 'object' && object !== null) {
return createFormDataFromObject(object);
}
throw new Error('Unable to create FormData from object ' + object);
}
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],116:[function(_dereq_,module,exports){
/*
* Copyright 2012 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
return {
read: function (str) {
return str;
},
write: function (obj) {
return obj.toString();
}
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],117:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function (_dereq_) {
var makePromise = _dereq_('./makePromise');
var Scheduler = _dereq_('./Scheduler');
var async = _dereq_('./env').asap;
return makePromise({
scheduler: new Scheduler(async)
});
});
})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); });
},{"./Scheduler":118,"./env":130,"./makePromise":132}],118:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
// Credit to Twisol (https://github.com/Twisol) for suggesting
// this type of extensible queue + trampoline approach for next-tick conflation.
/**
* Async task scheduler
* @param {function} async function to schedule a single async function
* @constructor
*/
function Scheduler(async) {
this._async = async;
this._running = false;
this._queue = this;
this._queueLen = 0;
this._afterQueue = {};
this._afterQueueLen = 0;
var self = this;
this.drain = function() {
self._drain();
};
}
/**
* Enqueue a task
* @param {{ run:function }} task
*/
Scheduler.prototype.enqueue = function(task) {
this._queue[this._queueLen++] = task;
this.run();
};
/**
* Enqueue a task to run after the main task queue
* @param {{ run:function }} task
*/
Scheduler.prototype.afterQueue = function(task) {
this._afterQueue[this._afterQueueLen++] = task;
this.run();
};
Scheduler.prototype.run = function() {
if (!this._running) {
this._running = true;
this._async(this.drain);
}
};
/**
* Drain the handler queue entirely, and then the after queue
*/
Scheduler.prototype._drain = function() {
var i = 0;
for (; i < this._queueLen; ++i) {
this._queue[i].run();
this._queue[i] = void 0;
}
this._queueLen = 0;
this._running = false;
for (i = 0; i < this._afterQueueLen; ++i) {
this._afterQueue[i].run();
this._afterQueue[i] = void 0;
}
this._afterQueueLen = 0;
};
return Scheduler;
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],119:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
/**
* Custom error type for promises rejected by promise.timeout
* @param {string} message
* @constructor
*/
function TimeoutError (message) {
Error.call(this);
this.message = message;
this.name = TimeoutError.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, TimeoutError);
}
}
TimeoutError.prototype = Object.create(Error.prototype);
TimeoutError.prototype.constructor = TimeoutError;
return TimeoutError;
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],120:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
makeApply.tryCatchResolve = tryCatchResolve;
return makeApply;
function makeApply(Promise, call) {
if(arguments.length < 2) {
call = tryCatchResolve;
}
return apply;
function apply(f, thisArg, args) {
var p = Promise._defer();
var l = args.length;
var params = new Array(l);
callAndResolve({ f:f, thisArg:thisArg, args:args, params:params, i:l-1, call:call }, p._handler);
return p;
}
function callAndResolve(c, h) {
if(c.i < 0) {
return call(c.f, c.thisArg, c.params, h);
}
var handler = Promise._handler(c.args[c.i]);
handler.fold(callAndResolveNext, c, void 0, h);
}
function callAndResolveNext(c, x, h) {
c.params[c.i] = x;
c.i -= 1;
callAndResolve(c, h);
}
}
function tryCatchResolve(f, thisArg, args, resolver) {
try {
resolver.resolve(f.apply(thisArg, args));
} catch(e) {
resolver.reject(e);
}
}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],121:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function(_dereq_) {
var state = _dereq_('../state');
var applier = _dereq_('../apply');
return function array(Promise) {
var applyFold = applier(Promise);
var toPromise = Promise.resolve;
var all = Promise.all;
var ar = Array.prototype.reduce;
var arr = Array.prototype.reduceRight;
var slice = Array.prototype.slice;
// Additional array combinators
Promise.any = any;
Promise.some = some;
Promise.settle = settle;
Promise.map = map;
Promise.filter = filter;
Promise.reduce = reduce;
Promise.reduceRight = reduceRight;
/**
* When this promise fulfills with an array, do
* onFulfilled.apply(void 0, array)
* @param {function} onFulfilled function to apply
* @returns {Promise} promise for the result of applying onFulfilled
*/
Promise.prototype.spread = function(onFulfilled) {
return this.then(all).then(function(array) {
return onFulfilled.apply(this, array);
});
};
return Promise;
/**
* One-winner competitive race.
* Return a promise that will fulfill when one of the promises
* in the input array fulfills, or will reject when all promises
* have rejected.
* @param {array} promises
* @returns {Promise} promise for the first fulfilled value
*/
function any(promises) {
var p = Promise._defer();
var resolver = p._handler;
var l = promises.length>>>0;
var pending = l;
var errors = [];
for (var h, x, i = 0; i < l; ++i) {
x = promises[i];
if(x === void 0 && !(i in promises)) {
--pending;
continue;
}
h = Promise._handler(x);
if(h.state() > 0) {
resolver.become(h);
Promise._visitRemaining(promises, i, h);
break;
} else {
h.visit(resolver, handleFulfill, handleReject);
}
}
if(pending === 0) {
resolver.reject(new RangeError('any(): array must not be empty'));
}
return p;
function handleFulfill(x) {
/*jshint validthis:true*/
errors = null;
this.resolve(x); // this === resolver
}
function handleReject(e) {
/*jshint validthis:true*/
if(this.resolved) { // this === resolver
return;
}
errors.push(e);
if(--pending === 0) {
this.reject(errors);
}
}
}
/**
* N-winner competitive race
* Return a promise that will fulfill when n input promises have
* fulfilled, or will reject when it becomes impossible for n
* input promises to fulfill (ie when promises.length - n + 1
* have rejected)
* @param {array} promises
* @param {number} n
* @returns {Promise} promise for the earliest n fulfillment values
*
* @deprecated
*/
function some(promises, n) {
/*jshint maxcomplexity:7*/
var p = Promise._defer();
var resolver = p._handler;
var results = [];
var errors = [];
var l = promises.length>>>0;
var nFulfill = 0;
var nReject;
var x, i; // reused in both for() loops
// First pass: count actual array items
for(i=0; i<l; ++i) {
x = promises[i];
if(x === void 0 && !(i in promises)) {
continue;
}
++nFulfill;
}
// Compute actual goals
n = Math.max(n, 0);
nReject = (nFulfill - n + 1);
nFulfill = Math.min(n, nFulfill);
if(n > nFulfill) {
resolver.reject(new RangeError('some(): array must contain at least '
+ n + ' item(s), but had ' + nFulfill));
} else if(nFulfill === 0) {
resolver.resolve(results);
}
// Second pass: observe each array item, make progress toward goals
for(i=0; i<l; ++i) {
x = promises[i];
if(x === void 0 && !(i in promises)) {
continue;
}
Promise._handler(x).visit(resolver, fulfill, reject, resolver.notify);
}
return p;
function fulfill(x) {
/*jshint validthis:true*/
if(this.resolved) { // this === resolver
return;
}
results.push(x);
if(--nFulfill === 0) {
errors = null;
this.resolve(results);
}
}
function reject(e) {
/*jshint validthis:true*/
if(this.resolved) { // this === resolver
return;
}
errors.push(e);
if(--nReject === 0) {
results = null;
this.reject(errors);
}
}
}
/**
* Apply f to the value of each promise in a list of promises
* and return a new list containing the results.
* @param {array} promises
* @param {function(x:*, index:Number):*} f mapping function
* @returns {Promise}
*/
function map(promises, f) {
return Promise._traverse(f, promises);
}
/**
* Filter the provided array of promises using the provided predicate. Input may
* contain promises and values
* @param {Array} promises array of promises and values
* @param {function(x:*, index:Number):boolean} predicate filtering predicate.
* Must return truthy (or promise for truthy) for items to retain.
* @returns {Promise} promise that will fulfill with an array containing all items
* for which predicate returned truthy.
*/
function filter(promises, predicate) {
var a = slice.call(promises);
return Promise._traverse(predicate, a).then(function(keep) {
return filterSync(a, keep);
});
}
function filterSync(promises, keep) {
// Safe because we know all promises have fulfilled if we've made it this far
var l = keep.length;
var filtered = new Array(l);
for(var i=0, j=0; i<l; ++i) {
if(keep[i]) {
filtered[j++] = Promise._handler(promises[i]).value;
}
}
filtered.length = j;
return filtered;
}
/**
* Return a promise that will always fulfill with an array containing
* the outcome states of all input promises. The returned promise
* will never reject.
* @param {Array} promises
* @returns {Promise} promise for array of settled state descriptors
*/
function settle(promises) {
return all(promises.map(settleOne));
}
function settleOne(p) {
var h = Promise._handler(p);
if(h.state() === 0) {
return toPromise(p).then(state.fulfilled, state.rejected);
}
h._unreport();
return state.inspect(h);
}
/**
* Traditional reduce function, similar to `Array.prototype.reduce()`, but
* input may contain promises and/or values, and reduceFunc
* may return either a value or a promise, *and* initialValue may
* be a promise for the starting value.
* @param {Array|Promise} promises array or promise for an array of anything,
* may contain a mix of promises and values.
* @param {function(accumulated:*, x:*, index:Number):*} f reduce function
* @returns {Promise} that will resolve to the final reduced value
*/
function reduce(promises, f /*, initialValue */) {
return arguments.length > 2 ? ar.call(promises, liftCombine(f), arguments[2])
: ar.call(promises, liftCombine(f));
}
/**
* Traditional reduce function, similar to `Array.prototype.reduceRight()`, but
* input may contain promises and/or values, and reduceFunc
* may return either a value or a promise, *and* initialValue may
* be a promise for the starting value.
* @param {Array|Promise} promises array or promise for an array of anything,
* may contain a mix of promises and values.
* @param {function(accumulated:*, x:*, index:Number):*} f reduce function
* @returns {Promise} that will resolve to the final reduced value
*/
function reduceRight(promises, f /*, initialValue */) {
return arguments.length > 2 ? arr.call(promises, liftCombine(f), arguments[2])
: arr.call(promises, liftCombine(f));
}
function liftCombine(f) {
return function(z, x, i) {
return applyFold(f, void 0, [z,x,i]);
};
}
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(_dereq_); }));
},{"../apply":120,"../state":133}],122:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return function flow(Promise) {
var resolve = Promise.resolve;
var reject = Promise.reject;
var origCatch = Promise.prototype['catch'];
/**
* Handle the ultimate fulfillment value or rejection reason, and assume
* responsibility for all errors. If an error propagates out of result
* or handleFatalError, it will be rethrown to the host, resulting in a
* loud stack track on most platforms and a crash on some.
* @param {function?} onResult
* @param {function?} onError
* @returns {undefined}
*/
Promise.prototype.done = function(onResult, onError) {
this._handler.visit(this._handler.receiver, onResult, onError);
};
/**
* Add Error-type and predicate matching to catch. Examples:
* promise['catch'](TypeError, handleTypeError)
* ['catch'](predicate, handleMatchedErrors)
* ['catch'](handleRemainingErrors)
* @param onRejected
* @returns {*}
*/
Promise.prototype['catch'] = Promise.prototype.otherwise = function(onRejected) {
if (arguments.length < 2) {
return origCatch.call(this, onRejected);
}
if(typeof onRejected !== 'function') {
return this.ensure(rejectInvalidPredicate);
}
return origCatch.call(this, createCatchFilter(arguments[1], onRejected));
};
/**
* Wraps the provided catch handler, so that it will only be called
* if the predicate evaluates truthy
* @param {?function} handler
* @param {function} predicate
* @returns {function} conditional catch handler
*/
function createCatchFilter(handler, predicate) {
return function(e) {
return evaluatePredicate(e, predicate)
? handler.call(this, e)
: reject(e);
};
}
/**
* Ensures that onFulfilledOrRejected will be called regardless of whether
* this promise is fulfilled or rejected. onFulfilledOrRejected WILL NOT
* receive the promises' value or reason. Any returned value will be disregarded.
* onFulfilledOrRejected may throw or return a rejected promise to signal
* an additional error.
* @param {function} handler handler to be called regardless of
* fulfillment or rejection
* @returns {Promise}
*/
Promise.prototype['finally'] = Promise.prototype.ensure = function(handler) {
if(typeof handler !== 'function') {
return this;
}
return this.then(function(x) {
return runSideEffect(handler, this, identity, x);
}, function(e) {
return runSideEffect(handler, this, reject, e);
});
};
function runSideEffect (handler, thisArg, propagate, value) {
var result = handler.call(thisArg);
return maybeThenable(result)
? propagateValue(result, propagate, value)
: propagate(value);
}
function propagateValue (result, propagate, x) {
return resolve(result).then(function () {
return propagate(x);
});
}
/**
* Recover from a failure by returning a defaultValue. If defaultValue
* is a promise, it's fulfillment value will be used. If defaultValue is
* a promise that rejects, the returned promise will reject with the
* same reason.
* @param {*} defaultValue
* @returns {Promise} new promise
*/
Promise.prototype['else'] = Promise.prototype.orElse = function(defaultValue) {
return this.then(void 0, function() {
return defaultValue;
});
};
/**
* Shortcut for .then(function() { return value; })
* @param {*} value
* @return {Promise} a promise that:
* - is fulfilled if value is not a promise, or
* - if value is a promise, will fulfill with its value, or reject
* with its reason.
*/
Promise.prototype['yield'] = function(value) {
return this.then(function() {
return value;
});
};
/**
* Runs a side effect when this promise fulfills, without changing the
* fulfillment value.
* @param {function} onFulfilledSideEffect
* @returns {Promise}
*/
Promise.prototype.tap = function(onFulfilledSideEffect) {
return this.then(onFulfilledSideEffect)['yield'](this);
};
return Promise;
};
function rejectInvalidPredicate() {
throw new TypeError('catch predicate must be a function');
}
function evaluatePredicate(e, predicate) {
return isError(predicate) ? e instanceof predicate : predicate(e);
}
function isError(predicate) {
return predicate === Error
|| (predicate != null && predicate.prototype instanceof Error);
}
function maybeThenable(x) {
return (typeof x === 'object' || typeof x === 'function') && x !== null;
}
function identity(x) {
return x;
}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],123:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
/** @author Jeff Escalante */
(function(define) { 'use strict';
define(function() {
return function fold(Promise) {
Promise.prototype.fold = function(f, z) {
var promise = this._beget();
this._handler.fold(function(z, x, to) {
Promise._handler(z).fold(function(x, z, to) {
to.resolve(f.call(this, z, x));
}, x, this, to);
}, z, promise._handler.receiver, promise._handler);
return promise;
};
return Promise;
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],124:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function(_dereq_) {
var inspect = _dereq_('../state').inspect;
return function inspection(Promise) {
Promise.prototype.inspect = function() {
return inspect(Promise._handler(this));
};
return Promise;
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(_dereq_); }));
},{"../state":133}],125:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return function generate(Promise) {
var resolve = Promise.resolve;
Promise.iterate = iterate;
Promise.unfold = unfold;
return Promise;
/**
* @deprecated Use github.com/cujojs/most streams and most.iterate
* Generate a (potentially infinite) stream of promised values:
* x, f(x), f(f(x)), etc. until condition(x) returns true
* @param {function} f function to generate a new x from the previous x
* @param {function} condition function that, given the current x, returns
* truthy when the iterate should stop
* @param {function} handler function to handle the value produced by f
* @param {*|Promise} x starting value, may be a promise
* @return {Promise} the result of the last call to f before
* condition returns true
*/
function iterate(f, condition, handler, x) {
return unfold(function(x) {
return [x, f(x)];
}, condition, handler, x);
}
/**
* @deprecated Use github.com/cujojs/most streams and most.unfold
* Generate a (potentially infinite) stream of promised values
* by applying handler(generator(seed)) iteratively until
* condition(seed) returns true.
* @param {function} unspool function that generates a [value, newSeed]
* given a seed.
* @param {function} condition function that, given the current seed, returns
* truthy when the unfold should stop
* @param {function} handler function to handle the value produced by unspool
* @param x {*|Promise} starting value, may be a promise
* @return {Promise} the result of the last value produced by unspool before
* condition returns true
*/
function unfold(unspool, condition, handler, x) {
return resolve(x).then(function(seed) {
return resolve(condition(seed)).then(function(done) {
return done ? seed : resolve(unspool(seed)).spread(next);
});
});
function next(item, newSeed) {
return resolve(handler(item)).then(function() {
return unfold(unspool, condition, handler, newSeed);
});
}
}
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],126:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return function progress(Promise) {
/**
* @deprecated
* Register a progress handler for this promise
* @param {function} onProgress
* @returns {Promise}
*/
Promise.prototype.progress = function(onProgress) {
return this.then(void 0, void 0, onProgress);
};
return Promise;
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],127:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function(_dereq_) {
var env = _dereq_('../env');
var TimeoutError = _dereq_('../TimeoutError');
function setTimeout(f, ms, x, y) {
return env.setTimer(function() {
f(x, y, ms);
}, ms);
}
return function timed(Promise) {
/**
* Return a new promise whose fulfillment value is revealed only
* after ms milliseconds
* @param {number} ms milliseconds
* @returns {Promise}
*/
Promise.prototype.delay = function(ms) {
var p = this._beget();
this._handler.fold(handleDelay, ms, void 0, p._handler);
return p;
};
function handleDelay(ms, x, h) {
setTimeout(resolveDelay, ms, x, h);
}
function resolveDelay(x, h) {
h.resolve(x);
}
/**
* Return a new promise that rejects after ms milliseconds unless
* this promise fulfills earlier, in which case the returned promise
* fulfills with the same value.
* @param {number} ms milliseconds
* @param {Error|*=} reason optional rejection reason to use, defaults
* to a TimeoutError if not provided
* @returns {Promise}
*/
Promise.prototype.timeout = function(ms, reason) {
var p = this._beget();
var h = p._handler;
var t = setTimeout(onTimeout, ms, reason, p._handler);
this._handler.visit(h,
function onFulfill(x) {
env.clearTimer(t);
this.resolve(x); // this = h
},
function onReject(x) {
env.clearTimer(t);
this.reject(x); // this = h
},
h.notify);
return p;
};
function onTimeout(reason, h, ms) {
var e = typeof reason === 'undefined'
? new TimeoutError('timed out after ' + ms + 'ms')
: reason;
h.reject(e);
}
return Promise;
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(_dereq_); }));
},{"../TimeoutError":119,"../env":130}],128:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function(_dereq_) {
var setTimer = _dereq_('../env').setTimer;
var format = _dereq_('../format');
return function unhandledRejection(Promise) {
var logError = noop;
var logInfo = noop;
var localConsole;
if(typeof console !== 'undefined') {
// Alias console to prevent things like uglify's drop_console option from
// removing console.log/error. Unhandled rejections fall into the same
// category as uncaught exceptions, and build tools shouldn't silence them.
localConsole = console;
logError = typeof localConsole.error !== 'undefined'
? function (e) { localConsole.error(e); }
: function (e) { localConsole.log(e); };
logInfo = typeof localConsole.info !== 'undefined'
? function (e) { localConsole.info(e); }
: function (e) { localConsole.log(e); };
}
Promise.onPotentiallyUnhandledRejection = function(rejection) {
enqueue(report, rejection);
};
Promise.onPotentiallyUnhandledRejectionHandled = function(rejection) {
enqueue(unreport, rejection);
};
Promise.onFatalRejection = function(rejection) {
enqueue(throwit, rejection.value);
};
var tasks = [];
var reported = [];
var running = null;
function report(r) {
if(!r.handled) {
reported.push(r);
logError('Potentially unhandled rejection [' + r.id + '] ' + format.formatError(r.value));
}
}
function unreport(r) {
var i = reported.indexOf(r);
if(i >= 0) {
reported.splice(i, 1);
logInfo('Handled previous rejection [' + r.id + '] ' + format.formatObject(r.value));
}
}
function enqueue(f, x) {
tasks.push(f, x);
if(running === null) {
running = setTimer(flush, 0);
}
}
function flush() {
running = null;
while(tasks.length > 0) {
tasks.shift()(tasks.shift());
}
}
return Promise;
};
function throwit(e) {
throw e;
}
function noop() {}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(_dereq_); }));
},{"../env":130,"../format":131}],129:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return function addWith(Promise) {
/**
* Returns a promise whose handlers will be called with `this` set to
* the supplied receiver. Subsequent promises derived from the
* returned promise will also have their handlers called with receiver
* as `this`. Calling `with` with undefined or no arguments will return
* a promise whose handlers will again be called in the usual Promises/A+
* way (no `this`) thus safely undoing any previous `with` in the
* promise chain.
*
* WARNING: Promises returned from `with`/`withThis` are NOT Promises/A+
* compliant, specifically violating 2.2.5 (http://promisesaplus.com/#point-41)
*
* @param {object} receiver `this` value for all handlers attached to
* the returned promise.
* @returns {Promise}
*/
Promise.prototype['with'] = Promise.prototype.withThis = function(receiver) {
var p = this._beget();
var child = p._handler;
child.receiver = receiver;
this._handler.chain(child, receiver);
return p;
};
return Promise;
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],130:[function(_dereq_,module,exports){
(function (process){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
/*global process,document,setTimeout,clearTimeout,MutationObserver,WebKitMutationObserver*/
(function(define) { 'use strict';
define(function(_dereq_) {
/*jshint maxcomplexity:6*/
// Sniff "best" async scheduling option
// Prefer process.nextTick or MutationObserver, then check for
// setTimeout, and finally vertx, since its the only env that doesn't
// have setTimeout
var MutationObs;
var capturedSetTimeout = typeof setTimeout !== 'undefined' && setTimeout;
// Default env
var setTimer = function(f, ms) { return setTimeout(f, ms); };
var clearTimer = function(t) { return clearTimeout(t); };
var asap = function (f) { return capturedSetTimeout(f, 0); };
// Detect specific env
if (isNode()) { // Node
asap = function (f) { return process.nextTick(f); };
} else if (MutationObs = hasMutationObserver()) { // Modern browser
asap = initMutationObserver(MutationObs);
} else if (!capturedSetTimeout) { // vert.x
var vertxRequire = _dereq_;
var vertx = vertxRequire('vertx');
setTimer = function (f, ms) { return vertx.setTimer(ms, f); };
clearTimer = vertx.cancelTimer;
asap = vertx.runOnLoop || vertx.runOnContext;
}
return {
setTimer: setTimer,
clearTimer: clearTimer,
asap: asap
};
function isNode () {
return typeof process !== 'undefined' &&
Object.prototype.toString.call(process) === '[object process]';
}
function hasMutationObserver () {
return (typeof MutationObserver === 'function' && MutationObserver) ||
(typeof WebKitMutationObserver === 'function' && WebKitMutationObserver);
}
function initMutationObserver(MutationObserver) {
var scheduled;
var node = document.createTextNode('');
var o = new MutationObserver(run);
o.observe(node, { characterData: true });
function run() {
var f = scheduled;
scheduled = void 0;
f();
}
var i = 0;
return function (f) {
scheduled = f;
node.data = (i ^= 1);
};
}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(_dereq_); }));
}).call(this,_dereq_('_process'))
},{"_process":76}],131:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return {
formatError: formatError,
formatObject: formatObject,
tryStringify: tryStringify
};
/**
* Format an error into a string. If e is an Error and has a stack property,
* it's returned. Otherwise, e is formatted using formatObject, with a
* warning added about e not being a proper Error.
* @param {*} e
* @returns {String} formatted string, suitable for output to developers
*/
function formatError(e) {
var s = typeof e === 'object' && e !== null && e.stack ? e.stack : formatObject(e);
return e instanceof Error ? s : s + ' (WARNING: non-Error used)';
}
/**
* Format an object, detecting "plain" objects and running them through
* JSON.stringify if possible.
* @param {Object} o
* @returns {string}
*/
function formatObject(o) {
var s = String(o);
if(s === '[object Object]' && typeof JSON !== 'undefined') {
s = tryStringify(o, s);
}
return s;
}
/**
* Try to return the result of JSON.stringify(x). If that fails, return
* defaultValue
* @param {*} x
* @param {*} defaultValue
* @returns {String|*} JSON.stringify(x) or defaultValue
*/
function tryStringify(x, defaultValue) {
try {
return JSON.stringify(x);
} catch(e) {
return defaultValue;
}
}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],132:[function(_dereq_,module,exports){
(function (process){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return function makePromise(environment) {
var tasks = environment.scheduler;
var emitRejection = initEmitRejection();
var objectCreate = Object.create ||
function(proto) {
function Child() {}
Child.prototype = proto;
return new Child();
};
/**
* Create a promise whose fate is determined by resolver
* @constructor
* @returns {Promise} promise
* @name Promise
*/
function Promise(resolver, handler) {
this._handler = resolver === Handler ? handler : init(resolver);
}
/**
* Run the supplied resolver
* @param resolver
* @returns {Pending}
*/
function init(resolver) {
var handler = new Pending();
try {
resolver(promiseResolve, promiseReject, promiseNotify);
} catch (e) {
promiseReject(e);
}
return handler;
/**
* Transition from pre-resolution state to post-resolution state, notifying
* all listeners of the ultimate fulfillment or rejection
* @param {*} x resolution value
*/
function promiseResolve (x) {
handler.resolve(x);
}
/**
* Reject this promise with reason, which will be used verbatim
* @param {Error|*} reason rejection reason, strongly suggested
* to be an Error type
*/
function promiseReject (reason) {
handler.reject(reason);
}
/**
* @deprecated
* Issue a progress event, notifying all progress listeners
* @param {*} x progress event payload to pass to all listeners
*/
function promiseNotify (x) {
handler.notify(x);
}
}
// Creation
Promise.resolve = resolve;
Promise.reject = reject;
Promise.never = never;
Promise._defer = defer;
Promise._handler = getHandler;
/**
* Returns a trusted promise. If x is already a trusted promise, it is
* returned, otherwise returns a new trusted Promise which follows x.
* @param {*} x
* @return {Promise} promise
*/
function resolve(x) {
return isPromise(x) ? x
: new Promise(Handler, new Async(getHandler(x)));
}
/**
* Return a reject promise with x as its reason (x is used verbatim)
* @param {*} x
* @returns {Promise} rejected promise
*/
function reject(x) {
return new Promise(Handler, new Async(new Rejected(x)));
}
/**
* Return a promise that remains pending forever
* @returns {Promise} forever-pending promise.
*/
function never() {
return foreverPendingPromise; // Should be frozen
}
/**
* Creates an internal {promise, resolver} pair
* @private
* @returns {Promise}
*/
function defer() {
return new Promise(Handler, new Pending());
}
// Transformation and flow control
/**
* Transform this promise's fulfillment value, returning a new Promise
* for the transformed result. If the promise cannot be fulfilled, onRejected
* is called with the reason. onProgress *may* be called with updates toward
* this promise's fulfillment.
* @param {function=} onFulfilled fulfillment handler
* @param {function=} onRejected rejection handler
* @param {function=} onProgress @deprecated progress handler
* @return {Promise} new promise
*/
Promise.prototype.then = function(onFulfilled, onRejected, onProgress) {
var parent = this._handler;
var state = parent.join().state();
if ((typeof onFulfilled !== 'function' && state > 0) ||
(typeof onRejected !== 'function' && state < 0)) {
// Short circuit: value will not change, simply share handler
return new this.constructor(Handler, parent);
}
var p = this._beget();
var child = p._handler;
parent.chain(child, parent.receiver, onFulfilled, onRejected, onProgress);
return p;
};
/**
* If this promise cannot be fulfilled due to an error, call onRejected to
* handle the error. Shortcut for .then(undefined, onRejected)
* @param {function?} onRejected
* @return {Promise}
*/
Promise.prototype['catch'] = function(onRejected) {
return this.then(void 0, onRejected);
};
/**
* Creates a new, pending promise of the same type as this promise
* @private
* @returns {Promise}
*/
Promise.prototype._beget = function() {
return begetFrom(this._handler, this.constructor);
};
function begetFrom(parent, Promise) {
var child = new Pending(parent.receiver, parent.join().context);
return new Promise(Handler, child);
}
// Array combinators
Promise.all = all;
Promise.race = race;
Promise._traverse = traverse;
/**
* Return a promise that will fulfill when all promises in the
* input array have fulfilled, or will reject when one of the
* promises rejects.
* @param {array} promises array of promises
* @returns {Promise} promise for array of fulfillment values
*/
function all(promises) {
return traverseWith(snd, null, promises);
}
/**
* Array<Promise<X>> -> Promise<Array<f(X)>>
* @private
* @param {function} f function to apply to each promise's value
* @param {Array} promises array of promises
* @returns {Promise} promise for transformed values
*/
function traverse(f, promises) {
return traverseWith(tryCatch2, f, promises);
}
function traverseWith(tryMap, f, promises) {
var handler = typeof f === 'function' ? mapAt : settleAt;
var resolver = new Pending();
var pending = promises.length >>> 0;
var results = new Array(pending);
for (var i = 0, x; i < promises.length && !resolver.resolved; ++i) {
x = promises[i];
if (x === void 0 && !(i in promises)) {
--pending;
continue;
}
traverseAt(promises, handler, i, x, resolver);
}
if(pending === 0) {
resolver.become(new Fulfilled(results));
}
return new Promise(Handler, resolver);
function mapAt(i, x, resolver) {
if(!resolver.resolved) {
traverseAt(promises, settleAt, i, tryMap(f, x, i), resolver);
}
}
function settleAt(i, x, resolver) {
results[i] = x;
if(--pending === 0) {
resolver.become(new Fulfilled(results));
}
}
}
function traverseAt(promises, handler, i, x, resolver) {
if (maybeThenable(x)) {
var h = getHandlerMaybeThenable(x);
var s = h.state();
if (s === 0) {
h.fold(handler, i, void 0, resolver);
} else if (s > 0) {
handler(i, h.value, resolver);
} else {
resolver.become(h);
visitRemaining(promises, i+1, h);
}
} else {
handler(i, x, resolver);
}
}
Promise._visitRemaining = visitRemaining;
function visitRemaining(promises, start, handler) {
for(var i=start; i<promises.length; ++i) {
markAsHandled(getHandler(promises[i]), handler);
}
}
function markAsHandled(h, handler) {
if(h === handler) {
return;
}
var s = h.state();
if(s === 0) {
h.visit(h, void 0, h._unreport);
} else if(s < 0) {
h._unreport();
}
}
/**
* Fulfill-reject competitive race. Return a promise that will settle
* to the same state as the earliest input promise to settle.
*
* WARNING: The ES6 Promise spec requires that race()ing an empty array
* must return a promise that is pending forever. This implementation
* returns a singleton forever-pending promise, the same singleton that is
* returned by Promise.never(), thus can be checked with ===
*
* @param {array} promises array of promises to race
* @returns {Promise} if input is non-empty, a promise that will settle
* to the same outcome as the earliest input promise to settle. if empty
* is empty, returns a promise that will never settle.
*/
function race(promises) {
if(typeof promises !== 'object' || promises === null) {
return reject(new TypeError('non-iterable passed to race()'));
}
// Sigh, race([]) is untestable unless we return *something*
// that is recognizable without calling .then() on it.
return promises.length === 0 ? never()
: promises.length === 1 ? resolve(promises[0])
: runRace(promises);
}
function runRace(promises) {
var resolver = new Pending();
var i, x, h;
for(i=0; i<promises.length; ++i) {
x = promises[i];
if (x === void 0 && !(i in promises)) {
continue;
}
h = getHandler(x);
if(h.state() !== 0) {
resolver.become(h);
visitRemaining(promises, i+1, h);
break;
} else {
h.visit(resolver, resolver.resolve, resolver.reject);
}
}
return new Promise(Handler, resolver);
}
// Promise internals
// Below this, everything is @private
/**
* Get an appropriate handler for x, without checking for cycles
* @param {*} x
* @returns {object} handler
*/
function getHandler(x) {
if(isPromise(x)) {
return x._handler.join();
}
return maybeThenable(x) ? getHandlerUntrusted(x) : new Fulfilled(x);
}
/**
* Get a handler for thenable x.
* NOTE: You must only call this if maybeThenable(x) == true
* @param {object|function|Promise} x
* @returns {object} handler
*/
function getHandlerMaybeThenable(x) {
return isPromise(x) ? x._handler.join() : getHandlerUntrusted(x);
}
/**
* Get a handler for potentially untrusted thenable x
* @param {*} x
* @returns {object} handler
*/
function getHandlerUntrusted(x) {
try {
var untrustedThen = x.then;
return typeof untrustedThen === 'function'
? new Thenable(untrustedThen, x)
: new Fulfilled(x);
} catch(e) {
return new Rejected(e);
}
}
/**
* Handler for a promise that is pending forever
* @constructor
*/
function Handler() {}
Handler.prototype.when
= Handler.prototype.become
= Handler.prototype.notify // deprecated
= Handler.prototype.fail
= Handler.prototype._unreport
= Handler.prototype._report
= noop;
Handler.prototype._state = 0;
Handler.prototype.state = function() {
return this._state;
};
/**
* Recursively collapse handler chain to find the handler
* nearest to the fully resolved value.
* @returns {object} handler nearest the fully resolved value
*/
Handler.prototype.join = function() {
var h = this;
while(h.handler !== void 0) {
h = h.handler;
}
return h;
};
Handler.prototype.chain = function(to, receiver, fulfilled, rejected, progress) {
this.when({
resolver: to,
receiver: receiver,
fulfilled: fulfilled,
rejected: rejected,
progress: progress
});
};
Handler.prototype.visit = function(receiver, fulfilled, rejected, progress) {
this.chain(failIfRejected, receiver, fulfilled, rejected, progress);
};
Handler.prototype.fold = function(f, z, c, to) {
this.when(new Fold(f, z, c, to));
};
/**
* Handler that invokes fail() on any handler it becomes
* @constructor
*/
function FailIfRejected() {}
inherit(Handler, FailIfRejected);
FailIfRejected.prototype.become = function(h) {
h.fail();
};
var failIfRejected = new FailIfRejected();
/**
* Handler that manages a queue of consumers waiting on a pending promise
* @constructor
*/
function Pending(receiver, inheritedContext) {
Promise.createContext(this, inheritedContext);
this.consumers = void 0;
this.receiver = receiver;
this.handler = void 0;
this.resolved = false;
}
inherit(Handler, Pending);
Pending.prototype._state = 0;
Pending.prototype.resolve = function(x) {
this.become(getHandler(x));
};
Pending.prototype.reject = function(x) {
if(this.resolved) {
return;
}
this.become(new Rejected(x));
};
Pending.prototype.join = function() {
if (!this.resolved) {
return this;
}
var h = this;
while (h.handler !== void 0) {
h = h.handler;
if (h === this) {
return this.handler = cycle();
}
}
return h;
};
Pending.prototype.run = function() {
var q = this.consumers;
var handler = this.handler;
this.handler = this.handler.join();
this.consumers = void 0;
for (var i = 0; i < q.length; ++i) {
handler.when(q[i]);
}
};
Pending.prototype.become = function(handler) {
if(this.resolved) {
return;
}
this.resolved = true;
this.handler = handler;
if(this.consumers !== void 0) {
tasks.enqueue(this);
}
if(this.context !== void 0) {
handler._report(this.context);
}
};
Pending.prototype.when = function(continuation) {
if(this.resolved) {
tasks.enqueue(new ContinuationTask(continuation, this.handler));
} else {
if(this.consumers === void 0) {
this.consumers = [continuation];
} else {
this.consumers.push(continuation);
}
}
};
/**
* @deprecated
*/
Pending.prototype.notify = function(x) {
if(!this.resolved) {
tasks.enqueue(new ProgressTask(x, this));
}
};
Pending.prototype.fail = function(context) {
var c = typeof context === 'undefined' ? this.context : context;
this.resolved && this.handler.join().fail(c);
};
Pending.prototype._report = function(context) {
this.resolved && this.handler.join()._report(context);
};
Pending.prototype._unreport = function() {
this.resolved && this.handler.join()._unreport();
};
/**
* Wrap another handler and force it into a future stack
* @param {object} handler
* @constructor
*/
function Async(handler) {
this.handler = handler;
}
inherit(Handler, Async);
Async.prototype.when = function(continuation) {
tasks.enqueue(new ContinuationTask(continuation, this));
};
Async.prototype._report = function(context) {
this.join()._report(context);
};
Async.prototype._unreport = function() {
this.join()._unreport();
};
/**
* Handler that wraps an untrusted thenable and assimilates it in a future stack
* @param {function} then
* @param {{then: function}} thenable
* @constructor
*/
function Thenable(then, thenable) {
Pending.call(this);
tasks.enqueue(new AssimilateTask(then, thenable, this));
}
inherit(Pending, Thenable);
/**
* Handler for a fulfilled promise
* @param {*} x fulfillment value
* @constructor
*/
function Fulfilled(x) {
Promise.createContext(this);
this.value = x;
}
inherit(Handler, Fulfilled);
Fulfilled.prototype._state = 1;
Fulfilled.prototype.fold = function(f, z, c, to) {
runContinuation3(f, z, this, c, to);
};
Fulfilled.prototype.when = function(cont) {
runContinuation1(cont.fulfilled, this, cont.receiver, cont.resolver);
};
var errorId = 0;
/**
* Handler for a rejected promise
* @param {*} x rejection reason
* @constructor
*/
function Rejected(x) {
Promise.createContext(this);
this.id = ++errorId;
this.value = x;
this.handled = false;
this.reported = false;
this._report();
}
inherit(Handler, Rejected);
Rejected.prototype._state = -1;
Rejected.prototype.fold = function(f, z, c, to) {
to.become(this);
};
Rejected.prototype.when = function(cont) {
if(typeof cont.rejected === 'function') {
this._unreport();
}
runContinuation1(cont.rejected, this, cont.receiver, cont.resolver);
};
Rejected.prototype._report = function(context) {
tasks.afterQueue(new ReportTask(this, context));
};
Rejected.prototype._unreport = function() {
if(this.handled) {
return;
}
this.handled = true;
tasks.afterQueue(new UnreportTask(this));
};
Rejected.prototype.fail = function(context) {
this.reported = true;
emitRejection('unhandledRejection', this);
Promise.onFatalRejection(this, context === void 0 ? this.context : context);
};
function ReportTask(rejection, context) {
this.rejection = rejection;
this.context = context;
}
ReportTask.prototype.run = function() {
if(!this.rejection.handled && !this.rejection.reported) {
this.rejection.reported = true;
emitRejection('unhandledRejection', this.rejection) ||
Promise.onPotentiallyUnhandledRejection(this.rejection, this.context);
}
};
function UnreportTask(rejection) {
this.rejection = rejection;
}
UnreportTask.prototype.run = function() {
if(this.rejection.reported) {
emitRejection('rejectionHandled', this.rejection) ||
Promise.onPotentiallyUnhandledRejectionHandled(this.rejection);
}
};
// Unhandled rejection hooks
// By default, everything is a noop
Promise.createContext
= Promise.enterContext
= Promise.exitContext
= Promise.onPotentiallyUnhandledRejection
= Promise.onPotentiallyUnhandledRejectionHandled
= Promise.onFatalRejection
= noop;
// Errors and singletons
var foreverPendingHandler = new Handler();
var foreverPendingPromise = new Promise(Handler, foreverPendingHandler);
function cycle() {
return new Rejected(new TypeError('Promise cycle'));
}
// Task runners
/**
* Run a single consumer
* @constructor
*/
function ContinuationTask(continuation, handler) {
this.continuation = continuation;
this.handler = handler;
}
ContinuationTask.prototype.run = function() {
this.handler.join().when(this.continuation);
};
/**
* Run a queue of progress handlers
* @constructor
*/
function ProgressTask(value, handler) {
this.handler = handler;
this.value = value;
}
ProgressTask.prototype.run = function() {
var q = this.handler.consumers;
if(q === void 0) {
return;
}
for (var c, i = 0; i < q.length; ++i) {
c = q[i];
runNotify(c.progress, this.value, this.handler, c.receiver, c.resolver);
}
};
/**
* Assimilate a thenable, sending it's value to resolver
* @param {function} then
* @param {object|function} thenable
* @param {object} resolver
* @constructor
*/
function AssimilateTask(then, thenable, resolver) {
this._then = then;
this.thenable = thenable;
this.resolver = resolver;
}
AssimilateTask.prototype.run = function() {
var h = this.resolver;
tryAssimilate(this._then, this.thenable, _resolve, _reject, _notify);
function _resolve(x) { h.resolve(x); }
function _reject(x) { h.reject(x); }
function _notify(x) { h.notify(x); }
};
function tryAssimilate(then, thenable, resolve, reject, notify) {
try {
then.call(thenable, resolve, reject, notify);
} catch (e) {
reject(e);
}
}
/**
* Fold a handler value with z
* @constructor
*/
function Fold(f, z, c, to) {
this.f = f; this.z = z; this.c = c; this.to = to;
this.resolver = failIfRejected;
this.receiver = this;
}
Fold.prototype.fulfilled = function(x) {
this.f.call(this.c, this.z, x, this.to);
};
Fold.prototype.rejected = function(x) {
this.to.reject(x);
};
Fold.prototype.progress = function(x) {
this.to.notify(x);
};
// Other helpers
/**
* @param {*} x
* @returns {boolean} true iff x is a trusted Promise
*/
function isPromise(x) {
return x instanceof Promise;
}
/**
* Test just enough to rule out primitives, in order to take faster
* paths in some code
* @param {*} x
* @returns {boolean} false iff x is guaranteed *not* to be a thenable
*/
function maybeThenable(x) {
return (typeof x === 'object' || typeof x === 'function') && x !== null;
}
function runContinuation1(f, h, receiver, next) {
if(typeof f !== 'function') {
return next.become(h);
}
Promise.enterContext(h);
tryCatchReject(f, h.value, receiver, next);
Promise.exitContext();
}
function runContinuation3(f, x, h, receiver, next) {
if(typeof f !== 'function') {
return next.become(h);
}
Promise.enterContext(h);
tryCatchReject3(f, x, h.value, receiver, next);
Promise.exitContext();
}
/**
* @deprecated
*/
function runNotify(f, x, h, receiver, next) {
if(typeof f !== 'function') {
return next.notify(x);
}
Promise.enterContext(h);
tryCatchReturn(f, x, receiver, next);
Promise.exitContext();
}
function tryCatch2(f, a, b) {
try {
return f(a, b);
} catch(e) {
return reject(e);
}
}
/**
* Return f.call(thisArg, x), or if it throws return a rejected promise for
* the thrown exception
*/
function tryCatchReject(f, x, thisArg, next) {
try {
next.become(getHandler(f.call(thisArg, x)));
} catch(e) {
next.become(new Rejected(e));
}
}
/**
* Same as above, but includes the extra argument parameter.
*/
function tryCatchReject3(f, x, y, thisArg, next) {
try {
f.call(thisArg, x, y, next);
} catch(e) {
next.become(new Rejected(e));
}
}
/**
* @deprecated
* Return f.call(thisArg, x), or if it throws, *return* the exception
*/
function tryCatchReturn(f, x, thisArg, next) {
try {
next.notify(f.call(thisArg, x));
} catch(e) {
next.notify(e);
}
}
function inherit(Parent, Child) {
Child.prototype = objectCreate(Parent.prototype);
Child.prototype.constructor = Child;
}
function snd(x, y) {
return y;
}
function noop() {}
function initEmitRejection() {
/*global process, self, CustomEvent*/
if(typeof process !== 'undefined' && process !== null
&& typeof process.emit === 'function') {
// Returning falsy here means to call the default
// onPotentiallyUnhandledRejection API. This is safe even in
// browserify since process.emit always returns falsy in browserify:
// https://github.com/defunctzombie/node-process/blob/master/browser.js#L40-L46
return function(type, rejection) {
return type === 'unhandledRejection'
? process.emit(type, rejection.value, rejection)
: process.emit(type, rejection);
};
} else if(typeof self !== 'undefined' && typeof CustomEvent === 'function') {
return (function(noop, self, CustomEvent) {
var hasCustomEvent = false;
try {
var ev = new CustomEvent('unhandledRejection');
hasCustomEvent = ev instanceof CustomEvent;
} catch (e) {}
return !hasCustomEvent ? noop : function(type, rejection) {
var ev = new CustomEvent(type, {
detail: {
reason: rejection.value,
key: rejection
},
bubbles: false,
cancelable: true
});
return !self.dispatchEvent(ev);
};
}(noop, self, CustomEvent));
}
return noop;
}
return Promise;
};
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
}).call(this,_dereq_('_process'))
},{"_process":76}],133:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
(function(define) { 'use strict';
define(function() {
return {
pending: toPendingState,
fulfilled: toFulfilledState,
rejected: toRejectedState,
inspect: inspect
};
function toPendingState() {
return { state: 'pending' };
}
function toRejectedState(e) {
return { state: 'rejected', reason: e };
}
function toFulfilledState(x) {
return { state: 'fulfilled', value: x };
}
function inspect(handler) {
var state = handler.state();
return state === 0 ? toPendingState()
: state > 0 ? toFulfilledState(handler.value)
: toRejectedState(handler.value);
}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));
},{}],134:[function(_dereq_,module,exports){
/** @license MIT License (c) copyright 2010-2014 original author or authors */
/**
* Promises/A+ and when() implementation
* when is part of the cujoJS family of libraries (http://cujojs.com/)
* @author Brian Cavalier
* @author John Hann
*/
(function(define) { 'use strict';
define(function (_dereq_) {
var timed = _dereq_('./lib/decorators/timed');
var array = _dereq_('./lib/decorators/array');
var flow = _dereq_('./lib/decorators/flow');
var fold = _dereq_('./lib/decorators/fold');
var inspect = _dereq_('./lib/decorators/inspect');
var generate = _dereq_('./lib/decorators/iterate');
var progress = _dereq_('./lib/decorators/progress');
var withThis = _dereq_('./lib/decorators/with');
var unhandledRejection = _dereq_('./lib/decorators/unhandledRejection');
var TimeoutError = _dereq_('./lib/TimeoutError');
var Promise = [array, flow, fold, generate, progress,
inspect, withThis, timed, unhandledRejection]
.reduce(function(Promise, feature) {
return feature(Promise);
}, _dereq_('./lib/Promise'));
var apply = _dereq_('./lib/apply')(Promise);
// Public API
when.promise = promise; // Create a pending promise
when.resolve = Promise.resolve; // Create a resolved promise
when.reject = Promise.reject; // Create a rejected promise
when.lift = lift; // lift a function to return promises
when['try'] = attempt; // call a function and return a promise
when.attempt = attempt; // alias for when.try
when.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises
when.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises
when.join = join; // Join 2 or more promises
when.all = all; // Resolve a list of promises
when.settle = settle; // Settle a list of promises
when.any = lift(Promise.any); // One-winner race
when.some = lift(Promise.some); // Multi-winner race
when.race = lift(Promise.race); // First-to-settle race
when.map = map; // Array.map() for promises
when.filter = filter; // Array.filter() for promises
when.reduce = lift(Promise.reduce); // Array.reduce() for promises
when.reduceRight = lift(Promise.reduceRight); // Array.reduceRight() for promises
when.isPromiseLike = isPromiseLike; // Is something promise-like, aka thenable
when.Promise = Promise; // Promise constructor
when.defer = defer; // Create a {promise, resolve, reject} tuple
// Error types
when.TimeoutError = TimeoutError;
/**
* Get a trusted promise for x, or by transforming x with onFulfilled
*
* @param {*} x
* @param {function?} onFulfilled callback to be called when x is
* successfully fulfilled. If promiseOrValue is an immediate value, callback
* will be invoked immediately.
* @param {function?} onRejected callback to be called when x is
* rejected.
* @param {function?} onProgress callback to be called when progress updates
* are issued for x. @deprecated
* @returns {Promise} a new promise that will fulfill with the return
* value of callback or errback or the completion value of promiseOrValue if
* callback and/or errback is not supplied.
*/
function when(x, onFulfilled, onRejected, onProgress) {
var p = Promise.resolve(x);
if (arguments.length < 2) {
return p;
}
return p.then(onFulfilled, onRejected, onProgress);
}
/**
* Creates a new promise whose fate is determined by resolver.
* @param {function} resolver function(resolve, reject, notify)
* @returns {Promise} promise whose fate is determine by resolver
*/
function promise(resolver) {
return new Promise(resolver);
}
/**
* Lift the supplied function, creating a version of f that returns
* promises, and accepts promises as arguments.
* @param {function} f
* @returns {Function} version of f that returns promises
*/
function lift(f) {
return function() {
for(var i=0, l=arguments.length, a=new Array(l); i<l; ++i) {
a[i] = arguments[i];
}
return apply(f, this, a);
};
}
/**
* Call f in a future turn, with the supplied args, and return a promise
* for the result.
* @param {function} f
* @returns {Promise}
*/
function attempt(f /*, args... */) {
/*jshint validthis:true */
for(var i=0, l=arguments.length-1, a=new Array(l); i<l; ++i) {
a[i] = arguments[i+1];
}
return apply(f, this, a);
}
/**
* Creates a {promise, resolver} pair, either or both of which
* may be given out safely to consumers.
* @return {{promise: Promise, resolve: function, reject: function, notify: function}}
*/
function defer() {
return new Deferred();
}
function Deferred() {
var p = Promise._defer();
function resolve(x) { p._handler.resolve(x); }
function reject(x) { p._handler.reject(x); }
function notify(x) { p._handler.notify(x); }
this.promise = p;
this.resolve = resolve;
this.reject = reject;
this.notify = notify;
this.resolver = { resolve: resolve, reject: reject, notify: notify };
}
/**
* Determines if x is promise-like, i.e. a thenable object
* NOTE: Will return true for *any thenable object*, and isn't truly
* safe, since it may attempt to access the `then` property of x (i.e.
* clever/malicious getters may do weird things)
* @param {*} x anything
* @returns {boolean} true if x is promise-like
*/
function isPromiseLike(x) {
return x && typeof x.then === 'function';
}
/**
* Return a promise that will resolve only once all the supplied arguments
* have resolved. The resolution value of the returned promise will be an array
* containing the resolution values of each of the arguments.
* @param {...*} arguments may be a mix of promises and values
* @returns {Promise}
*/
function join(/* ...promises */) {
return Promise.all(arguments);
}
/**
* Return a promise that will fulfill once all input promises have
* fulfilled, or reject when any one input promise rejects.
* @param {array|Promise} promises array (or promise for an array) of promises
* @returns {Promise}
*/
function all(promises) {
return when(promises, Promise.all);
}
/**
* Return a promise that will always fulfill with an array containing
* the outcome states of all input promises. The returned promise
* will only reject if `promises` itself is a rejected promise.
* @param {array|Promise} promises array (or promise for an array) of promises
* @returns {Promise} promise for array of settled state descriptors
*/
function settle(promises) {
return when(promises, Promise.settle);
}
/**
* Promise-aware array map function, similar to `Array.prototype.map()`,
* but input array may contain promises or values.
* @param {Array|Promise} promises array of anything, may contain promises and values
* @param {function(x:*, index:Number):*} mapFunc map function which may
* return a promise or value
* @returns {Promise} promise that will fulfill with an array of mapped values
* or reject if any input promise rejects.
*/
function map(promises, mapFunc) {
return when(promises, function(promises) {
return Promise.map(promises, mapFunc);
});
}
/**
* Filter the provided array of promises using the provided predicate. Input may
* contain promises and values
* @param {Array|Promise} promises array of promises and values
* @param {function(x:*, index:Number):boolean} predicate filtering predicate.
* Must return truthy (or promise for truthy) for items to retain.
* @returns {Promise} promise that will fulfill with an array containing all items
* for which predicate returned truthy.
*/
function filter(promises, predicate) {
return when(promises, function(promises) {
return Promise.filter(promises, predicate);
});
}
return when;
});
})(typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); });
},{"./lib/Promise":117,"./lib/TimeoutError":119,"./lib/apply":120,"./lib/decorators/array":121,"./lib/decorators/flow":122,"./lib/decorators/fold":123,"./lib/decorators/inspect":124,"./lib/decorators/iterate":125,"./lib/decorators/progress":126,"./lib/decorators/timed":127,"./lib/decorators/unhandledRejection":128,"./lib/decorators/with":129}],135:[function(_dereq_,module,exports){
/*
* Copyright 2013 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
return {
/**
* Find objects within a graph the contain a property of a certain name.
*
* NOTE: this method will not discover object graph cycles.
*
* @param {*} obj object to search on
* @param {string} prop name of the property to search for
* @param {Function} callback function to receive the found properties and their parent
*/
findProperties: function findProperties(obj, prop, callback) {
if (typeof obj !== 'object' || obj === null) { return; }
if (prop in obj) {
callback(obj[prop], obj, prop);
}
Object.keys(obj).forEach(function (key) {
findProperties(obj[key], prop, callback);
});
}
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],136:[function(_dereq_,module,exports){
/*
* Copyright 2013 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var when;
when = _dereq_('when');
/**
* Create a promise whose work is started only when a handler is registered.
*
* The work function will be invoked at most once. Thrown values will result
* in promise rejection.
*
* @param {Function} work function whose ouput is used to resolve the
* returned promise.
* @returns {Promise} a lazy promise
*/
function lazyPromise(work) {
var defer, started, resolver, promise, then;
defer = when.defer();
started = false;
resolver = defer.resolver;
promise = defer.promise;
then = promise.then;
promise.then = function () {
if (!started) {
started = true;
when.attempt(work).then(resolver.resolve, resolver.reject);
}
return then.apply(promise, arguments);
};
return promise;
}
return lazyPromise;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"when":134}],137:[function(_dereq_,module,exports){
/*
* Copyright 2012-2013 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
// derived from dojo.mixin
define(function (/* require */) {
var empty = {};
/**
* Mix the properties from the source object into the destination object.
* When the same property occurs in more then one object, the right most
* value wins.
*
* @param {Object} dest the object to copy properties to
* @param {Object} sources the objects to copy properties from. May be 1 to N arguments, but not an Array.
* @return {Object} the destination object
*/
function mixin(dest /*, sources... */) {
var i, l, source, name;
if (!dest) { dest = {}; }
for (i = 1, l = arguments.length; i < l; i += 1) {
source = arguments[i];
for (name in source) {
if (!(name in dest) || (dest[name] !== source[name] && (!(name in empty) || empty[name] !== source[name]))) {
dest[name] = source[name];
}
}
}
return dest; // Object
}
return mixin;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],138:[function(_dereq_,module,exports){
/*
* Copyright 2012 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
/**
* Normalize HTTP header names using the pseudo camel case.
*
* For example:
* content-type -> Content-Type
* accepts -> Accepts
* x-custom-header-name -> X-Custom-Header-Name
*
* @param {string} name the raw header name
* @return {string} the normalized header name
*/
function normalizeHeaderName(name) {
return name.toLowerCase()
.split('-')
.map(function (chunk) { return chunk.charAt(0).toUpperCase() + chunk.slice(1); })
.join('-');
}
return normalizeHeaderName;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],139:[function(_dereq_,module,exports){
/*
* Copyright 2014-2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (_dereq_) {
var when = _dereq_('when'),
normalizeHeaderName = _dereq_('./normalizeHeaderName');
function property(promise, name) {
return promise.then(
function (value) {
return value && value[name];
},
function (value) {
return when.reject(value && value[name]);
}
);
}
/**
* Obtain the response entity
*
* @returns {Promise} for the response entity
*/
function entity() {
/*jshint validthis:true */
return property(this, 'entity');
}
/**
* Obtain the response status
*
* @returns {Promise} for the response status
*/
function status() {
/*jshint validthis:true */
return property(property(this, 'status'), 'code');
}
/**
* Obtain the response headers map
*
* @returns {Promise} for the response headers map
*/
function headers() {
/*jshint validthis:true */
return property(this, 'headers');
}
/**
* Obtain a specific response header
*
* @param {String} headerName the header to retrieve
* @returns {Promise} for the response header's value
*/
function header(headerName) {
/*jshint validthis:true */
headerName = normalizeHeaderName(headerName);
return property(this.headers(), headerName);
}
/**
* Follow a related resource
*
* The relationship to follow may be define as a plain string, an object
* with the rel and params, or an array containing one or more entries
* with the previous forms.
*
* Examples:
* response.follow('next')
*
* response.follow({ rel: 'next', params: { pageSize: 100 } })
*
* response.follow([
* { rel: 'items', params: { projection: 'noImages' } },
* 'search',
* { rel: 'findByGalleryIsNull', params: { projection: 'noImages' } },
* 'items'
* ])
*
* @param {String|Object|Array} rels one, or more, relationships to follow
* @returns ResponsePromise<Response> related resource
*/
function follow(rels) {
/*jshint validthis:true */
rels = [].concat(rels);
return make(when.reduce(rels, function (response, rel) {
if (typeof rel === 'string') {
rel = { rel: rel };
}
if (typeof response.entity.clientFor !== 'function') {
throw new Error('Hypermedia response expected');
}
var client = response.entity.clientFor(rel.rel);
return client({ params: rel.params });
}, this));
}
/**
* Wrap a Promise as an ResponsePromise
*
* @param {Promise<Response>} promise the promise for an HTTP Response
* @returns {ResponsePromise<Response>} wrapped promise for Response with additional helper methods
*/
function make(promise) {
promise.status = status;
promise.headers = headers;
promise.header = header;
promise.entity = entity;
promise.follow = follow;
return promise;
}
function responsePromise() {
return make(when.apply(when, arguments));
}
responsePromise.make = make;
responsePromise.reject = function (val) {
return make(when.reject(val));
};
responsePromise.promise = function (func) {
return make(when.promise(func));
};
return responsePromise;
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"./normalizeHeaderName":138,"when":134}],140:[function(_dereq_,module,exports){
/*
* Copyright 2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
define(function (/* require */) {
var charMap;
charMap = (function () {
var strings = {
alpha: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
digit: '0123456789'
};
strings.genDelims = ':/?#[]@';
strings.subDelims = '!$&\'()*+,;=';
strings.reserved = strings.genDelims + strings.subDelims;
strings.unreserved = strings.alpha + strings.digit + '-._~';
strings.url = strings.reserved + strings.unreserved;
strings.scheme = strings.alpha + strings.digit + '+-.';
strings.userinfo = strings.unreserved + strings.subDelims + ':';
strings.host = strings.unreserved + strings.subDelims;
strings.port = strings.digit;
strings.pchar = strings.unreserved + strings.subDelims + ':@';
strings.segment = strings.pchar;
strings.path = strings.segment + '/';
strings.query = strings.pchar + '/?';
strings.fragment = strings.pchar + '/?';
return Object.keys(strings).reduce(function (charMap, set) {
charMap[set] = strings[set].split('').reduce(function (chars, myChar) {
chars[myChar] = true;
return chars;
}, {});
return charMap;
}, {});
}());
function encode(str, allowed) {
if (typeof str !== 'string') {
throw new Error('String required for URL encoding');
}
return str.split('').map(function (myChar) {
if (allowed.hasOwnProperty(myChar)) {
return myChar;
}
var code = myChar.charCodeAt(0);
if (code <= 127) {
return '%' + code.toString(16).toUpperCase();
}
else {
return encodeURIComponent(myChar).toUpperCase();
}
}).join('');
}
function makeEncoder(allowed) {
allowed = allowed || charMap.unreserved;
return function (str) {
return encode(str, allowed);
};
}
function decode(str) {
return decodeURIComponent(str);
}
return {
/*
* Decode URL encoded strings
*
* @param {string} URL encoded string
* @returns {string} URL decoded string
*/
decode: decode,
/*
* URL encode a string
*
* All but alpha-numerics and a very limited set of punctuation - . _ ~ are
* encoded.
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encode: makeEncoder(),
/*
* URL encode a URL
*
* All character permitted anywhere in a URL are left unencoded even
* if that character is not permitted in that portion of a URL.
*
* Note: This method is typically not what you want.
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodeURL: makeEncoder(charMap.url),
/*
* URL encode the scheme portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodeScheme: makeEncoder(charMap.scheme),
/*
* URL encode the user info portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodeUserInfo: makeEncoder(charMap.userinfo),
/*
* URL encode the host portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodeHost: makeEncoder(charMap.host),
/*
* URL encode the port portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodePort: makeEncoder(charMap.port),
/*
* URL encode a path segment portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodePathSegment: makeEncoder(charMap.segment),
/*
* URL encode the path portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodePath: makeEncoder(charMap.path),
/*
* URL encode the query portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodeQuery: makeEncoder(charMap.query),
/*
* URL encode the fragment portion of a URL
*
* @param {string} string to encode
* @returns {string} URL encoded string
*/
encodeFragment: makeEncoder(charMap.fragment)
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{}],141:[function(_dereq_,module,exports){
/*
* Copyright 2015 the original author or authors
* @license MIT, see LICENSE.txt for details
*
* @author Scott Andrews
*/
(function (define) {
'use strict';
var undef;
define(function (_dereq_) {
var uriEncoder, operations, prefixRE;
uriEncoder = _dereq_('./uriEncoder');
prefixRE = /^([^:]*):([0-9]+)$/;
operations = {
'': { first: '', separator: ',', named: false, empty: '', encoder: uriEncoder.encode },
'+': { first: '', separator: ',', named: false, empty: '', encoder: uriEncoder.encodeURL },
'#': { first: '#', separator: ',', named: false, empty: '', encoder: uriEncoder.encodeURL },
'.': { first: '.', separator: '.', named: false, empty: '', encoder: uriEncoder.encode },
'/': { first: '/', separator: '/', named: false, empty: '', encoder: uriEncoder.encode },
';': { first: ';', separator: ';', named: true, empty: '', encoder: uriEncoder.encode },
'?': { first: '?', separator: '&', named: true, empty: '=', encoder: uriEncoder.encode },
'&': { first: '&', separator: '&', named: true, empty: '=', encoder: uriEncoder.encode },
'=': { reserved: true },
',': { reserved: true },
'!': { reserved: true },
'@': { reserved: true },
'|': { reserved: true }
};
function apply(operation, expression, params) {
/*jshint maxcomplexity:11 */
return expression.split(',').reduce(function (result, variable) {
var opts, value;
opts = {};
if (variable.slice(-1) === '*') {
variable = variable.slice(0, -1);
opts.explode = true;
}
if (prefixRE.test(variable)) {
var prefix = prefixRE.exec(variable);
variable = prefix[1];
opts.maxLength = parseInt(prefix[2]);
}
variable = uriEncoder.decode(variable);
value = params[variable];
if (value === undef || value === null) {
return result;
}
if (Array.isArray(value)) {
result += value.reduce(function (result, value) {
if (result.length) {
result += opts.explode ? operation.separator : ',';
if (operation.named && opts.explode) {
result += operation.encoder(variable);
result += value.length ? '=' : operation.empty;
}
}
else {
result += operation.first;
if (operation.named) {
result += operation.encoder(variable);
result += value.length ? '=' : operation.empty;
}
}
result += operation.encoder(value);
return result;
}, '');
}
else if (typeof value === 'object') {
result += Object.keys(value).reduce(function (result, name) {
if (result.length) {
result += opts.explode ? operation.separator : ',';
}
else {
result += operation.first;
if (operation.named && !opts.explode) {
result += operation.encoder(variable);
result += value[name].length ? '=' : operation.empty;
}
}
result += operation.encoder(name);
result += opts.explode ? '=' : ',';
result += operation.encoder(value[name]);
return result;
}, '');
}
else {
value = String(value);
if (opts.maxLength) {
value = value.slice(0, opts.maxLength);
}
result += result.length ? operation.separator : operation.first;
if (operation.named) {
result += operation.encoder(variable);
result += value.length ? '=' : operation.empty;
}
result += operation.encoder(value);
}
return result;
}, '');
}
function expandExpression(expression, params) {
var operation;
operation = operations[expression.slice(0,1)];
if (operation) {
expression = expression.slice(1);
}
else {
operation = operations[''];
}
if (operation.reserved) {
throw new Error('Reserved expression operations are not supported');
}
return apply(operation, expression, params);
}
function expandTemplate(template, params) {
var start, end, uri;
uri = '';
end = 0;
while (true) {
start = template.indexOf('{', end);
if (start === -1) {
// no more expressions
uri += template.slice(end);
break;
}
uri += template.slice(end, start);
end = template.indexOf('}', start) + 1;
uri += expandExpression(template.slice(start + 1, end - 1), params);
}
return uri;
}
return {
/**
* Expand a URI Template with parameters to form a URI.
*
* Full implementation (level 4) of rfc6570.
* @see https://tools.ietf.org/html/rfc6570
*
* @param {string} template URI template
* @param {Object} [params] params to apply to the template durring expantion
* @returns {string} expanded URI
*/
expand: expandTemplate
};
});
}(
typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(_dereq_); }
// Boilerplate for AMD and Node
));
},{"./uriEncoder":140}]},{},[1]);
|
src/Main.js | andre-lima/Simple-React-Page-Router | import React from 'react';
import './Main.css';
export default class Main extends React.Component {
render() {
return (
<main id='page'>
{this.props.children}
</main>
);
}
}
|
src/svg-icons/content/reply-all.js | ruifortes/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ContentReplyAll = (props) => (
<SvgIcon {...props}>
<path d="M7 8V5l-7 7 7 7v-3l-4-4 4-4zm6 1V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"/>
</SvgIcon>
);
ContentReplyAll = pure(ContentReplyAll);
ContentReplyAll.displayName = 'ContentReplyAll';
ContentReplyAll.muiName = 'SvgIcon';
export default ContentReplyAll;
|
src/components/views/elements/ActionButton.js | aperezdc/matrix-react-sdk | /*
Copyright 2017 Vector Creations Ltd
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.
*/
import React from 'react';
import PropTypes from 'prop-types';
import AccessibleButton from './AccessibleButton';
import dis from '../../../dispatcher';
import sdk from '../../../index';
import Analytics from '../../../Analytics';
export default React.createClass({
displayName: 'RoleButton',
propTypes: {
size: PropTypes.string,
tooltip: PropTypes.bool,
action: PropTypes.string.isRequired,
mouseOverAction: PropTypes.string,
label: PropTypes.string.isRequired,
iconPath: PropTypes.string.isRequired,
},
getDefaultProps: function() {
return {
size: "25",
tooltip: false,
};
},
getInitialState: function() {
return {
showTooltip: false,
};
},
_onClick: function(ev) {
ev.stopPropagation();
Analytics.trackEvent('Action Button', 'click', this.props.action);
dis.dispatch({action: this.props.action});
},
_onMouseEnter: function() {
if (this.props.tooltip) this.setState({showTooltip: true});
if (this.props.mouseOverAction) {
dis.dispatch({action: this.props.mouseOverAction});
}
},
_onMouseLeave: function() {
this.setState({showTooltip: false});
},
render: function() {
const TintableSvg = sdk.getComponent("elements.TintableSvg");
let tooltip;
if (this.state.showTooltip) {
const RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
tooltip = <RoomTooltip className="mx_RoleButton_tooltip" label={this.props.label} />;
}
return (
<AccessibleButton className="mx_RoleButton"
onClick={this._onClick}
onMouseEnter={this._onMouseEnter}
onMouseLeave={this._onMouseLeave}
aria-label={this.props.label}
>
<TintableSvg src={this.props.iconPath} width={this.props.size} height={this.props.size} />
{ tooltip }
</AccessibleButton>
);
},
});
|
client/src/app/components/graphs/vectormap/VectorMap.js | zraees/sms-project |
import React from 'react'
var VectorMap = React.createClass({
componentDidMount: function(){
var data = this.props.data;
// $(this.getHold()).vectorMap({
// map: 'world_mill_en',
// backgroundColor: '#fff',
// regionStyle: {
// initial: {
// fill: '#c4c4c4'
// },
// hover: {
// "fill-opacity": 1
// }
// },
// series: {
// regions: [
// {
// values: data,
// scale: ['#85a8b6', '#4d7686'],
// normalizeFunction: 'polynomial'
// }
// ]
// },
// onRegionLabelShow: function (e, el, code) {
// if (typeof data[code] == 'undefined') {
// e.preventDefault();
// } else {
// var countrylbl = data[code];
// el.html(el.html() + ': ' + countrylbl + ' visits');
// }
// }
// });
},
componentWillUnmount: function(){
let mapObject = $(this.getHold()).children('.jvectormap-container').data('mapObject');
mapObject && mapObject.remove();
},
render: function () {
return (
<div id="vector-map" className="vector-map" ref={ref=>this.setHold(ref)}/>
)
}
});
export default VectorMap
|
ajax/libs/react/0.12.0/react-with-addons.min.js | bsquochoaidownloadfolders/cdnjs | /**
* React (with addons) v0.12.0
*
* Copyright 2013-2014, 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.
*
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.React=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t){"use strict";var n=e("./LinkedStateMixin"),r=e("./React"),o=e("./ReactComponentWithPureRenderMixin"),i=e("./ReactCSSTransitionGroup"),a=e("./ReactTransitionGroup"),s=e("./ReactUpdates"),u=e("./cx"),c=e("./cloneWithProps"),l=e("./update");r.addons={CSSTransitionGroup:i,LinkedStateMixin:n,PureRenderMixin:o,TransitionGroup:a,batchedUpdates:s.batchedUpdates,classSet:u,cloneWithProps:c,update:l},t.exports=r},{"./LinkedStateMixin":25,"./React":31,"./ReactCSSTransitionGroup":34,"./ReactComponentWithPureRenderMixin":39,"./ReactTransitionGroup":87,"./ReactUpdates":88,"./cloneWithProps":110,"./cx":115,"./update":154}],2:[function(e,t){"use strict";var n=e("./focusNode"),r={componentDidMount:function(){this.props.autoFocus&&n(this.getDOMNode())}};t.exports=r},{"./focusNode":122}],3:[function(e,t){"use strict";function n(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}var o=e("./EventConstants"),i=e("./EventPropagators"),a=e("./ExecutionEnvironment"),s=e("./SyntheticInputEvent"),u=e("./keyOf"),c=a.canUseDOM&&"TextEvent"in window&&!("documentMode"in document||n()),l=32,p=String.fromCharCode(l),d=o.topLevelTypes,f={beforeInput:{phasedRegistrationNames:{bubbled:u({onBeforeInput:null}),captured:u({onBeforeInputCapture:null})},dependencies:[d.topCompositionEnd,d.topKeyPress,d.topTextInput,d.topPaste]}},h=null,m=!1,v={eventTypes:f,extractEvents:function(e,t,n,o){var a;if(c)switch(e){case d.topKeyPress:var u=o.which;if(u!==l)return;m=!0,a=p;break;case d.topTextInput:if(a=o.data,a===p&&m)return;break;default:return}else{switch(e){case d.topPaste:h=null;break;case d.topKeyPress:o.which&&!r(o)&&(h=String.fromCharCode(o.which));break;case d.topCompositionEnd:h=o.data}if(null===h)return;a=h}if(a){var v=s.getPooled(f.beforeInput,n,o);return v.data=a,h=null,i.accumulateTwoPhaseDispatches(v),v}}};t.exports=v},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./SyntheticInputEvent":98,"./keyOf":144}],4:[function(e,t){var n=e("./invariant"),r={addClass:function(e,t){return n(!/\s/.test(t)),t&&(e.classList?e.classList.add(t):r.hasClass(e,t)||(e.className=e.className+" "+t)),e},removeClass:function(e,t){return n(!/\s/.test(t)),t&&(e.classList?e.classList.remove(t):r.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,""))),e},conditionClass:function(e,t,n){return(n?r.addClass:r.removeClass)(e,t)},hasClass:function(e,t){return n(!/\s/.test(t)),e.classList?!!t&&e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}};t.exports=r},{"./invariant":137}],5:[function(e,t){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={columnCount:!0,fillOpacity:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[n(t,e)]=r[e]})});var i={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!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}},a={isUnitlessNumber:r,shorthandPropertyExpansions:i};t.exports=a},{}],6:[function(e,t){"use strict";var n=e("./CSSProperty"),r=e("./ExecutionEnvironment"),o=(e("./camelizeStyleName"),e("./dangerousStyleValue")),i=e("./hyphenateStyleName"),a=e("./memoizeStringOnly"),s=(e("./warning"),a(function(e){return i(e)})),u="cssFloat";r.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(u="styleFloat");var c={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=s(n)+":",t+=o(n,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var i in t)if(t.hasOwnProperty(i)){var a=o(i,t[i]);if("float"===i&&(i=u),a)r[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var c in s)r[c]="";else r[i]=""}}}};t.exports=c},{"./CSSProperty":5,"./ExecutionEnvironment":23,"./camelizeStyleName":109,"./dangerousStyleValue":116,"./hyphenateStyleName":135,"./memoizeStringOnly":146,"./warning":155}],7:[function(e,t){"use strict";function n(){this._callbacks=null,this._contexts=null}var r=e("./PooledClass"),o=e("./Object.assign"),i=e("./invariant");o(n.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){i(e.length===t.length),this._callbacks=null,this._contexts=null;for(var n=0,r=e.length;r>n;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{"./Object.assign":29,"./PooledClass":30,"./invariant":137}],8:[function(e,t){"use strict";function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=M.getPooled(P.change,w,e);E.accumulateTwoPhaseDispatches(t),R.batchedUpdates(o,t)}function o(e){g.enqueueEvents(e),g.processEventQueue()}function i(e,t){T=e,w=t,T.attachEvent("onchange",r)}function a(){T&&(T.detachEvent("onchange",r),T=null,w=null)}function s(e,t,n){return e===x.topChange?n:void 0}function u(e,t,n){e===x.topFocus?(a(),i(t,n)):e===x.topBlur&&a()}function c(e,t){T=e,w=t,_=e.value,S=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(T,"value",k),T.attachEvent("onpropertychange",p)}function l(){T&&(delete T.value,T.detachEvent("onpropertychange",p),T=null,w=null,_=null,S=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==_&&(_=t,r(e))}}function d(e,t,n){return e===x.topInput?n:void 0}function f(e,t,n){e===x.topFocus?(l(),c(t,n)):e===x.topBlur&&l()}function h(e){return e!==x.topSelectionChange&&e!==x.topKeyUp&&e!==x.topKeyDown||!T||T.value===_?void 0:(_=T.value,w)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===x.topClick?n:void 0}var y=e("./EventConstants"),g=e("./EventPluginHub"),E=e("./EventPropagators"),C=e("./ExecutionEnvironment"),R=e("./ReactUpdates"),M=e("./SyntheticEvent"),b=e("./isEventSupported"),O=e("./isTextInputElement"),D=e("./keyOf"),x=y.topLevelTypes,P={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})},dependencies:[x.topBlur,x.topChange,x.topClick,x.topFocus,x.topInput,x.topKeyDown,x.topKeyUp,x.topSelectionChange]}},T=null,w=null,_=null,S=null,N=!1;C.canUseDOM&&(N=b("change")&&(!("documentMode"in document)||document.documentMode>8));var I=!1;C.canUseDOM&&(I=b("input")&&(!("documentMode"in document)||document.documentMode>9));var k={get:function(){return S.get.call(this)},set:function(e){_=""+e,S.set.call(this,e)}},A={eventTypes:P,extractEvents:function(e,t,r,o){var i,a;if(n(t)?N?i=s:a=u:O(t)?I?i=d:(i=h,a=f):m(t)&&(i=v),i){var c=i(e,t,r);if(c){var l=M.getPooled(P.change,c,o);return E.accumulateTwoPhaseDispatches(l),l}}a&&a(e,t,r)}};t.exports=A},{"./EventConstants":17,"./EventPluginHub":19,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactUpdates":88,"./SyntheticEvent":96,"./isEventSupported":138,"./isTextInputElement":140,"./keyOf":144}],9:[function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],10:[function(e,t){"use strict";function n(e){switch(e){case y.topCompositionStart:return E.compositionStart;case y.topCompositionEnd:return E.compositionEnd;case y.topCompositionUpdate:return E.compositionUpdate}}function r(e,t){return e===y.topKeyDown&&t.keyCode===h}function o(e,t){switch(e){case y.topKeyUp:return-1!==f.indexOf(t.keyCode);case y.topKeyDown:return t.keyCode!==h;case y.topKeyPress:case y.topMouseDown:case y.topBlur:return!0;default:return!1}}function i(e){this.root=e,this.startSelection=c.getSelection(e),this.startValue=this.getText()}var a=e("./EventConstants"),s=e("./EventPropagators"),u=e("./ExecutionEnvironment"),c=e("./ReactInputSelection"),l=e("./SyntheticCompositionEvent"),p=e("./getTextContentAccessor"),d=e("./keyOf"),f=[9,13,27,32],h=229,m=u.canUseDOM&&"CompositionEvent"in window,v=!m||"documentMode"in document&&document.documentMode>8&&document.documentMode<=11,y=a.topLevelTypes,g=null,E={compositionEnd:{phasedRegistrationNames:{bubbled:d({onCompositionEnd:null}),captured:d({onCompositionEndCapture:null})},dependencies:[y.topBlur,y.topCompositionEnd,y.topKeyDown,y.topKeyPress,y.topKeyUp,y.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:d({onCompositionStart:null}),captured:d({onCompositionStartCapture:null})},dependencies:[y.topBlur,y.topCompositionStart,y.topKeyDown,y.topKeyPress,y.topKeyUp,y.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:d({onCompositionUpdate:null}),captured:d({onCompositionUpdateCapture:null})},dependencies:[y.topBlur,y.topCompositionUpdate,y.topKeyDown,y.topKeyPress,y.topKeyUp,y.topMouseDown]}};i.prototype.getText=function(){return this.root.value||this.root[p()]},i.prototype.getData=function(){var e=this.getText(),t=this.startSelection.start,n=this.startValue.length-this.startSelection.end;return e.substr(t,e.length-n-t)};var C={eventTypes:E,extractEvents:function(e,t,a,u){var c,p;if(m?c=n(e):g?o(e,u)&&(c=E.compositionEnd):r(e,u)&&(c=E.compositionStart),v&&(g||c!==E.compositionStart?c===E.compositionEnd&&g&&(p=g.getData(),g=null):g=new i(t)),c){var d=l.getPooled(c,a,u);return p&&(d.data=p),s.accumulateTwoPhaseDispatches(d),d}}};t.exports=C},{"./EventConstants":17,"./EventPropagators":22,"./ExecutionEnvironment":23,"./ReactInputSelection":63,"./SyntheticCompositionEvent":94,"./getTextContentAccessor":132,"./keyOf":144}],11:[function(e,t){"use strict";function n(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r,o=e("./Danger"),i=e("./ReactMultiChildUpdateTypes"),a=e("./getTextContentAccessor"),s=e("./invariant"),u=a();r="textContent"===u?function(e,t){e.textContent=t}:function(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);if(t){var n=e.ownerDocument||document;e.appendChild(n.createTextNode(t))}};var c={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:r,processUpdates:function(e,t){for(var a,u=null,c=null,l=0;a=e[l];l++)if(a.type===i.MOVE_EXISTING||a.type===i.REMOVE_NODE){var p=a.fromIndex,d=a.parentNode.childNodes[p],f=a.parentID;s(d),u=u||{},u[f]=u[f]||[],u[f][p]=d,c=c||[],c.push(d)}var h=o.dangerouslyRenderMarkup(t);if(c)for(var m=0;m<c.length;m++)c[m].parentNode.removeChild(c[m]);for(var v=0;a=e[v];v++)switch(a.type){case i.INSERT_MARKUP:n(a.parentNode,h[a.markupIndex],a.toIndex);break;case i.MOVE_EXISTING:n(a.parentNode,u[a.parentID][a.fromIndex],a.toIndex);break;case i.TEXT_CONTENT:r(a.parentNode,a.textContent);break;case i.REMOVE_NODE:}}};t.exports=c},{"./Danger":14,"./ReactMultiChildUpdateTypes":70,"./getTextContentAccessor":132,"./invariant":137}],12:[function(e,t){"use strict";function n(e,t){return(e&t)===t}var r=e("./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=e.Properties||{},i=e.DOMAttributeNames||{},s=e.DOMPropertyNames||{},u=e.DOMMutationMethods||{};e.isCustomAttribute&&a._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var c in t){r(!a.isStandardName.hasOwnProperty(c)),a.isStandardName[c]=!0;var l=c.toLowerCase();if(a.getPossibleStandardName[l]=c,i.hasOwnProperty(c)){var p=i[c];a.getPossibleStandardName[p]=c,a.getAttributeName[c]=p}else a.getAttributeName[c]=l;a.getPropertyName[c]=s.hasOwnProperty(c)?s[c]:c,a.getMutationMethod[c]=u.hasOwnProperty(c)?u[c]:null;var d=t[c];a.mustUseAttribute[c]=n(d,o.MUST_USE_ATTRIBUTE),a.mustUseProperty[c]=n(d,o.MUST_USE_PROPERTY),a.hasSideEffects[c]=n(d,o.HAS_SIDE_EFFECTS),a.hasBooleanValue[c]=n(d,o.HAS_BOOLEAN_VALUE),a.hasNumericValue[c]=n(d,o.HAS_NUMERIC_VALUE),a.hasPositiveNumericValue[c]=n(d,o.HAS_POSITIVE_NUMERIC_VALUE),a.hasOverloadedBooleanValue[c]=n(d,o.HAS_OVERLOADED_BOOLEAN_VALUE),r(!a.mustUseAttribute[c]||!a.mustUseProperty[c]),r(a.mustUseProperty[c]||!a.hasSideEffects[c]),r(!!a.hasBooleanValue[c]+!!a.hasNumericValue[c]+!!a.hasOverloadedBooleanValue[c]<=1)}}},i={},a={ID_ATTRIBUTE_NAME:"data-reactid",isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasSideEffects:{},hasBooleanValue:{},hasNumericValue:{},hasPositiveNumericValue:{},hasOverloadedBooleanValue:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t<a._isCustomAttributeFunctions.length;t++){var n=a._isCustomAttributeFunctions[t];if(n(e))return!0}return!1},getDefaultValueForProperty:function(e,t){var n,r=i[e];return r||(i[e]=r={}),t in r||(n=document.createElement(e),r[t]=n[t]),r[t]},injection:o};t.exports=a},{"./invariant":137}],13:[function(e,t){"use strict";function n(e,t){return null==t||r.hasBooleanValue[e]&&!t||r.hasNumericValue[e]&&isNaN(t)||r.hasPositiveNumericValue[e]&&1>t||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e("./DOMProperty"),o=e("./escapeTextForBrowser"),i=e("./memoizeStringOnly"),a=(e("./warning"),i(function(e){return o(e)+'="'})),s={createMarkupForID:function(e){return a(r.ID_ATTRIBUTE_NAME)+o(e)+'"'},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(n(e,t))return"";var i=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?o(i):a(i)+o(t)+'"'}return r.isCustomAttribute(e)?null==t?"":a(e)+o(t)+'"':null},setValueForProperty:function(e,t,o){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var i=r.getMutationMethod[t];if(i)i(e,o);else if(n(t,o))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+o);else{var a=r.getPropertyName[t];r.hasSideEffects[t]&&""+e[a]==""+o||(e[a]=o)}}else r.isCustomAttribute(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var n=r.getMutationMethod[t];if(n)n(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var o=r.getPropertyName[t],i=r.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects[t]&&""+e[o]===i||(e[o]=i)}}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};t.exports=s},{"./DOMProperty":12,"./escapeTextForBrowser":120,"./memoizeStringOnly":146,"./warning":155}],14:[function(e,t){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e("./ExecutionEnvironment"),o=e("./createNodesFromMarkup"),i=e("./emptyFunction"),a=e("./getMarkupWrap"),s=e("./invariant"),u=/^(<[^ \/>]+)/,c="data-danger-index",l={dangerouslyRenderMarkup:function(e){s(r.canUseDOM);for(var t,l={},p=0;p<e.length;p++)s(e[p]),t=n(e[p]),t=a(t)?t:"*",l[t]=l[t]||[],l[t][p]=e[p];var d=[],f=0;for(t in l)if(l.hasOwnProperty(t)){var h=l[t];for(var m in h)if(h.hasOwnProperty(m)){var v=h[m];h[m]=v.replace(u,"$1 "+c+'="'+m+'" ')}var y=o(h.join(""),i);for(p=0;p<y.length;++p){var g=y[p];g.hasAttribute&&g.hasAttribute(c)&&(m=+g.getAttribute(c),g.removeAttribute(c),s(!d.hasOwnProperty(m)),d[m]=g,f+=1)}}return s(f===d.length),s(d.length===e.length),d},dangerouslyReplaceNodeWithMarkup:function(e,t){s(r.canUseDOM),s(t),s("html"!==e.tagName.toLowerCase());var n=o(t,i)[0];e.parentNode.replaceChild(n,e)}};t.exports=l},{"./ExecutionEnvironment":23,"./createNodesFromMarkup":114,"./emptyFunction":118,"./getMarkupWrap":129,"./invariant":137}],15:[function(e,t){"use strict";var n=e("./keyOf"),r=[n({ResponderEventPlugin:null}),n({SimpleEventPlugin:null}),n({TapEventPlugin:null}),n({EnterLeaveEventPlugin:null}),n({ChangeEventPlugin:null}),n({SelectEventPlugin:null}),n({CompositionEventPlugin:null}),n({BeforeInputEventPlugin:null}),n({AnalyticsEventPlugin:null}),n({MobileSafariClickEventPlugin:null})];t.exports=r},{"./keyOf":144}],16:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./EventPropagators"),o=e("./SyntheticMouseEvent"),i=e("./ReactMount"),a=e("./keyOf"),s=n.topLevelTypes,u=i.getFirstReactDOM,c={mouseEnter:{registrationName:a({onMouseEnter:null}),dependencies:[s.topMouseOut,s.topMouseOver]},mouseLeave:{registrationName:a({onMouseLeave:null}),dependencies:[s.topMouseOut,s.topMouseOver]}},l=[null,null],p={eventTypes:c,extractEvents:function(e,t,n,a){if(e===s.topMouseOver&&(a.relatedTarget||a.fromElement))return null;if(e!==s.topMouseOut&&e!==s.topMouseOver)return null;var p;if(t.window===t)p=t;else{var d=t.ownerDocument;p=d?d.defaultView||d.parentWindow:window}var f,h;if(e===s.topMouseOut?(f=t,h=u(a.relatedTarget||a.toElement)||p):(f=p,h=t),f===h)return null;var m=f?i.getID(f):"",v=h?i.getID(h):"",y=o.getPooled(c.mouseLeave,m,a);y.type="mouseleave",y.target=f,y.relatedTarget=h;var g=o.getPooled(c.mouseEnter,v,a);return g.type="mouseenter",g.target=h,g.relatedTarget=f,r.accumulateEnterLeaveDispatches(y,g,m,v),l[0]=y,l[1]=g,l}};t.exports=p},{"./EventConstants":17,"./EventPropagators":22,"./ReactMount":68,"./SyntheticMouseEvent":100,"./keyOf":144}],17:[function(e,t){"use strict";var n=e("./keyMirror"),r=n({bubbled:null,captured:null}),o=n({topBlur: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,topError:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topLoad:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topReset:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTextInput:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),i={topLevelTypes:o,PropagationPhases:r};t.exports=i},{"./keyMirror":143}],18:[function(e,t){var n=e("./emptyFunction"),r={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,r){return e.addEventListener?(e.addEventListener(t,r,!0),{remove:function(){e.removeEventListener(t,r,!0)}}):{remove:n}},registerDefault:function(){}};t.exports=r},{"./emptyFunction":118}],19:[function(e,t){"use strict";var n=e("./EventPluginRegistry"),r=e("./EventPluginUtils"),o=e("./accumulateInto"),i=e("./forEachAccumulated"),a=e("./invariant"),s={},u=null,c=function(e){if(e){var t=r.executeDispatch,o=n.getPluginModuleForEvent(e);o&&o.executeDispatch&&(t=o.executeDispatch),r.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e)}},l=null,p={injection:{injectMount:r.injection.injectMount,injectInstanceHandle:function(e){l=e},getInstanceHandle:function(){return l},injectEventPluginOrder:n.injectEventPluginOrder,injectEventPluginsByName:n.injectEventPluginsByName},eventNameDispatchConfigs:n.eventNameDispatchConfigs,registrationNameModules:n.registrationNameModules,putListener:function(e,t,n){a(!n||"function"==typeof n);var r=s[t]||(s[t]={});r[e]=n},getListener:function(e,t){var n=s[t];return n&&n[e]},deleteListener:function(e,t){var n=s[t];n&&delete n[e]},deleteAllListeners:function(e){for(var t in s)delete s[t][e]},extractEvents:function(e,t,r,i){for(var a,s=n.plugins,u=0,c=s.length;c>u;u++){var l=s[u];if(l){var p=l.extractEvents(e,t,r,i);p&&(a=o(a,p))}}return a},enqueueEvents:function(e){e&&(u=o(u,e))},processEventQueue:function(){var e=u;u=null,i(e,c),a(!u)},__purge:function(){s={}},__getListenerBank:function(){return s}};t.exports=p},{"./EventPluginRegistry":20,"./EventPluginUtils":21,"./accumulateInto":106,"./forEachAccumulated":123,"./invariant":137}],20:[function(e,t){"use strict";function n(){if(a)for(var e in s){var t=s[e],n=a.indexOf(e);if(i(n>-1),!u.plugins[n]){i(t.extractEvents),u.plugins[n]=t;var o=t.eventTypes;for(var c in o)i(r(o[c],t,c))}}}function r(e,t,n){i(!u.eventNameDispatchConfigs.hasOwnProperty(n)),u.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];o(s,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){i(!u.registrationNameModules[e]),u.registrationNameModules[e]=t,u.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=e("./invariant"),a=null,s={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){i(!a),a=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];s.hasOwnProperty(r)&&s[r]===o||(i(!s[r]),s[r]=o,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){a=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=u},{"./invariant":137}],21:[function(e,t){"use strict";function n(e){return e===m.topMouseUp||e===m.topTouchEnd||e===m.topTouchCancel}function r(e){return e===m.topMouseMove||e===m.topTouchMove}function o(e){return e===m.topMouseDown||e===m.topTouchStart}function i(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)t(e,n[o],r[o]);else n&&t(e,n,r)}function a(e,t,n){e.currentTarget=h.Mount.getNode(n);var r=t(e,n);return e.currentTarget=null,r}function s(e,t){i(e,t),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 c(e){var t=u(e);return e._dispatchIDs=null,e._dispatchListeners=null,t}function l(e){var t=e._dispatchListeners,n=e._dispatchIDs;f(!Array.isArray(t));var r=t?t(e,n):null;return e._dispatchListeners=null,e._dispatchIDs=null,r}function p(e){return!!e._dispatchListeners}var d=e("./EventConstants"),f=e("./invariant"),h={Mount:null,injectMount:function(e){h.Mount=e}},m=d.topLevelTypes,v={isEndish:n,isMoveish:r,isStartish:o,executeDirectDispatch:l,executeDispatch:a,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:c,hasDispatches:p,injection:h,useTouchEvents:!1};t.exports=v},{"./EventConstants":17,"./invariant":137}],22:[function(e,t){"use strict";function n(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return m(e,r)}function r(e,t,r){var o=t?h.bubbled:h.captured,i=n(e,r,o);i&&(r._dispatchListeners=d(r._dispatchListeners,i),r._dispatchIDs=d(r._dispatchIDs,e))}function o(e){e&&e.dispatchConfig.phasedRegistrationNames&&p.injection.getInstanceHandle().traverseTwoPhase(e.dispatchMarker,r,e)}function i(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=m(e,r);o&&(n._dispatchListeners=d(n._dispatchListeners,o),n._dispatchIDs=d(n._dispatchIDs,e))}}function a(e){e&&e.dispatchConfig.registrationName&&i(e.dispatchMarker,null,e)}function s(e){f(e,o)}function u(e,t,n,r){p.injection.getInstanceHandle().traverseEnterLeave(n,r,i,e,t)}function c(e){f(e,a)}var l=e("./EventConstants"),p=e("./EventPluginHub"),d=e("./accumulateInto"),f=e("./forEachAccumulated"),h=l.PropagationPhases,m=p.getListener,v={accumulateTwoPhaseDispatches:s,accumulateDirectDispatches:c,accumulateEnterLeaveDispatches:u};t.exports=v},{"./EventConstants":17,"./EventPluginHub":19,"./accumulateInto":106,"./forEachAccumulated":123}],23:[function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};t.exports=r},{}],24:[function(e,t){"use strict";var n,r=e("./DOMProperty"),o=e("./ExecutionEnvironment"),i=r.injection.MUST_USE_ATTRIBUTE,a=r.injection.MUST_USE_PROPERTY,s=r.injection.HAS_BOOLEAN_VALUE,u=r.injection.HAS_SIDE_EFFECTS,c=r.injection.HAS_NUMERIC_VALUE,l=r.injection.HAS_POSITIVE_NUMERIC_VALUE,p=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var d=document.implementation;n=d&&d.hasFeature&&d.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var f={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:i|s,allowTransparency:i,alt:null,async:s,autoComplete:null,autoPlay:s,cellPadding:null,cellSpacing:null,charSet:i,checked:a|s,classID:i,className:n?i:a,cols:i|l,colSpan:null,content:null,contentEditable:null,contextMenu:i,controls:a|s,coords:null,crossOrigin:null,data:null,dateTime:i,defer:s,dir:null,disabled:i|s,download:p,draggable:null,encType:null,form:i,formNoValidate:s,frameBorder:i,height:i,hidden:i|s,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:a,label:null,lang:null,list:i,loop:a|s,manifest:i,max:null,maxLength:i,media:i,mediaGroup:null,method:null,min:null,multiple:a|s,muted:a|s,name:null,noValidate:s,open:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:a|s,rel:null,required:s,role:i,rows:i|l,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:i|s,selected:a|s,shape:null,size:i|l,sizes:i,span:l,spellCheck:null,src:null,srcDoc:a,srcSet:i,start:c,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:a|u,width:i,wmode:i,autoCapitalize:null,autoCorrect:null,itemProp:i,itemScope:i|s,itemType:i,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"enctype",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=f},{"./DOMProperty":12,"./ExecutionEnvironment":23}],25:[function(e,t){"use strict";var n=e("./ReactLink"),r=e("./ReactStateSetters"),o={linkState:function(e){return new n(this.state[e],r.createStateKeySetter(this,e))}};t.exports=o},{"./ReactLink":66,"./ReactStateSetters":83}],26:[function(e,t){"use strict";function n(e){u(null==e.props.checkedLink||null==e.props.valueLink)}function r(e){n(e),u(null==e.props.value&&null==e.props.onChange)}function o(e){n(e),u(null==e.props.checked&&null==e.props.onChange)}function i(e){this.props.valueLink.requestChange(e.target.value)}function a(e){this.props.checkedLink.requestChange(e.target.checked)}var s=e("./ReactPropTypes"),u=e("./invariant"),c={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},l={Mixin:{propTypes:{value:function(e,t){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?void 0: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){return!e[t]||e.onChange||e.readOnly||e.disabled?void 0: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}},getValue:function(e){return e.props.valueLink?(r(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(o(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(r(e),i):e.props.checkedLink?(o(e),a):e.props.onChange}};t.exports=l},{"./ReactPropTypes":77,"./invariant":137}],27:[function(e,t){"use strict";function n(e){e.remove()}var r=e("./ReactBrowserEventEmitter"),o=e("./accumulateInto"),i=e("./forEachAccumulated"),a=e("./invariant"),s={trapBubbledEvent:function(e,t){a(this.isMounted());var n=r.trapBubbledEvent(e,t,this.getDOMNode());this._localEventListeners=o(this._localEventListeners,n)},componentWillUnmount:function(){this._localEventListeners&&i(this._localEventListeners,n)}};t.exports=s},{"./ReactBrowserEventEmitter":33,"./accumulateInto":106,"./forEachAccumulated":123,"./invariant":137}],28:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./emptyFunction"),o=n.topLevelTypes,i={eventTypes:null,extractEvents:function(e,t,n,i){if(e===o.topTouchStart){var a=i.target;a&&!a.onclick&&(a.onclick=r)}}};t.exports=i},{"./EventConstants":17,"./emptyFunction":118}],29:[function(e,t){function n(e){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var t=Object(e),n=Object.prototype.hasOwnProperty,r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o){var i=Object(o);for(var a in i)n.call(i,a)&&(t[a]=i[a])}}return t}t.exports=n},{}],30:[function(e,t){"use strict";var n=e("./invariant"),r=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)},i=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},a=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},s=function(e){var t=this;n(e instanceof t),e.destructor&&e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},u=10,c=r,l=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||c,n.poolSize||(n.poolSize=u),n.release=s,n},p={addPoolingTo:l,oneArgumentPooler:r,twoArgumentPooler:o,threeArgumentPooler:i,fiveArgumentPooler:a};t.exports=p},{"./invariant":137}],31:[function(e,t){"use strict";var n=e("./DOMPropertyOperations"),r=e("./EventPluginUtils"),o=e("./ReactChildren"),i=e("./ReactComponent"),a=e("./ReactCompositeComponent"),s=e("./ReactContext"),u=e("./ReactCurrentOwner"),c=e("./ReactElement"),l=(e("./ReactElementValidator"),e("./ReactDOM")),p=e("./ReactDOMComponent"),d=e("./ReactDefaultInjection"),f=e("./ReactInstanceHandles"),h=e("./ReactLegacyElement"),m=e("./ReactMount"),v=e("./ReactMultiChild"),y=e("./ReactPerf"),g=e("./ReactPropTypes"),E=e("./ReactServerRendering"),C=e("./ReactTextComponent"),R=e("./Object.assign"),M=e("./deprecated"),b=e("./onlyChild");
d.inject();var O=c.createElement,D=c.createFactory;O=h.wrapCreateElement(O),D=h.wrapCreateFactory(D);var x=y.measure("React","render",m.render),P={Children:{map:o.map,forEach:o.forEach,count:o.count,only:b},DOM:l,PropTypes:g,initializeTouchEvents:function(e){r.useTouchEvents=e},createClass:a.createClass,createElement:O,createFactory:D,constructAndRenderComponent:m.constructAndRenderComponent,constructAndRenderComponentByID:m.constructAndRenderComponentByID,render:x,renderToString:E.renderToString,renderToStaticMarkup:E.renderToStaticMarkup,unmountComponentAtNode:m.unmountComponentAtNode,isValidClass:h.isValidClass,isValidElement:c.isValidElement,withContext:s.withContext,__spread:R,renderComponent:M("React","renderComponent","render",this,x),renderComponentToString:M("React","renderComponentToString","renderToString",this,E.renderToString),renderComponentToStaticMarkup:M("React","renderComponentToStaticMarkup","renderToStaticMarkup",this,E.renderToStaticMarkup),isValidComponent:M("React","isValidComponent","isValidElement",this,c.isValidElement)};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({Component:i,CurrentOwner:u,DOMComponent:p,DOMPropertyOperations:n,InstanceHandles:f,Mount:m,MultiChild:v,TextComponent:C});P.version="0.12.0",t.exports=P},{"./DOMPropertyOperations":13,"./EventPluginUtils":21,"./Object.assign":29,"./ReactChildren":36,"./ReactComponent":37,"./ReactCompositeComponent":40,"./ReactContext":41,"./ReactCurrentOwner":42,"./ReactDOM":43,"./ReactDOMComponent":45,"./ReactDefaultInjection":55,"./ReactElement":56,"./ReactElementValidator":57,"./ReactInstanceHandles":64,"./ReactLegacyElement":65,"./ReactMount":68,"./ReactMultiChild":69,"./ReactPerf":73,"./ReactPropTypes":77,"./ReactServerRendering":81,"./ReactTextComponent":84,"./deprecated":117,"./onlyChild":148}],32:[function(e,t){"use strict";var n=e("./ReactEmptyComponent"),r=e("./ReactMount"),o=e("./invariant"),i={getDOMNode:function(){return o(this.isMounted()),n.isNullComponentID(this._rootNodeID)?null:r.getNode(this._rootNodeID)}};t.exports=i},{"./ReactEmptyComponent":58,"./ReactMount":68,"./invariant":137}],33:[function(e,t){"use strict";function n(e){return Object.prototype.hasOwnProperty.call(e,h)||(e[h]=d++,l[e[h]]={}),l[e[h]]}var r=e("./EventConstants"),o=e("./EventPluginHub"),i=e("./EventPluginRegistry"),a=e("./ReactEventEmitterMixin"),s=e("./ViewportMetrics"),u=e("./Object.assign"),c=e("./isEventSupported"),l={},p=!1,d=0,f={topBlur:"blur",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",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topWheel:"wheel"},h="_reactListenersID"+String(Math.random()).slice(2),m=u({},a,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var o=t,a=n(o),s=i.registrationNameDependencies[e],u=r.topLevelTypes,l=0,p=s.length;p>l;l++){var d=s[l];a.hasOwnProperty(d)&&a[d]||(d===u.topWheel?c("wheel")?m.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",o):c("mousewheel")?m.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",o):m.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",o):d===u.topScroll?c("scroll",!0)?m.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",o):m.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",m.ReactEventListener.WINDOW_HANDLE):d===u.topFocus||d===u.topBlur?(c("focus",!0)?(m.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",o),m.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",o)):c("focusin")&&(m.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",o),m.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",o)),a[u.topBlur]=!0,a[u.topFocus]=!0):f.hasOwnProperty(d)&&m.ReactEventListener.trapBubbledEvent(d,f[d],o),a[d]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!p){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:o.putListener,getListener:o.getListener,deleteListener:o.deleteListener,deleteAllListeners:o.deleteAllListeners});t.exports=m},{"./EventConstants":17,"./EventPluginHub":19,"./EventPluginRegistry":20,"./Object.assign":29,"./ReactEventEmitterMixin":60,"./ViewportMetrics":105,"./isEventSupported":138}],34:[function(e,t){"use strict";var n=e("./React"),r=e("./Object.assign"),o=n.createFactory(e("./ReactTransitionGroup")),i=n.createFactory(e("./ReactCSSTransitionGroupChild")),a=n.createClass({displayName:"ReactCSSTransitionGroup",propTypes:{transitionName:n.PropTypes.string.isRequired,transitionEnter:n.PropTypes.bool,transitionLeave:n.PropTypes.bool},getDefaultProps:function(){return{transitionEnter:!0,transitionLeave:!0}},_wrapChild:function(e){return i({name:this.props.transitionName,enter:this.props.transitionEnter,leave:this.props.transitionLeave},e)},render:function(){return o(r({},this.props,{childFactory:this._wrapChild}))}});t.exports=a},{"./Object.assign":29,"./React":31,"./ReactCSSTransitionGroupChild":35,"./ReactTransitionGroup":87}],35:[function(e,t){"use strict";var n=e("./React"),r=e("./CSSCore"),o=e("./ReactTransitionEvents"),i=e("./onlyChild"),a=17,s=n.createClass({displayName:"ReactCSSTransitionGroupChild",transition:function(e,t){var n=this.getDOMNode(),i=this.props.name+"-"+e,a=i+"-active",s=function(e){e&&e.target!==n||(r.removeClass(n,i),r.removeClass(n,a),o.removeEndEventListener(n,s),t&&t())};o.addEndEventListener(n,s),r.addClass(n,i),this.queueClass(a)},queueClass:function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,a))},flushClassNameQueue:function(){this.isMounted()&&this.classNameQueue.forEach(r.addClass.bind(r,this.getDOMNode())),this.classNameQueue.length=0,this.timeout=null},componentWillMount:function(){this.classNameQueue=[]},componentWillUnmount:function(){this.timeout&&clearTimeout(this.timeout)},componentWillEnter:function(e){this.props.enter?this.transition("enter",e):e()},componentWillLeave:function(e){this.props.leave?this.transition("leave",e):e()},render:function(){return i(this.props.children)}});t.exports=s},{"./CSSCore":4,"./React":31,"./ReactTransitionEvents":86,"./onlyChild":148}],36:[function(e,t){"use strict";function n(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function o(e,t,o){if(null==e)return e;var i=n.getPooled(t,o);p(e,r,i),n.release(i)}function i(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function a(e,t,n,r){var o=e,i=o.mapResult,a=!i.hasOwnProperty(n);if(a){var s=o.mapFunction.call(o.mapContext,t,r);i[n]=s}}function s(e,t,n){if(null==e)return e;var r={},o=i.getPooled(r,t,n);return p(e,a,o),i.release(o),r}function u(){return null}function c(e){return p(e,u,null)}var l=e("./PooledClass"),p=e("./traverseAllChildren"),d=(e("./warning"),l.twoArgumentPooler),f=l.threeArgumentPooler;l.addPoolingTo(n,d),l.addPoolingTo(i,f);var h={forEach:o,map:s,count:c};t.exports=h},{"./PooledClass":30,"./traverseAllChildren":153,"./warning":155}],37:[function(e,t){"use strict";var n=e("./ReactElement"),r=e("./ReactOwner"),o=e("./ReactUpdates"),i=e("./Object.assign"),a=e("./invariant"),s=e("./keyMirror"),u=s({MOUNTED:null,UNMOUNTED:null}),c=!1,l=null,p=null,d={injection:{injectEnvironment:function(e){a(!c),p=e.mountImageIntoNode,l=e.unmountIDFromEnvironment,d.BackendIDOperations=e.BackendIDOperations,c=!0}},LifeCycle:u,BackendIDOperations:null,Mixin:{isMounted:function(){return this._lifeCycleState===u.MOUNTED},setProps:function(e,t){var n=this._pendingElement||this._currentElement;this.replaceProps(i({},n.props,e),t)},replaceProps:function(e,t){a(this.isMounted()),a(0===this._mountDepth),this._pendingElement=n.cloneAndReplaceProps(this._pendingElement||this._currentElement,e),o.enqueueUpdate(this,t)},_setPropsInternal:function(e,t){var r=this._pendingElement||this._currentElement;this._pendingElement=n.cloneAndReplaceProps(r,i({},r.props,e)),o.enqueueUpdate(this,t)},construct:function(e){this.props=e.props,this._owner=e._owner,this._lifeCycleState=u.UNMOUNTED,this._pendingCallbacks=null,this._currentElement=e,this._pendingElement=null},mountComponent:function(e,t,n){a(!this.isMounted());var o=this._currentElement.ref;if(null!=o){var i=this._currentElement._owner;r.addComponentAsRefTo(this,o,i)}this._rootNodeID=e,this._lifeCycleState=u.MOUNTED,this._mountDepth=n},unmountComponent:function(){a(this.isMounted());var e=this._currentElement.ref;null!=e&&r.removeComponentAsRefFrom(this,e,this._owner),l(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=u.UNMOUNTED},receiveComponent:function(e,t){a(this.isMounted()),this._pendingElement=e,this.performUpdateIfNecessary(t)},performUpdateIfNecessary:function(e){if(null!=this._pendingElement){var t=this._currentElement,n=this._pendingElement;this._currentElement=n,this.props=n.props,this._owner=n._owner,this._pendingElement=null,this.updateComponent(e,t)}},updateComponent:function(e,t){var n=this._currentElement;(n._owner!==t._owner||n.ref!==t.ref)&&(null!=t.ref&&r.removeComponentAsRefFrom(this,t.ref,t._owner),null!=n.ref&&r.addComponentAsRefTo(this,n.ref,n._owner))},mountComponentIntoNode:function(e,t,n){var r=o.ReactReconcileTransaction.getPooled();r.perform(this._mountComponentIntoNode,this,e,t,r,n),o.ReactReconcileTransaction.release(r)},_mountComponentIntoNode:function(e,t,n,r){var o=this.mountComponent(e,n,0);p(o,t,r)},isOwnedBy:function(e){return this._owner===e},getSiblingByRef:function(e){var t=this._owner;return t&&t.refs?t.refs[e]:null}}};t.exports=d},{"./Object.assign":29,"./ReactElement":56,"./ReactOwner":72,"./ReactUpdates":88,"./invariant":137,"./keyMirror":143}],38:[function(e,t){"use strict";var n=e("./ReactDOMIDOperations"),r=e("./ReactMarkupChecksum"),o=e("./ReactMount"),i=e("./ReactPerf"),a=e("./ReactReconcileTransaction"),s=e("./getReactRootElementInContainer"),u=e("./invariant"),c=e("./setInnerHTML"),l=1,p=9,d={ReactReconcileTransaction:a,BackendIDOperations:n,unmountIDFromEnvironment:function(e){o.purgeID(e)},mountImageIntoNode:i.measure("ReactComponentBrowserEnvironment","mountImageIntoNode",function(e,t,n){if(u(t&&(t.nodeType===l||t.nodeType===p)),n){if(r.canReuseMarkup(e,s(t)))return;u(t.nodeType!==p)}u(t.nodeType!==p),c(t,e)})};t.exports=d},{"./ReactDOMIDOperations":47,"./ReactMarkupChecksum":67,"./ReactMount":68,"./ReactPerf":73,"./ReactReconcileTransaction":79,"./getReactRootElementInContainer":131,"./invariant":137,"./setInnerHTML":149}],39:[function(e,t){"use strict";var n=e("./shallowEqual"),r={shouldComponentUpdate:function(e,t){return!n(this.props,e)||!n(this.state,t)}};t.exports=r},{"./shallowEqual":150}],40:[function(e,t){"use strict";function n(e){var t=e._owner||null;return t&&t.constructor&&t.constructor.displayName?" Check the render method of `"+t.constructor.displayName+"`.":""}function r(e,t){for(var n in t)t.hasOwnProperty(n)&&D("function"==typeof t[n])}function o(e,t){var n=I.hasOwnProperty(t)?I[t]:null;L.hasOwnProperty(t)&&D(n===S.OVERRIDE_BASE),e.hasOwnProperty(t)&&D(n===S.DEFINE_MANY||n===S.DEFINE_MANY_MERGED)}function i(e){var t=e._compositeLifeCycleState;D(e.isMounted()||t===A.MOUNTING),D(null==f.current),D(t!==A.UNMOUNTING)}function a(e,t){if(t){D(!y.isValidFactory(t)),D(!h.isValidElement(t));var n=e.prototype;t.hasOwnProperty(_)&&k.mixins(e,t.mixins);for(var r in t)if(t.hasOwnProperty(r)&&r!==_){var i=t[r];if(o(n,r),k.hasOwnProperty(r))k[r](e,i);else{var a=I.hasOwnProperty(r),s=n.hasOwnProperty(r),u=i&&i.__reactDontBind,p="function"==typeof i,d=p&&!a&&!s&&!u;if(d)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[r]=i,n[r]=i;else if(s){var f=I[r];D(a&&(f===S.DEFINE_MANY_MERGED||f===S.DEFINE_MANY)),f===S.DEFINE_MANY_MERGED?n[r]=c(n[r],i):f===S.DEFINE_MANY&&(n[r]=l(n[r],i))}else n[r]=i}}}}function s(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in k;D(!o);var i=n in e;D(!i),e[n]=r}}}function u(e,t){return D(e&&t&&"object"==typeof e&&"object"==typeof t),T(t,function(t,n){D(void 0===e[n]),e[n]=t}),e}function c(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);return null==n?r:null==r?n:u(n,r)}}function l(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}var p=e("./ReactComponent"),d=e("./ReactContext"),f=e("./ReactCurrentOwner"),h=e("./ReactElement"),m=(e("./ReactElementValidator"),e("./ReactEmptyComponent")),v=e("./ReactErrorUtils"),y=e("./ReactLegacyElement"),g=e("./ReactOwner"),E=e("./ReactPerf"),C=e("./ReactPropTransferer"),R=e("./ReactPropTypeLocations"),M=(e("./ReactPropTypeLocationNames"),e("./ReactUpdates")),b=e("./Object.assign"),O=e("./instantiateReactComponent"),D=e("./invariant"),x=e("./keyMirror"),P=e("./keyOf"),T=(e("./monitorCodeUse"),e("./mapObject")),w=e("./shouldUpdateReactComponent"),_=(e("./warning"),P({mixins:null})),S=x({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),N=[],I={mixins:S.DEFINE_MANY,statics:S.DEFINE_MANY,propTypes:S.DEFINE_MANY,contextTypes:S.DEFINE_MANY,childContextTypes:S.DEFINE_MANY,getDefaultProps:S.DEFINE_MANY_MERGED,getInitialState:S.DEFINE_MANY_MERGED,getChildContext:S.DEFINE_MANY_MERGED,render:S.DEFINE_ONCE,componentWillMount:S.DEFINE_MANY,componentDidMount:S.DEFINE_MANY,componentWillReceiveProps:S.DEFINE_MANY,shouldComponentUpdate:S.DEFINE_ONCE,componentWillUpdate:S.DEFINE_MANY,componentDidUpdate:S.DEFINE_MANY,componentWillUnmount:S.DEFINE_MANY,updateComponent:S.OVERRIDE_BASE},k={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)a(e,t[n])},childContextTypes:function(e,t){r(e,t,R.childContext),e.childContextTypes=b({},e.childContextTypes,t)},contextTypes:function(e,t){r(e,t,R.context),e.contextTypes=b({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps=e.getDefaultProps?c(e.getDefaultProps,t):t},propTypes:function(e,t){r(e,t,R.prop),e.propTypes=b({},e.propTypes,t)},statics:function(e,t){s(e,t)}},A=x({MOUNTING:null,UNMOUNTING:null,RECEIVING_PROPS:null}),L={construct:function(){p.Mixin.construct.apply(this,arguments),g.Mixin.construct.apply(this,arguments),this.state=null,this._pendingState=null,this.context=null,this._compositeLifeCycleState=null},isMounted:function(){return p.Mixin.isMounted.call(this)&&this._compositeLifeCycleState!==A.MOUNTING},mountComponent:E.measure("ReactCompositeComponent","mountComponent",function(e,t,n){p.Mixin.mountComponent.call(this,e,t,n),this._compositeLifeCycleState=A.MOUNTING,this.__reactAutoBindMap&&this._bindAutoBindMethods(),this.context=this._processContext(this._currentElement._context),this.props=this._processProps(this.props),this.state=this.getInitialState?this.getInitialState():null,D("object"==typeof this.state&&!Array.isArray(this.state)),this._pendingState=null,this._pendingForceUpdate=!1,this.componentWillMount&&(this.componentWillMount(),this._pendingState&&(this.state=this._pendingState,this._pendingState=null)),this._renderedComponent=O(this._renderValidatedComponent(),this._currentElement.type),this._compositeLifeCycleState=null;var r=this._renderedComponent.mountComponent(e,t,n+1);return this.componentDidMount&&t.getReactMountReady().enqueue(this.componentDidMount,this),r}),unmountComponent:function(){this._compositeLifeCycleState=A.UNMOUNTING,this.componentWillUnmount&&this.componentWillUnmount(),this._compositeLifeCycleState=null,this._renderedComponent.unmountComponent(),this._renderedComponent=null,p.Mixin.unmountComponent.call(this)},setState:function(e,t){D("object"==typeof e||null==e),this.replaceState(b({},this._pendingState||this.state,e),t)},replaceState:function(e,t){i(this),this._pendingState=e,this._compositeLifeCycleState!==A.MOUNTING&&M.enqueueUpdate(this,t)},_processContext:function(e){var t=null,n=this.constructor.contextTypes;if(n){t={};for(var r in n)t[r]=e[r]}return t},_processChildContext:function(e){var t=this.getChildContext&&this.getChildContext();if(this.constructor.displayName||"ReactCompositeComponent",t){D("object"==typeof this.constructor.childContextTypes);for(var n in t)D(n in this.constructor.childContextTypes);return b({},e,t)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,r){var o=this.constructor.displayName;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i](t,i,o,r);a instanceof Error&&n(this)}},performUpdateIfNecessary:function(e){var t=this._compositeLifeCycleState;if(t!==A.MOUNTING&&t!==A.RECEIVING_PROPS&&(null!=this._pendingElement||null!=this._pendingState||this._pendingForceUpdate)){var n=this.context,r=this.props,o=this._currentElement;null!=this._pendingElement&&(o=this._pendingElement,n=this._processContext(o._context),r=this._processProps(o.props),this._pendingElement=null,this._compositeLifeCycleState=A.RECEIVING_PROPS,this.componentWillReceiveProps&&this.componentWillReceiveProps(r,n)),this._compositeLifeCycleState=null;var i=this._pendingState||this.state;this._pendingState=null;var a=this._pendingForceUpdate||!this.shouldComponentUpdate||this.shouldComponentUpdate(r,i,n);a?(this._pendingForceUpdate=!1,this._performComponentUpdate(o,r,i,n,e)):(this._currentElement=o,this.props=r,this.state=i,this.context=n,this._owner=o._owner)}},_performComponentUpdate:function(e,t,n,r,o){var i=this._currentElement,a=this.props,s=this.state,u=this.context;this.componentWillUpdate&&this.componentWillUpdate(t,n,r),this._currentElement=e,this.props=t,this.state=n,this.context=r,this._owner=e._owner,this.updateComponent(o,i),this.componentDidUpdate&&o.getReactMountReady().enqueue(this.componentDidUpdate.bind(this,a,s,u),this)},receiveComponent:function(e,t){(e!==this._currentElement||null==e._owner)&&p.Mixin.receiveComponent.call(this,e,t)},updateComponent:E.measure("ReactCompositeComponent","updateComponent",function(e,t){p.Mixin.updateComponent.call(this,e,t);var n=this._renderedComponent,r=n._currentElement,o=this._renderValidatedComponent();if(w(r,o))n.receiveComponent(o,e);else{var i=this._rootNodeID,a=n._rootNodeID;n.unmountComponent(),this._renderedComponent=O(o,this._currentElement.type);var s=this._renderedComponent.mountComponent(i,e,this._mountDepth+1);p.BackendIDOperations.dangerouslyReplaceNodeWithMarkupByID(a,s)}}),forceUpdate:function(e){var t=this._compositeLifeCycleState;D(this.isMounted()||t===A.MOUNTING),D(t!==A.UNMOUNTING&&null==f.current),this._pendingForceUpdate=!0,M.enqueueUpdate(this,e)},_renderValidatedComponent:E.measure("ReactCompositeComponent","_renderValidatedComponent",function(){var e,t=d.current;d.current=this._processChildContext(this._currentElement._context),f.current=this;try{e=this.render(),null===e||e===!1?(e=m.getEmptyComponent(),m.registerNullComponentID(this._rootNodeID)):m.deregisterNullComponentID(this._rootNodeID)}finally{d.current=t,f.current=null}return D(h.isValidElement(e)),e}),_bindAutoBindMethods:function(){for(var e in this.__reactAutoBindMap)if(this.__reactAutoBindMap.hasOwnProperty(e)){var t=this.__reactAutoBindMap[e];this[e]=this._bindAutoBindMethod(v.guard(t,this.constructor.displayName+"."+e))}},_bindAutoBindMethod:function(e){var t=this,n=e.bind(t);return n}},U=function(){};b(U.prototype,p.Mixin,g.Mixin,C.Mixin,L);var F={LifeCycle:A,Base:U,createClass:function(e){var t=function(){};t.prototype=new U,t.prototype.constructor=t,N.forEach(a.bind(null,t)),a(t,e),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),D(t.prototype.render);for(var n in I)t.prototype[n]||(t.prototype[n]=null);return y.wrapFactory(h.createFactory(t))},injection:{injectMixin:function(e){N.push(e)}}};t.exports=F},{"./Object.assign":29,"./ReactComponent":37,"./ReactContext":41,"./ReactCurrentOwner":42,"./ReactElement":56,"./ReactElementValidator":57,"./ReactEmptyComponent":58,"./ReactErrorUtils":59,"./ReactLegacyElement":65,"./ReactOwner":72,"./ReactPerf":73,"./ReactPropTransferer":74,"./ReactPropTypeLocationNames":75,"./ReactPropTypeLocations":76,"./ReactUpdates":88,"./instantiateReactComponent":136,"./invariant":137,"./keyMirror":143,"./keyOf":144,"./mapObject":145,"./monitorCodeUse":147,"./shouldUpdateReactComponent":151,"./warning":155}],41:[function(e,t){"use strict";var n=e("./Object.assign"),r={current:{},withContext:function(e,t){var o,i=r.current;r.current=n({},i,e);try{o=t()}finally{r.current=i}return o}};t.exports=r},{"./Object.assign":29}],42:[function(e,t){"use strict";var n={current:null};t.exports=n},{}],43:[function(e,t){"use strict";function n(e){return o.markNonLegacyFactory(r.createFactory(e))}var r=e("./ReactElement"),o=(e("./ReactElementValidator"),e("./ReactLegacyElement")),i=e("./mapObject"),a=i({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",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",defs:"defs",ellipse:"ellipse",g:"g",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"},n);t.exports=a},{"./ReactElement":56,"./ReactElementValidator":57,"./ReactLegacyElement":65,"./mapObject":145}],44:[function(e,t){"use strict";var n=e("./AutoFocusMixin"),r=e("./ReactBrowserComponentMixin"),o=e("./ReactCompositeComponent"),i=e("./ReactElement"),a=e("./ReactDOM"),s=e("./keyMirror"),u=i.createFactory(a.button.type),c=s({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),l=o.createClass({displayName:"ReactDOMButton",mixins:[n,r],render:function(){var e={};for(var t in this.props)!this.props.hasOwnProperty(t)||this.props.disabled&&c[t]||(e[t]=this.props[t]);return u(e,this.props.children)}});t.exports=l},{"./AutoFocusMixin":2,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56,"./keyMirror":143}],45:[function(e,t){"use strict";function n(e){e&&(y(null==e.children||null==e.dangerouslySetInnerHTML),y(null==e.style||"object"==typeof e.style))}function r(e,t,n,r){var o=d.findReactContainerForID(e);if(o){var i=o.nodeType===O?o.ownerDocument:o;C(t,i)}r.getPutListenerQueue().enqueuePutListener(e,t,n)}function o(e){T.call(P,e)||(y(x.test(e)),P[e]=!0)}function i(e){o(e),this._tag=e,this.tagName=e.toUpperCase()}var a=e("./CSSPropertyOperations"),s=e("./DOMProperty"),u=e("./DOMPropertyOperations"),c=e("./ReactBrowserComponentMixin"),l=e("./ReactComponent"),p=e("./ReactBrowserEventEmitter"),d=e("./ReactMount"),f=e("./ReactMultiChild"),h=e("./ReactPerf"),m=e("./Object.assign"),v=e("./escapeTextForBrowser"),y=e("./invariant"),g=(e("./isEventSupported"),e("./keyOf")),E=(e("./monitorCodeUse"),p.deleteListener),C=p.listenTo,R=p.registrationNameModules,M={string:!0,number:!0},b=g({style:null}),O=1,D={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},x=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P={},T={}.hasOwnProperty;i.displayName="ReactDOMComponent",i.Mixin={mountComponent:h.measure("ReactDOMComponent","mountComponent",function(e,t,r){l.Mixin.mountComponent.call(this,e,t,r),n(this.props);var o=D[this._tag]?"":"</"+this._tag+">";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t)+o}),_createOpenTagMarkupAndPutListeners:function(e){var t=this.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];if(null!=i)if(R.hasOwnProperty(o))r(this._rootNodeID,o,i,e);else{o===b&&(i&&(i=t.style=m({},t.style)),i=a.createMarkupForStyles(i));var s=u.createMarkupForProperty(o,i);s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n+">";var c=u.createMarkupForID(this._rootNodeID);return n+" "+c+">"},_createContentMarkup:function(e){var t=this.props.dangerouslySetInnerHTML;if(null!=t){if(null!=t.__html)return t.__html}else{var n=M[typeof this.props.children]?this.props.children:null,r=null!=n?null:this.props.children;if(null!=n)return v(n);if(null!=r){var o=this.mountChildren(r,e);return o.join("")}}return""},receiveComponent:function(e,t){(e!==this._currentElement||null==e._owner)&&l.Mixin.receiveComponent.call(this,e,t)},updateComponent:h.measure("ReactDOMComponent","updateComponent",function(e,t){n(this._currentElement.props),l.Mixin.updateComponent.call(this,e,t),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e)}),_updateDOMProperties:function(e,t){var n,o,i,a=this.props;for(n in e)if(!a.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===b){var u=e[n];for(o in u)u.hasOwnProperty(o)&&(i=i||{},i[o]="")}else R.hasOwnProperty(n)?E(this._rootNodeID,n):(s.isStandardName[n]||s.isCustomAttribute(n))&&l.BackendIDOperations.deletePropertyByID(this._rootNodeID,n);for(n in a){var c=a[n],p=e[n];if(a.hasOwnProperty(n)&&c!==p)if(n===b)if(c&&(c=a.style=m({},c)),p){for(o in p)!p.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(i=i||{},i[o]="");for(o in c)c.hasOwnProperty(o)&&p[o]!==c[o]&&(i=i||{},i[o]=c[o])}else i=c;else R.hasOwnProperty(n)?r(this._rootNodeID,n,c,t):(s.isStandardName[n]||s.isCustomAttribute(n))&&l.BackendIDOperations.updatePropertyByID(this._rootNodeID,n,c)}i&&l.BackendIDOperations.updateStylesByID(this._rootNodeID,i)},_updateDOMChildren:function(e,t){var n=this.props,r=M[typeof e.children]?e.children:null,o=M[typeof n.children]?n.children:null,i=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,a=n.dangerouslySetInnerHTML&&n.dangerouslySetInnerHTML.__html,s=null!=r?null:e.children,u=null!=o?null:n.children,c=null!=r||null!=i,p=null!=o||null!=a;null!=s&&null==u?this.updateChildren(null,t):c&&!p&&this.updateTextContent(""),null!=o?r!==o&&this.updateTextContent(""+o):null!=a?i!==a&&l.BackendIDOperations.updateInnerHTMLByID(this._rootNodeID,a):null!=u&&this.updateChildren(u,t)},unmountComponent:function(){this.unmountChildren(),p.deleteAllListeners(this._rootNodeID),l.Mixin.unmountComponent.call(this)}},m(i.prototype,l.Mixin,i.Mixin,f.Mixin,c),t.exports=i},{"./CSSPropertyOperations":6,"./DOMProperty":12,"./DOMPropertyOperations":13,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactBrowserEventEmitter":33,"./ReactComponent":37,"./ReactMount":68,"./ReactMultiChild":69,"./ReactPerf":73,"./escapeTextForBrowser":120,"./invariant":137,"./isEventSupported":138,"./keyOf":144,"./monitorCodeUse":147}],46:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./LocalEventTrapMixin"),o=e("./ReactBrowserComponentMixin"),i=e("./ReactCompositeComponent"),a=e("./ReactElement"),s=e("./ReactDOM"),u=a.createFactory(s.form.type),c=i.createClass({displayName:"ReactDOMForm",mixins:[o,r],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(n.topLevelTypes.topSubmit,"submit")}});t.exports=c},{"./EventConstants":17,"./LocalEventTrapMixin":27,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56}],47:[function(e,t){"use strict";var n=e("./CSSPropertyOperations"),r=e("./DOMChildrenOperations"),o=e("./DOMPropertyOperations"),i=e("./ReactMount"),a=e("./ReactPerf"),s=e("./invariant"),u=e("./setInnerHTML"),c={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},l={updatePropertyByID:a.measure("ReactDOMIDOperations","updatePropertyByID",function(e,t,n){var r=i.getNode(e);s(!c.hasOwnProperty(t)),null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)}),deletePropertyByID:a.measure("ReactDOMIDOperations","deletePropertyByID",function(e,t,n){var r=i.getNode(e);s(!c.hasOwnProperty(t)),o.deleteValueForProperty(r,t,n)}),updateStylesByID:a.measure("ReactDOMIDOperations","updateStylesByID",function(e,t){var r=i.getNode(e);n.setValueForStyles(r,t)}),updateInnerHTMLByID:a.measure("ReactDOMIDOperations","updateInnerHTMLByID",function(e,t){var n=i.getNode(e);u(n,t)}),updateTextContentByID:a.measure("ReactDOMIDOperations","updateTextContentByID",function(e,t){var n=i.getNode(e);r.updateTextContent(n,t)}),dangerouslyReplaceNodeWithMarkupByID:a.measure("ReactDOMIDOperations","dangerouslyReplaceNodeWithMarkupByID",function(e,t){var n=i.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)}),dangerouslyProcessChildrenUpdates:a.measure("ReactDOMIDOperations","dangerouslyProcessChildrenUpdates",function(e,t){for(var n=0;n<e.length;n++)e[n].parentNode=i.getNode(e[n].parentID);r.processUpdates(e,t)})};t.exports=l},{"./CSSPropertyOperations":6,"./DOMChildrenOperations":11,"./DOMPropertyOperations":13,"./ReactMount":68,"./ReactPerf":73,"./invariant":137,"./setInnerHTML":149}],48:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./LocalEventTrapMixin"),o=e("./ReactBrowserComponentMixin"),i=e("./ReactCompositeComponent"),a=e("./ReactElement"),s=e("./ReactDOM"),u=a.createFactory(s.img.type),c=i.createClass({displayName:"ReactDOMImg",tagName:"IMG",mixins:[o,r],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topLoad,"load"),this.trapBubbledEvent(n.topLevelTypes.topError,"error")}});t.exports=c},{"./EventConstants":17,"./LocalEventTrapMixin":27,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56}],49:[function(e,t){"use strict";function n(){this.isMounted()&&this.forceUpdate()}var r=e("./AutoFocusMixin"),o=e("./DOMPropertyOperations"),i=e("./LinkedValueUtils"),a=e("./ReactBrowserComponentMixin"),s=e("./ReactCompositeComponent"),u=e("./ReactElement"),c=e("./ReactDOM"),l=e("./ReactMount"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=e("./invariant"),h=u.createFactory(c.input.type),m={},v=s.createClass({displayName:"ReactDOMInput",mixins:[r,i.Mixin,a],getInitialState:function(){var e=this.props.defaultValue;
return{initialChecked:this.props.defaultChecked||!1,initialValue:null!=e?e:null}},render:function(){var e=d({},this.props);e.defaultChecked=null,e.defaultValue=null;var t=i.getValue(this);e.value=null!=t?t:this.state.initialValue;var n=i.getChecked(this);return e.checked=null!=n?n:this.state.initialChecked,e.onChange=this._handleChange,h(e,this.props.children)},componentDidMount:function(){var e=l.getID(this.getDOMNode());m[e]=this},componentWillUnmount:function(){var e=this.getDOMNode(),t=l.getID(e);delete m[t]},componentDidUpdate:function(){var e=this.getDOMNode();null!=this.props.checked&&o.setValueForProperty(e,"checked",this.props.checked||!1);var t=i.getValue(this);null!=t&&o.setValueForProperty(e,"value",""+t)},_handleChange:function(e){var t,r=i.getOnChange(this);r&&(t=r.call(this,e)),p.asap(n,this);var o=this.props.name;if("radio"===this.props.type&&null!=o){for(var a=this.getDOMNode(),s=a;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),c=0,d=u.length;d>c;c++){var h=u[c];if(h!==a&&h.form===a.form){var v=l.getID(h);f(v);var y=m[v];f(y),p.asap(n,y)}}}return t}});t.exports=v},{"./AutoFocusMixin":2,"./DOMPropertyOperations":13,"./LinkedValueUtils":26,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56,"./ReactMount":68,"./ReactUpdates":88,"./invariant":137}],50:[function(e,t){"use strict";var n=e("./ReactBrowserComponentMixin"),r=e("./ReactCompositeComponent"),o=e("./ReactElement"),i=e("./ReactDOM"),a=(e("./warning"),o.createFactory(i.option.type)),s=r.createClass({displayName:"ReactDOMOption",mixins:[n],componentWillMount:function(){},render:function(){return a(this.props,this.props.children)}});t.exports=s},{"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56,"./warning":155}],51:[function(e,t){"use strict";function n(){this.isMounted()&&(this.setState({value:this._pendingValue}),this._pendingValue=0)}function r(e,t){if(null!=e[t])if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be an array if `multiple` is true.")}else if(Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to <select> must be a scalar value if `multiple` is false.")}function o(e,t){var n,r,o,i=e.props.multiple,a=null!=t?t:e.state.value,s=e.getDOMNode().options;if(i)for(n={},r=0,o=a.length;o>r;++r)n[""+a[r]]=!0;else n=""+a;for(r=0,o=s.length;o>r;r++){var u=i?n.hasOwnProperty(s[r].value):s[r].value===n;u!==s[r].selected&&(s[r].selected=u)}}var i=e("./AutoFocusMixin"),a=e("./LinkedValueUtils"),s=e("./ReactBrowserComponentMixin"),u=e("./ReactCompositeComponent"),c=e("./ReactElement"),l=e("./ReactDOM"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=c.createFactory(l.select.type),h=u.createClass({displayName:"ReactDOMSelect",mixins:[i,a.Mixin,s],propTypes:{defaultValue:r,value:r},getInitialState:function(){return{value:this.props.defaultValue||(this.props.multiple?[]:"")}},componentWillMount:function(){this._pendingValue=null},componentWillReceiveProps:function(e){!this.props.multiple&&e.multiple?this.setState({value:[this.state.value]}):this.props.multiple&&!e.multiple&&this.setState({value:this.state.value[0]})},render:function(){var e=d({},this.props);return e.onChange=this._handleChange,e.value=null,f(e,this.props.children)},componentDidMount:function(){o(this,a.getValue(this))},componentDidUpdate:function(e){var t=a.getValue(this),n=!!e.multiple,r=!!this.props.multiple;(null!=t||n!==r)&&o(this,t)},_handleChange:function(e){var t,r=a.getOnChange(this);r&&(t=r.call(this,e));var o;if(this.props.multiple){o=[];for(var i=e.target.options,s=0,u=i.length;u>s;s++)i[s].selected&&o.push(i[s].value)}else o=e.target.value;return this._pendingValue=o,p.asap(n,this),t}});t.exports=h},{"./AutoFocusMixin":2,"./LinkedValueUtils":26,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56,"./ReactUpdates":88}],52:[function(e,t){"use strict";function n(e,t,n,r){return e===n&&t===r}function r(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var i=o.text.length,a=i+r;return{start:i,end:a}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0),u=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),c=u?0:s.toString().length,l=s.cloneRange();l.selectNodeContents(e),l.setEnd(s.startContainer,s.startOffset);var p=n(l.startContainer,l.startOffset,l.endContainer,l.endOffset),d=p?0:l.toString().length,f=d+c,h=document.createRange();h.setStart(r,o),h.setEnd(i,a);var m=h.collapsed;return{start:m?f:d,end:m?d:f}}function i(e,t){var n,r,o=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),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function a(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),i="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=u(e,o),l=u(e,i);if(s&&l){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}var s=e("./ExecutionEnvironment"),u=e("./getNodeForCharacterOffset"),c=e("./getTextContentAccessor"),l=s.canUseDOM&&document.selection,p={getOffsets:l?r:o,setOffsets:l?i:a};t.exports=p},{"./ExecutionEnvironment":23,"./getNodeForCharacterOffset":130,"./getTextContentAccessor":132}],53:[function(e,t){"use strict";function n(){this.isMounted()&&this.forceUpdate()}var r=e("./AutoFocusMixin"),o=e("./DOMPropertyOperations"),i=e("./LinkedValueUtils"),a=e("./ReactBrowserComponentMixin"),s=e("./ReactCompositeComponent"),u=e("./ReactElement"),c=e("./ReactDOM"),l=e("./ReactUpdates"),p=e("./Object.assign"),d=e("./invariant"),f=(e("./warning"),u.createFactory(c.textarea.type)),h=s.createClass({displayName:"ReactDOMTextarea",mixins:[r,i.Mixin,a],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(d(null==e),Array.isArray(t)&&(d(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=i.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=p({},this.props);return d(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,f(e,this.state.initialValue)},componentDidUpdate:function(){var e=i.getValue(this);if(null!=e){var t=this.getDOMNode();o.setValueForProperty(t,"value",""+e)}},_handleChange:function(e){var t,r=i.getOnChange(this);return r&&(t=r.call(this,e)),l.asap(n,this),t}});t.exports=h},{"./AutoFocusMixin":2,"./DOMPropertyOperations":13,"./LinkedValueUtils":26,"./Object.assign":29,"./ReactBrowserComponentMixin":32,"./ReactCompositeComponent":40,"./ReactDOM":43,"./ReactElement":56,"./ReactUpdates":88,"./invariant":137,"./warning":155}],54:[function(e,t){"use strict";function n(){this.reinitializeTransaction()}var r=e("./ReactUpdates"),o=e("./Transaction"),i=e("./Object.assign"),a=e("./emptyFunction"),s={initialize:a,close:function(){p.isBatchingUpdates=!1}},u={initialize:a,close:r.flushBatchedUpdates.bind(r)},c=[u,s];i(n.prototype,o.Mixin,{getTransactionWrappers:function(){return c}});var l=new n,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n){var r=p.isBatchingUpdates;p.isBatchingUpdates=!0,r?e(t,n):l.perform(e,null,t,n)}};t.exports=p},{"./Object.assign":29,"./ReactUpdates":88,"./Transaction":104,"./emptyFunction":118}],55:[function(e,t){"use strict";function n(){O.EventEmitter.injectReactEventListener(b),O.EventPluginHub.injectEventPluginOrder(s),O.EventPluginHub.injectInstanceHandle(D),O.EventPluginHub.injectMount(x),O.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:o,CompositionEventPlugin:a,MobileSafariClickEventPlugin:p,SelectEventPlugin:P,BeforeInputEventPlugin:r}),O.NativeComponent.injectGenericComponentClass(m),O.NativeComponent.injectComponentClasses({button:v,form:y,img:g,input:E,option:C,select:R,textarea:M,html:S("html"),head:S("head"),body:S("body")}),O.CompositeComponent.injectMixin(d),O.DOMProperty.injectDOMPropertyConfig(l),O.DOMProperty.injectDOMPropertyConfig(_),O.EmptyComponent.injectEmptyComponent("noscript"),O.Updates.injectReconcileTransaction(f.ReactReconcileTransaction),O.Updates.injectBatchingStrategy(h),O.RootIndex.injectCreateReactRootIndex(c.canUseDOM?i.createReactRootIndex:T.createReactRootIndex),O.Component.injectEnvironment(f)}var r=e("./BeforeInputEventPlugin"),o=e("./ChangeEventPlugin"),i=e("./ClientReactRootIndex"),a=e("./CompositionEventPlugin"),s=e("./DefaultEventPluginOrder"),u=e("./EnterLeaveEventPlugin"),c=e("./ExecutionEnvironment"),l=e("./HTMLDOMPropertyConfig"),p=e("./MobileSafariClickEventPlugin"),d=e("./ReactBrowserComponentMixin"),f=e("./ReactComponentBrowserEnvironment"),h=e("./ReactDefaultBatchingStrategy"),m=e("./ReactDOMComponent"),v=e("./ReactDOMButton"),y=e("./ReactDOMForm"),g=e("./ReactDOMImg"),E=e("./ReactDOMInput"),C=e("./ReactDOMOption"),R=e("./ReactDOMSelect"),M=e("./ReactDOMTextarea"),b=e("./ReactEventListener"),O=e("./ReactInjection"),D=e("./ReactInstanceHandles"),x=e("./ReactMount"),P=e("./SelectEventPlugin"),T=e("./ServerReactRootIndex"),w=e("./SimpleEventPlugin"),_=e("./SVGDOMPropertyConfig"),S=e("./createFullPageComponent");t.exports={inject:n}},{"./BeforeInputEventPlugin":3,"./ChangeEventPlugin":8,"./ClientReactRootIndex":9,"./CompositionEventPlugin":10,"./DefaultEventPluginOrder":15,"./EnterLeaveEventPlugin":16,"./ExecutionEnvironment":23,"./HTMLDOMPropertyConfig":24,"./MobileSafariClickEventPlugin":28,"./ReactBrowserComponentMixin":32,"./ReactComponentBrowserEnvironment":38,"./ReactDOMButton":44,"./ReactDOMComponent":45,"./ReactDOMForm":46,"./ReactDOMImg":48,"./ReactDOMInput":49,"./ReactDOMOption":50,"./ReactDOMSelect":51,"./ReactDOMTextarea":53,"./ReactDefaultBatchingStrategy":54,"./ReactEventListener":61,"./ReactInjection":62,"./ReactInstanceHandles":64,"./ReactMount":68,"./SVGDOMPropertyConfig":89,"./SelectEventPlugin":90,"./ServerReactRootIndex":91,"./SimpleEventPlugin":92,"./createFullPageComponent":113}],56:[function(e,t){"use strict";var n=e("./ReactContext"),r=e("./ReactCurrentOwner"),o=(e("./warning"),{key:!0,ref:!0}),i=function(e,t,n,r,o,i){this.type=e,this.key=t,this.ref=n,this._owner=r,this._context=o,this.props=i};i.prototype={_isReactElement:!0},i.createElement=function(e,t,a){var s,u={},c=null,l=null;if(null!=t){l=void 0===t.ref?null:t.ref,c=null==t.key?null:""+t.key;for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(u[s]=t[s])}var p=arguments.length-2;if(1===p)u.children=a;else if(p>1){for(var d=Array(p),f=0;p>f;f++)d[f]=arguments[f+2];u.children=d}if(e.defaultProps){var h=e.defaultProps;for(s in h)"undefined"==typeof u[s]&&(u[s]=h[s])}return new i(e,c,l,r.current,n.current,u)},i.createFactory=function(e){var t=i.createElement.bind(null,e);return t.type=e,t},i.cloneAndReplaceProps=function(e,t){var n=new i(e.type,e.key,e.ref,e._owner,e._context,t);return n},i.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=i},{"./ReactContext":41,"./ReactCurrentOwner":42,"./warning":155}],57:[function(e,t){"use strict";function n(){var e=p.current;return e&&e.constructor.displayName||void 0}function r(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,i("react_key_warning",'Each child in an array should have a unique "key" prop.',e,t))}function o(e,t,n){v.test(e)&&i("react_numeric_key_warning","Child objects should have non-numeric keys so ordering is preserved.",t,n)}function i(e,t,r,o){var i=n(),a=o.displayName,s=i||a,u=f[e];if(!u.hasOwnProperty(s)){u[s]=!0,t+=i?" Check the render method of "+i+".":" Check the renderComponent call using <"+a+">.";var c=null;r._owner&&r._owner!==p.current&&(c=r._owner.constructor.displayName,t+=" It was passed a child from "+c+"."),t+=" See http://fb.me/react-warning-keys for more information.",d(e,{component:s,componentOwner:c}),console.warn(t)}}function a(){var e=n()||"";h.hasOwnProperty(e)||(h[e]=!0,d("react_object_map_children"))}function s(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++){var i=e[n];c.isValidElement(i)&&r(i,t)}else if(c.isValidElement(e))e._store.validated=!0;else if(e&&"object"==typeof e){a();for(var s in e)o(s,e[s],t)}}function u(e,t,n,r){for(var o in t)if(t.hasOwnProperty(o)){var i;try{i=t[o](n,o,e,r)}catch(a){i=a}i instanceof Error&&!(i.message in m)&&(m[i.message]=!0,d("react_failed_descriptor_type_check",{message:i.message}))}}var c=e("./ReactElement"),l=e("./ReactPropTypeLocations"),p=e("./ReactCurrentOwner"),d=e("./monitorCodeUse"),f={react_key_warning:{},react_numeric_key_warning:{}},h={},m={},v=/^\d+$/,y={createElement:function(e){var t=c.createElement.apply(this,arguments);if(null==t)return t;for(var n=2;n<arguments.length;n++)s(arguments[n],e);var r=e.displayName;return e.propTypes&&u(r,e.propTypes,t.props,l.prop),e.contextTypes&&u(r,e.contextTypes,t._context,l.context),t},createFactory:function(e){var t=y.createElement.bind(null,e);return t.type=e,t}};t.exports=y},{"./ReactCurrentOwner":42,"./ReactElement":56,"./ReactPropTypeLocations":76,"./monitorCodeUse":147}],58:[function(e,t){"use strict";function n(){return u(a),a()}function r(e){c[e]=!0}function o(e){delete c[e]}function i(e){return c[e]}var a,s=e("./ReactElement"),u=e("./invariant"),c={},l={injectEmptyComponent:function(e){a=s.createFactory(e)}},p={deregisterNullComponentID:o,getEmptyComponent:n,injection:l,isNullComponentID:i,registerNullComponentID:r};t.exports=p},{"./ReactElement":56,"./invariant":137}],59:[function(e,t){"use strict";var n={guard:function(e){return e}};t.exports=n},{}],60:[function(e,t){"use strict";function n(e){r.enqueueEvents(e),r.processEventQueue()}var r=e("./EventPluginHub"),o={handleTopLevel:function(e,t,o,i){var a=r.extractEvents(e,t,o,i);n(a)}};t.exports=o},{"./EventPluginHub":19}],61:[function(e,t){"use strict";function n(e){var t=l.getID(e),n=c.getReactRootIDFromNodeID(t),r=l.findReactContainerForID(n),o=l.getFirstReactDOM(r);return o}function r(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function o(e){for(var t=l.getFirstReactDOM(f(e.nativeEvent))||window,r=t;r;)e.ancestors.push(r),r=n(r);for(var o=0,i=e.ancestors.length;i>o;o++){t=e.ancestors[o];var a=l.getID(t)||"";m._handleTopLevel(e.topLevelType,t,a,e.nativeEvent)}}function i(e){var t=h(window);e(t)}var a=e("./EventListener"),s=e("./ExecutionEnvironment"),u=e("./PooledClass"),c=e("./ReactInstanceHandles"),l=e("./ReactMount"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=e("./getEventTarget"),h=e("./getUnboundedScrollPosition");d(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),u.addPoolingTo(r,u.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:s.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?a.listen(r,t,m.dispatchEvent.bind(null,e)):void 0},trapCapturedEvent:function(e,t,n){var r=n;return r?a.capture(r,t,m.dispatchEvent.bind(null,e)):void 0},monitorScrollValue:function(e){var t=i.bind(null,e);a.listen(window,"scroll",t),a.listen(window,"resize",t)},dispatchEvent:function(e,t){if(m._enabled){var n=r.getPooled(e,t);try{p.batchedUpdates(o,n)}finally{r.release(n)}}}};t.exports=m},{"./EventListener":18,"./ExecutionEnvironment":23,"./Object.assign":29,"./PooledClass":30,"./ReactInstanceHandles":64,"./ReactMount":68,"./ReactUpdates":88,"./getEventTarget":128,"./getUnboundedScrollPosition":133}],62:[function(e,t){"use strict";var n=e("./DOMProperty"),r=e("./EventPluginHub"),o=e("./ReactComponent"),i=e("./ReactCompositeComponent"),a=e("./ReactEmptyComponent"),s=e("./ReactBrowserEventEmitter"),u=e("./ReactNativeComponent"),c=e("./ReactPerf"),l=e("./ReactRootIndex"),p=e("./ReactUpdates"),d={Component:o.injection,CompositeComponent:i.injection,DOMProperty:n.injection,EmptyComponent:a.injection,EventPluginHub:r.injection,EventEmitter:s.injection,NativeComponent:u.injection,Perf:c.injection,RootIndex:l.injection,Updates:p.injection};t.exports=d},{"./DOMProperty":12,"./EventPluginHub":19,"./ReactBrowserEventEmitter":33,"./ReactComponent":37,"./ReactCompositeComponent":40,"./ReactEmptyComponent":58,"./ReactNativeComponent":71,"./ReactPerf":73,"./ReactRootIndex":80,"./ReactUpdates":88}],63:[function(e,t){"use strict";function n(e){return o(document.documentElement,e)}var r=e("./ReactDOMSelection"),o=e("./containsNode"),i=e("./focusNode"),a=e("./getActiveElement"),s={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t=a(),r=e.focusedElem,o=e.selectionRange;t!==r&&n(r)&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,o),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){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=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};t.exports=s},{"./ReactDOMSelection":52,"./containsNode":111,"./focusNode":122,"./getActiveElement":124}],64:[function(e,t){"use strict";function n(e){return d+e.toString(36)}function r(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 i(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function a(e){return e?e.substr(0,e.lastIndexOf(d)):""}function s(e,t){if(p(o(e)&&o(t)),p(i(e,t)),e===t)return e;for(var n=e.length+f,a=n;a<t.length&&!r(t,a);a++);return t.substr(0,a)}function u(e,t){var n=Math.min(e.length,t.length);if(0===n)return"";for(var i=0,a=0;n>=a;a++)if(r(e,a)&&r(t,a))i=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,i);return p(o(s)),s}function c(e,t,n,r,o,u){e=e||"",t=t||"",p(e!==t);var c=i(t,e);p(c||i(e,t));for(var l=0,d=c?a:s,f=e;;f=d(f,t)){var m;if(o&&f===e||u&&f===t||(m=n(f,c,r)),m===!1||f===t)break;p(l++<h)}}var l=e("./ReactRootIndex"),p=e("./invariant"),d=".",f=d.length,h=100,m={createReactRootID:function(){return n(l.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,o){var i=u(e,t);i!==e&&c(e,i,n,r,!1,!0),i!==t&&c(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},_getFirstCommonAncestorID:u,_getNextDescendantID:s,isAncestorIDOf:i,SEPARATOR:d};t.exports=m},{"./ReactRootIndex":80,"./invariant":137}],65:[function(e,t){"use strict";function n(e,t){if("function"==typeof t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if("function"==typeof r){var o=r.bind(t);for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);e[n]=o}else e[n]=r}}var r=(e("./ReactCurrentOwner"),e("./invariant")),o=(e("./monitorCodeUse"),e("./warning"),{}),i={},a={};a.wrapCreateFactory=function(e){var t=function(t){return"function"!=typeof t?e(t):t.isReactNonLegacyFactory?e(t.type):t.isReactLegacyFactory?e(t.type):t};return t},a.wrapCreateElement=function(e){var t=function(t){if("function"!=typeof t)return e.apply(this,arguments);var n;return t.isReactNonLegacyFactory?(n=Array.prototype.slice.call(arguments,0),n[0]=t.type,e.apply(this,n)):t.isReactLegacyFactory?(t._isMockFunction&&(t.type._mockedReactClassConstructor=t),n=Array.prototype.slice.call(arguments,0),n[0]=t.type,e.apply(this,n)):t.apply(null,Array.prototype.slice.call(arguments,1))};return t},a.wrapFactory=function(e){r("function"==typeof e);var t=function(){return e.apply(this,arguments)};return n(t,e.type),t.isReactLegacyFactory=o,t.type=e.type,t},a.markNonLegacyFactory=function(e){return e.isReactNonLegacyFactory=i,e},a.isValidFactory=function(e){return"function"==typeof e&&e.isReactLegacyFactory===o},a.isValidClass=function(e){return a.isValidFactory(e)},a._isLegacyCallWarningEnabled=!0,t.exports=a},{"./ReactCurrentOwner":42,"./invariant":137,"./monitorCodeUse":147,"./warning":155}],66:[function(e,t){"use strict";function n(e,t){this.value=e,this.requestChange=t}function r(e){var t={value:"undefined"==typeof e?o.PropTypes.any.isRequired:e.isRequired,requestChange:o.PropTypes.func.isRequired};return o.PropTypes.shape(t)}var o=e("./React");n.PropTypes={link:r},t.exports=n},{"./React":31}],67:[function(e,t){"use strict";var n=e("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var o=t.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var i=n(e);return i===o}};t.exports=r},{"./adler32":107}],68:[function(e,t){"use strict";function n(e){var t=E(e);return t&&I.getID(t)}function r(e){var t=o(e);if(t)if(x.hasOwnProperty(t)){var n=x[t];n!==e&&(R(!s(n,t)),x[t]=e)}else x[t]=e;return t}function o(e){return e&&e.getAttribute&&e.getAttribute(D)||""}function i(e,t){var n=o(e);n!==t&&delete x[n],e.setAttribute(D,t),x[t]=e}function a(e){return x.hasOwnProperty(e)&&s(x[e],e)||(x[e]=I.findReactNodeByID(e)),x[e]}function s(e,t){if(e){R(o(e)===t);var n=I.findReactContainerForID(t);if(n&&y(n,e))return!0}return!1}function u(e){delete x[e]}function c(e){var t=x[e];return t&&s(t,e)?void(N=t):!1}function l(e){N=null,m.traverseAncestors(e,c);var t=N;return N=null,t}var p=e("./DOMProperty"),d=e("./ReactBrowserEventEmitter"),f=(e("./ReactCurrentOwner"),e("./ReactElement")),h=e("./ReactLegacyElement"),m=e("./ReactInstanceHandles"),v=e("./ReactPerf"),y=e("./containsNode"),g=e("./deprecated"),E=e("./getReactRootElementInContainer"),C=e("./instantiateReactComponent"),R=e("./invariant"),M=e("./shouldUpdateReactComponent"),b=(e("./warning"),h.wrapCreateElement(f.createElement)),O=m.SEPARATOR,D=p.ID_ATTRIBUTE_NAME,x={},P=1,T=9,w={},_={},S=[],N=null,I={_instancesByReactRootID:w,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){var o=t.props;return I.scrollMonitor(n,function(){e.replaceProps(o,r)}),e},_registerComponent:function(e,t){R(t&&(t.nodeType===P||t.nodeType===T)),d.ensureScrollValueMonitoring();var n=I.registerContainer(t);return w[n]=e,n},_renderNewRootComponent:v.measure("ReactMount","_renderNewRootComponent",function(e,t,n){var r=C(e,null),o=I._registerComponent(r,t);return r.mountComponentIntoNode(o,t,n),r}),render:function(e,t,r){R(f.isValidElement(e));var o=w[n(t)];if(o){var i=o._currentElement;if(M(i,e))return I._updateRootComponent(o,e,t,r);I.unmountComponentAtNode(t)}var a=E(t),s=a&&I.isRenderedByReact(a),u=s&&!o,c=I._renderNewRootComponent(e,t,u);return r&&r.call(c),c},constructAndRenderComponent:function(e,t,n){var r=b(e,t);return I.render(r,n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return R(r),I.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=n(e);return t&&(t=m.getReactRootIDFromNodeID(t)),t||(t=m.createReactRootID()),_[t]=e,t},unmountComponentAtNode:function(e){var t=n(e),r=w[t];return r?(I.unmountComponentFromNode(r,e),delete w[t],delete _[t],!0):!1},unmountComponentFromNode:function(e,t){for(e.unmountComponent(),t.nodeType===T&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=m.getReactRootIDFromNodeID(e),n=_[t];return n},findReactNodeByID:function(e){var t=I.findReactContainerForID(e);return I.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=I.getID(e);return t?t.charAt(0)===O:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(I.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=S,r=0,o=l(t)||e;for(n[0]=o.firstChild,n.length=1;r<n.length;){for(var i,a=n[r++];a;){var s=I.getID(a);s?t===s?i=a:m.isAncestorIDOf(s,t)&&(n.length=r=0,n.push(a.firstChild)):n.push(a.firstChild),a=a.nextSibling}if(i)return n.length=0,i}n.length=0,R(!1)},getReactRootID:n,getID:r,setID:i,getNode:a,purgeID:u};I.renderComponent=g("ReactMount","renderComponent","render",this,I.render),t.exports=I},{"./DOMProperty":12,"./ReactBrowserEventEmitter":33,"./ReactCurrentOwner":42,"./ReactElement":56,"./ReactInstanceHandles":64,"./ReactLegacyElement":65,"./ReactPerf":73,"./containsNode":111,"./deprecated":117,"./getReactRootElementInContainer":131,"./instantiateReactComponent":136,"./invariant":137,"./shouldUpdateReactComponent":151,"./warning":155}],69:[function(e,t){"use strict";function n(e,t,n){h.push({parentID:e,parentNode:null,type:c.INSERT_MARKUP,markupIndex:m.push(t)-1,textContent:null,fromIndex:null,toIndex:n})}function r(e,t,n){h.push({parentID:e,parentNode:null,type:c.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:t,toIndex:n})}function o(e,t){h.push({parentID:e,parentNode:null,type:c.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:t,toIndex:null})}function i(e,t){h.push({parentID:e,parentNode:null,type:c.TEXT_CONTENT,markupIndex:null,textContent:t,fromIndex:null,toIndex:null})}function a(){h.length&&(u.BackendIDOperations.dangerouslyProcessChildrenUpdates(h,m),s())}function s(){h.length=0,m.length=0}var u=e("./ReactComponent"),c=e("./ReactMultiChildUpdateTypes"),l=e("./flattenChildren"),p=e("./instantiateReactComponent"),d=e("./shouldUpdateReactComponent"),f=0,h=[],m=[],v={Mixin:{mountChildren:function(e,t){var n=l(e),r=[],o=0;this._renderedChildren=n;for(var i in n){var a=n[i];if(n.hasOwnProperty(i)){var s=p(a,null);n[i]=s;var u=this._rootNodeID+i,c=s.mountComponent(u,t,this._mountDepth+1);s._mountIndex=o,r.push(c),o++}}return r},updateTextContent:function(e){f++;var t=!0;try{var n=this._renderedChildren;for(var r in n)n.hasOwnProperty(r)&&this._unmountChildByName(n[r],r);this.setTextContent(e),t=!1}finally{f--,f||(t?s():a())}},updateChildren:function(e,t){f++;var n=!0;try{this._updateChildren(e,t),n=!1}finally{f--,f||(n?s():a())}},_updateChildren:function(e,t){var n=l(e),r=this._renderedChildren;if(n||r){var o,i=0,a=0;for(o in n)if(n.hasOwnProperty(o)){var s=r&&r[o],u=s&&s._currentElement,c=n[o];if(d(u,c))this.moveChild(s,a,i),i=Math.max(s._mountIndex,i),s.receiveComponent(c,t),s._mountIndex=a;else{s&&(i=Math.max(s._mountIndex,i),this._unmountChildByName(s,o));var f=p(c,null);this._mountChildByNameAtIndex(f,o,a,t)}a++}for(o in r)!r.hasOwnProperty(o)||n&&n[o]||this._unmountChildByName(r[o],o)}},unmountChildren:function(){var e=this._renderedChildren;for(var t in e){var n=e[t];n.unmountComponent&&n.unmountComponent()}this._renderedChildren=null},moveChild:function(e,t,n){e._mountIndex<n&&r(this._rootNodeID,e._mountIndex,t)},createChild:function(e,t){n(this._rootNodeID,t,e._mountIndex)},removeChild:function(e){o(this._rootNodeID,e._mountIndex)},setTextContent:function(e){i(this._rootNodeID,e)},_mountChildByNameAtIndex:function(e,t,n,r){var o=this._rootNodeID+t,i=e.mountComponent(o,r,this._mountDepth+1);e._mountIndex=n,this.createChild(e,i),this._renderedChildren=this._renderedChildren||{},this._renderedChildren[t]=e},_unmountChildByName:function(e,t){this.removeChild(e),e._mountIndex=null,e.unmountComponent(),delete this._renderedChildren[t]}}};t.exports=v},{"./ReactComponent":37,"./ReactMultiChildUpdateTypes":70,"./flattenChildren":121,"./instantiateReactComponent":136,"./shouldUpdateReactComponent":151}],70:[function(e,t){"use strict";var n=e("./keyMirror"),r=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});t.exports=r},{"./keyMirror":143}],71:[function(e,t){"use strict";function n(e,t,n){var r=a[e];return null==r?(o(i),new i(e,t)):n===e?(o(i),new i(e,t)):new r.type(t)}var r=e("./Object.assign"),o=e("./invariant"),i=null,a={},s={injectGenericComponentClass:function(e){i=e},injectComponentClasses:function(e){r(a,e)}},u={createInstanceForTag:n,injection:s};t.exports=u},{"./Object.assign":29,"./invariant":137}],72:[function(e,t){"use strict";var n=e("./emptyObject"),r=e("./invariant"),o={isValidOwner:function(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)},addComponentAsRefTo:function(e,t,n){r(o.isValidOwner(n)),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(o.isValidOwner(n)),n.refs[t]===e&&n.detachRef(t)},Mixin:{construct:function(){this.refs=n},attachRef:function(e,t){r(t.isOwnedBy(this));var o=this.refs===n?this.refs={}:this.refs;o[e]=t},detachRef:function(e){delete this.refs[e]}}};t.exports=o},{"./emptyObject":119,"./invariant":137}],73:[function(e,t){"use strict";function n(e,t,n){return n}var r={enableMeasure:!1,storedMeasure:n,measure:function(e,t,n){return n},injection:{injectMeasure:function(e){r.storedMeasure=e}}};t.exports=r},{}],74:[function(e,t){"use strict";function n(e){return function(t,n,r){t[n]=t.hasOwnProperty(n)?e(t[n],r):r}}function r(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=c[n];r&&c.hasOwnProperty(n)?r(e,n,t[n]):e.hasOwnProperty(n)||(e[n]=t[n])}return e}var o=e("./Object.assign"),i=e("./emptyFunction"),a=e("./invariant"),s=e("./joinClasses"),u=(e("./warning"),n(function(e,t){return o({},t,e)})),c={children:i,className:n(s),style:u},l={TransferStrategies:c,mergeProps:function(e,t){return r(o({},e),t)},Mixin:{transferPropsTo:function(e){return a(e._owner===this),r(e.props,this.props),e}}};t.exports=l},{"./Object.assign":29,"./emptyFunction":118,"./invariant":137,"./joinClasses":142,"./warning":155}],75:[function(e,t){"use strict";var n={};t.exports=n},{}],76:[function(e,t){"use strict";var n=e("./keyMirror"),r=n({prop:null,context:null,childContext:null});t.exports=r},{"./keyMirror":143}],77:[function(e,t){"use strict";function n(e){function t(t,n,r,o,i){if(o=o||C,null!=n[r])return e(n,r,o,i);var a=y[i];return t?new Error("Required "+a+" `"+r+"` was not specified in "+("`"+o+"`.")):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function r(e){function t(t,n,r,o){var i=t[n],a=h(i);if(a!==e){var s=y[o],u=m(i);return new Error("Invalid "+s+" `"+n+"` of type `"+u+"` "+("supplied to `"+r+"`, expected `"+e+"`."))}}return n(t)}function o(){return n(E.thatReturns())}function i(e){function t(t,n,r,o){var i=t[n];if(!Array.isArray(i)){var a=y[o],s=h(i);return new Error("Invalid "+a+" `"+n+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var u=0;u<i.length;u++){var c=e(i,u,r,o);if(c instanceof Error)return c}}return n(t)}function a(){function e(e,t,n,r){if(!v.isValidElement(e[t])){var o=y[r];return new Error("Invalid "+o+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactElement."))}}return n(e)}function s(e){function t(t,n,r,o){if(!(t[n]instanceof e)){var i=y[o],a=e.name||C;return new Error("Invalid "+i+" `"+n+"` supplied to "+("`"+r+"`, expected instance of `"+a+"`."))}}return n(t)}function u(e){function t(t,n,r,o){for(var i=t[n],a=0;a<e.length;a++)if(i===e[a])return;var s=y[o],u=JSON.stringify(e);return new Error("Invalid "+s+" `"+n+"` of value `"+i+"` "+("supplied to `"+r+"`, expected one of "+u+"."))}return n(t)}function c(e){function t(t,n,r,o){var i=t[n],a=h(i);if("object"!==a){var s=y[o];return new Error("Invalid "+s+" `"+n+"` of type "+("`"+a+"` supplied to `"+r+"`, expected an object."))
}for(var u in i)if(i.hasOwnProperty(u)){var c=e(i,u,r,o);if(c instanceof Error)return c}}return n(t)}function l(e){function t(t,n,r,o){for(var i=0;i<e.length;i++){var a=e[i];if(null==a(t,n,r,o))return}var s=y[o];return new Error("Invalid "+s+" `"+n+"` supplied to "+("`"+r+"`."))}return n(t)}function p(){function e(e,t,n,r){if(!f(e[t])){var o=y[r];return new Error("Invalid "+o+" `"+t+"` supplied to "+("`"+n+"`, expected a ReactNode."))}}return n(e)}function d(e){function t(t,n,r,o){var i=t[n],a=h(i);if("object"!==a){var s=y[o];return new Error("Invalid "+s+" `"+n+"` of type `"+a+"` "+("supplied to `"+r+"`, expected `object`."))}for(var u in e){var c=e[u];if(c){var l=c(i,u,r,o);if(l)return l}}}return n(t,"expected `object`")}function f(e){switch(typeof e){case"number":case"string":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(f);if(v.isValidElement(e))return!0;for(var t in e)if(!f(e[t]))return!1;return!0;default:return!1}}function h(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":t}function m(e){var t=h(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}var v=e("./ReactElement"),y=e("./ReactPropTypeLocationNames"),g=e("./deprecated"),E=e("./emptyFunction"),C="<<anonymous>>",R=a(),M=p(),b={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:o(),arrayOf:i,element:R,instanceOf:s,node:M,objectOf:c,oneOf:u,oneOfType:l,shape:d,component:g("React.PropTypes","component","element",this,R),renderable:g("React.PropTypes","renderable","node",this,M)};t.exports=b},{"./ReactElement":56,"./ReactPropTypeLocationNames":75,"./deprecated":117,"./emptyFunction":118}],78:[function(e,t){"use strict";function n(){this.listenersToPut=[]}var r=e("./PooledClass"),o=e("./ReactBrowserEventEmitter"),i=e("./Object.assign");i(n.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e<this.listenersToPut.length;e++){var t=this.listenersToPut[e];o.putListener(t.rootNodeID,t.propKey,t.propValue)}},reset:function(){this.listenersToPut.length=0},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{"./Object.assign":29,"./PooledClass":30,"./ReactBrowserEventEmitter":33}],79:[function(e,t){"use strict";function n(){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=r.getPooled(null),this.putListenerQueue=s.getPooled()}var r=e("./CallbackQueue"),o=e("./PooledClass"),i=e("./ReactBrowserEventEmitter"),a=e("./ReactInputSelection"),s=e("./ReactPutListenerQueue"),u=e("./Transaction"),c=e("./Object.assign"),l={initialize:a.getSelectionInformation,close:a.restoreSelection},p={initialize:function(){var e=i.isEnabled();return i.setEnabled(!1),e},close:function(e){i.setEnabled(e)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},f={initialize:function(){this.putListenerQueue.reset()},close:function(){this.putListenerQueue.putListeners()}},h=[f,l,p,d],m={getTransactionWrappers:function(){return h},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){r.release(this.reactMountReady),this.reactMountReady=null,s.release(this.putListenerQueue),this.putListenerQueue=null}};c(n.prototype,u.Mixin,m),o.addPoolingTo(n),t.exports=n},{"./CallbackQueue":7,"./Object.assign":29,"./PooledClass":30,"./ReactBrowserEventEmitter":33,"./ReactInputSelection":63,"./ReactPutListenerQueue":78,"./Transaction":104}],80:[function(e,t){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};t.exports=r},{}],81:[function(e,t){"use strict";function n(e){c(o.isValidElement(e));var t;try{var n=i.createReactRootID();return t=s.getPooled(!1),t.perform(function(){var r=u(e,null),o=r.mountComponent(n,t,0);return a.addChecksumToMarkup(o)},null)}finally{s.release(t)}}function r(e){c(o.isValidElement(e));var t;try{var n=i.createReactRootID();return t=s.getPooled(!0),t.perform(function(){var r=u(e,null);return r.mountComponent(n,t,0)},null)}finally{s.release(t)}}var o=e("./ReactElement"),i=e("./ReactInstanceHandles"),a=e("./ReactMarkupChecksum"),s=e("./ReactServerRenderingTransaction"),u=e("./instantiateReactComponent"),c=e("./invariant");t.exports={renderToString:n,renderToStaticMarkup:r}},{"./ReactElement":56,"./ReactInstanceHandles":64,"./ReactMarkupChecksum":67,"./ReactServerRenderingTransaction":82,"./instantiateReactComponent":136,"./invariant":137}],82:[function(e,t){"use strict";function n(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=o.getPooled(null),this.putListenerQueue=i.getPooled()}var r=e("./PooledClass"),o=e("./CallbackQueue"),i=e("./ReactPutListenerQueue"),a=e("./Transaction"),s=e("./Object.assign"),u=e("./emptyFunction"),c={initialize:function(){this.reactMountReady.reset()},close:u},l={initialize:function(){this.putListenerQueue.reset()},close:u},p=[l,c],d={getTransactionWrappers:function(){return p},getReactMountReady:function(){return this.reactMountReady},getPutListenerQueue:function(){return this.putListenerQueue},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null,i.release(this.putListenerQueue),this.putListenerQueue=null}};s(n.prototype,a.Mixin,d),r.addPoolingTo(n),t.exports=n},{"./CallbackQueue":7,"./Object.assign":29,"./PooledClass":30,"./ReactPutListenerQueue":78,"./Transaction":104,"./emptyFunction":118}],83:[function(e,t){"use strict";function n(e,t){var n={};return function(r){n[t]=r,e.setState(n)}}var r={createStateSetter:function(e,t){return function(n,r,o,i,a,s){var u=t.call(e,n,r,o,i,a,s);u&&e.setState(u)}},createStateKeySetter:function(e,t){var r=e.__keySetters||(e.__keySetters={});return r[t]||(r[t]=n(e,t))}};r.Mixin={createStateSetter:function(e){return r.createStateSetter(this,e)},createStateKeySetter:function(e){return r.createStateKeySetter(this,e)}},t.exports=r},{}],84:[function(e,t){"use strict";var n=e("./DOMPropertyOperations"),r=e("./ReactComponent"),o=e("./ReactElement"),i=e("./Object.assign"),a=e("./escapeTextForBrowser"),s=function(){};i(s.prototype,r.Mixin,{mountComponent:function(e,t,o){r.Mixin.mountComponent.call(this,e,t,o);var i=a(this.props);return t.renderToStaticMarkup?i:"<span "+n.createMarkupForID(e)+">"+i+"</span>"},receiveComponent:function(e){var t=e.props;t!==this.props&&(this.props=t,r.BackendIDOperations.updateTextContentByID(this._rootNodeID,t))}});var u=function(e){return new o(s,null,null,null,null,e)};u.type=s,t.exports=u},{"./DOMPropertyOperations":13,"./Object.assign":29,"./ReactComponent":37,"./ReactElement":56,"./escapeTextForBrowser":120}],85:[function(e,t){"use strict";var n=e("./ReactChildren"),r={getChildMapping:function(e){return n.map(e,function(e){return e})},mergeChildMappings:function(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},o=[];for(var i in e)t.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var u in t){if(r.hasOwnProperty(u))for(a=0;a<r[u].length;a++){var c=r[u][a];s[r[u][a]]=n(c)}s[u]=n(u)}for(a=0;a<o.length;a++)s[o[a]]=n(o[a]);return s}};t.exports=r},{"./ReactChildren":36}],86:[function(e,t){"use strict";function n(){var e=document.createElement("div"),t=e.style;"AnimationEvent"in window||delete a.animationend.animation,"TransitionEvent"in window||delete a.transitionend.transition;for(var n in a){var r=a[n];for(var o in r)if(o in t){s.push(r[o]);break}}}function r(e,t,n){e.addEventListener(t,n,!1)}function o(e,t,n){e.removeEventListener(t,n,!1)}var i=e("./ExecutionEnvironment"),a={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},s=[];i.canUseDOM&&n();var u={addEndEventListener:function(e,t){return 0===s.length?void window.setTimeout(t,0):void s.forEach(function(n){r(e,n,t)})},removeEndEventListener:function(e,t){0!==s.length&&s.forEach(function(n){o(e,n,t)})}};t.exports=u},{"./ExecutionEnvironment":23}],87:[function(e,t){"use strict";var n=e("./React"),r=e("./ReactTransitionChildMapping"),o=e("./Object.assign"),i=e("./cloneWithProps"),a=e("./emptyFunction"),s=n.createClass({displayName:"ReactTransitionGroup",propTypes:{component:n.PropTypes.any,childFactory:n.PropTypes.func},getDefaultProps:function(){return{component:"span",childFactory:a.thatReturnsArgument}},getInitialState:function(){return{children:r.getChildMapping(this.props.children)}},componentWillReceiveProps:function(e){var t=r.getChildMapping(e.children),n=this.state.children;this.setState({children:r.mergeChildMappings(n,t)});var o;for(o in t){var i=n&&n.hasOwnProperty(o);!t[o]||i||this.currentlyTransitioningKeys[o]||this.keysToEnter.push(o)}for(o in n){var a=t&&t.hasOwnProperty(o);!n[o]||a||this.currentlyTransitioningKeys[o]||this.keysToLeave.push(o)}},componentWillMount:function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},componentDidUpdate:function(){var e=this.keysToEnter;this.keysToEnter=[],e.forEach(this.performEnter);var t=this.keysToLeave;this.keysToLeave=[],t.forEach(this.performLeave)},performEnter:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)},_handleDoneEntering:function(e){var t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e];var n=r.getChildMapping(this.props.children);n&&n.hasOwnProperty(e)||this.performLeave(e)},performLeave:function(e){this.currentlyTransitioningKeys[e]=!0;var t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)},_handleDoneLeaving:function(e){var t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];var n=r.getChildMapping(this.props.children);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{var i=o({},this.state.children);delete i[e],this.setState({children:i})}},render:function(){var e={};for(var t in this.state.children){var r=this.state.children[t];r&&(e[t]=i(this.props.childFactory(r),{ref:t}))}return n.createElement(this.props.component,this.props,e)}});t.exports=s},{"./Object.assign":29,"./React":31,"./ReactTransitionChildMapping":85,"./cloneWithProps":110,"./emptyFunction":118}],88:[function(e,t){"use strict";function n(){h(O.ReactReconcileTransaction&&g)}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=O.ReactReconcileTransaction.getPooled()}function o(e,t,r){n(),g.batchedUpdates(e,t,r)}function i(e,t){return e._mountDepth-t._mountDepth}function a(e){var t=e.dirtyComponentsLength;h(t===m.length),m.sort(i);for(var n=0;t>n;n++){var r=m[n];if(r.isMounted()){var o=r._pendingCallbacks;if(r._pendingCallbacks=null,r.performUpdateIfNecessary(e.reconcileTransaction),o)for(var a=0;a<o.length;a++)e.callbackQueue.enqueue(o[a],r)}}}function s(e,t){return h(!t||"function"==typeof t),n(),g.isBatchingUpdates?(m.push(e),void(t&&(e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t]))):void g.batchedUpdates(s,e,t)}function u(e,t){h(g.isBatchingUpdates),v.enqueue(e,t),y=!0}var c=e("./CallbackQueue"),l=e("./PooledClass"),p=(e("./ReactCurrentOwner"),e("./ReactPerf")),d=e("./Transaction"),f=e("./Object.assign"),h=e("./invariant"),m=(e("./warning"),[]),v=c.getPooled(),y=!1,g=null,E={initialize:function(){this.dirtyComponentsLength=m.length},close:function(){this.dirtyComponentsLength!==m.length?(m.splice(0,this.dirtyComponentsLength),M()):m.length=0}},C={initialize:function(){this.callbackQueue.reset()},close:function(){this.callbackQueue.notifyAll()}},R=[E,C];f(r.prototype,d.Mixin,{getTransactionWrappers:function(){return R},destructor:function(){this.dirtyComponentsLength=null,c.release(this.callbackQueue),this.callbackQueue=null,O.ReactReconcileTransaction.release(this.reconcileTransaction),this.reconcileTransaction=null},perform:function(e,t,n){return d.Mixin.perform.call(this,this.reconcileTransaction.perform,this.reconcileTransaction,e,t,n)}}),l.addPoolingTo(r);var M=p.measure("ReactUpdates","flushBatchedUpdates",function(){for(;m.length||y;){if(m.length){var e=r.getPooled();e.perform(a,null,e),r.release(e)}if(y){y=!1;var t=v;v=c.getPooled(),t.notifyAll(),c.release(t)}}}),b={injectReconcileTransaction:function(e){h(e),O.ReactReconcileTransaction=e},injectBatchingStrategy:function(e){h(e),h("function"==typeof e.batchedUpdates),h("boolean"==typeof e.isBatchingUpdates),g=e}},O={ReactReconcileTransaction:null,batchedUpdates:o,enqueueUpdate:s,flushBatchedUpdates:M,injection:b,asap:u};t.exports=O},{"./CallbackQueue":7,"./Object.assign":29,"./PooledClass":30,"./ReactCurrentOwner":42,"./ReactPerf":73,"./Transaction":104,"./invariant":137,"./warning":155}],89:[function(e,t){"use strict";var n=e("./DOMProperty"),r=n.injection.MUST_USE_ATTRIBUTE,o={Properties:{cx:r,cy:r,d:r,dx:r,dy:r,fill:r,fillOpacity:r,fontFamily:r,fontSize:r,fx:r,fy:r,gradientTransform:r,gradientUnits:r,markerEnd:r,markerMid:r,markerStart:r,offset:r,opacity:r,patternContentUnits:r,patternUnits:r,points:r,preserveAspectRatio:r,r:r,rx:r,ry:r,spreadMethod:r,stopColor:r,stopOpacity:r,stroke:r,strokeDasharray:r,strokeLinecap:r,strokeOpacity:r,strokeWidth:r,textAnchor:r,transform:r,version:r,viewBox:r,x1:r,x2:r,x:r,y1:r,y2:r,y:r},DOMAttributeNames:{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"}};t.exports=o},{"./DOMProperty":12}],90:[function(e,t){"use strict";function n(e){if("selectionStart"in e&&a.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 r(e){if(!y&&null!=h&&h==u()){var t=n(h);if(!v||!p(v,t)){v=t;var r=s.getPooled(f.select,m,e);return r.type="select",r.target=h,i.accumulateTwoPhaseDispatches(r),r}}}var o=e("./EventConstants"),i=e("./EventPropagators"),a=e("./ReactInputSelection"),s=e("./SyntheticEvent"),u=e("./getActiveElement"),c=e("./isTextInputElement"),l=e("./keyOf"),p=e("./shallowEqual"),d=o.topLevelTypes,f={select:{phasedRegistrationNames:{bubbled:l({onSelect:null}),captured:l({onSelectCapture:null})},dependencies:[d.topBlur,d.topContextMenu,d.topFocus,d.topKeyDown,d.topMouseDown,d.topMouseUp,d.topSelectionChange]}},h=null,m=null,v=null,y=!1,g={eventTypes:f,extractEvents:function(e,t,n,o){switch(e){case d.topFocus:(c(t)||"true"===t.contentEditable)&&(h=t,m=n,v=null);break;case d.topBlur:h=null,m=null,v=null;break;case d.topMouseDown:y=!0;break;case d.topContextMenu:case d.topMouseUp:return y=!1,r(o);case d.topSelectionChange:case d.topKeyDown:case d.topKeyUp:return r(o)}}};t.exports=g},{"./EventConstants":17,"./EventPropagators":22,"./ReactInputSelection":63,"./SyntheticEvent":96,"./getActiveElement":124,"./isTextInputElement":140,"./keyOf":144,"./shallowEqual":150}],91:[function(e,t){"use strict";var n=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*n)}};t.exports=r},{}],92:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./EventPluginUtils"),o=e("./EventPropagators"),i=e("./SyntheticClipboardEvent"),a=e("./SyntheticEvent"),s=e("./SyntheticFocusEvent"),u=e("./SyntheticKeyboardEvent"),c=e("./SyntheticMouseEvent"),l=e("./SyntheticDragEvent"),p=e("./SyntheticTouchEvent"),d=e("./SyntheticUIEvent"),f=e("./SyntheticWheelEvent"),h=e("./getEventCharCode"),m=e("./invariant"),v=e("./keyOf"),y=(e("./warning"),n.topLevelTypes),g={blur:{phasedRegistrationNames:{bubbled:v({onBlur:!0}),captured:v({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:v({onClick:!0}),captured:v({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:v({onContextMenu:!0}),captured:v({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:v({onCopy:!0}),captured:v({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:v({onCut:!0}),captured:v({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:v({onDoubleClick:!0}),captured:v({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:v({onDrag:!0}),captured:v({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:v({onDragEnd:!0}),captured:v({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:v({onDragEnter:!0}),captured:v({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:v({onDragExit:!0}),captured:v({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:v({onDragLeave:!0}),captured:v({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:v({onDragOver:!0}),captured:v({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:v({onDragStart:!0}),captured:v({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:v({onDrop:!0}),captured:v({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:v({onFocus:!0}),captured:v({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:v({onInput:!0}),captured:v({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:v({onKeyDown:!0}),captured:v({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:v({onKeyPress:!0}),captured:v({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:v({onKeyUp:!0}),captured:v({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:v({onLoad:!0}),captured:v({onLoadCapture:!0})}},error:{phasedRegistrationNames:{bubbled:v({onError:!0}),captured:v({onErrorCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:v({onMouseDown:!0}),captured:v({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:v({onMouseMove:!0}),captured:v({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:v({onMouseOut:!0}),captured:v({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:v({onMouseOver:!0}),captured:v({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:v({onMouseUp:!0}),captured:v({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:v({onPaste:!0}),captured:v({onPasteCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:v({onReset:!0}),captured:v({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:v({onScroll:!0}),captured:v({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:v({onSubmit:!0}),captured:v({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:v({onTouchCancel:!0}),captured:v({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:v({onTouchEnd:!0}),captured:v({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:v({onTouchMove:!0}),captured:v({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:v({onTouchStart:!0}),captured:v({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:v({onWheel:!0}),captured:v({onWheelCapture:!0})}}},E={topBlur:g.blur,topClick:g.click,topContextMenu:g.contextMenu,topCopy:g.copy,topCut:g.cut,topDoubleClick:g.doubleClick,topDrag:g.drag,topDragEnd:g.dragEnd,topDragEnter:g.dragEnter,topDragExit:g.dragExit,topDragLeave:g.dragLeave,topDragOver:g.dragOver,topDragStart:g.dragStart,topDrop:g.drop,topError:g.error,topFocus:g.focus,topInput:g.input,topKeyDown:g.keyDown,topKeyPress:g.keyPress,topKeyUp:g.keyUp,topLoad:g.load,topMouseDown:g.mouseDown,topMouseMove:g.mouseMove,topMouseOut:g.mouseOut,topMouseOver:g.mouseOver,topMouseUp:g.mouseUp,topPaste:g.paste,topReset:g.reset,topScroll:g.scroll,topSubmit:g.submit,topTouchCancel:g.touchCancel,topTouchEnd:g.touchEnd,topTouchMove:g.touchMove,topTouchStart:g.touchStart,topWheel:g.wheel};for(var C in E)E[C].dependencies=[C];var R={eventTypes:g,executeDispatch:function(e,t,n){var o=r.executeDispatch(e,t,n);o===!1&&(e.stopPropagation(),e.preventDefault())},extractEvents:function(e,t,n,r){var v=E[e];if(!v)return null;var g;switch(e){case y.topInput:case y.topLoad:case y.topError:case y.topReset:case y.topSubmit:g=a;break;case y.topKeyPress:if(0===h(r))return null;case y.topKeyDown:case y.topKeyUp:g=u;break;case y.topBlur:case y.topFocus:g=s;break;case y.topClick:if(2===r.button)return null;case y.topContextMenu:case y.topDoubleClick:case y.topMouseDown:case y.topMouseMove:case y.topMouseOut:case y.topMouseOver:case y.topMouseUp:g=c;break;case y.topDrag:case y.topDragEnd:case y.topDragEnter:case y.topDragExit:case y.topDragLeave:case y.topDragOver:case y.topDragStart:case y.topDrop:g=l;break;case y.topTouchCancel:case y.topTouchEnd:case y.topTouchMove:case y.topTouchStart:g=p;break;case y.topScroll:g=d;break;case y.topWheel:g=f;break;case y.topCopy:case y.topCut:case y.topPaste:g=i}m(g);var C=g.getPooled(v,n,r);return o.accumulateTwoPhaseDispatches(C),C}};t.exports=R},{"./EventConstants":17,"./EventPluginUtils":21,"./EventPropagators":22,"./SyntheticClipboardEvent":93,"./SyntheticDragEvent":95,"./SyntheticEvent":96,"./SyntheticFocusEvent":97,"./SyntheticKeyboardEvent":99,"./SyntheticMouseEvent":100,"./SyntheticTouchEvent":101,"./SyntheticUIEvent":102,"./SyntheticWheelEvent":103,"./getEventCharCode":125,"./invariant":137,"./keyOf":144,"./warning":155}],93:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};r.augmentClass(n,o),t.exports=n},{"./SyntheticEvent":96}],94:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),o={data:null};r.augmentClass(n,o),t.exports=n},{"./SyntheticEvent":96}],95:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticMouseEvent"),o={dataTransfer:null};r.augmentClass(n,o),t.exports=n},{"./SyntheticMouseEvent":100}],96:[function(e,t){"use strict";function n(e,t,n){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var r=this.constructor.Interface;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];this[o]=a?a(n):n[o]}var s=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;this.isDefaultPrevented=s?i.thatReturnsTrue:i.thatReturnsFalse,this.isPropagationStopped=i.thatReturnsFalse}var r=e("./PooledClass"),o=e("./Object.assign"),i=e("./emptyFunction"),a=e("./getEventTarget"),s={type:null,target:a,currentTarget:i.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};o(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=i.thatReturnsTrue},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=i.thatReturnsTrue},persist:function(){this.isPersistent=i.thatReturnsTrue},isPersistent:i.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}}),n.Interface=s,n.augmentClass=function(e,t){var n=this,i=Object.create(n.prototype);o(i,e.prototype),e.prototype=i,e.prototype.constructor=e,e.Interface=o({},n.Interface,t),e.augmentClass=n.augmentClass,r.addPoolingTo(e,r.threeArgumentPooler)},r.addPoolingTo(n,r.threeArgumentPooler),t.exports=n},{"./Object.assign":29,"./PooledClass":30,"./emptyFunction":118,"./getEventTarget":128}],97:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),o={relatedTarget:null};r.augmentClass(n,o),t.exports=n},{"./SyntheticUIEvent":102}],98:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),o={data:null};r.augmentClass(n,o),t.exports=n},{"./SyntheticEvent":96}],99:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),o=e("./getEventCharCode"),i=e("./getEventKey"),a=e("./getEventModifierState"),s={key:i,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:a,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}};r.augmentClass(n,s),t.exports=n},{"./SyntheticUIEvent":102,"./getEventCharCode":125,"./getEventKey":126,"./getEventModifierState":127}],100:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),o=e("./ViewportMetrics"),i=e("./getEventModifierState"),a={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:i,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}};r.augmentClass(n,a),t.exports=n},{"./SyntheticUIEvent":102,"./ViewportMetrics":105,"./getEventModifierState":127}],101:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticUIEvent"),o=e("./getEventModifierState"),i={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:o};r.augmentClass(n,i),t.exports=n},{"./SyntheticUIEvent":102,"./getEventModifierState":127}],102:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=e("./SyntheticEvent"),o=e("./getEventTarget"),i={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}};r.augmentClass(n,i),t.exports=n},{"./SyntheticEvent":96,"./getEventTarget":128}],103:[function(e,t){"use strict";function n(e,t,n){r.call(this,e,t,n)}var r=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};r.augmentClass(n,o),t.exports=n},{"./SyntheticMouseEvent":100}],104:[function(e,t){"use strict";var n=e("./invariant"),r={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,r,o,i,a,s,u){n(!this.isInTransaction());var c,l;try{this._isInTransaction=!0,c=!0,this.initializeAll(0),l=e.call(t,r,o,i,a,s,u),c=!1}finally{try{if(c)try{this.closeAll(0)}catch(p){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return l},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){n(this.isInTransaction());for(var t=this.transactionWrappers,r=e;r<t.length;r++){var i,a=t[r],s=this.wrapperInitData[r];try{i=!0,s!==o.OBSERVED_ERROR&&a.close&&a.close.call(this,s),i=!1}finally{if(i)try{this.closeAll(r+1)}catch(u){}}}this.wrapperInitData.length=0}},o={Mixin:r,OBSERVED_ERROR:{}};t.exports=o},{"./invariant":137}],105:[function(e,t){"use strict";var n=e("./getUnboundedScrollPosition"),r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(){var e=n(window);r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};t.exports=r},{"./getUnboundedScrollPosition":133}],106:[function(e,t){"use strict";function n(e,t){if(r(null!=t),null==e)return t;var n=Array.isArray(e),o=Array.isArray(t);return n&&o?(e.push.apply(e,t),e):n?(e.push(t),e):o?[e].concat(t):[e,t]}var r=e("./invariant");t.exports=n},{"./invariant":137}],107:[function(e,t){"use strict";function n(e){for(var t=1,n=0,o=0;o<e.length;o++)t=(t+e.charCodeAt(o))%r,n=(n+t)%r;return t|n<<16}var r=65521;t.exports=n},{}],108:[function(e,t){function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;t.exports=n},{}],109:[function(e,t){"use strict";function n(e){return r(e.replace(o,"ms-"))}var r=e("./camelize"),o=/^-ms-/;t.exports=n},{"./camelize":108}],110:[function(e,t){"use strict";function n(e,t){var n=o.mergeProps(t,e.props);return!n.hasOwnProperty(a)&&e.props.hasOwnProperty(a)&&(n.children=e.props.children),r.createElement(e.type,n)}var r=e("./ReactElement"),o=e("./ReactPropTransferer"),i=e("./keyOf"),a=(e("./warning"),i({children:null}));t.exports=n},{"./ReactElement":56,"./ReactPropTransferer":74,"./keyOf":144,"./warning":155}],111:[function(e,t){function n(e,t){return e&&t?e===t?!0:r(e)?!1:r(t)?n(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var r=e("./isTextNode");t.exports=n},{"./isTextNode":141}],112:[function(e,t){function n(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 r(e){return n(e)?Array.isArray(e)?e.slice():o(e):[e]}var o=e("./toArray");t.exports=r},{"./toArray":152}],113:[function(e,t){"use strict";function n(e){var t=o.createFactory(e),n=r.createClass({displayName:"ReactFullPageComponent"+e,componentWillUnmount:function(){i(!1)},render:function(){return t(this.props)}});return n}var r=e("./ReactCompositeComponent"),o=e("./ReactElement"),i=e("./invariant");t.exports=n},{"./ReactCompositeComponent":40,"./ReactElement":56,"./invariant":137}],114:[function(e,t){function n(e){var t=e.match(c);return t&&t[1].toLowerCase()}function r(e,t){var r=u;s(!!u);var o=n(e),c=o&&a(o);if(c){r.innerHTML=c[1]+e+c[2];for(var l=c[0];l--;)r=r.lastChild}else r.innerHTML=e;var p=r.getElementsByTagName("script");p.length&&(s(t),i(p).forEach(t));for(var d=i(r.childNodes);r.lastChild;)r.removeChild(r.lastChild);return d}var o=e("./ExecutionEnvironment"),i=e("./createArrayFrom"),a=e("./getMarkupWrap"),s=e("./invariant"),u=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=r},{"./ExecutionEnvironment":23,"./createArrayFrom":112,"./getMarkupWrap":129,"./invariant":137}],115:[function(e,t){function n(e){return"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}).join(" "):Array.prototype.join.call(arguments," ")}t.exports=n},{}],116:[function(e,t){"use strict";function n(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 r=e("./CSSProperty"),o=r.isUnitlessNumber;t.exports=n},{"./CSSProperty":5}],117:[function(e,t){function n(e,t,n,r,o){return o
}e("./Object.assign"),e("./warning");t.exports=n},{"./Object.assign":29,"./warning":155}],118:[function(e,t){function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},t.exports=r},{}],119:[function(e,t){"use strict";var n={};t.exports=n},{}],120:[function(e,t){"use strict";function n(e){return o[e]}function r(e){return(""+e).replace(i,n)}var o={"&":"&",">":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;t.exports=r},{}],121:[function(e,t){"use strict";function n(e,t,n){var r=e,i=!r.hasOwnProperty(n);if(i&&null!=t){var a,s=typeof t;a="string"===s?o(t):"number"===s?o(""+t):t,r[n]=a}}function r(e){if(null==e)return e;var t={};return i(e,n,t),t}{var o=e("./ReactTextComponent"),i=e("./traverseAllChildren");e("./warning")}t.exports=r},{"./ReactTextComponent":84,"./traverseAllChildren":153,"./warning":155}],122:[function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}t.exports=n},{}],123:[function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],124:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],125:[function(e,t){"use strict";function n(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=n},{}],126:[function(e,t){"use strict";function n(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}var r=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"},i={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=n},{"./getEventCharCode":125}],127:[function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],128:[function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],129:[function(e,t){function n(e){return o(!!i),p.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"<link />":"<"+e+"></"+e+">",a[e]=!i.firstChild),a[e]?p[e]:null}var r=e("./ExecutionEnvironment"),o=e("./invariant"),i=r.canUseDOM?document.createElement("div"):null,a={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,"<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:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c,circle:l,defs:l,ellipse:l,g:l,line:l,linearGradient:l,path:l,polygon:l,polyline:l,radialGradient:l,rect:l,stop:l,text:l};t.exports=n},{"./ExecutionEnvironment":23,"./invariant":137}],130:[function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),i=0,a=0;o;){if(3==o.nodeType){if(a=i+o.textContent.length,t>=i&&a>=t)return{node:o,offset:t-i};i=a}o=n(r(o))}}t.exports=o},{}],131:[function(e,t){"use strict";function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=n},{}],132:[function(e,t){"use strict";function n(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var r=e("./ExecutionEnvironment"),o=null;t.exports=n},{"./ExecutionEnvironment":23}],133:[function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],134:[function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],135:[function(e,t){"use strict";function n(e){return r(e).replace(o,"-ms-")}var r=e("./hyphenate"),o=/^ms-/;t.exports=n},{"./hyphenate":134}],136:[function(e,t){"use strict";function n(e,t){var n;return n="string"==typeof e.type?r.createInstanceForTag(e.type,e.props,t):new e.type(e.props),n.construct(e),n}{var r=(e("./warning"),e("./ReactElement"),e("./ReactLegacyElement"),e("./ReactNativeComponent"));e("./ReactEmptyComponent")}t.exports=n},{"./ReactElement":56,"./ReactEmptyComponent":58,"./ReactLegacyElement":65,"./ReactNativeComponent":71,"./warning":155}],137:[function(e,t){"use strict";var n=function(e,t,n,r,o,i,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 c=[n,r,o,i,a,s],l=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[l++]}))}throw u.framesToPop=1,u}};t.exports=n},{}],138:[function(e,t){"use strict";function n(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var r,o=e("./ExecutionEnvironment");o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{"./ExecutionEnvironment":23}],139:[function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],140:[function(e,t){"use strict";function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={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=n},{}],141:[function(e,t){function n(e){return r(e)&&3==e.nodeType}var r=e("./isNode");t.exports=n},{"./isNode":139}],142:[function(e,t){"use strict";function n(e){e||(e="");var t,n=arguments.length;if(n>1)for(var r=1;n>r;r++)t=arguments[r],t&&(e=(e?e+" ":"")+t);return e}t.exports=n},{}],143:[function(e,t){"use strict";var n=e("./invariant"),r=function(e){var t,r={};n(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r},{"./invariant":137}],144:[function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],145:[function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var i in e)r.call(e,i)&&(o[i]=t.call(n,e[i],i,e));return o}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],146:[function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)?t[n]:t[n]=e.call(this,n)}}t.exports=n},{}],147:[function(e,t){"use strict";function n(e){r(e&&!/[^a-z0-9_]/.test(e))}var r=e("./invariant");t.exports=n},{"./invariant":137}],148:[function(e,t){"use strict";function n(e){return o(r.isValidElement(e)),e}var r=e("./ReactElement"),o=e("./invariant");t.exports=n},{"./ReactElement":56,"./invariant":137}],149:[function(e,t){"use strict";var n=e("./ExecutionEnvironment"),r=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,i=function(e,t){e.innerHTML=t};if(n.canUseDOM){var a=document.createElement("div");a.innerHTML=" ",""===a.innerHTML&&(i=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=""+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=i},{"./ExecutionEnvironment":23}],150:[function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=n},{}],151:[function(e,t){"use strict";function n(e,t){return e&&t&&e.type===t.type&&e.key===t.key&&e._owner===t._owner?!0:!1}t.exports=n},{}],152:[function(e,t){function n(e){var t=e.length;if(r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),r("number"==typeof t),r(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var o=Array(t),i=0;t>i;i++)o[i]=e[i];return o}var r=e("./invariant");t.exports=n},{"./invariant":137}],153:[function(e,t){"use strict";function n(e){return d[e]}function r(e,t){return e&&null!=e.key?i(e.key):t.toString(36)}function o(e){return(""+e).replace(f,n)}function i(e){return"$"+o(e)}function a(e,t,n){return null==e?0:h(e,"",0,t,n)}var s=e("./ReactElement"),u=e("./ReactInstanceHandles"),c=e("./invariant"),l=u.SEPARATOR,p=":",d={"=":"=0",".":"=1",":":"=2"},f=/[=.:]/g,h=function(e,t,n,o,a){var u,d,f=0;if(Array.isArray(e))for(var m=0;m<e.length;m++){var v=e[m];u=t+(t?p:l)+r(v,m),d=n+f,f+=h(v,u,d,o,a)}else{var y=typeof e,g=""===t,E=g?l+r(e,0):t;if(null==e||"boolean"===y)o(a,null,E,n),f=1;else if("string"===y||"number"===y||s.isValidElement(e))o(a,e,E,n),f=1;else if("object"===y){c(!e||1!==e.nodeType);for(var C in e)e.hasOwnProperty(C)&&(u=t+(t?p:l)+i(C)+p+r(e[C],0),d=n+f,f+=h(e[C],u,d,o,a))}}return f};t.exports=a},{"./ReactElement":56,"./ReactInstanceHandles":64,"./invariant":137}],154:[function(e,t){"use strict";function n(e){return Array.isArray(e)?e.concat():e&&"object"==typeof e?i(new e.constructor,e):e}function r(e,t,n){s(Array.isArray(e));var r=t[n];s(Array.isArray(r))}function o(e,t){if(s("object"==typeof t),t.hasOwnProperty(p))return s(1===Object.keys(t).length),t[p];var a=n(e);if(t.hasOwnProperty(d)){var h=t[d];s(h&&"object"==typeof h),s(a&&"object"==typeof a),i(a,t[d])}t.hasOwnProperty(u)&&(r(e,t,u),t[u].forEach(function(e){a.push(e)})),t.hasOwnProperty(c)&&(r(e,t,c),t[c].forEach(function(e){a.unshift(e)})),t.hasOwnProperty(l)&&(s(Array.isArray(e)),s(Array.isArray(t[l])),t[l].forEach(function(e){s(Array.isArray(e)),a.splice.apply(a,e)})),t.hasOwnProperty(f)&&(s("function"==typeof t[f]),a=t[f](a));for(var v in t)m.hasOwnProperty(v)&&m[v]||(a[v]=o(e[v],t[v]));return a}var i=e("./Object.assign"),a=e("./keyOf"),s=e("./invariant"),u=a({$push:null}),c=a({$unshift:null}),l=a({$splice:null}),p=a({$set:null}),d=a({$merge:null}),f=a({$apply:null}),h=[u,c,l,p,d,f],m={};h.forEach(function(e){m[e]=!0}),t.exports=o},{"./Object.assign":29,"./invariant":137,"./keyOf":144}],155:[function(e,t){"use strict";var n=e("./emptyFunction"),r=n;t.exports=r},{"./emptyFunction":118}]},{},[1])(1)}); |
ajax/libs/6to5/1.14.5/browser-polyfill.js | paleozogt/cdnjs | (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){var ensureSymbol=function(key){Symbol[key]=Symbol[key]||Symbol()};var ensureProto=function(Constructor,key,val){var proto=Constructor.prototype;proto[key]=proto[key]||val};if(typeof Symbol==="undefined"){require("es6-symbol/implement")}require("es6-shim");require("./transformation/transformers/es6-generators/runtime");ensureSymbol("referenceGet");ensureSymbol("referenceSet");ensureSymbol("referenceDelete");ensureProto(Function,Symbol.referenceGet,function(){return this});ensureProto(Map,Symbol.referenceGet,Map.prototype.get);ensureProto(Map,Symbol.referenceSet,Map.prototype.set);ensureProto(Map,Symbol.referenceDelete,Map.prototype.delete);if(global.WeakMap){ensureProto(WeakMap,Symbol.referenceGet,WeakMap.prototype.get);ensureProto(WeakMap,Symbol.referenceSet,WeakMap.prototype.set);ensureProto(WeakMap,Symbol.referenceDelete,WeakMap.prototype.delete)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./transformation/transformers/es6-generators/runtime":2,"es6-shim":4,"es6-symbol/implement":5}],2:[function(require,module,exports){(function(global){var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";var runtime=global.regeneratorRuntime=exports;var hasOwn=Object.prototype.hasOwnProperty;var wrap=runtime.wrap=function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])};var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};var GF=function GeneratorFunction(){};var GFp=function GeneratorFunctionPrototype(){};var Gp=GFp.prototype=Generator.prototype;(GFp.constructor=GF).prototype=Gp.constructor=GFp;var GFName="GeneratorFunction";if(GF.name!==GFName)GF.name=GFName;if(GF.name!==GFName)throw new Error(GFName+" renamed?");runtime.isGeneratorFunction=function(genFun){var ctor=genFun&&genFun.constructor;return ctor?GF.name===ctor.name:false};runtime.mark=function(genFun){genFun.__proto__=GFp;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){var info;var value;try{info=this(arg);value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){throw new Error("Generator has already finished")}while(true){var delegate=context.delegate;var info;if(delegate){try{info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){var iterator=iterable;if(iteratorSymbol in iterable){iterator=iterable[iteratorSymbol]()}else if(!isNaN(iterable.length)){var i=-1;iterator=function next(){while(++i<iterable.length){if(i in iterable){next.value=iterable[i];next.done=false;return next}}next.done=true;return next};iterator.next=iterator}return iterator}runtime.values=values;Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;var thrown;if(record.type==="throw"){thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){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")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],4:[function(require,module,exports){(function(process){(function(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.returnExports=factory()}})(this,function(){"use strict";var isCallableWithoutNew=function(func){try{func()}catch(e){return false}return true};var supportsSubclassing=function(C,f){try{var Sub=function(){C.apply(this,arguments)};if(!Sub.__proto__){return false}Object.setPrototypeOf(Sub,C);Sub.prototype=Object.create(C.prototype,{constructor:{value:C}});return f(Sub)}catch(e){return false}};var arePropertyDescriptorsSupported=function(){try{Object.defineProperty({},"x",{});return true}catch(e){return false}};var startsWithRejectsRegex=function(){var rejectsRegex=false;if(String.prototype.startsWith){try{"/a/".startsWith(/a/)}catch(e){rejectsRegex=true}}return rejectsRegex};var getGlobal=new Function("return this;");var globals=getGlobal();var global_isFinite=globals.isFinite;var supportsDescriptors=!!Object.defineProperty&&arePropertyDescriptorsSupported();var startsWithIsCompliant=startsWithRejectsRegex();var _slice=Array.prototype.slice;var _indexOf=String.prototype.indexOf;var _toString=Object.prototype.toString;var _hasOwnProperty=Object.prototype.hasOwnProperty;var ArrayIterator;var defineProperty=function(object,name,value,force){if(!force&&name in object){return}if(supportsDescriptors){Object.defineProperty(object,name,{configurable:true,enumerable:false,writable:true,value:value})}else{object[name]=value}};var defineProperties=function(object,map){Object.keys(map).forEach(function(name){var method=map[name];defineProperty(object,name,method,false)})};var create=Object.create||function(prototype,properties){function Type(){}Type.prototype=prototype;var object=new Type;if(typeof properties!=="undefined"){defineProperties(object,properties)}return object};var $iterator$=typeof Symbol==="function"&&Symbol.iterator||"_es6shim_iterator_";if(globals.Set&&typeof(new globals.Set)["@@iterator"]==="function"){$iterator$="@@iterator"}var addIterator=function(prototype,impl){if(!impl){impl=function iterator(){return this}}var o={};o[$iterator$]=impl;defineProperties(prototype,o);if(!prototype[$iterator$]&&typeof $iterator$==="symbol"){prototype[$iterator$]=impl}};var isArguments=function isArguments(value){var str=_toString.call(value);var result=str==="[object Arguments]";if(!result){result=str!=="[object Array]"&&value!==null&&typeof value==="object"&&typeof value.length==="number"&&value.length>=0&&_toString.call(value.callee)==="[object Function]"}return result};var emulateES6construct=function(o){if(!ES.TypeIsObject(o)){throw new TypeError("bad object")}if(!o._es6construct){if(o.constructor&&ES.IsCallable(o.constructor["@@create"])){o=o.constructor["@@create"](o)}defineProperties(o,{_es6construct:true})}return o};var ES={CheckObjectCoercible:function(x,optMessage){if(x==null){throw new TypeError(optMessage||"Cannot call method on "+x)}return x},TypeIsObject:function(x){return x!=null&&Object(x)===x},ToObject:function(o,optMessage){return Object(ES.CheckObjectCoercible(o,optMessage))},IsCallable:function(x){return typeof x==="function"&&_toString.call(x)==="[object Function]"},ToInt32:function(x){return x>>0},ToUint32:function(x){return x>>>0},ToInteger:function(value){var number=+value;if(Number.isNaN(number)){return 0}if(number===0||!Number.isFinite(number)){return number}return(number>0?1:-1)*Math.floor(Math.abs(number))},ToLength:function(value){var len=ES.ToInteger(value);if(len<=0){return 0}if(len>Number.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return len},SameValue:function(a,b){if(a===b){if(a===0){return 1/a===1/b}return true}return Number.isNaN(a)&&Number.isNaN(b)},SameValueZero:function(a,b){return a===b||Number.isNaN(a)&&Number.isNaN(b)},IsIterable:function(o){return ES.TypeIsObject(o)&&(typeof o[$iterator$]!=="undefined"||isArguments(o))},GetIterator:function(o){if(isArguments(o)){return new ArrayIterator(o,"value")}var itFn=o[$iterator$];if(!ES.IsCallable(itFn)){throw new TypeError("value is not an iterable")}var it=itFn.call(o);if(!ES.TypeIsObject(it)){throw new TypeError("bad iterator")}return it},IteratorNext:function(it){var result=arguments.length>1?it.next(arguments[1]):it.next();if(!ES.TypeIsObject(result)){throw new TypeError("bad iterator")}return result},Construct:function(C,args){var obj;if(ES.IsCallable(C["@@create"])){obj=C["@@create"]()}else{obj=create(C.prototype||null)}defineProperties(obj,{_es6construct:true});var result=C.apply(obj,args);return ES.TypeIsObject(result)?result:obj}};var numberConversion=function(){function roundToEven(n){var w=Math.floor(n),f=n-w;if(f<.5){return w}if(f>.5){return w+1}return w%2?w+1:w}function packIEEE754(v,ebits,fbits){var bias=(1<<ebits-1)-1,s,e,f,i,bits,str,bytes;if(v!==v){e=(1<<ebits)-1;f=Math.pow(2,fbits-1);s=0}else if(v===Infinity||v===-Infinity){e=(1<<ebits)-1;f=0;s=v<0?1:0}else if(v===0){e=0;f=0;s=1/v===-Infinity?1:0}else{s=v<0;v=Math.abs(v);if(v>=Math.pow(2,1-bias)){e=Math.min(Math.floor(Math.log(v)/Math.LN2),1023);f=roundToEven(v/Math.pow(2,e)*Math.pow(2,fbits));if(f/Math.pow(2,fbits)>=2){e=e+1;f=1}if(e>bias){e=(1<<ebits)-1;f=0}else{e=e+bias;f=f-Math.pow(2,fbits)}}else{e=0;f=roundToEven(v/Math.pow(2,1-bias-fbits))}}bits=[];for(i=fbits;i;i-=1){bits.push(f%2?1:0);f=Math.floor(f/2)}for(i=ebits;i;i-=1){bits.push(e%2?1:0);e=Math.floor(e/2)}bits.push(s?1:0);bits.reverse();str=bits.join("");bytes=[];while(str.length){bytes.push(parseInt(str.slice(0,8),2));str=str.slice(8)}return bytes}function unpackIEEE754(bytes,ebits,fbits){var bits=[],i,j,b,str,bias,s,e,f;for(i=bytes.length;i;i-=1){b=bytes[i-1];for(j=8;j;j-=1){bits.push(b%2?1:0);b=b>>1}}bits.reverse();str=bits.join("");bias=(1<<ebits-1)-1;s=parseInt(str.slice(0,1),2)?-1:1;e=parseInt(str.slice(1,1+ebits),2);f=parseInt(str.slice(1+ebits),2);if(e===(1<<ebits)-1){return f!==0?NaN:s*Infinity}else if(e>0){return s*Math.pow(2,e-bias)*(1+f/Math.pow(2,fbits))}else if(f!==0){return s*Math.pow(2,-(bias-1))*(f/Math.pow(2,fbits))}else{return s<0?-0:0}}function unpackFloat64(b){return unpackIEEE754(b,11,52)}function packFloat64(v){return packIEEE754(v,11,52)}function unpackFloat32(b){return unpackIEEE754(b,8,23)}function packFloat32(v){return packIEEE754(v,8,23)}var conversions={toFloat32:function(num){return unpackFloat32(packFloat32(num))}};if(typeof Float32Array!=="undefined"){var float32array=new Float32Array(1);conversions.toFloat32=function(num){float32array[0]=num;return float32array[0]}}return conversions}();defineProperties(String,{fromCodePoint:function(_){var points=_slice.call(arguments,0,arguments.length);var result=[];var next;for(var i=0,length=points.length;i<length;i++){next=Number(points[i]);if(!ES.SameValue(next,ES.ToInteger(next))||next<0||next>1114111){throw new RangeError("Invalid code point "+next)}if(next<65536){result.push(String.fromCharCode(next))}else{next-=65536;result.push(String.fromCharCode((next>>10)+55296));result.push(String.fromCharCode(next%1024+56320))}}return result.join("")},raw:function(callSite){var substitutions=_slice.call(arguments,1,arguments.length);var cooked=ES.ToObject(callSite,"bad callSite");var rawValue=cooked.raw;var raw=ES.ToObject(rawValue,"bad raw value");var len=Object.keys(raw).length;var literalsegments=ES.ToLength(len);if(literalsegments===0){return""}var stringElements=[];var nextIndex=0;var nextKey,next,nextSeg,nextSub;while(nextIndex<literalsegments){nextKey=String(nextIndex);next=raw[nextKey];nextSeg=String(next);stringElements.push(nextSeg);if(nextIndex+1>=literalsegments){break}next=substitutions[nextKey];if(typeof next==="undefined"){break}nextSub=String(next);stringElements.push(nextSub);nextIndex++}return stringElements.join("")}});if(String.fromCodePoint.length!==1){var originalFromCodePoint=String.fromCodePoint;defineProperty(String,"fromCodePoint",function(_){return originalFromCodePoint.apply(this,arguments)},true)}var StringShims={repeat:function(){var repeat=function(s,times){if(times<1){return""}if(times%2){return repeat(s,times-1)+s}var half=repeat(s,times/2);return half+half};return function(times){var thisStr=String(ES.CheckObjectCoercible(this));times=ES.ToInteger(times);if(times<0||times===Infinity){throw new RangeError("Invalid String#repeat value")}return repeat(thisStr,times)}}(),startsWith:function(searchStr){var thisStr=String(ES.CheckObjectCoercible(this));if(_toString.call(searchStr)==="[object RegExp]"){throw new TypeError('Cannot call method "startsWith" with a regex')}searchStr=String(searchStr);var startArg=arguments.length>1?arguments[1]:void 0;var start=Math.max(ES.ToInteger(startArg),0);return thisStr.slice(start,start+searchStr.length)===searchStr},endsWith:function(searchStr){var thisStr=String(ES.CheckObjectCoercible(this));if(_toString.call(searchStr)==="[object RegExp]"){throw new TypeError('Cannot call method "endsWith" with a regex')}searchStr=String(searchStr);var thisLen=thisStr.length;var posArg=arguments.length>1?arguments[1]:void 0;var pos=typeof posArg==="undefined"?thisLen:ES.ToInteger(posArg);var end=Math.min(Math.max(pos,0),thisLen);return thisStr.slice(end-searchStr.length,end)===searchStr},contains:function(searchString){var position=arguments.length>1?arguments[1]:void 0;return _indexOf.call(this,searchString,position)!==-1},codePointAt:function(pos){var thisStr=String(ES.CheckObjectCoercible(this));var position=ES.ToInteger(pos);var length=thisStr.length;if(position<0||position>=length){return}var first=thisStr.charCodeAt(position);var isEnd=position+1===length;if(first<55296||first>56319||isEnd){return first}var second=thisStr.charCodeAt(position+1);if(second<56320||second>57343){return first}return(first-55296)*1024+(second-56320)+65536}};defineProperties(String.prototype,StringShims);var hasStringTrimBug="
".trim().length!==1;if(hasStringTrimBug){var originalStringTrim=String.prototype.trim;delete String.prototype.trim;var ws=[" \n\f\r "," \u2028","\u2029"].join("");var trimRegexp=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g");defineProperties(String.prototype,{trim:function(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(trimRegexp,"")}})}var StringIterator=function(s){this._s=String(ES.CheckObjectCoercible(s));this._i=0};StringIterator.prototype.next=function(){var s=this._s,i=this._i;if(typeof s==="undefined"||i>=s.length){this._s=void 0;return{value:void 0,done:true}}var first=s.charCodeAt(i),second,len;if(first<55296||first>56319||i+1==s.length){len=1}else{second=s.charCodeAt(i+1);len=second<56320||second>57343?1:2}this._i=i+len;return{value:s.substr(i,len),done:false}};addIterator(StringIterator.prototype);addIterator(String.prototype,function(){return new StringIterator(this)});if(!startsWithIsCompliant){String.prototype.startsWith=StringShims.startsWith;String.prototype.endsWith=StringShims.endsWith}var ArrayShims={from:function(iterable){var mapFn=arguments.length>1?arguments[1]:void 0;var list=ES.ToObject(iterable,"bad iterable");if(typeof mapFn!=="undefined"&&!ES.IsCallable(mapFn)){throw new TypeError("Array.from: when provided, the second argument must be a function")}var hasThisArg=arguments.length>2;var thisArg=hasThisArg?arguments[2]:void 0;var usingIterator=ES.IsIterable(list);var length;var result,i,value;if(usingIterator){i=0;result=ES.IsCallable(this)?Object(new this):[];var it=usingIterator?ES.GetIterator(list):null;var iterationValue;do{iterationValue=ES.IteratorNext(it);if(!iterationValue.done){value=iterationValue.value;if(mapFn){result[i]=hasThisArg?mapFn.call(thisArg,value,i):mapFn(value,i)}else{result[i]=value}i+=1}}while(!iterationValue.done);length=i}else{length=ES.ToLength(list.length);result=ES.IsCallable(this)?Object(new this(length)):new Array(length);for(i=0;i<length;++i){value=list[i];if(mapFn){result[i]=hasThisArg?mapFn.call(thisArg,value,i):mapFn(value,i)}else{result[i]=value}}}result.length=length;return result},of:function(){return Array.from(arguments)}};defineProperties(Array,ArrayShims);var arrayFromSwallowsNegativeLengths=function(){try{return Array.from({length:-1}).length===0}catch(e){return false}};if(!arrayFromSwallowsNegativeLengths()){defineProperty(Array,"from",ArrayShims.from,true)}ArrayIterator=function(array,kind){this.i=0;this.array=array;this.kind=kind};defineProperties(ArrayIterator.prototype,{next:function(){var i=this.i,array=this.array;if(!(this instanceof ArrayIterator)){throw new TypeError("Not an ArrayIterator")}if(typeof array!=="undefined"){var len=ES.ToLength(array.length);for(;i<len;i++){var kind=this.kind;var retval;if(kind==="key"){retval=i}else if(kind==="value"){retval=array[i]}else if(kind==="entry"){retval=[i,array[i]]}this.i=i+1;return{value:retval,done:false}}}this.array=void 0;return{value:void 0,done:true}}});addIterator(ArrayIterator.prototype);var ArrayPrototypeShims={copyWithin:function(target,start){var end=arguments[2];var o=ES.ToObject(this);var len=ES.ToLength(o.length);target=ES.ToInteger(target);start=ES.ToInteger(start);var to=target<0?Math.max(len+target,0):Math.min(target,len);var from=start<0?Math.max(len+start,0):Math.min(start,len);end=typeof end==="undefined"?len:ES.ToInteger(end);var fin=end<0?Math.max(len+end,0):Math.min(end,len);var count=Math.min(fin-from,len-to);var direction=1;if(from<to&&to<from+count){direction=-1;from+=count-1;to+=count-1}while(count>0){if(_hasOwnProperty.call(o,from)){o[to]=o[from]}else{delete o[from]}from+=direction;to+=direction;count-=1}return o},fill:function(value){var start=arguments.length>1?arguments[1]:void 0;var end=arguments.length>2?arguments[2]:void 0;var O=ES.ToObject(this);var len=ES.ToLength(O.length);start=ES.ToInteger(typeof start==="undefined"?0:start);end=ES.ToInteger(typeof end==="undefined"?len:end);var relativeStart=start<0?Math.max(len+start,0):Math.min(start,len);var relativeEnd=end<0?len+end:end;for(var i=relativeStart;i<len&&i<relativeEnd;++i){O[i]=value}return O},find:function find(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#find: predicate must be a function")}var thisArg=arguments[1];for(var i=0,value;i<length;i++){value=list[i];if(predicate.call(thisArg,value,i,list)){return value}}return},findIndex:function findIndex(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#findIndex: predicate must be a function")}var thisArg=arguments[1];for(var i=0;i<length;i++){if(predicate.call(thisArg,list[i],i,list)){return i}}return-1},keys:function(){return new ArrayIterator(this,"key")},values:function(){return new ArrayIterator(this,"value")},entries:function(){return new ArrayIterator(this,"entry")}};if(Array.prototype.keys&&!ES.IsCallable([1].keys().next)){delete Array.prototype.keys}if(Array.prototype.entries&&!ES.IsCallable([1].entries().next)){delete Array.prototype.entries}if(Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[$iterator$]){defineProperties(Array.prototype,{values:Array.prototype[$iterator$]})}defineProperties(Array.prototype,ArrayPrototypeShims);addIterator(Array.prototype,function(){return this.values()});if(Object.getPrototypeOf){addIterator(Object.getPrototypeOf([].values()))}var maxSafeInteger=Math.pow(2,53)-1;defineProperties(Number,{MAX_SAFE_INTEGER:maxSafeInteger,MIN_SAFE_INTEGER:-maxSafeInteger,EPSILON:2.220446049250313e-16,parseInt:globals.parseInt,parseFloat:globals.parseFloat,isFinite:function(value){return typeof value==="number"&&global_isFinite(value)},isInteger:function(value){return Number.isFinite(value)&&ES.ToInteger(value)===value},isSafeInteger:function(value){return Number.isInteger(value)&&Math.abs(value)<=Number.MAX_SAFE_INTEGER},isNaN:function(value){return value!==value}});if(![,1].find(function(item,idx){return idx===0})){defineProperty(Array.prototype,"find",ArrayPrototypeShims.find,true)}if([,1].findIndex(function(item,idx){return idx===0})!==0){defineProperty(Array.prototype,"findIndex",ArrayPrototypeShims.findIndex,true)}if(supportsDescriptors){defineProperties(Object,{getPropertyDescriptor:function(subject,name){var pd=Object.getOwnPropertyDescriptor(subject,name);var proto=Object.getPrototypeOf(subject);while(typeof pd==="undefined"&&proto!==null){pd=Object.getOwnPropertyDescriptor(proto,name);proto=Object.getPrototypeOf(proto)}return pd},getPropertyNames:function(subject){var result=Object.getOwnPropertyNames(subject);var proto=Object.getPrototypeOf(subject);var addProperty=function(property){if(result.indexOf(property)===-1){result.push(property)}};while(proto!==null){Object.getOwnPropertyNames(proto).forEach(addProperty);proto=Object.getPrototypeOf(proto)}return result}});defineProperties(Object,{assign:function(target,source){if(!ES.TypeIsObject(target)){throw new TypeError("target must be an object")}return Array.prototype.reduce.call(arguments,function(target,source){return Object.keys(Object(source)).reduce(function(target,key){target[key]=source[key];return target},target)})},is:function(a,b){return ES.SameValue(a,b)},setPrototypeOf:function(Object,magic){var set;var checkArgs=function(O,proto){if(!ES.TypeIsObject(O)){throw new TypeError("cannot set prototype on a non-object")}if(!(proto===null||ES.TypeIsObject(proto))){throw new TypeError("can only set prototype to an object or null"+proto)}};var setPrototypeOf=function(O,proto){checkArgs(O,proto);set.call(O,proto);return O};try{set=Object.getOwnPropertyDescriptor(Object.prototype,magic).set;set.call({},null)}catch(e){if(Object.prototype!=={}[magic]){return}set=function(proto){this[magic]=proto};setPrototypeOf.polyfill=setPrototypeOf(setPrototypeOf({},null),Object.prototype)instanceof Object}return setPrototypeOf}(Object,"__proto__")})}if(Object.setPrototypeOf&&Object.getPrototypeOf&&Object.getPrototypeOf(Object.setPrototypeOf({},null))!==null&&Object.getPrototypeOf(Object.create(null))===null){(function(){var FAKENULL=Object.create(null);var gpo=Object.getPrototypeOf,spo=Object.setPrototypeOf;Object.getPrototypeOf=function(o){var result=gpo(o);return result===FAKENULL?null:result};Object.setPrototypeOf=function(o,p){if(p===null){p=FAKENULL}return spo(o,p)};Object.setPrototypeOf.polyfill=false})()}try{Object.keys("foo")}catch(e){var originalObjectKeys=Object.keys;Object.keys=function(obj){return originalObjectKeys(ES.ToObject(obj))}}var MathShims={acosh:function(value){value=Number(value);if(Number.isNaN(value)||value<1){return NaN}if(value===1){return 0}if(value===Infinity){return value}return Math.log(value+Math.sqrt(value*value-1))},asinh:function(value){value=Number(value);if(value===0||!global_isFinite(value)){return value}return value<0?-Math.asinh(-value):Math.log(value+Math.sqrt(value*value+1))},atanh:function(value){value=Number(value);if(Number.isNaN(value)||value<-1||value>1){return NaN}if(value===-1){return-Infinity}if(value===1){return Infinity}if(value===0){return value}return.5*Math.log((1+value)/(1-value))},cbrt:function(value){value=Number(value);if(value===0){return value}var negate=value<0,result;if(negate){value=-value}result=Math.pow(value,1/3);return negate?-result:result},clz32:function(value){value=Number(value);var number=ES.ToUint32(value);if(number===0){return 32}return 32-number.toString(2).length},cosh:function(value){value=Number(value);if(value===0){return 1}if(Number.isNaN(value)){return NaN}if(!global_isFinite(value)){return Infinity}if(value<0){value=-value}if(value>21){return Math.exp(value)/2}return(Math.exp(value)+Math.exp(-value))/2},expm1:function(value){value=Number(value);if(value===-Infinity){return-1}if(!global_isFinite(value)||value===0){return value}return Math.exp(value)-1},hypot:function(x,y){var anyNaN=false;var allZero=true;var anyInfinity=false;var numbers=[];Array.prototype.every.call(arguments,function(arg){var num=Number(arg);if(Number.isNaN(num)){anyNaN=true}else if(num===Infinity||num===-Infinity){anyInfinity=true}else if(num!==0){allZero=false}if(anyInfinity){return false}else if(!anyNaN){numbers.push(Math.abs(num))}return true});if(anyInfinity){return Infinity}if(anyNaN){return NaN}if(allZero){return 0}numbers.sort(function(a,b){return b-a});var largest=numbers[0];var divided=numbers.map(function(number){return number/largest});var sum=divided.reduce(function(sum,number){return sum+=number*number},0);return largest*Math.sqrt(sum)},log2:function(value){return Math.log(value)*Math.LOG2E},log10:function(value){return Math.log(value)*Math.LOG10E},log1p:function(value){value=Number(value);if(value<-1||Number.isNaN(value)){return NaN}if(value===0||value===Infinity){return value}if(value===-1){return-Infinity}var result=0;var n=50;if(value<0||value>1){return Math.log(1+value)}for(var i=1;i<n;i++){if(i%2===0){result-=Math.pow(value,i)/i}else{result+=Math.pow(value,i)/i}}return result},sign:function(value){var number=+value;if(number===0){return number}if(Number.isNaN(number)){return number}return number<0?-1:1},sinh:function(value){value=Number(value);if(!global_isFinite(value)||value===0){return value}return(Math.exp(value)-Math.exp(-value))/2},tanh:function(value){value=Number(value);if(Number.isNaN(value)||value===0){return value}if(value===Infinity){return 1}if(value===-Infinity){return-1}return(Math.exp(value)-Math.exp(-value))/(Math.exp(value)+Math.exp(-value))},trunc:function(value){var number=Number(value);return number<0?-Math.floor(-number):Math.floor(number)},imul:function(x,y){x=ES.ToUint32(x);y=ES.ToUint32(y);var ah=x>>>16&65535;var al=x&65535;var bh=y>>>16&65535;var bl=y&65535;return al*bl+(ah*bl+al*bh<<16>>>0)|0},fround:function(x){if(x===0||x===Infinity||x===-Infinity||Number.isNaN(x)){return x}var num=Number(x);return numberConversion.toFloat32(num)}};defineProperties(Math,MathShims);if(Math.imul(4294967295,5)!==-5){Math.imul=MathShims.imul
}var PromiseShim=function(){var Promise,Promise$prototype;ES.IsPromise=function(promise){if(!ES.TypeIsObject(promise)){return false}if(!promise._promiseConstructor){return false}if(typeof promise._status==="undefined"){return false}return true};var PromiseCapability=function(C){if(!ES.IsCallable(C)){throw new TypeError("bad promise constructor")}var capability=this;var resolver=function(resolve,reject){capability.resolve=resolve;capability.reject=reject};capability.promise=ES.Construct(C,[resolver]);if(!capability.promise._es6construct){throw new TypeError("bad promise constructor")}if(!(ES.IsCallable(capability.resolve)&&ES.IsCallable(capability.reject))){throw new TypeError("bad promise constructor")}};var setTimeout=globals.setTimeout;var makeZeroTimeout;if(typeof window!=="undefined"&&ES.IsCallable(window.postMessage)){makeZeroTimeout=function(){var timeouts=[];var messageName="zero-timeout-message";var setZeroTimeout=function(fn){timeouts.push(fn);window.postMessage(messageName,"*")};var handleMessage=function(event){if(event.source==window&&event.data==messageName){event.stopPropagation();if(timeouts.length===0){return}var fn=timeouts.shift();fn()}};window.addEventListener("message",handleMessage,true);return setZeroTimeout}}var makePromiseAsap=function(){var P=globals.Promise;return P&&P.resolve&&function(task){return P.resolve().then(task)}};var enqueue=ES.IsCallable(globals.setImmediate)?globals.setImmediate.bind(globals):typeof process==="object"&&process.nextTick?process.nextTick:makePromiseAsap()||(ES.IsCallable(makeZeroTimeout)?makeZeroTimeout():function(task){setTimeout(task,0)});var triggerPromiseReactions=function(reactions,x){reactions.forEach(function(reaction){enqueue(function(){var handler=reaction.handler;var capability=reaction.capability;var resolve=capability.resolve;var reject=capability.reject;try{var result=handler(x);if(result===capability.promise){throw new TypeError("self resolution")}var updateResult=updatePromiseFromPotentialThenable(result,capability);if(!updateResult){resolve(result)}}catch(e){reject(e)}})})};var updatePromiseFromPotentialThenable=function(x,capability){if(!ES.TypeIsObject(x)){return false}var resolve=capability.resolve;var reject=capability.reject;try{var then=x.then;if(!ES.IsCallable(then)){return false}then.call(x,resolve,reject)}catch(e){reject(e)}return true};var promiseResolutionHandler=function(promise,onFulfilled,onRejected){return function(x){if(x===promise){return onRejected(new TypeError("self resolution"))}var C=promise._promiseConstructor;var capability=new PromiseCapability(C);var updateResult=updatePromiseFromPotentialThenable(x,capability);if(updateResult){return capability.promise.then(onFulfilled,onRejected)}else{return onFulfilled(x)}}};Promise=function(resolver){var promise=this;promise=emulateES6construct(promise);if(!promise._promiseConstructor){throw new TypeError("bad promise")}if(typeof promise._status!=="undefined"){throw new TypeError("promise already initialized")}if(!ES.IsCallable(resolver)){throw new TypeError("not a valid resolver")}promise._status="unresolved";promise._resolveReactions=[];promise._rejectReactions=[];var resolve=function(resolution){if(promise._status!=="unresolved"){return}var reactions=promise._resolveReactions;promise._result=resolution;promise._resolveReactions=void 0;promise._rejectReactions=void 0;promise._status="has-resolution";triggerPromiseReactions(reactions,resolution)};var reject=function(reason){if(promise._status!=="unresolved"){return}var reactions=promise._rejectReactions;promise._result=reason;promise._resolveReactions=void 0;promise._rejectReactions=void 0;promise._status="has-rejection";triggerPromiseReactions(reactions,reason)};try{resolver(resolve,reject)}catch(e){reject(e)}return promise};Promise$prototype=Promise.prototype;defineProperties(Promise,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Promise$prototype;obj=obj||create(prototype);defineProperties(obj,{_status:void 0,_result:void 0,_resolveReactions:void 0,_rejectReactions:void 0,_promiseConstructor:void 0});obj._promiseConstructor=constructor;return obj}});var _promiseAllResolver=function(index,values,capability,remaining){var done=false;return function(x){if(done){return}done=true;values[index]=x;if(--remaining.count===0){var resolve=capability.resolve;resolve(values)}}};Promise.all=function(iterable){var C=this;var capability=new PromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;try{if(!ES.IsIterable(iterable)){throw new TypeError("bad iterable")}var it=ES.GetIterator(iterable);var values=[],remaining={count:1};for(var index=0;;index++){var next=ES.IteratorNext(it);if(next.done){break}var nextPromise=C.resolve(next.value);var resolveElement=_promiseAllResolver(index,values,capability,remaining);remaining.count++;nextPromise.then(resolveElement,capability.reject)}if(--remaining.count===0){resolve(values)}}catch(e){reject(e)}return capability.promise};Promise.race=function(iterable){var C=this;var capability=new PromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;try{if(!ES.IsIterable(iterable)){throw new TypeError("bad iterable")}var it=ES.GetIterator(iterable);while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextPromise=C.resolve(next.value);nextPromise.then(resolve,reject)}}catch(e){reject(e)}return capability.promise};Promise.reject=function(reason){var C=this;var capability=new PromiseCapability(C);var reject=capability.reject;reject(reason);return capability.promise};Promise.resolve=function(v){var C=this;if(ES.IsPromise(v)){var constructor=v._promiseConstructor;if(constructor===C){return v}}var capability=new PromiseCapability(C);var resolve=capability.resolve;resolve(v);return capability.promise};Promise.prototype["catch"]=function(onRejected){return this.then(void 0,onRejected)};Promise.prototype.then=function(onFulfilled,onRejected){var promise=this;if(!ES.IsPromise(promise)){throw new TypeError("not a promise")}var C=this.constructor;var capability=new PromiseCapability(C);if(!ES.IsCallable(onRejected)){onRejected=function(e){throw e}}if(!ES.IsCallable(onFulfilled)){onFulfilled=function(x){return x}}var resolutionHandler=promiseResolutionHandler(promise,onFulfilled,onRejected);var resolveReaction={capability:capability,handler:resolutionHandler};var rejectReaction={capability:capability,handler:onRejected};switch(promise._status){case"unresolved":promise._resolveReactions.push(resolveReaction);promise._rejectReactions.push(rejectReaction);break;case"has-resolution":triggerPromiseReactions([resolveReaction],promise._result);break;case"has-rejection":triggerPromiseReactions([rejectReaction],promise._result);break;default:throw new TypeError("unexpected")}return capability.promise};return Promise}();defineProperties(globals,{Promise:PromiseShim});var promiseSupportsSubclassing=supportsSubclassing(globals.Promise,function(S){return S.resolve(42)instanceof S});var promiseIgnoresNonFunctionThenCallbacks=function(){try{globals.Promise.reject(42).then(null,5).then(null,function(){});return true}catch(ex){return false}}();var promiseRequiresObjectContext=function(){try{Promise.call(3,function(){})}catch(e){return true}return false}();if(!promiseSupportsSubclassing||!promiseIgnoresNonFunctionThenCallbacks||!promiseRequiresObjectContext){globals.Promise=PromiseShim}var testOrder=function(a){var b=Object.keys(a.reduce(function(o,k){o[k]=true;return o},{}));return a.join(":")===b.join(":")};var preservesInsertionOrder=testOrder(["z","a","bb"]);var preservesNumericInsertionOrder=testOrder(["z",1,"a","3",2]);if(supportsDescriptors){var fastkey=function fastkey(key){if(!preservesInsertionOrder){return null}var type=typeof key;if(type==="string"){return"$"+key}else if(type==="number"){if(!preservesNumericInsertionOrder){return"n"+key}return key}return null};var emptyObject=function emptyObject(){return Object.create?Object.create(null):{}};var collectionShims={Map:function(){var empty={};function MapEntry(key,value){this.key=key;this.value=value;this.next=null;this.prev=null}MapEntry.prototype.isRemoved=function(){return this.key===empty};function MapIterator(map,kind){this.head=map._head;this.i=this.head;this.kind=kind}MapIterator.prototype={next:function(){var i=this.i,kind=this.kind,head=this.head,result;if(typeof this.i==="undefined"){return{value:void 0,done:true}}while(i.isRemoved()&&i!==head){i=i.prev}while(i.next!==head){i=i.next;if(!i.isRemoved()){if(kind==="key"){result=i.key}else if(kind==="value"){result=i.value}else{result=[i.key,i.value]}this.i=i;return{value:result,done:false}}}this.i=void 0;return{value:void 0,done:true}}};addIterator(MapIterator.prototype);function Map(iterable){var map=this;if(!ES.TypeIsObject(map)){throw new TypeError("Map does not accept arguments when called as a function")}map=emulateES6construct(map);if(!map._es6map){throw new TypeError("bad map")}var head=new MapEntry(null,null);head.next=head.prev=head;defineProperties(map,{_head:head,_storage:emptyObject(),_size:0});if(typeof iterable!=="undefined"&&iterable!==null){var it=ES.GetIterator(iterable);var adder=map.set;if(!ES.IsCallable(adder)){throw new TypeError("bad map")}while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextItem=next.value;if(!ES.TypeIsObject(nextItem)){throw new TypeError("expected iterable of pairs")}adder.call(map,nextItem[0],nextItem[1])}}return map}var Map$prototype=Map.prototype;defineProperties(Map,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Map$prototype;obj=obj||create(prototype);defineProperties(obj,{_es6map:true});return obj}});Object.defineProperty(Map.prototype,"size",{configurable:true,enumerable:false,get:function(){if(typeof this._size==="undefined"){throw new TypeError("size method called on incompatible Map")}return this._size}});defineProperties(Map.prototype,{get:function(key){var fkey=fastkey(key);if(fkey!==null){var entry=this._storage[fkey];if(entry){return entry.value}else{return}}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return i.value}}return},has:function(key){var fkey=fastkey(key);if(fkey!==null){return typeof this._storage[fkey]!=="undefined"}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return true}}return false},set:function(key,value){var head=this._head,i=head,entry;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]!=="undefined"){this._storage[fkey].value=value;return this}else{entry=this._storage[fkey]=new MapEntry(key,value);i=head.prev}}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.value=value;return this}}entry=entry||new MapEntry(key,value);if(ES.SameValue(-0,key)){entry.key=+0}entry.next=this._head;entry.prev=this._head.prev;entry.prev.next=entry;entry.next.prev=entry;this._size+=1;return this},"delete":function(key){var head=this._head,i=head;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]==="undefined"){return false}i=this._storage[fkey].prev;delete this._storage[fkey]}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.key=i.value=empty;i.prev.next=i.next;i.next.prev=i.prev;this._size-=1;return true}}return false},clear:function(){this._size=0;this._storage=emptyObject();var head=this._head,i=head,p=i.next;while((i=p)!==head){i.key=i.value=empty;p=i.next;i.next=i.prev=head}head.next=head.prev=head},keys:function(){return new MapIterator(this,"key")},values:function(){return new MapIterator(this,"value")},entries:function(){return new MapIterator(this,"key+value")},forEach:function(callback){var context=arguments.length>1?arguments[1]:null;var it=this.entries();for(var entry=it.next();!entry.done;entry=it.next()){callback.call(context,entry.value[1],entry.value[0],this)}}});addIterator(Map.prototype,function(){return this.entries()});return Map}(),Set:function(){var SetShim=function Set(iterable){var set=this;if(!ES.TypeIsObject(set)){throw new TypeError("Set does not accept arguments when called as a function")}set=emulateES6construct(set);if(!set._es6set){throw new TypeError("bad set")}defineProperties(set,{"[[SetData]]":null,_storage:emptyObject()});if(typeof iterable!=="undefined"&&iterable!==null){var it=ES.GetIterator(iterable);var adder=set.add;if(!ES.IsCallable(adder)){throw new TypeError("bad set")}while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextItem=next.value;adder.call(set,nextItem)}}return set};var Set$prototype=SetShim.prototype;defineProperties(SetShim,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Set$prototype;obj=obj||create(prototype);defineProperties(obj,{_es6set:true});return obj}});var ensureMap=function ensureMap(set){if(!set["[[SetData]]"]){var m=set["[[SetData]]"]=new collectionShims.Map;Object.keys(set._storage).forEach(function(k){if(k.charCodeAt(0)===36){k=k.slice(1)}else if(k.charAt(0)==="n"){k=+k.slice(1)}else{k=+k}m.set(k,k)});set._storage=null}};Object.defineProperty(SetShim.prototype,"size",{configurable:true,enumerable:false,get:function(){if(typeof this._storage==="undefined"){throw new TypeError("size method called on incompatible Set")}ensureMap(this);return this["[[SetData]]"].size}});defineProperties(SetShim.prototype,{has:function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){return!!this._storage[fkey]}ensureMap(this);return this["[[SetData]]"].has(key)},add:function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){this._storage[fkey]=true;return this}ensureMap(this);this["[[SetData]]"].set(key,key);return this},"delete":function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){var hasFKey=_hasOwnProperty.call(this._storage,fkey);return delete this._storage[fkey]&&hasFKey}ensureMap(this);return this["[[SetData]]"]["delete"](key)},clear:function(){if(this._storage){this._storage=emptyObject();return}return this["[[SetData]]"].clear()},keys:function(){ensureMap(this);return this["[[SetData]]"].keys()},values:function(){ensureMap(this);return this["[[SetData]]"].values()},entries:function(){ensureMap(this);return this["[[SetData]]"].entries()},forEach:function(callback){var context=arguments.length>1?arguments[1]:null;var entireSet=this;ensureMap(this);this["[[SetData]]"].forEach(function(value,key){callback.call(context,key,key,entireSet)})}});addIterator(SetShim.prototype,function(){return this.values()});return SetShim}()};defineProperties(globals,collectionShims);if(globals.Map||globals.Set){if(typeof globals.Map.prototype.clear!=="function"||(new globals.Set).size!==0||(new globals.Map).size!==0||typeof globals.Map.prototype.keys!=="function"||typeof globals.Set.prototype.keys!=="function"||typeof globals.Map.prototype.forEach!=="function"||typeof globals.Set.prototype.forEach!=="function"||isCallableWithoutNew(globals.Map)||isCallableWithoutNew(globals.Set)||!supportsSubclassing(globals.Map,function(M){var m=new M([]);m.set(42,42);return m instanceof M})){globals.Map=collectionShims.Map;globals.Set=collectionShims.Set}}addIterator(Object.getPrototypeOf((new globals.Map).keys()));addIterator(Object.getPrototypeOf((new globals.Set).keys()))}return globals})}).call(this,require("_process"))},{_process:3}],5:[function(require,module,exports){"use strict";if(!require("./is-implemented")()){Object.defineProperty(require("es5-ext/global"),"Symbol",{value:require("./polyfill"),configurable:true,enumerable:false,writable:true})}},{"./is-implemented":6,"./polyfill":21,"es5-ext/global":8}],6:[function(require,module,exports){"use strict";module.exports=function(){var symbol;if(typeof Symbol!=="function")return false;symbol=Symbol("test symbol");try{String(symbol)}catch(e){return false}if(typeof Symbol.iterator==="symbol")return true;if(typeof Symbol.isConcatSpreadable!=="object")return false;if(typeof Symbol.isRegExp!=="object")return false;if(typeof Symbol.iterator!=="object")return false;if(typeof Symbol.toPrimitive!=="object")return false;if(typeof Symbol.toStringTag!=="object")return false;if(typeof Symbol.unscopables!=="object")return false;return true}},{}],7:[function(require,module,exports){"use strict";var assign=require("es5-ext/object/assign"),normalizeOpts=require("es5-ext/object/normalize-options"),isCallable=require("es5-ext/object/is-callable"),contains=require("es5-ext/string/#/contains"),d;d=module.exports=function(dscr,value){var c,e,w,options,desc;if(arguments.length<2||typeof dscr!=="string"){options=value;value=dscr;dscr=null}else{options=arguments[2]}if(dscr==null){c=w=true;e=false}else{c=contains.call(dscr,"c");e=contains.call(dscr,"e");w=contains.call(dscr,"w")}desc={value:value,configurable:c,enumerable:e,writable:w};return!options?desc:assign(normalizeOpts(options),desc)};d.gs=function(dscr,get,set){var c,e,options,desc;if(typeof dscr!=="string"){options=set;set=get;get=dscr;dscr=null}else{options=arguments[3]}if(get==null){get=undefined}else if(!isCallable(get)){options=get;get=set=undefined}else if(set==null){set=undefined}else if(!isCallable(set)){options=set;set=undefined}if(dscr==null){c=true;e=false}else{c=contains.call(dscr,"c");e=contains.call(dscr,"e")}desc={get:get,set:set,configurable:c,enumerable:e};return!options?desc:assign(normalizeOpts(options),desc)}},{"es5-ext/object/assign":9,"es5-ext/object/is-callable":12,"es5-ext/object/normalize-options":16,"es5-ext/string/#/contains":18}],8:[function(require,module,exports){"use strict";module.exports=new Function("return this")()},{}],9:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":10,"./shim":11}],10:[function(require,module,exports){"use strict";module.exports=function(){var assign=Object.assign,obj;if(typeof assign!=="function")return false;obj={foo:"raz"};assign(obj,{bar:"dwa"},{trzy:"trzy"});return obj.foo+obj.bar+obj.trzy==="razdwatrzy"}},{}],11:[function(require,module,exports){"use strict";var keys=require("../keys"),value=require("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,l=max(arguments.length,2),assign;dest=Object(value(dest));assign=function(key){try{dest[key]=src[key]}catch(e){if(!error)error=e}};for(i=1;i<l;++i){src=arguments[i];keys(src).forEach(assign)}if(error!==undefined)throw error;return dest}},{"../keys":13,"../valid-value":17}],12:[function(require,module,exports){"use strict";module.exports=function(obj){return typeof obj==="function"}},{}],13:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.keys:require("./shim")},{"./is-implemented":14,"./shim":15}],14:[function(require,module,exports){"use strict";module.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},{}],15:[function(require,module,exports){"use strict";var keys=Object.keys;module.exports=function(object){return keys(object==null?object:Object(object))}},{}],16:[function(require,module,exports){"use strict";var assign=require("./assign"),forEach=Array.prototype.forEach,create=Object.create,getPrototypeOf=Object.getPrototypeOf,process;process=function(src,obj){var proto=getPrototypeOf(src);return assign(proto?process(proto,obj):obj,src)};module.exports=function(options){var result=create(null);forEach.call(arguments,function(options){if(options==null)return;process(Object(options),result)});return result}},{"./assign":9}],17:[function(require,module,exports){"use strict";module.exports=function(value){if(value==null)throw new TypeError("Cannot use null or undefined");return value}},{}],18:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?String.prototype.contains:require("./shim")},{"./is-implemented":19,"./shim":20}],19:[function(require,module,exports){"use strict";var str="razdwatrzy";module.exports=function(){if(typeof str.contains!=="function")return false;return str.contains("dwa")===true&&str.contains("foo")===false}},{}],20:[function(require,module,exports){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],21:[function(require,module,exports){"use strict";var d=require("d"),create=Object.create,defineProperties=Object.defineProperties,generateName,Symbol;generateName=function(){var created=create(null);return function(desc){var postfix=0;while(created[desc+(postfix||"")])++postfix;desc+=postfix||"";created[desc]=true;return"@@"+desc}}();module.exports=Symbol=function(description){var symbol;if(this instanceof Symbol){throw new TypeError("TypeError: Symbol is not a constructor")}symbol=create(Symbol.prototype);description=description===undefined?"":String(description);return defineProperties(symbol,{__description__:d("",description),__name__:d("",generateName(description))})};Object.defineProperties(Symbol,{create:d("",Symbol("create")),hasInstance:d("",Symbol("hasInstance")),isConcatSpreadable:d("",Symbol("isConcatSpreadable")),isRegExp:d("",Symbol("isRegExp")),iterator:d("",Symbol("iterator")),toPrimitive:d("",Symbol("toPrimitive")),toStringTag:d("",Symbol("toStringTag")),unscopables:d("",Symbol("unscopables"))});defineProperties(Symbol.prototype,{properToString:d(function(){return"Symbol ("+this.__description__+")"}),toString:d("",function(){return this.__name__})});Object.defineProperty(Symbol.prototype,Symbol.toPrimitive,d("",function(hint){throw new TypeError("Conversion of symbol objects is not allowed")}));Object.defineProperty(Symbol.prototype,Symbol.toStringTag,d("c","Symbol"))},{d:7}]},{},[1]); |
docs/src/app/components/pages/components/Paper/ExampleRounded.js | lawrence-yu/material-ui | import React from 'react';
import Paper from 'material-ui/Paper';
const style = {
height: 100,
width: 100,
margin: 20,
textAlign: 'center',
display: 'inline-block',
};
const PaperExampleRounded = () => (
<div>
<Paper style={style} zDepth={1} rounded={false} />
<Paper style={style} zDepth={2} rounded={false} />
<Paper style={style} zDepth={3} rounded={false} />
<Paper style={style} zDepth={4} rounded={false} />
<Paper style={style} zDepth={5} rounded={false} />
</div>
);
export default PaperExampleRounded;
|
ajax/libs/analytics.js/1.5.3/analytics.min.js | mikaelbr/cdnjs | (function(){function require(path,parent,orig){var resolved=require.resolve(path);if(null==resolved){orig=orig||path;parent=parent||"root";var err=new Error('Failed to require "'+orig+'" from "'+parent+'"');err.path=orig;err.parent=parent;err.require=true;throw err}var module=require.modules[resolved];if(!module._resolving&&!module.exports){var mod={};mod.exports={};mod.client=mod.component=true;module._resolving=true;module.call(this,mod.exports,require.relative(resolved),mod);delete module._resolving;module.exports=mod.exports}return module.exports}require.modules={};require.aliases={};require.resolve=function(path){if(path.charAt(0)==="/")path=path.slice(1);var paths=[path,path+".js",path+".json",path+"/index.js",path+"/index.json"];for(var i=0;i<paths.length;i++){var path=paths[i];if(require.modules.hasOwnProperty(path))return path;if(require.aliases.hasOwnProperty(path))return require.aliases[path]}};require.normalize=function(curr,path){var segs=[];if("."!=path.charAt(0))return path;curr=curr.split("/");path=path.split("/");for(var i=0;i<path.length;++i){if(".."==path[i]){curr.pop()}else if("."!=path[i]&&""!=path[i]){segs.push(path[i])}}return curr.concat(segs).join("/")};require.register=function(path,definition){require.modules[path]=definition};require.alias=function(from,to){if(!require.modules.hasOwnProperty(from)){throw new Error('Failed to alias "'+from+'", it does not exist')}require.aliases[to]=from};require.relative=function(parent){var p=require.normalize(parent,"..");function lastIndexOf(arr,obj){var i=arr.length;while(i--){if(arr[i]===obj)return i}return-1}function localRequire(path){var resolved=localRequire.resolve(path);return require(resolved,parent,path)}localRequire.resolve=function(path){var c=path.charAt(0);if("/"==c)return path.slice(1);if("."==c)return require.normalize(p,path);var segs=parent.split("/");var i=lastIndexOf(segs,"deps")+1;if(!i)i=0;path=segs.slice(0,i+1).join("/")+"/deps/"+path;return path};localRequire.exists=function(path){return require.modules.hasOwnProperty(localRequire.resolve(path))};return localRequire};require.register("avetisk-defaults/index.js",function(exports,require,module){"use strict";var defaults=function(dest,src,recursive){for(var prop in src){if(recursive&&dest[prop]instanceof Object&&src[prop]instanceof Object){dest[prop]=defaults(dest[prop],src[prop],true)}else if(!(prop in dest)){dest[prop]=src[prop]}}return dest};module.exports=defaults});require.register("component-type/index.js",function(exports,require,module){var toString=Object.prototype.toString;module.exports=function(val){switch(toString.call(val)){case"[object Function]":return"function";case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object String]":return"string"}if(val===null)return"null";if(val===undefined)return"undefined";if(val&&val.nodeType===1)return"element";if(val===Object(val))return"object";return typeof val}});require.register("component-clone/index.js",function(exports,require,module){var type;try{type=require("type")}catch(e){type=require("type-component")}module.exports=clone;function clone(obj){switch(type(obj)){case"object":var copy={};for(var key in obj){if(obj.hasOwnProperty(key)){copy[key]=clone(obj[key])}}return copy;case"array":var copy=new Array(obj.length);for(var i=0,l=obj.length;i<l;i++){copy[i]=clone(obj[i])}return copy;case"regexp":var flags="";flags+=obj.multiline?"m":"";flags+=obj.global?"g":"";flags+=obj.ignoreCase?"i":"";return new RegExp(obj.source,flags);case"date":return new Date(obj.getTime());default:return obj}}});require.register("component-cookie/index.js",function(exports,require,module){var encode=encodeURIComponent;var decode=decodeURIComponent;module.exports=function(name,value,options){switch(arguments.length){case 3:case 2:return set(name,value,options);case 1:return get(name);default:return all()}};function set(name,value,options){options=options||{};var str=encode(name)+"="+encode(value);if(null==value)options.maxage=-1;if(options.maxage){options.expires=new Date(+new Date+options.maxage)}if(options.path)str+="; path="+options.path;if(options.domain)str+="; domain="+options.domain;if(options.expires)str+="; expires="+options.expires.toGMTString();if(options.secure)str+="; secure";document.cookie=str}function all(){return parse(document.cookie)}function get(name){return all()[name]}function parse(str){var obj={};var pairs=str.split(/ *; */);var pair;if(""==pairs[0])return obj;for(var i=0;i<pairs.length;++i){pair=pairs[i].split("=");obj[decode(pair[0])]=decode(pair[1])}return obj}});require.register("component-each/index.js",function(exports,require,module){var type=require("type");var has=Object.prototype.hasOwnProperty;module.exports=function(obj,fn){switch(type(obj)){case"array":return array(obj,fn);case"object":if("number"==typeof obj.length)return array(obj,fn);return object(obj,fn);case"string":return string(obj,fn)}};function string(obj,fn){for(var i=0;i<obj.length;++i){fn(obj.charAt(i),i)}}function object(obj,fn){for(var key in obj){if(has.call(obj,key)){fn(key,obj[key])}}}function array(obj,fn){for(var i=0;i<obj.length;++i){fn(obj[i],i)}}});require.register("component-indexof/index.js",function(exports,require,module){module.exports=function(arr,obj){if(arr.indexOf)return arr.indexOf(obj);for(var i=0;i<arr.length;++i){if(arr[i]===obj)return i}return-1}});require.register("component-emitter/index.js",function(exports,require,module){var index=require("indexof");module.exports=Emitter;function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[event]=this._callbacks[event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){var self=this;this._callbacks=this._callbacks||{};function on(){self.off(event,on);fn.apply(this,arguments)}fn._off=on;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[event];return this}var i=index(callbacks,fn._off||fn);if(~i)callbacks.splice(i,1);return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=[].slice.call(arguments,1),callbacks=this._callbacks[event];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i){callbacks[i].apply(this,args)}}return this};Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length}});require.register("component-event/index.js",function(exports,require,module){exports.bind=function(el,type,fn,capture){if(el.addEventListener){el.addEventListener(type,fn,capture||false)}else{el.attachEvent("on"+type,fn)}return fn};exports.unbind=function(el,type,fn,capture){if(el.removeEventListener){el.removeEventListener(type,fn,capture||false)}else{el.detachEvent("on"+type,fn)}return fn}});require.register("component-inherit/index.js",function(exports,require,module){module.exports=function(a,b){var fn=function(){};fn.prototype=b.prototype;a.prototype=new fn;a.prototype.constructor=a}});require.register("component-object/index.js",function(exports,require,module){var has=Object.prototype.hasOwnProperty;exports.keys=Object.keys||function(obj){var keys=[];for(var key in obj){if(has.call(obj,key)){keys.push(key)}}return keys};exports.values=function(obj){var vals=[];for(var key in obj){if(has.call(obj,key)){vals.push(obj[key])}}return vals};exports.merge=function(a,b){for(var key in b){if(has.call(b,key)){a[key]=b[key]}}return a};exports.length=function(obj){return exports.keys(obj).length};exports.isEmpty=function(obj){return 0==exports.length(obj)}});require.register("component-trim/index.js",function(exports,require,module){exports=module.exports=trim;function trim(str){if(str.trim)return str.trim();return str.replace(/^\s*|\s*$/g,"")}exports.left=function(str){if(str.trimLeft)return str.trimLeft();return str.replace(/^\s*/,"")};exports.right=function(str){if(str.trimRight)return str.trimRight();return str.replace(/\s*$/,"")}});require.register("component-querystring/index.js",function(exports,require,module){var encode=encodeURIComponent;var decode=decodeURIComponent;var trim=require("trim");var type=require("type");exports.parse=function(str){if("string"!=typeof str)return{};str=trim(str);if(""==str)return{};if("?"==str.charAt(0))str=str.slice(1);var obj={};var pairs=str.split("&");for(var i=0;i<pairs.length;i++){var parts=pairs[i].split("=");var key=decode(parts[0]);var m;if(m=/(\w+)\[(\d+)\]/.exec(key)){obj[m[1]]=obj[m[1]]||[];obj[m[1]][m[2]]=decode(parts[1]);continue}obj[parts[0]]=null==parts[1]?"":decode(parts[1])}return obj};exports.stringify=function(obj){if(!obj)return"";var pairs=[];for(var key in obj){var value=obj[key];if("array"==type(value)){for(var i=0;i<value.length;++i){pairs.push(encode(key+"["+i+"]")+"="+encode(value[i]))}continue}pairs.push(encode(key)+"="+encode(obj[key]))}return pairs.join("&")}});require.register("component-url/index.js",function(exports,require,module){exports.parse=function(url){var a=document.createElement("a");a.href=url;return{href:a.href,host:a.host,port:a.port,hash:a.hash,hostname:a.hostname,pathname:a.pathname,protocol:a.protocol,search:a.search,query:a.search.slice(1)}};exports.isAbsolute=function(url){if(0==url.indexOf("//"))return true;if(~url.indexOf("://"))return true;return false};exports.isRelative=function(url){return!exports.isAbsolute(url)};exports.isCrossDomain=function(url){url=exports.parse(url);return url.hostname!=location.hostname||url.port!=location.port||url.protocol!=location.protocol}});require.register("component-bind/index.js",function(exports,require,module){var slice=[].slice;module.exports=function(obj,fn){if("string"==typeof fn)fn=obj[fn];if("function"!=typeof fn)throw new Error("bind() requires a function");var args=slice.call(arguments,2);return function(){return fn.apply(obj,args.concat(slice.call(arguments)))}}});require.register("segmentio-bind-all/index.js",function(exports,require,module){try{var bind=require("bind");var type=require("type")}catch(e){var bind=require("bind-component");var type=require("type-component")}module.exports=function(obj){for(var key in obj){var val=obj[key];if(type(val)==="function")obj[key]=bind(obj,obj[key])}return obj}});require.register("ianstormtaylor-bind/index.js",function(exports,require,module){try{var bind=require("bind")}catch(e){var bind=require("bind-component")}var bindAll=require("bind-all");module.exports=exports=bind;exports.all=bindAll;exports.methods=bindMethods;function bindMethods(obj,methods){methods=[].slice.call(arguments,1);for(var i=0,method;method=methods[i];i++){obj[method]=bind(obj,obj[method])}return obj}});require.register("timoxley-next-tick/index.js",function(exports,require,module){"use strict";if(typeof setImmediate=="function"){module.exports=function(f){setImmediate(f)}}else if(typeof process!="undefined"&&typeof process.nextTick=="function"){module.exports=process.nextTick}else if(typeof window=="undefined"||window.ActiveXObject||!window.postMessage){module.exports=function(f){setTimeout(f)}}else{var q=[];window.addEventListener("message",function(){var i=0;while(i<q.length){try{q[i++]()}catch(e){q=q.slice(i);window.postMessage("tic!","*");throw e}}q.length=0},true);module.exports=function(fn){if(!q.length)window.postMessage("tic!","*");q.push(fn)}}});require.register("ianstormtaylor-callback/index.js",function(exports,require,module){var next=require("next-tick");module.exports=callback;function callback(fn){if("function"===typeof fn)fn()}callback.async=function(fn,wait){if("function"!==typeof fn)return;if(!wait)return next(fn);setTimeout(fn,wait)};callback.sync=callback});require.register("ianstormtaylor-is-empty/index.js",function(exports,require,module){module.exports=isEmpty;var has=Object.prototype.hasOwnProperty;function isEmpty(val){if(null==val)return true;if("number"==typeof val)return 0===val;if(undefined!==val.length)return 0===val.length;for(var key in val)if(has.call(val,key))return false;return true}});require.register("ianstormtaylor-is/index.js",function(exports,require,module){var isEmpty=require("is-empty");try{var typeOf=require("type")}catch(e){var typeOf=require("component-type")}var types=["arguments","array","boolean","date","element","function","null","number","object","regexp","string","undefined"];for(var i=0,type;type=types[i];i++)exports[type]=generate(type);exports.fn=exports["function"];exports.empty=isEmpty;exports.nan=function(val){return exports.number(val)&&val!=val};function generate(type){return function(value){return type===typeOf(value)}}});require.register("segmentio-after/index.js",function(exports,require,module){module.exports=function after(times,func){if(times<=0)return func();return function(){if(--times<1){return func.apply(this,arguments)}}}});require.register("component-domify/index.js",function(exports,require,module){module.exports=parse;var map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};map.td=map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"];map.option=map.optgroup=[1,'<select multiple="multiple">',"</select>"];map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,"<table>","</table>"];map.text=map.circle=map.ellipse=map.line=map.path=map.polygon=map.polyline=map.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function parse(html){if("string"!=typeof html)throw new TypeError("String expected");html=html.replace(/^\s+|\s+$/g,"");var m=/<([\w:]+)/.exec(html);if(!m)return document.createTextNode(html);var tag=m[1];if(tag=="body"){var el=document.createElement("html");el.innerHTML=html;return el.removeChild(el.lastChild)}var wrap=map[tag]||map._default;var depth=wrap[0];var prefix=wrap[1];var suffix=wrap[2];var el=document.createElement("div");el.innerHTML=prefix+html+suffix;while(depth--)el=el.lastChild;if(el.firstChild==el.lastChild){return el.removeChild(el.firstChild)}var fragment=document.createDocumentFragment();while(el.firstChild){fragment.appendChild(el.removeChild(el.firstChild))}return fragment}});require.register("component-once/index.js",function(exports,require,module){var n=0;var global=function(){return this}();module.exports=function(fn){var id=n++;function once(){if(this==global){if(once.called)return;once.called=true;return fn.apply(this,arguments)}var key="__called_"+id+"__";if(this[key])return;this[key]=true;return fn.apply(this,arguments)}return once}});require.register("ianstormtaylor-to-no-case/index.js",function(exports,require,module){module.exports=toNoCase;var hasSpace=/\s/;var hasCamel=/[a-z][A-Z]/;var hasSeparator=/[\W_]/;function toNoCase(string){if(hasSpace.test(string))return string.toLowerCase();if(hasSeparator.test(string))string=unseparate(string);if(hasCamel.test(string))string=uncamelize(string);return string.toLowerCase()}var separatorSplitter=/[\W_]+(.|$)/g;function unseparate(string){return string.replace(separatorSplitter,function(m,next){return next?" "+next:""})}var camelSplitter=/(.)([A-Z]+)/g;function uncamelize(string){return string.replace(camelSplitter,function(m,previous,uppers){return previous+" "+uppers.toLowerCase().split("").join(" ")})}});require.register("ianstormtaylor-to-space-case/index.js",function(exports,require,module){var clean=require("to-no-case");module.exports=toSpaceCase;function toSpaceCase(string){return clean(string).replace(/[\W_]+(.|$)/g,function(matches,match){return match?" "+match:""})}});require.register("ianstormtaylor-to-snake-case/index.js",function(exports,require,module){var toSpace=require("to-space-case");module.exports=toSnakeCase;function toSnakeCase(string){return toSpace(string).replace(/\s/g,"_")}});require.register("segmentio-alias/index.js",function(exports,require,module){var type=require("type");try{var clone=require("clone")}catch(e){var clone=require("clone-component")}module.exports=alias;function alias(obj,method){switch(type(method)){case"object":return aliasByDictionary(clone(obj),method);case"function":return aliasByFunction(clone(obj),method)}}function aliasByDictionary(obj,aliases){for(var key in aliases){if(undefined===obj[key])continue;obj[aliases[key]]=obj[key];delete obj[key]}return obj}function aliasByFunction(obj,convert){var output={};for(var key in obj)output[convert(key)]=obj[key];return output}});require.register("segmentio-analytics.js-integration/lib/index.js",function(exports,require,module){var bind=require("bind");var callback=require("callback");var clone=require("clone");var debug=require("debug");var defaults=require("defaults");var protos=require("./protos");var slug=require("slug");var statics=require("./statics");module.exports=createIntegration;function createIntegration(name){function Integration(options){this.debug=debug("analytics:integration:"+slug(name));this.options=defaults(clone(options)||{},this.defaults);this._queue=[];this.once("ready",bind(this,this.flush));Integration.emit("construct",this);this._wrapInitialize();this._wrapLoad();this._wrapPage();this._wrapTrack()}Integration.prototype.defaults={};Integration.prototype.globals=[];Integration.prototype.name=name;for(var key in statics)Integration[key]=statics[key];for(var key in protos)Integration.prototype[key]=protos[key];return Integration}});require.register("segmentio-analytics.js-integration/lib/protos.js",function(exports,require,module){var normalize=require("to-no-case");var after=require("after");var callback=require("callback");var Emitter=require("emitter");var tick=require("next-tick");var events=require("./events");var type=require("type");Emitter(exports);exports.initialize=function(){this.load()};exports.loaded=function(){return false};exports.load=function(cb){callback.async(cb)};exports.page=function(page){};exports.track=function(track){};exports.map=function(obj,str){var a=normalize(str);var ret=[];if(!obj)return ret;if("object"==type(obj)){for(var k in obj){var item=obj[k];var b=normalize(k);if(b==a)ret.push(item)}}if("array"==type(obj)){if(!obj.length)return ret;if(!obj[0].key)return ret;for(var i=0;i<obj.length;++i){var item=obj[i];var b=normalize(item.key);if(b==a)ret.push(item.value)}}return ret};exports.invoke=function(method){if(!this[method])return;var args=[].slice.call(arguments,1);if(!this._ready)return this.queue(method,args);var ret;try{this.debug("%s with %o",method,args);ret=this[method].apply(this,args)}catch(e){this.debug("error %o calling %s with %o",e,method,args)}return ret};exports.queue=function(method,args){if("page"==method&&this._assumesPageview&&!this._initialized){return this.page.apply(this,args)}this._queue.push({method:method,args:args})};exports.flush=function(){this._ready=true;var call;while(call=this._queue.shift())this[call.method].apply(this,call.args)};exports.reset=function(){for(var i=0,key;key=this.globals[i];i++)window[key]=undefined};exports._wrapInitialize=function(){var initialize=this.initialize;this.initialize=function(){this.debug("initialize");this._initialized=true;var ret=initialize.apply(this,arguments);this.emit("initialize");var self=this;if(this._readyOnInitialize){tick(function(){self.emit("ready")})}return ret};if(this._assumesPageview)this.initialize=after(2,this.initialize)};exports._wrapLoad=function(){var load=this.load;this.load=function(callback){var self=this;this.debug("loading");if(this.loaded()){this.debug("already loaded");tick(function(){if(self._readyOnLoad)self.emit("ready");callback&&callback()});return}return load.call(this,function(err,e){self.debug("loaded");self.emit("load");if(self._readyOnLoad)self.emit("ready");callback&&callback(err,e)})}};exports._wrapPage=function(){var page=this.page;this.page=function(){if(this._assumesPageview&&!this._initialized){return this.initialize.apply(this,arguments)}return page.apply(this,arguments)}};exports._wrapTrack=function(){var t=this.track;this.track=function(track){var event=track.event();var called;var ret;for(var method in events){var regexp=events[method];if(!this[method])continue;if(!regexp.test(event))continue;ret=this[method].apply(this,arguments);called=true;break}if(!called)ret=t.apply(this,arguments);return ret}}});require.register("segmentio-analytics.js-integration/lib/events.js",function(exports,require,module){module.exports={removedProduct:/removed[ _]?product/i,viewedProduct:/viewed[ _]?product/i,addedProduct:/added[ _]?product/i,completedOrder:/completed[ _]?order/i}});require.register("segmentio-analytics.js-integration/lib/statics.js",function(exports,require,module){var after=require("after");var Emitter=require("emitter");Emitter(exports);exports.option=function(key,value){this.prototype.defaults[key]=value;return this};exports.mapping=function(name){this.option(name,[]);this.prototype[name]=function(str){return this.map(this.options[name],str)};return this};exports.global=function(key){this.prototype.globals.push(key);return this};exports.assumesPageview=function(){this.prototype._assumesPageview=true;return this};exports.readyOnLoad=function(){this.prototype._readyOnLoad=true;return this};exports.readyOnInitialize=function(){this.prototype._readyOnInitialize=true;return this}});require.register("segmentio-convert-dates/index.js",function(exports,require,module){var is=require("is");try{var clone=require("clone")}catch(e){var clone=require("clone-component")}module.exports=convertDates;function convertDates(obj,convert){obj=clone(obj);for(var key in obj){var val=obj[key];if(is.date(val))obj[key]=convert(val);if(is.object(val))obj[key]=convertDates(val,convert)}return obj}});require.register("segmentio-global-queue/index.js",function(exports,require,module){module.exports=generate;function generate(name,options){options=options||{};return function(args){args=[].slice.call(arguments);window[name]||(window[name]=[]);options.wrap===false?window[name].push.apply(window[name],args):window[name].push(args)}}});require.register("segmentio-load-date/index.js",function(exports,require,module){var time=new Date,perf=window.performance;if(perf&&perf.timing&&perf.timing.responseEnd){time=new Date(perf.timing.responseEnd)}module.exports=time});require.register("segmentio-load-script/index.js",function(exports,require,module){var type=require("type");module.exports=function loadScript(options,callback){if(!options)throw new Error("Cant load nothing...");if(type(options)==="string")options={src:options};var https=document.location.protocol==="https:"||document.location.protocol==="chrome-extension:";if(options.src&&options.src.indexOf("//")===0){options.src=https?"https:"+options.src:"http:"+options.src}if(https&&options.https)options.src=options.https;else if(!https&&options.http)options.src=options.http;var script=document.createElement("script");script.type="text/javascript";script.async=true;script.src=options.src;var firstScript=document.getElementsByTagName("script")[0];firstScript.parentNode.insertBefore(script,firstScript);if(callback&&type(callback)==="function"){if(script.addEventListener){script.addEventListener("load",function(event){callback(null,event)},false);script.addEventListener("error",function(event){callback(new Error("Failed to load the script."),event)},false)}else if(script.attachEvent){script.attachEvent("onreadystatechange",function(event){if(/complete|loaded/.test(script.readyState)){callback(null,event)}})}}return script}});require.register("segmentio-script-onload/index.js",function(exports,require,module){module.exports=function(el,fn){return el.addEventListener?add(el,fn):attach(el,fn)};function add(el,fn){el.addEventListener("load",function(_,e){fn(null,e)},false);el.addEventListener("error",function(e){var err=new Error('failed to load the script "'+el.src+'"');err.event=e;fn(err)},false)}function attach(el,fn){el.attachEvent("onreadystatechange",function(e){if(!/complete|loaded/.test(el.readyState))return;fn(null,e)})}});require.register("segmentio-on-body/index.js",function(exports,require,module){var each=require("each");var body=false;var callbacks=[];module.exports=function onBody(callback){if(body){call(callback)}else{callbacks.push(callback)}};var interval=setInterval(function(){if(!document.body)return;body=true;each(callbacks,call);clearInterval(interval)},5);function call(callback){callback(document.body)}});require.register("segmentio-on-error/index.js",function(exports,require,module){module.exports=onError;var callbacks=[];if("function"==typeof window.onerror)callbacks.push(window.onerror);window.onerror=handler;function handler(){for(var i=0,fn;fn=callbacks[i];i++)fn.apply(this,arguments)}function onError(fn){callbacks.push(fn);if(window.onerror!=handler){callbacks.push(window.onerror);window.onerror=handler}}});require.register("segmentio-to-iso-string/index.js",function(exports,require,module){module.exports=toIsoString;function toIsoString(date){return date.getUTCFullYear()+"-"+pad(date.getUTCMonth()+1)+"-"+pad(date.getUTCDate())+"T"+pad(date.getUTCHours())+":"+pad(date.getUTCMinutes())+":"+pad(date.getUTCSeconds())+"."+String((date.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}function pad(number){var n=number.toString();return n.length===1?"0"+n:n}});require.register("segmentio-to-unix-timestamp/index.js",function(exports,require,module){module.exports=toUnixTimestamp;function toUnixTimestamp(date){return Math.floor(date.getTime()/1e3)}});require.register("segmentio-use-https/index.js",function(exports,require,module){module.exports=function(url){switch(arguments.length){case 0:return check();case 1:return transform(url)}};function transform(url){return check()?"https:"+url:"http:"+url}function check(){return location.protocol=="https:"||location.protocol=="chrome-extension:"}});require.register("segmentio-when/index.js",function(exports,require,module){var callback=require("callback");module.exports=when;function when(condition,fn,interval){if(condition())return callback.async(fn);var ref=setInterval(function(){if(!condition())return;callback(fn);clearInterval(ref)},interval||10)}});require.register("yields-slug/index.js",function(exports,require,module){module.exports=function(str,options){options||(options={});return str.toLowerCase().replace(options.replace||/[^a-z0-9]/g," ").replace(/^ +| +$/g,"").replace(/ +/g,options.separator||"-")}});require.register("visionmedia-batch/index.js",function(exports,require,module){try{var EventEmitter=require("events").EventEmitter}catch(err){var Emitter=require("emitter")}function noop(){}module.exports=Batch;function Batch(){if(!(this instanceof Batch))return new Batch;this.fns=[];this.concurrency(Infinity);this.throws(true);for(var i=0,len=arguments.length;i<len;++i){this.push(arguments[i])}}if(EventEmitter){Batch.prototype.__proto__=EventEmitter.prototype}else{Emitter(Batch.prototype)}Batch.prototype.concurrency=function(n){this.n=n;return this};Batch.prototype.push=function(fn){this.fns.push(fn);return this};Batch.prototype.throws=function(throws){this.e=!!throws;return this};Batch.prototype.end=function(cb){var self=this,total=this.fns.length,pending=total,results=[],errors=[],cb=cb||noop,fns=this.fns,max=this.n,throws=this.e,index=0,done;if(!fns.length)return cb(null,results);function next(){var i=index++;var fn=fns[i];if(!fn)return;var start=new Date;try{fn(callback)}catch(err){callback(err)}function callback(err,res){if(done)return;if(err&&throws)return done=true,cb(err);var complete=total-pending+1;var end=new Date;results[i]=res;errors[i]=err;self.emit("progress",{index:i,value:res,error:err,pending:pending,total:total,complete:complete,percent:complete/total*100|0,start:start,end:end,duration:end-start});if(--pending)next();else if(!throws)cb(errors,results);else cb(null,results)}}for(var i=0;i<fns.length;i++){if(i==max)break;next()}return this}});require.register("segmentio-substitute/index.js",function(exports,require,module){module.exports=substitute;function substitute(str,obj,expr){if(!obj)throw new TypeError("expected an object");expr=expr||/:(\w+)/g;return str.replace(expr,function(_,prop){return null!=obj[prop]?obj[prop]:_})}});require.register("segmentio-load-pixel/index.js",function(exports,require,module){var stringify=require("querystring").stringify;var sub=require("substitute");module.exports=function(path){return function(query,obj,fn){if("function"==typeof obj)fn=obj,obj={};obj=obj||{};fn=fn||function(){};var url=sub(path,obj);var img=new Image;img.onerror=error(fn,"failed to load pixel",img);img.onload=function(){fn()};query=stringify(query);if(query)query="?"+query;img.src=url+query;img.width=1;img.height=1;return img}};function error(fn,message,img){return function(e){e=e||window.event;var err=new Error(message);err.event=e;err.source=img;fn(err)}}});require.register("segmentio-replace-document-write/index.js",function(exports,require,module){var domify=require("domify");module.exports=function(match,parent,fn){var write=document.write;document.write=append;if(typeof parent==="function")fn=parent,parent=null;if(!parent)parent=document.body;function append(str){var el=domify(str);var src=el.src||"";if(el.src.indexOf(match)===-1)return write(str);if("SCRIPT"==el.tagName)el=recreate(el);parent.appendChild(el);document.write=write;fn&&fn()}};function recreate(script){var ret=document.createElement("script");ret.src=script.src;ret.async=script.async;ret.defer=script.defer;return ret}});require.register("ianstormtaylor-to-camel-case/index.js",function(exports,require,module){var toSpace=require("to-space-case");module.exports=toCamelCase;function toCamelCase(string){return toSpace(string).replace(/\s(\w)/g,function(matches,letter){return letter.toUpperCase()})}});require.register("ianstormtaylor-to-capital-case/index.js",function(exports,require,module){var clean=require("to-no-case");module.exports=toCapitalCase;function toCapitalCase(string){return clean(string).replace(/(^|\s)(\w)/g,function(matches,previous,letter){return previous+letter.toUpperCase()})}});require.register("ianstormtaylor-to-constant-case/index.js",function(exports,require,module){var snake=require("to-snake-case");module.exports=toConstantCase;function toConstantCase(string){return snake(string).toUpperCase()}});require.register("ianstormtaylor-to-dot-case/index.js",function(exports,require,module){var toSpace=require("to-space-case");module.exports=toDotCase;function toDotCase(string){return toSpace(string).replace(/\s/g,".")}});require.register("ianstormtaylor-to-pascal-case/index.js",function(exports,require,module){var toSpace=require("to-space-case");module.exports=toPascalCase;function toPascalCase(string){return toSpace(string).replace(/(?:^|\s)(\w)/g,function(matches,letter){return letter.toUpperCase()})}});require.register("ianstormtaylor-to-sentence-case/index.js",function(exports,require,module){var clean=require("to-no-case");module.exports=toSentenceCase;function toSentenceCase(string){return clean(string).replace(/[a-z]/i,function(letter){return letter.toUpperCase()})}});require.register("ianstormtaylor-to-slug-case/index.js",function(exports,require,module){var toSpace=require("to-space-case");module.exports=toSlugCase;function toSlugCase(string){return toSpace(string).replace(/\s/g,"-")}});require.register("component-escape-regexp/index.js",function(exports,require,module){module.exports=function(str){return String(str).replace(/([.*+?=^!:${}()|[\]\/\\])/g,"\\$1")}});require.register("ianstormtaylor-map/index.js",function(exports,require,module){var each=require("each");
module.exports=function map(obj,iterator){var arr=[];each(obj,function(o){arr.push(iterator.apply(null,arguments))});return arr}});require.register("ianstormtaylor-title-case-minors/index.js",function(exports,require,module){module.exports=["a","an","and","as","at","but","by","en","for","from","how","if","in","neither","nor","of","on","only","onto","out","or","per","so","than","that","the","to","until","up","upon","v","v.","versus","vs","vs.","via","when","with","without","yet"]});require.register("ianstormtaylor-to-title-case/index.js",function(exports,require,module){var capital=require("to-capital-case"),escape=require("escape-regexp"),map=require("map"),minors=require("title-case-minors");module.exports=toTitleCase;var escaped=map(minors,escape);var minorMatcher=new RegExp("[^^]\\b("+escaped.join("|")+")\\b","ig");var colonMatcher=/:\s*(\w)/g;function toTitleCase(string){return capital(string).replace(minorMatcher,function(minor){return minor.toLowerCase()}).replace(colonMatcher,function(letter){return letter.toUpperCase()})}});require.register("ianstormtaylor-case/lib/index.js",function(exports,require,module){var cases=require("./cases");module.exports=exports=determineCase;function determineCase(string){for(var key in cases){if(key=="none")continue;var convert=cases[key];if(convert(string)==string)return key}return null}exports.add=function(name,convert){exports[name]=cases[name]=convert};for(var key in cases){exports.add(key,cases[key])}});require.register("ianstormtaylor-case/lib/cases.js",function(exports,require,module){var camel=require("to-camel-case"),capital=require("to-capital-case"),constant=require("to-constant-case"),dot=require("to-dot-case"),none=require("to-no-case"),pascal=require("to-pascal-case"),sentence=require("to-sentence-case"),slug=require("to-slug-case"),snake=require("to-snake-case"),space=require("to-space-case"),title=require("to-title-case");exports.camel=camel;exports.pascal=pascal;exports.dot=dot;exports.slug=slug;exports.snake=snake;exports.space=space;exports.constant=constant;exports.capital=capital;exports.title=title;exports.sentence=sentence;exports.lower=function(string){return none(string).toLowerCase()};exports.upper=function(string){return none(string).toUpperCase()};exports.inverse=function(string){for(var i=0,char;char=string[i];i++){if(!/[a-z]/i.test(char))continue;var upper=char.toUpperCase();var lower=char.toLowerCase();string[i]=char==upper?lower:upper}return string};exports.none=none});require.register("segmentio-obj-case/index.js",function(exports,require,module){var Case=require("case");var cases=[Case.upper,Case.lower,Case.snake,Case.pascal,Case.camel,Case.constant,Case.title,Case.capital,Case.sentence];module.exports=module.exports.find=multiple(find);module.exports.replace=function(obj,key,val){multiple(replace).apply(this,arguments);return obj};module.exports.del=function(obj,key){multiple(del).apply(this,arguments);return obj};function multiple(fn){return function(obj,key,val){var keys=key.split(".");if(keys.length===0)return;while(keys.length>1){key=keys.shift();obj=find(obj,key);if(obj===null||obj===undefined)return}key=keys.shift();return fn(obj,key,val)}}function find(obj,key){for(var i=0;i<cases.length;i++){var cased=cases[i](key);if(obj.hasOwnProperty(cased))return obj[cased]}}function del(obj,key){for(var i=0;i<cases.length;i++){var cased=cases[i](key);if(obj.hasOwnProperty(cased))delete obj[cased]}return obj}function replace(obj,key,val){for(var i=0;i<cases.length;i++){var cased=cases[i](key);if(obj.hasOwnProperty(cased))obj[cased]=val}return obj}});require.register("segmentio-analytics.js-integrations/index.js",function(exports,require,module){var integrations=require("./lib/slugs");var each=require("each");each(integrations,function(slug){var plugin=require("./lib/"+slug);var name=plugin.Integration.prototype.name;exports[name]=plugin})});require.register("segmentio-analytics.js-integrations/lib/adroll.js",function(exports,require,module){var integration=require("integration");var is=require("is");var load=require("load-script");var user;var has=Object.prototype.hasOwnProperty;module.exports=exports=function(analytics){analytics.addIntegration(AdRoll);user=analytics.user()};var AdRoll=exports.Integration=integration("AdRoll").assumesPageview().readyOnLoad().global("__adroll_loaded").global("adroll_adv_id").global("adroll_pix_id").global("adroll_custom_data").option("events",{}).option("advId","").option("pixId","");AdRoll.prototype.initialize=function(page){window.adroll_adv_id=this.options.advId;window.adroll_pix_id=this.options.pixId;if(user.id())window.adroll_custom_data={USER_ID:user.id()};window.__adroll_loaded=true;this.load()};AdRoll.prototype.loaded=function(){return window.__adroll};AdRoll.prototype.load=function(callback){load({http:"http://a.adroll.com/j/roundtrip.js",https:"https://s.adroll.com/j/roundtrip.js"},callback)};AdRoll.prototype.track=function(track){var events=this.options.events;var total=track.revenue();var event=track.event();if(has.call(events,event))event=events[event];window.__adroll.record_user({adroll_conversion_value_in_dollars:total||0,order_id:track.orderId()||0,adroll_segments:event})}});require.register("segmentio-analytics.js-integrations/lib/adwords.js",function(exports,require,module){var onbody=require("on-body");var integration=require("integration");var load=require("load-script");var domify=require("domify");module.exports=exports=function(analytics){analytics.addIntegration(AdWords)};var has=Object.prototype.hasOwnProperty;var AdWords=exports.Integration=integration("AdWords").readyOnLoad().option("conversionId","").option("events",{});AdWords.prototype.load=function(fn){onbody(fn)};AdWords.prototype.loaded=function(){return!!document.body};AdWords.prototype.track=function(track){var id=this.options.conversionId;var events=this.options.events;var event=track.event();if(!has.call(events,event))return;return this.conversion({value:track.revenue()||0,label:events[event],conversionId:id})};AdWords.prototype.conversion=function(obj,fn){if(this.reporting)return this.wait(obj);this.reporting=true;this.debug("sending %o",obj);var self=this;var write=document.write;document.write=append;window.google_conversion_id=obj.conversionId;window.google_conversion_language="en";window.google_conversion_format="3";window.google_conversion_color="ffffff";window.google_conversion_label=obj.label;window.google_conversion_value=obj.value;window.google_remarketing_only=false;load("//www.googleadservices.com/pagead/conversion.js",fn);function append(str){var el=domify(str);if(!el.src)return write(str);if(!/googleadservices/.test(el.src))return write(str);self.debug("append %o",el);document.body.appendChild(el);document.write=write;self.reporting=null}};AdWords.prototype.wait=function(obj){var self=this;var id=setTimeout(function(){clearTimeout(id);self.conversion(obj)},50)}});require.register("segmentio-analytics.js-integrations/lib/alexa.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Alexa)};var Alexa=exports.Integration=integration("Alexa").assumesPageview().readyOnLoad().global("_atrk_opts").option("account",null).option("domain","").option("dynamic",true);Alexa.prototype.initialize=function(page){window._atrk_opts={atrk_acct:this.options.account,domain:this.options.domain,dynamic:this.options.dynamic};this.load()};Alexa.prototype.loaded=function(){return!!window.atrk};Alexa.prototype.load=function(callback){load("//d31qbv1cthcecs.cloudfront.net/atrk.js",function(err){if(err)return callback(err);window.atrk();callback()})}});require.register("segmentio-analytics.js-integrations/lib/amplitude.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Amplitude)};var Amplitude=exports.Integration=integration("Amplitude").assumesPageview().readyOnInitialize().global("amplitude").option("apiKey","").option("trackAllPages",false).option("trackNamedPages",true).option("trackCategorizedPages",true);Amplitude.prototype.initialize=function(page){(function(e,t){var r=e.amplitude||{};r._q=[];function i(e){r[e]=function(){r._q.push([e].concat(Array.prototype.slice.call(arguments,0)))}}var s=["init","logEvent","setUserId","setGlobalUserProperties","setVersionName","setDomain"];for(var c=0;c<s.length;c++){i(s[c])}e.amplitude=r})(window,document);window.amplitude.init(this.options.apiKey);this.load()};Amplitude.prototype.loaded=function(){return!!(window.amplitude&&window.amplitude.options)};Amplitude.prototype.load=function(callback){load("https://d24n15hnbwhuhn.cloudfront.net/libs/amplitude-1.1-min.js",callback)};Amplitude.prototype.page=function(page){var properties=page.properties();var category=page.category();var name=page.fullName();var opts=this.options;if(opts.trackAllPages){this.track(page.track())}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};Amplitude.prototype.identify=function(identify){var id=identify.userId();var traits=identify.traits();if(id)window.amplitude.setUserId(id);if(traits)window.amplitude.setGlobalUserProperties(traits)};Amplitude.prototype.track=function(track){var props=track.properties();var event=track.event();window.amplitude.logEvent(event,props)}});require.register("segmentio-analytics.js-integrations/lib/awesm.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var user;module.exports=exports=function(analytics){analytics.addIntegration(Awesm);user=analytics.user()};var Awesm=exports.Integration=integration("awe.sm").assumesPageview().readyOnLoad().global("AWESM").option("apiKey","").option("events",{});Awesm.prototype.initialize=function(page){window.AWESM={api_key:this.options.apiKey};this.load()};Awesm.prototype.loaded=function(){return!!window.AWESM._exists};Awesm.prototype.load=function(callback){var key=this.options.apiKey;load("//widgets.awe.sm/v3/widgets.js?key="+key+"&async=true",callback)};Awesm.prototype.track=function(track){var event=track.event();var goal=this.options.events[event];if(!goal)return;window.AWESM.convert(goal,track.cents(),null,user.id())}});require.register("segmentio-analytics.js-integrations/lib/awesomatic.js",function(exports,require,module){var integration=require("integration");var is=require("is");var load=require("load-script");var noop=function(){};var onBody=require("on-body");var user;module.exports=exports=function(analytics){analytics.addIntegration(Awesomatic);user=analytics.user()};var Awesomatic=exports.Integration=integration("Awesomatic").assumesPageview().global("Awesomatic").global("AwesomaticSettings").global("AwsmSetup").global("AwsmTmp").option("appId","");Awesomatic.prototype.initialize=function(page){var self=this;var id=user.id();var options=user.traits();options.appId=this.options.appId;if(id)options.user_id=id;this.load(function(){window.Awesomatic.initialize(options,function(){self.emit("ready")})})};Awesomatic.prototype.loaded=function(){return is.object(window.Awesomatic)};Awesomatic.prototype.load=function(callback){var url="https://1c817b7a15b6941337c0-dff9b5f4adb7ba28259631e99c3f3691.ssl.cf2.rackcdn.com/gen/embed.js";load(url,callback)}});require.register("segmentio-analytics.js-integrations/lib/bing-ads.js",function(exports,require,module){var integration=require("integration");module.exports=exports=function(analytics){analytics.addIntegration(Bing)};var has=Object.prototype.hasOwnProperty;var Bing=exports.Integration=integration("Bing Ads").readyOnInitialize().option("siteId","").option("domainId","").option("goals",{});Bing.prototype.track=function(track){var goals=this.options.goals;var traits=track.traits();var event=track.event();if(!has.call(goals,event))return;var goal=goals[event];return exports.load(goal,track.revenue(),this.options)};exports.load=function(goal,revenue,options){var iframe=document.createElement("iframe");iframe.src="//flex.msn.com/mstag/tag/"+options.siteId+"/analytics.html"+"?domainId="+options.domainId+"&revenue="+revenue||0+"&actionid="+goal;+"&dedup=1"+"&type=1";iframe.width=1;iframe.height=1;return iframe}});require.register("segmentio-analytics.js-integrations/lib/bronto.js",function(exports,require,module){var integration=require("integration");var Track=require("facade").Track;var load=require("load-script");var each=require("each");module.exports=exports=function(analytics){analytics.addIntegration(Bronto)};var Bronto=exports.Integration=integration("Bronto").readyOnLoad().global("__bta").option("siteId","").option("host","");Bronto.prototype.initialize=function(page){this.load()};Bronto.prototype.loaded=function(){return this.bta};Bronto.prototype.load=function(fn){var self=this;load("//p.bm23.com/bta.js",function(err){if(err)return fn(err);var opts=self.options;self.bta=new window.__bta(opts.siteId);if(opts.host)self.bta.setHost(opts.host);fn()})};Bronto.prototype.track=function(track){var revenue=track.revenue();var event=track.event();var type="number"==typeof revenue?"$":"t";this.bta.addConversionLegacy(type,event,revenue)};Bronto.prototype.completedOrder=function(track){var products=track.products();var props=track.properties();var items=[];each(products,function(product){var track=new Track({properties:product});items.push({item_id:track.id()||track.sku(),desc:product.description||track.name(),quantity:track.quantity(),amount:track.price()})});this.bta.addConversion({order_id:track.orderId(),date:props.date||new Date,items:items})}});require.register("segmentio-analytics.js-integrations/lib/bugherd.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(BugHerd)};var BugHerd=exports.Integration=integration("BugHerd").assumesPageview().readyOnLoad().global("BugHerdConfig").global("_bugHerd").option("apiKey","").option("showFeedbackTab",true);BugHerd.prototype.initialize=function(page){window.BugHerdConfig={feedback:{hide:!this.options.showFeedbackTab}};this.load()};BugHerd.prototype.loaded=function(){return!!window._bugHerd};BugHerd.prototype.load=function(callback){load("//www.bugherd.com/sidebarv2.js?apikey="+this.options.apiKey,callback)}});require.register("segmentio-analytics.js-integrations/lib/bugsnag.js",function(exports,require,module){var integration=require("integration");var is=require("is");var extend=require("extend");var load=require("load-script");var onError=require("on-error");module.exports=exports=function(analytics){analytics.addIntegration(Bugsnag)};var Bugsnag=exports.Integration=integration("Bugsnag").readyOnLoad().global("Bugsnag").option("apiKey","");Bugsnag.prototype.initialize=function(page){this.load()};Bugsnag.prototype.loaded=function(){return is.object(window.Bugsnag)};Bugsnag.prototype.load=function(callback){var apiKey=this.options.apiKey;load("//d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js",function(err){if(err)return callback(err);window.Bugsnag.apiKey=apiKey;callback()})};Bugsnag.prototype.identify=function(identify){window.Bugsnag.metaData=window.Bugsnag.metaData||{};extend(window.Bugsnag.metaData,identify.traits())}});require.register("segmentio-analytics.js-integrations/lib/chartbeat.js",function(exports,require,module){var integration=require("integration");var onBody=require("on-body");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Chartbeat)};var Chartbeat=exports.Integration=integration("Chartbeat").assumesPageview().readyOnLoad().global("_sf_async_config").global("_sf_endpt").global("pSUPERFLY").option("domain","").option("uid",null);Chartbeat.prototype.initialize=function(page){window._sf_async_config=this.options;onBody(function(){window._sf_endpt=(new Date).getTime()});this.load()};Chartbeat.prototype.loaded=function(){return!!window.pSUPERFLY};Chartbeat.prototype.load=function(callback){load({https:"https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/js/chartbeat.js",http:"http://static.chartbeat.com/js/chartbeat.js"},callback)};Chartbeat.prototype.page=function(page){var props=page.properties();var name=page.fullName();window.pSUPERFLY.virtualPage(props.path,name||props.title)}});require.register("segmentio-analytics.js-integrations/lib/churnbee.js",function(exports,require,module){var push=require("global-queue")("_cbq");var integration=require("integration");var load=require("load-script");var has=Object.prototype.hasOwnProperty;var supported={activation:true,changePlan:true,register:true,refund:true,charge:true,cancel:true,login:true};module.exports=exports=function(analytics){analytics.addIntegration(ChurnBee)};var ChurnBee=exports.Integration=integration("ChurnBee").readyOnInitialize().global("_cbq").global("ChurnBee").option("events",{}).option("apiKey","");ChurnBee.prototype.initialize=function(page){push("_setApiKey",this.options.apiKey);this.load()};ChurnBee.prototype.loaded=function(){return!!window.ChurnBee};ChurnBee.prototype.load=function(fn){load("//api.churnbee.com/cb.js",fn)};ChurnBee.prototype.track=function(track){var events=this.options.events;var event=track.event();if(has.call(events,event))event=events[event];if(true!=supported[event])return;push(event,track.properties({revenue:"amount"}))}});require.register("segmentio-analytics.js-integrations/lib/clicky.js",function(exports,require,module){var Identify=require("facade").Identify;var extend=require("extend");var integration=require("integration");var is=require("is");var load=require("load-script");var user;module.exports=exports=function(analytics){analytics.addIntegration(Clicky);user=analytics.user()};var Clicky=exports.Integration=integration("Clicky").assumesPageview().readyOnLoad().global("clicky").global("clicky_site_ids").global("clicky_custom").option("siteId",null);Clicky.prototype.initialize=function(page){window.clicky_site_ids=window.clicky_site_ids||[this.options.siteId];this.identify(new Identify({userId:user.id(),traits:user.traits()}));this.load()};Clicky.prototype.loaded=function(){return is.object(window.clicky)};Clicky.prototype.load=function(callback){load("//static.getclicky.com/js",callback)};Clicky.prototype.page=function(page){var properties=page.properties();var category=page.category();var name=page.fullName();window.clicky.log(properties.path,name||properties.title)};Clicky.prototype.identify=function(identify){window.clicky_custom=window.clicky_custom||{};window.clicky_custom.session=window.clicky_custom.session||{};extend(window.clicky_custom.session,identify.traits())};Clicky.prototype.track=function(track){window.clicky.goal(track.event(),track.revenue())}});require.register("segmentio-analytics.js-integrations/lib/comscore.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Comscore)};var Comscore=exports.Integration=integration("comScore").assumesPageview().readyOnLoad().global("_comscore").global("COMSCORE").option("c1","2").option("c2","");Comscore.prototype.initialize=function(page){window._comscore=window._comscore||[this.options];this.load()};Comscore.prototype.loaded=function(){return!!window.COMSCORE};Comscore.prototype.load=function(callback){load({http:"http://b.scorecardresearch.com/beacon.js",https:"https://sb.scorecardresearch.com/beacon.js"},callback)}});require.register("segmentio-analytics.js-integrations/lib/crazy-egg.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(CrazyEgg)};var CrazyEgg=exports.Integration=integration("Crazy Egg").assumesPageview().readyOnLoad().global("CE2").option("accountNumber","");CrazyEgg.prototype.initialize=function(page){this.load()};CrazyEgg.prototype.loaded=function(){return!!window.CE2};CrazyEgg.prototype.load=function(callback){var number=this.options.accountNumber;var path=number.slice(0,4)+"/"+number.slice(4);var cache=Math.floor((new Date).getTime()/36e5);var url="//dnn506yrbagrg.cloudfront.net/pages/scripts/"+path+".js?"+cache;load(url,callback)}});require.register("segmentio-analytics.js-integrations/lib/curebit.js",function(exports,require,module){var clone=require("clone");var each=require("each");var Identify=require("facade").Identify;var integration=require("integration");var iso=require("to-iso-string");var load=require("load-script");var push=require("global-queue")("_curebitq");var Track=require("facade").Track;var user;module.exports=exports=function(analytics){analytics.addIntegration(Curebit);user=analytics.user()};var Curebit=exports.Integration=integration("Curebit").readyOnInitialize().global("_curebitq").global("curebit").option("siteId","").option("iframeWidth","100%").option("iframeHeight","480").option("iframeBorder",0).option("iframeId","").option("responsive",true).option("device","").option("insertIntoId","curebit-frame").option("campaigns",{}).option("server","https://www.curebit.com");Curebit.prototype.initialize=function(page){push("init",{site_id:this.options.siteId,server:this.options.server});this.load()};Curebit.prototype.loaded=function(){return!!window.curebit};Curebit.prototype.load=function(fn){var url="//d2jjzw81hqbuqv.cloudfront.net/integration/curebit-1.0.min.js";load(url,fn)};Curebit.prototype.page=function(page){var campaigns=this.options.campaigns;var path=window.location.pathname;if(!campaigns[path])return;var tags=(campaigns[path]||"").split(",");if(!tags.length)return;var settings={responsive:this.options.responsive,device:this.options.device,campaign_tags:tags,iframe:{width:this.options.iframeWidth,height:this.options.iframeHeight,id:this.options.iframeId,frameborder:this.options.iframeBorder,container:this.options.insertIntoId}};var identify=new Identify({userId:user.id(),traits:user.traits()});if(identify.email()){settings.affiliate_member={email:identify.email(),first_name:identify.firstName(),last_name:identify.lastName(),customer_id:identify.userId()}}push("register_affiliate",settings)};Curebit.prototype.completedOrder=function(track){var orderId=track.orderId();var products=track.products();var props=track.properties();var items=[];var identify=new Identify({traits:user.traits(),userId:user.id()});each(products,function(product){var track=new Track({properties:product});items.push({product_id:track.id()||track.sku(),quantity:track.quantity(),image_url:product.image,price:track.price(),title:track.name(),url:product.url})});push("register_purchase",{order_date:iso(props.date||new Date),order_number:orderId,coupon_code:track.coupon(),subtotal:track.total(),customer_id:identify.userId(),first_name:identify.firstName(),last_name:identify.lastName(),email:identify.email(),items:items})}});require.register("segmentio-analytics.js-integrations/lib/customerio.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var convertDates=require("convert-dates");var Identify=require("facade").Identify;var integration=require("integration");var load=require("load-script");var user;module.exports=exports=function(analytics){analytics.addIntegration(Customerio);user=analytics.user()};var Customerio=exports.Integration=integration("Customer.io").assumesPageview().readyOnInitialize().global("_cio").option("siteId","");Customerio.prototype.initialize=function(page){window._cio=window._cio||[];(function(){var a,b,c;a=function(f){return function(){window._cio.push([f].concat(Array.prototype.slice.call(arguments,0)))}};b=["identify","track"];for(c=0;c<b.length;c++){window._cio[b[c]]=a(b[c])}})();this.load()};Customerio.prototype.loaded=function(){return!!(window._cio&&window._cio.pageHasLoaded)};Customerio.prototype.load=function(callback){var script=load("https://assets.customer.io/assets/track.js",callback);script.id="cio-tracker";script.setAttribute("data-site-id",this.options.siteId)};Customerio.prototype.identify=function(identify){if(!identify.userId())return this.debug("user id required");var traits=identify.traits({created:"created_at"});traits=convertDates(traits,convertDate);window._cio.identify(traits)};Customerio.prototype.group=function(group){var traits=group.traits();traits=alias(traits,function(trait){return"Group "+trait});this.identify(new Identify({userId:user.id(),traits:traits}))};Customerio.prototype.track=function(track){var properties=track.properties();properties=convertDates(properties,convertDate);window._cio.track(track.event(),properties)};function convertDate(date){return Math.floor(date.getTime()/1e3)}});require.register("segmentio-analytics.js-integrations/lib/drip.js",function(exports,require,module){var alias=require("alias");var integration=require("integration");var is=require("is");var load=require("load-script");var push=require("global-queue")("_dcq");module.exports=exports=function(analytics){analytics.addIntegration(Drip)};var Drip=exports.Integration=integration("Drip").assumesPageview().readyOnLoad().global("dc").global("_dcq").global("_dcs").option("account","");Drip.prototype.initialize=function(page){window._dcq=window._dcq||[];window._dcs=window._dcs||{};window._dcs.account=this.options.account;this.load()};Drip.prototype.loaded=function(){return is.object(window.dc)};Drip.prototype.load=function(callback){load("//tag.getdrip.com/"+this.options.account+".js",callback)};Drip.prototype.track=function(track){var props=track.properties();var cents=Math.round(track.cents());props.action=track.event();if(cents)props.value=cents;delete props.revenue;push("track",props)}});require.register("segmentio-analytics.js-integrations/lib/errorception.js",function(exports,require,module){var callback=require("callback");var extend=require("extend");var integration=require("integration");var load=require("load-script");var onError=require("on-error");var push=require("global-queue")("_errs");module.exports=exports=function(analytics){analytics.addIntegration(Errorception)};var Errorception=exports.Integration=integration("Errorception").assumesPageview().readyOnInitialize().global("_errs").option("projectId","").option("meta",true);Errorception.prototype.initialize=function(page){window._errs=window._errs||[this.options.projectId];onError(push);this.load()};Errorception.prototype.loaded=function(){return!!(window._errs&&window._errs.push!==Array.prototype.push)};Errorception.prototype.load=function(callback){load("//beacon.errorception.com/"+this.options.projectId+".js",callback)};Errorception.prototype.identify=function(identify){if(!this.options.meta)return;var traits=identify.traits();window._errs=window._errs||[];window._errs.meta=window._errs.meta||{};extend(window._errs.meta,traits)}});require.register("segmentio-analytics.js-integrations/lib/evergage.js",function(exports,require,module){var each=require("each");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_aaq");module.exports=exports=function(analytics){analytics.addIntegration(Evergage)};var Evergage=exports.Integration=integration("Evergage").assumesPageview().readyOnInitialize().global("_aaq").option("account","").option("dataset","");Evergage.prototype.initialize=function(page){var account=this.options.account;var dataset=this.options.dataset;window._aaq=window._aaq||[];push("setEvergageAccount",account);push("setDataset",dataset);push("setUseSiteConfig",true);this.load()};Evergage.prototype.loaded=function(){return!!(window._aaq&&window._aaq.push!==Array.prototype.push)};Evergage.prototype.load=function(callback){var account=this.options.account;var dataset=this.options.dataset;var url="//cdn.evergage.com/beacon/"+account+"/"+dataset+"/scripts/evergage.min.js";load(url,callback)};Evergage.prototype.page=function(page){var props=page.properties();var name=page.name();if(name)push("namePage",name);each(props,function(key,value){push("setCustomField",key,value,"page")});window.Evergage.init(true)};Evergage.prototype.identify=function(identify){var id=identify.userId();if(!id)return;push("setUser",id);var traits=identify.traits({email:"userEmail",name:"userName"});each(traits,function(key,value){push("setUserField",key,value,"page")})};Evergage.prototype.group=function(group){var props=group.traits();var id=group.groupId();if(!id)return;push("setCompany",id);each(props,function(key,value){push("setAccountField",key,value,"page")})};Evergage.prototype.track=function(track){push("trackAction",track.event(),track.properties())}});require.register("segmentio-analytics.js-integrations/lib/facebook-ads.js",function(exports,require,module){var load=require("load-pixel")("//www.facebook.com/offsite_event.php");var integration=require("integration");module.exports=exports=function(analytics){analytics.addIntegration(Facebook)};exports.load=load;var has=Object.prototype.hasOwnProperty;var Facebook=exports.Integration=integration("Facebook Ads").readyOnInitialize().option("currency","USD").option("events",{});Facebook.prototype.track=function(track){var events=this.options.events;var traits=track.traits();var event=track.event();if(!has.call(events,event))return;return exports.load({currency:this.options.currency,value:track.revenue()||0,id:events[event]})}});require.register("segmentio-analytics.js-integrations/lib/foxmetrics.js",function(exports,require,module){var push=require("global-queue")("_fxm");var integration=require("integration");var Track=require("facade").Track;var callback=require("callback");var load=require("load-script");var each=require("each");module.exports=exports=function(analytics){analytics.addIntegration(FoxMetrics)};var FoxMetrics=exports.Integration=integration("FoxMetrics").assumesPageview().readyOnInitialize().global("_fxm").option("appId","");FoxMetrics.prototype.initialize=function(page){window._fxm=window._fxm||[];this.load()};FoxMetrics.prototype.loaded=function(){return!!(window._fxm&&window._fxm.appId)};FoxMetrics.prototype.load=function(callback){var id=this.options.appId;load("//d35tca7vmefkrc.cloudfront.net/scripts/"+id+".js",callback)};FoxMetrics.prototype.page=function(page){var properties=page.proxy("properties");var category=page.category();var name=page.name();this._category=category;push("_fxm.pages.view",properties.title,name,category,properties.url,properties.referrer)};FoxMetrics.prototype.identify=function(identify){var id=identify.userId();if(!id)return;push("_fxm.visitor.profile",id,identify.firstName(),identify.lastName(),identify.email(),identify.address(),undefined,undefined,identify.traits())};FoxMetrics.prototype.track=function(track){var props=track.properties();var category=this._category||props.category;push(track.event(),category,props)};FoxMetrics.prototype.viewedProduct=function(track){ecommerce("productview",track)};FoxMetrics.prototype.removedProduct=function(track){ecommerce("removecartitem",track)};FoxMetrics.prototype.addedProduct=function(track){ecommerce("cartitem",track)};FoxMetrics.prototype.completedOrder=function(track){var orderId=track.orderId();push("_fxm.ecommerce.order",orderId,track.subtotal(),track.shipping(),track.tax(),track.city(),track.state(),track.zip(),track.quantity());each(track.products(),function(product){var track=new Track({properties:product});ecommerce("purchaseitem",track,[track.quantity(),track.price(),orderId])})};function ecommerce(event,track,arr){push.apply(null,["_fxm.ecommerce."+event,track.id()||track.sku(),track.name(),track.category()].concat(arr||[]))}});require.register("segmentio-analytics.js-integrations/lib/frontleaf.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var is=require("is");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Frontleaf)
};var Frontleaf=exports.Integration=integration("Frontleaf").assumesPageview().readyOnInitialize().global("_fl").global("_flBaseUrl").option("baseUrl","https://api.frontleaf.com").option("token","").option("stream","");Frontleaf.prototype.initialize=function(page){window._fl=window._fl||[];window._flBaseUrl=window._flBaseUrl||this.options.baseUrl;this._push("setApiToken",this.options.token);this._push("setStream",this.options.stream);this.load()};Frontleaf.prototype.loaded=function(){return is.array(window._fl)&&window._fl.ready===true};Frontleaf.prototype.load=function(fn){if(document.getElementById("_fl"))return callback.async(fn);var script=load(window._flBaseUrl+"/lib/tracker.js",fn);script.id="_fl"};Frontleaf.prototype.identify=function(identify){var userId=identify.userId();if(userId){this._push("setUser",{id:userId,name:identify.name()||identify.username(),data:clean(identify.traits())})}};Frontleaf.prototype.group=function(group){var groupId=group.groupId();if(groupId){this._push("setAccount",{id:groupId,name:group.proxy("traits.name"),data:clean(group.traits())})}};Frontleaf.prototype.track=function(track){var event=track.event();if(event){this._push("event",event,clean(track.properties()))}};Frontleaf.prototype._push=function(command){var args=[].slice.call(arguments,1);window._fl.push(function(t){t[command].apply(command,args)})};function clean(obj){var ret={};var excludeKeys=["id","name","firstName","lastName"];var len=excludeKeys.length;for(var i=0;i<len;i++){clear(obj,excludeKeys[i])}obj=flatten(obj);for(var key in obj){var val=obj[key];if(null==val){continue}if(is.array(val)){ret[key]=val.toString();continue}ret[key]=val}return ret}function clear(obj,key){if(obj.hasOwnProperty(key)){delete obj[key]}}function flatten(source){var output={};function step(object,prev){for(var key in object){var value=object[key];var newKey=prev?prev+" "+key:key;if(!is.array(value)&&is.object(value)){return step(value,newKey)}output[newKey]=value}}step(source);return output}});require.register("segmentio-analytics.js-integrations/lib/gauges.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_gauges");module.exports=exports=function(analytics){analytics.addIntegration(Gauges)};var Gauges=exports.Integration=integration("Gauges").assumesPageview().readyOnInitialize().global("_gauges").option("siteId","");Gauges.prototype.initialize=function(page){window._gauges=window._gauges||[];this.load()};Gauges.prototype.loaded=function(){return!!(window._gauges&&window._gauges.push!==Array.prototype.push)};Gauges.prototype.load=function(callback){var id=this.options.siteId;var script=load("//secure.gaug.es/track.js",callback);script.id="gauges-tracker";script.setAttribute("data-site-id",id)};Gauges.prototype.page=function(page){push("track")}});require.register("segmentio-analytics.js-integrations/lib/get-satisfaction.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var onBody=require("on-body");module.exports=exports=function(analytics){analytics.addIntegration(GetSatisfaction)};var GetSatisfaction=exports.Integration=integration("Get Satisfaction").assumesPageview().readyOnLoad().global("GSFN").option("widgetId","");GetSatisfaction.prototype.initialize=function(page){var widget=this.options.widgetId;var div=document.createElement("div");var id=div.id="getsat-widget-"+widget;onBody(function(body){body.appendChild(div)});this.load(function(){window.GSFN.loadWidget(widget,{containerId:id})})};GetSatisfaction.prototype.loaded=function(){return!!window.GSFN};GetSatisfaction.prototype.load=function(callback){load("https://loader.engage.gsfn.us/loader.js",callback)}});require.register("segmentio-analytics.js-integrations/lib/google-analytics.js",function(exports,require,module){var callback=require("callback");var canonical=require("canonical");var each=require("each");var integration=require("integration");var is=require("is");var load=require("load-script");var push=require("global-queue")("_gaq");var Track=require("facade").Track;var length=require("object").length;var keys=require("object").keys;var dot=require("obj-case");var type=require("type");var url=require("url");var group;var user;module.exports=exports=function(analytics){analytics.addIntegration(GA);group=analytics.group();user=analytics.user()};var GA=exports.Integration=integration("Google Analytics").readyOnLoad().global("ga").global("gaplugins").global("_gaq").global("GoogleAnalyticsObject").option("anonymizeIp",false).option("classic",false).option("domain","none").option("doubleClick",false).option("enhancedLinkAttribution",false).option("ignoredReferrers",null).option("includeSearch",false).option("siteSpeedSampleRate",1).option("trackingId","").option("trackNamedPages",true).option("trackCategorizedPages",true).option("sendUserId",false).option("metrics",{}).option("dimensions",{});GA.on("construct",function(integration){if(!integration.options.classic)return;integration.initialize=integration.initializeClassic;integration.load=integration.loadClassic;integration.loaded=integration.loadedClassic;integration.page=integration.pageClassic;integration.track=integration.trackClassic;integration.completedOrder=integration.completedOrderClassic});GA.prototype.initialize=function(){var opts=this.options;var gMetrics=metrics(group.traits(),opts);var uMetrics=metrics(user.traits(),opts);var custom;window.GoogleAnalyticsObject="ga";window.ga=window.ga||function(){window.ga.q=window.ga.q||[];window.ga.q.push(arguments)};window.ga.l=(new Date).getTime();window.ga("create",opts.trackingId,{cookieDomain:opts.domain||GA.prototype.defaults.domain,siteSpeedSampleRate:opts.siteSpeedSampleRate,allowLinker:true});if(opts.doubleClick){window.ga("require","displayfeatures")}if(opts.sendUserId&&user.id()){window.ga("set","&uid",user.id())}if(opts.anonymizeIp)window.ga("set","anonymizeIp",true);if(length(gMetrics))window.ga("set",gMetrics);if(length(uMetrics))window.ga("set",uMetrics);this.load()};GA.prototype.loaded=function(){return!!window.gaplugins};GA.prototype.load=function(callback){load("//www.google-analytics.com/analytics.js",callback)};GA.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();var pageview={};var track;this._category=category;var hit=metrics(page.properties(),this.options);hit.page=path(props,this.options);hit.title=name||props.title;hit.location=props.url;window.ga("send","pageview",hit);if(category&&this.options.trackCategorizedPages){track=page.track(category);this.track(track,{noninteraction:true})}if(name&&this.options.trackNamedPages){track=page.track(name);this.track(track,{noninteraction:true})}};GA.prototype.track=function(track,options){var opts=options||track.options(this.name);var props=track.properties();var event=metrics(props,this.options);event.eventAction=track.event();event.eventCategory=props.category||this._category||"All";event.eventLabel=props.label;event.eventValue=formatValue(props.value||track.revenue());event.nonInteraction=props.noninteraction||opts.noninteraction;window.ga("send","event",event)};GA.prototype.completedOrder=function(track){var total=track.total()||track.revenue()||0;var orderId=track.orderId();var products=track.products();var props=track.properties();if(!orderId)return;if(!this.ecommerce){window.ga("require","ecommerce","ecommerce.js");this.ecommerce=true}window.ga("ecommerce:addTransaction",{affiliation:props.affiliation,shipping:track.shipping(),revenue:total,tax:track.tax(),id:orderId});each(products,function(product){var track=new Track({properties:product});window.ga("ecommerce:addItem",{category:track.category(),quantity:track.quantity(),price:track.price(),name:track.name(),sku:track.sku(),id:orderId})});window.ga("ecommerce:send")};GA.prototype.initializeClassic=function(){var opts=this.options;var anonymize=opts.anonymizeIp;var db=opts.doubleClick;var domain=opts.domain;var enhanced=opts.enhancedLinkAttribution;var ignore=opts.ignoredReferrers;var sample=opts.siteSpeedSampleRate;window._gaq=window._gaq||[];push("_setAccount",opts.trackingId);push("_setAllowLinker",true);if(anonymize)push("_gat._anonymizeIp");if(domain)push("_setDomainName",domain);if(sample)push("_setSiteSpeedSampleRate",sample);if(enhanced){var protocol="https:"===document.location.protocol?"https:":"http:";var pluginUrl=protocol+"//www.google-analytics.com/plugins/ga/inpage_linkid.js";push("_require","inpage_linkid",pluginUrl)}if(ignore){if(!is.array(ignore))ignore=[ignore];each(ignore,function(domain){push("_addIgnoredRef",domain)})}this.load()};GA.prototype.loadedClassic=function(){return!!(window._gaq&&window._gaq.push!==Array.prototype.push)};GA.prototype.loadClassic=function(callback){if(this.options.doubleClick){load("//stats.g.doubleclick.net/dc.js",callback)}else{load({http:"http://www.google-analytics.com/ga.js",https:"https://ssl.google-analytics.com/ga.js"},callback)}};GA.prototype.pageClassic=function(page){var opts=page.options(this.name);var category=page.category();var props=page.properties();var name=page.fullName();var track;push("_trackPageview",path(props,this.options));if(category&&this.options.trackCategorizedPages){track=page.track(category);this.track(track,{noninteraction:true})}if(name&&this.options.trackNamedPages){track=page.track(name);this.track(track,{noninteraction:true})}};GA.prototype.trackClassic=function(track,options){var opts=options||track.options(this.name);var props=track.properties();var revenue=track.revenue();var event=track.event();var category=this._category||props.category||"All";var label=props.label;var value=formatValue(revenue||props.value);var noninteraction=props.noninteraction||opts.noninteraction;push("_trackEvent",category,event,label,value,noninteraction)};GA.prototype.completedOrderClassic=function(track){var total=track.total()||track.revenue()||0;var orderId=track.orderId();var products=track.products()||[];var props=track.properties();if(!orderId)return;push("_addTrans",orderId,props.affiliation,total,track.tax(),track.shipping(),track.city(),track.state(),track.country());each(products,function(product){var track=new Track({properties:product});push("_addItem",orderId,track.sku(),track.name(),track.category(),track.price(),track.quantity())});push("_trackTrans")};function path(properties,options){if(!properties)return;var str=properties.path;if(options.includeSearch&&properties.search)str+=properties.search;return str}function formatValue(value){if(!value||value<0)return 0;return Math.round(value)}function metrics(obj,data){var dimensions=data.dimensions;var metrics=data.metrics;var names=keys(metrics).concat(keys(dimensions));var ret={};for(var i=0;i<names.length;++i){var name=metrics[names[i]]||dimensions[names[i]];var value=dot(obj,name);if(null==value)continue;ret[names[i]]=value}return ret}});require.register("segmentio-analytics.js-integrations/lib/google-tag-manager.js",function(exports,require,module){var push=require("global-queue")("dataLayer",{wrap:false});var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(GTM)};var GTM=exports.Integration=integration("Google Tag Manager").assumesPageview().readyOnLoad().global("dataLayer").global("google_tag_manager").option("containerId","").option("trackNamedPages",true).option("trackCategorizedPages",true);GTM.prototype.initialize=function(){this.load()};GTM.prototype.loaded=function(){return!!(window.dataLayer&&[].push!=window.dataLayer.push)};GTM.prototype.load=function(fn){var id=this.options.containerId;push({"gtm.start":+new Date,event:"gtm.js"});load("//www.googletagmanager.com/gtm.js?id="+id+"&l=dataLayer",fn)};GTM.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();var opts=this.options;var track;if(opts.trackAllPages){this.track(page.track())}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};GTM.prototype.track=function(track){var props=track.properties();props.event=track.event();push(props)}});require.register("segmentio-analytics.js-integrations/lib/gosquared.js",function(exports,require,module){var Identify=require("facade").Identify;var Track=require("facade").Track;var callback=require("callback");var integration=require("integration");var load=require("load-script");var onBody=require("on-body");var each=require("each");var user;module.exports=exports=function(analytics){analytics.addIntegration(GoSquared);user=analytics.user()};var GoSquared=exports.Integration=integration("GoSquared").assumesPageview().readyOnLoad().global("_gs").option("siteToken","").option("anonymizeIP",false).option("cookieDomain",null).option("useCookies",true).option("trackHash",false).option("trackLocal",false).option("trackParams",true);GoSquared.prototype.initialize=function(page){var self=this;var options=this.options;push(options.siteToken);each(options,function(name,value){if("siteToken"==name)return;if(null==value)return;push("set",name,value)});self.identify(new Identify({traits:user.traits(),userId:user.id()}));self.load()};GoSquared.prototype.loaded=function(){return!!(window._gs&&window._gs.v)};GoSquared.prototype.load=function(callback){load("//d1l6p2sc9645hc.cloudfront.net/tracker.js",callback)};GoSquared.prototype.page=function(page){var props=page.properties();var name=page.fullName();push("track",props.path,name||props.title)};GoSquared.prototype.identify=function(identify){var traits=identify.traits({userId:"userID"});var username=identify.username();var email=identify.email();var id=identify.userId();if(id)push("set","visitorID",id);var name=email||username||id;if(name)push("set","visitorName",name);push("set","visitor",traits)};GoSquared.prototype.track=function(track){push("event",track.event(),track.properties())};GoSquared.prototype.completedOrder=function(track){var products=track.products();var items=[];each(products,function(product){var track=new Track({properties:product});items.push({category:track.category(),quantity:track.quantity(),price:track.price(),name:track.name()})});push("transaction",track.orderId(),{revenue:track.total(),track:true},items)};function push(){var _gs=window._gs=window._gs||function(){(_gs.q=_gs.q||[]).push(arguments)};_gs.apply(null,arguments)}});require.register("segmentio-analytics.js-integrations/lib/heap.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Heap)};var Heap=exports.Integration=integration("Heap").assumesPageview().readyOnInitialize().global("heap").global("_heapid").option("apiKey","");Heap.prototype.initialize=function(page){window.heap=window.heap||[];window.heap.load=function(a){window._heapid=a;var d=function(a){return function(){window.heap.push([a].concat(Array.prototype.slice.call(arguments,0)))}},e=["identify","track"];for(var f=0;f<e.length;f++)window.heap[e[f]]=d(e[f])};window.heap.load(this.options.apiKey);this.load()};Heap.prototype.loaded=function(){return window.heap&&window.heap.appid};Heap.prototype.load=function(callback){load("//d36lvucg9kzous.cloudfront.net",callback)};Heap.prototype.identify=function(identify){var traits=identify.traits();var username=identify.username();var id=identify.userId();var handle=username||id;if(handle)traits.handle=handle;delete traits.username;window.heap.identify(traits)};Heap.prototype.track=function(track){window.heap.track(track.event(),track.properties())}});require.register("segmentio-analytics.js-integrations/lib/hellobar.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Hellobar)};var Hellobar=exports.Integration=integration("Hello Bar").assumesPageview().readyOnInitialize().global("_hbq").option("apiKey","");Hellobar.prototype.initialize=function(page){window._hbq=window._hbq||[];this.load()};Hellobar.prototype.load=function(callback){var url="//s3.amazonaws.com/scripts.hellobar.com/"+this.options.apiKey+".js";load(url,callback)};Hellobar.prototype.loaded=function(){return!!(window._hbq&&window._hbq.push!==Array.prototype.push)}});require.register("segmentio-analytics.js-integrations/lib/hittail.js",function(exports,require,module){var integration=require("integration");var is=require("is");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(HitTail)};var HitTail=exports.Integration=integration("HitTail").assumesPageview().readyOnLoad().global("htk").option("siteId","");HitTail.prototype.initialize=function(page){this.load()};HitTail.prototype.loaded=function(){return is.fn(window.htk)};HitTail.prototype.load=function(callback){var id=this.options.siteId;load("//"+id+".hittail.com/mlt.js",callback)}});require.register("segmentio-analytics.js-integrations/lib/hubspot.js",function(exports,require,module){var callback=require("callback");var convert=require("convert-dates");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_hsq");module.exports=exports=function(analytics){analytics.addIntegration(HubSpot)};var HubSpot=exports.Integration=integration("HubSpot").assumesPageview().readyOnInitialize().global("_hsq").option("portalId",null);HubSpot.prototype.initialize=function(page){window._hsq=[];this.load()};HubSpot.prototype.loaded=function(){return!!(window._hsq&&window._hsq.push!==Array.prototype.push)};HubSpot.prototype.load=function(fn){if(document.getElementById("hs-analytics"))return callback.async(fn);var id=this.options.portalId;var cache=Math.ceil(new Date/3e5)*3e5;var url="https://js.hs-analytics.net/analytics/"+cache+"/"+id+".js";var script=load(url,fn);script.id="hs-analytics"};HubSpot.prototype.page=function(page){push("_trackPageview")};HubSpot.prototype.identify=function(identify){if(!identify.email())return;var traits=identify.traits();traits=convertDates(traits);push("identify",traits)};HubSpot.prototype.track=function(track){var props=track.properties();props=convertDates(props);push("trackEvent",track.event(),props)};function convertDates(properties){return convert(properties,function(date){return date.getTime()})}});require.register("segmentio-analytics.js-integrations/lib/improvely.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Improvely)};var Improvely=exports.Integration=integration("Improvely").assumesPageview().readyOnInitialize().global("_improvely").global("improvely").option("domain","").option("projectId",null);Improvely.prototype.initialize=function(page){window._improvely=[];window.improvely={init:function(e,t){window._improvely.push(["init",e,t])},goal:function(e){window._improvely.push(["goal",e])},label:function(e){window._improvely.push(["label",e])}};var domain=this.options.domain;var id=this.options.projectId;window.improvely.init(domain,id);this.load()};Improvely.prototype.loaded=function(){return!!(window.improvely&&window.improvely.identify)};Improvely.prototype.load=function(callback){var domain=this.options.domain;load("//"+domain+".iljmp.com/improvely.js",callback)};Improvely.prototype.identify=function(identify){var id=identify.userId();if(id)window.improvely.label(id)};Improvely.prototype.track=function(track){var props=track.properties({revenue:"amount"});props.type=track.event();window.improvely.goal(props)}});require.register("segmentio-analytics.js-integrations/lib/inspectlet.js",function(exports,require,module){var integration=require("integration");var alias=require("alias");var clone=require("clone");var load=require("load-script");var push=require("global-queue")("__insp");module.exports=exports=function(analytics){analytics.addIntegration(Inspectlet)};var Inspectlet=exports.Integration=integration("Inspectlet").assumesPageview().readyOnLoad().global("__insp").global("__insp_").option("wid","");Inspectlet.prototype.initialize=function(page){push("wid",this.options.wid);this.load()};Inspectlet.prototype.loaded=function(){return!!window.__insp_};Inspectlet.prototype.load=function(callback){load("//www.inspectlet.com/inspectlet.js",callback)};Inspectlet.prototype.identify=function(identify){var traits=identify.traits({id:"userid"});push("tagSession",traits)};Inspectlet.prototype.track=function(track){push("tagSession",track.event())}});require.register("segmentio-analytics.js-integrations/lib/intercom.js",function(exports,require,module){var alias=require("alias");var convertDates=require("convert-dates");var integration=require("integration");var each=require("each");var is=require("is");var isEmail=require("is-email");var load=require("load-script");var defaults=require("defaults");var empty=require("is-empty");var when=require("when");var group;module.exports=exports=function(analytics){analytics.addIntegration(Intercom);group=analytics.group()};var Intercom=exports.Integration=integration("Intercom").assumesPageview().readyOnLoad().global("Intercom").option("activator","#IntercomDefaultWidget").option("appId","").option("inbox",false);Intercom.prototype.initialize=function(page){this.load()};Intercom.prototype.loaded=function(){return is.fn(window.Intercom)};Intercom.prototype.load=function(callback){var self=this;load("https://static.intercomcdn.com/intercom.v1.js",function(err){if(err)return callback(err);when(function(){return self.loaded()},callback)})};Intercom.prototype.page=function(page){window.Intercom("update")};Intercom.prototype.identify=function(identify){var traits=identify.traits({userId:"user_id"});var activator=this.options.activator;var opts=identify.options(this.name);var companyCreated=identify.companyCreated();var created=identify.created();var email=identify.email();var name=identify.name();var id=identify.userId();if(!id&&!traits.email)return;traits.app_id=this.options.appId;if(!empty(group.traits())){traits.company=traits.company||{};defaults(traits.company,group.traits())}if(name)traits.name=name;if(companyCreated)traits.company.created=companyCreated;if(created)traits.created=created;traits=convertDates(traits,formatDate);traits=alias(traits,{created:"created_at"});if(traits.company){traits.company=alias(traits.company,{created:"created_at"})}if(opts.increments)traits.increments=opts.increments;if(opts.userHash)traits.user_hash=opts.userHash;if(opts.user_hash)traits.user_hash=opts.user_hash;if("#IntercomDefaultWidget"!=activator){traits.widget={activator:activator}}var method=this._id!==id?"boot":"update";this._id=id;window.Intercom(method,traits)};Intercom.prototype.group=function(group){var props=group.properties();var id=group.groupId();if(id)props.id=id;window.Intercom("update",{company:props})};Intercom.prototype.track=function(track){window.Intercom("trackEvent",track.event(),track.properties())};function formatDate(date){return Math.floor(date/1e3)}});require.register("segmentio-analytics.js-integrations/lib/keen-io.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Keen)};var Keen=exports.Integration=integration("Keen IO").readyOnInitialize().global("Keen").option("projectId","").option("readKey","").option("writeKey","").option("trackNamedPages",true).option("trackAllPages",false).option("trackCategorizedPages",true);Keen.prototype.initialize=function(){var options=this.options;window.Keen=window.Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};window.Keen.configure({projectId:options.projectId,writeKey:options.writeKey,readKey:options.readKey});this.load()};Keen.prototype.loaded=function(){return!!(window.Keen&&window.Keen.Base64)};Keen.prototype.load=function(callback){load("//dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js",callback)};Keen.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();var opts=this.options;if(opts.trackAllPages){this.track(page.track())}if(name&&opts.trackNamedPages){this.track(page.track(name))}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}};Keen.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();var user={};if(id)user.userId=id;if(traits)user.traits=traits;window.Keen.setGlobalProperties(function(){return{user:user}})};Keen.prototype.track=function(track){window.Keen.addEvent(track.event(),track.properties())}});require.register("segmentio-analytics.js-integrations/lib/kenshoo.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var is=require("is");module.exports=exports=function(analytics){analytics.addIntegration(Kenshoo)};var Kenshoo=exports.Integration=integration("Kenshoo").readyOnLoad().global("k_trackevent").option("cid","").option("subdomain","").option("trackNamedPages",true).option("trackCategorizedPages",true);Kenshoo.prototype.initialize=function(page){this.load()};Kenshoo.prototype.loaded=function(){return is.fn(window.k_trackevent)};Kenshoo.prototype.load=function(callback){var url="//"+this.options.subdomain+".xg4ken.com/media/getpx.php?cid="+this.options.cid;load(url,callback)};Kenshoo.prototype.completedOrder=function(track){this._track(track,{val:track.total()})};Kenshoo.prototype.page=function(page){var category=page.category();var name=page.name();var fullName=page.fullName();var isNamed=name&&this.options.trackNamedPages;var isCategorized=category&&this.options.trackCategorizedPages;var track;if(name&&!this.options.trackNamedPages){return}if(category&&!this.options.trackCategorizedPages){return}if(isNamed&&isCategorized){track=page.track(fullName)}else if(isNamed){track=page.track(name)}else if(isCategorized){track=page.track(category)}else{track=page.track()}this._track(track)};Kenshoo.prototype.track=function(track){this._track(track)};Kenshoo.prototype._track=function(track,options){options=options||{val:track.revenue()};var params=["id="+this.options.cid,"type="+track.event(),"val="+(options.val||"0.0"),"orderId="+(track.orderId()||""),"promoCode="+(track.coupon()||""),"valueCurrency="+(track.currency()||""),"GCID=","kw=","product="];window.k_trackevent(params,this.options.subdomain)}});require.register("segmentio-analytics.js-integrations/lib/kissmetrics.js",function(exports,require,module){var alias=require("alias");var Batch=require("batch");var callback=require("callback");var integration=require("integration");var is=require("is");var load=require("load-script");var push=require("global-queue")("_kmq");var Track=require("facade").Track;var each=require("each");module.exports=exports=function(analytics){analytics.addIntegration(KISSmetrics)};var KISSmetrics=exports.Integration=integration("KISSmetrics").assumesPageview().readyOnInitialize().global("_kmq").global("KM").global("_kmil").option("apiKey","").option("trackNamedPages",true).option("trackCategorizedPages",true).option("prefixProperties",true);exports.isMobile=navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/iPhone|iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/IEMobile/i);KISSmetrics.prototype.initialize=function(page){window._kmq=[];if(exports.isMobile)push("set",{"Mobile Session":"Yes"});this.load()};KISSmetrics.prototype.loaded=function(){return is.object(window.KM)};KISSmetrics.prototype.load=function(callback){var key=this.options.apiKey;var useless="//i.kissmetrics.com/i.js";var library="//doug1izaerwt3.cloudfront.net/"+key+".1.js";(new Batch).push(function(done){load(useless,done)}).push(function(done){load(library,done)}).end(callback)};KISSmetrics.prototype.page=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(name&&opts.trackNamedPages){this.track(page.track(name))}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}};KISSmetrics.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();if(id)push("identify",id);if(traits)push("set",traits)};KISSmetrics.prototype.track=function(track){var mapping={revenue:"Billing Amount"};var event=track.event();var properties=track.properties(mapping);if(this.options.prefixProperties)properties=prefix(event,properties);push("record",event,properties)};KISSmetrics.prototype.alias=function(alias){push("alias",alias.to(),alias.from())};KISSmetrics.prototype.completedOrder=function(track){var products=track.products();var event=track.event();push("record",event,prefix(event,track.properties()));window._kmq.push(function(){var km=window.KM;each(products,function(product,i){var temp=new Track({event:event,properties:product});var item=prefix(event,product);item._t=km.ts()+i;item._d=1;km.set(item)})})};function prefix(event,properties){var prefixed={};each(properties,function(key,val){if(key==="Billing Amount"){prefixed[key]=val}else{prefixed[event+" - "+key]=val}});return prefixed}});require.register("segmentio-analytics.js-integrations/lib/klaviyo.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_learnq");module.exports=exports=function(analytics){analytics.addIntegration(Klaviyo)};var Klaviyo=exports.Integration=integration("Klaviyo").assumesPageview().readyOnInitialize().global("_learnq").option("apiKey","");Klaviyo.prototype.initialize=function(page){push("account",this.options.apiKey);this.load()};Klaviyo.prototype.loaded=function(){return!!(window._learnq&&window._learnq.push!==Array.prototype.push)};Klaviyo.prototype.load=function(callback){load("//a.klaviyo.com/media/js/learnmarklet.js",callback)};var aliases={id:"$id",email:"$email",firstName:"$first_name",lastName:"$last_name",phone:"$phone_number",title:"$title"};Klaviyo.prototype.identify=function(identify){var traits=identify.traits(aliases);if(!traits.$id&&!traits.$email)return;push("identify",traits)};Klaviyo.prototype.group=function(group){var props=group.properties();if(!props.name)return;push("identify",{$organization:props.name})};Klaviyo.prototype.track=function(track){push("track",track.event(),track.properties({revenue:"$value"}))}});require.register("segmentio-analytics.js-integrations/lib/leadlander.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(LeadLander)};var LeadLander=exports.Integration=integration("LeadLander").assumesPageview().readyOnLoad().global("llactid").global("trackalyzer").option("accountId",null);LeadLander.prototype.initialize=function(page){window.llactid=this.options.accountId;this.load()};LeadLander.prototype.loaded=function(){return!!window.trackalyzer};LeadLander.prototype.load=function(callback){load("http://t6.trackalyzer.com/trackalyze-nodoc.js",callback)}});require.register("segmentio-analytics.js-integrations/lib/livechat.js",function(exports,require,module){var each=require("each");var integration=require("integration");var load=require("load-script");var clone=require("clone");var when=require("when");module.exports=exports=function(analytics){analytics.addIntegration(LiveChat)
};var LiveChat=exports.Integration=integration("LiveChat").assumesPageview().readyOnLoad().global("__lc").global("__lc_inited").global("LC_API").global("LC_Invite").option("group",0).option("license","");LiveChat.prototype.initialize=function(page){window.__lc=clone(this.options);this.load()};LiveChat.prototype.loaded=function(){return!!(window.LC_API&&window.LC_Invite)};LiveChat.prototype.load=function(callback){var self=this;load("//cdn.livechatinc.com/tracking.js",function(err){if(err)return callback(err);when(function(){return self.loaded()},callback)})};LiveChat.prototype.identify=function(identify){var traits=identify.traits({userId:"User ID"});window.LC_API.set_custom_variables(convert(traits))};function convert(traits){var arr=[];each(traits,function(key,value){arr.push({name:key,value:value})});return arr}});require.register("segmentio-analytics.js-integrations/lib/lucky-orange.js",function(exports,require,module){var Identify=require("facade").Identify;var integration=require("integration");var load=require("load-script");var user;module.exports=exports=function(analytics){analytics.addIntegration(LuckyOrange);user=analytics.user()};var LuckyOrange=exports.Integration=integration("Lucky Orange").assumesPageview().readyOnLoad().global("_loq").global("__wtw_watcher_added").global("__wtw_lucky_site_id").global("__wtw_lucky_is_segment_io").global("__wtw_custom_user_data").option("siteId",null);LuckyOrange.prototype.initialize=function(page){window._loq||(window._loq=[]);window.__wtw_lucky_site_id=this.options.siteId;this.identify(new Identify({traits:user.traits(),userId:user.id()}));this.load()};LuckyOrange.prototype.loaded=function(){return!!window.__wtw_watcher_added};LuckyOrange.prototype.load=function(callback){var cache=Math.floor((new Date).getTime()/6e4);load({http:"http://www.luckyorange.com/w.js?"+cache,https:"https://ssl.luckyorange.com/w.js?"+cache},callback)};LuckyOrange.prototype.identify=function(identify){var traits=window.__wtw_custom_user_data=identify.traits();var email=identify.email();var name=identify.name();if(name)traits.name=name;if(email)traits.email=email}});require.register("segmentio-analytics.js-integrations/lib/lytics.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Lytics)};var Lytics=exports.Integration=integration("Lytics").readyOnInitialize().global("jstag").option("cid","").option("cookie","seerid").option("delay",2e3).option("sessionTimeout",1800).option("url","//c.lytics.io");var aliases={sessionTimeout:"sessecs"};Lytics.prototype.initialize=function(page){var options=alias(this.options,aliases);window.jstag=function(){var t={_q:[],_c:options,ts:(new Date).getTime()};t.send=function(){this._q.push(["ready","send",Array.prototype.slice.call(arguments)]);return this};return t}();this.load()};Lytics.prototype.loaded=function(){return!!(window.jstag&&window.jstag.bind)};Lytics.prototype.load=function(callback){load("//c.lytics.io/static/io.min.js",callback)};Lytics.prototype.page=function(page){window.jstag.send(page.properties())};Lytics.prototype.identify=function(identify){var traits=identify.traits({userId:"_uid"});window.jstag.send(traits)};Lytics.prototype.track=function(track){var props=track.properties();props._e=track.event();window.jstag.send(props)}});require.register("segmentio-analytics.js-integrations/lib/mixpanel.js",function(exports,require,module){var alias=require("alias");var clone=require("clone");var dates=require("convert-dates");var integration=require("integration");var iso=require("to-iso-string");var load=require("load-script");var indexof=require("indexof");var del=require("obj-case").del;module.exports=exports=function(analytics){analytics.addIntegration(Mixpanel)};var Mixpanel=exports.Integration=integration("Mixpanel").readyOnLoad().global("mixpanel").option("increments",[]).option("cookieName","").option("nameTag",true).option("pageview",false).option("people",false).option("token","").option("trackAllPages",false).option("trackNamedPages",true).option("trackCategorizedPages",true);var optionsAliases={cookieName:"cookie_name"};Mixpanel.prototype.initialize=function(){(function(c,a){window.mixpanel=a;var b,d,h,e;a._i=[];a.init=function(b,c,f){function d(a,b){var c=b.split(".");2==c.length&&(a=a[c[0]],b=c[1]);a[b]=function(){a.push([b].concat(Array.prototype.slice.call(arguments,0)))}}var g=a;"undefined"!==typeof f?g=a[f]=[]:f="mixpanel";g.people=g.people||[];h=["disable","track","track_pageview","track_links","track_forms","register","register_once","unregister","identify","alias","name_tag","set_config","people.set","people.increment","people.track_charge","people.append"];for(e=0;e<h.length;e++)d(g,h[e]);a._i.push([b,c,f])};a.__SV=1.2})(document,window.mixpanel||[]);this.options.increments=lowercase(this.options.increments);var options=alias(this.options,optionsAliases);window.mixpanel.init(options.token,options);this.load()};Mixpanel.prototype.loaded=function(){return!!(window.mixpanel&&window.mixpanel.config)};Mixpanel.prototype.load=function(callback){load("//cdn.mxpnl.com/libs/mixpanel-2.2.min.js",callback)};Mixpanel.prototype.page=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(opts.trackAllPages){this.track(page.track())}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};var traitAliases={created:"$created",email:"$email",firstName:"$first_name",lastName:"$last_name",lastSeen:"$last_seen",name:"$name",username:"$username",phone:"$phone"};Mixpanel.prototype.identify=function(identify){var username=identify.username();var email=identify.email();var id=identify.userId();if(id)window.mixpanel.identify(id);var nametag=email||username||id;if(nametag)window.mixpanel.name_tag(nametag);var traits=identify.traits(traitAliases);if(traits.$created)del(traits,"createdAt");window.mixpanel.register(traits);if(this.options.people)window.mixpanel.people.set(traits)};Mixpanel.prototype.track=function(track){var increments=this.options.increments;var increment=track.event().toLowerCase();var people=this.options.people;var props=track.properties();var revenue=track.revenue();if(people&&~indexof(increments,increment)){window.mixpanel.people.increment(track.event());window.mixpanel.people.set("Last "+track.event(),new Date)}props=dates(props,iso);window.mixpanel.track(track.event(),props);if(revenue&&people){window.mixpanel.people.track_charge(revenue)}};Mixpanel.prototype.alias=function(alias){var mp=window.mixpanel;var to=alias.to();if(mp.get_distinct_id&&mp.get_distinct_id()===to)return;if(mp.get_property&&mp.get_property("$people_distinct_id")===to)return;mp.alias(to,alias.from())};function lowercase(arr){var ret=new Array(arr.length);for(var i=0;i<arr.length;++i){ret[i]=String(arr[i]).toLowerCase()}return ret}});require.register("segmentio-analytics.js-integrations/lib/mojn.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var is=require("is");module.exports=exports=function(analytics){analytics.addIntegration(Mojn)};var Mojn=exports.Integration=integration("Mojn").option("customerCode","").global("_mojnTrack").readyOnInitialize();Mojn.prototype.initialize=function(){window._mojnTrack=window._mojnTrack||[];window._mojnTrack.push({cid:this.options.customerCode});this.load()};Mojn.prototype.load=function(fn){load("https://track.idtargeting.com/"+this.options.customerCode+"/track.js",fn)};Mojn.prototype.loaded=function(){return is.object(window._mojnTrack)};Mojn.prototype.identify=function(identify){var email=identify.email();if(!email)return;var img=new Image;img.src="//matcher.idtargeting.com/analytics.gif?cid="+this.options.customerCode+"&_mjnctid="+email;img.width=1;img.height=1;return img};Mojn.prototype.track=function(track){var properties=track.properties();var revenue=properties.revenue;var currency=properties.currency||"";var conv=currency+revenue;if(!revenue)return;window._mojnTrack.push({conv:conv});return conv}});require.register("segmentio-analytics.js-integrations/lib/mouseflow.js",function(exports,require,module){var push=require("global-queue")("_mfq");var integration=require("integration");var load=require("load-script");var each=require("each");module.exports=exports=function(analytics){analytics.addIntegration(Mouseflow)};var Mouseflow=exports.Integration=integration("Mouseflow").assumesPageview().readyOnLoad().global("mouseflow").global("_mfq").option("apiKey","").option("mouseflowHtmlDelay",0);Mouseflow.prototype.initialize=function(page){this.load()};Mouseflow.prototype.loaded=function(){return!!(window._mfq&&[].push!=window._mfq.push)};Mouseflow.prototype.load=function(fn){var apiKey=this.options.apiKey;window.mouseflowHtmlDelay=this.options.mouseflowHtmlDelay;load("//cdn.mouseflow.com/projects/"+apiKey+".js",fn)};Mouseflow.prototype.page=function(page){if(!window.mouseflow)return;if("function"!=typeof mouseflow.newPageView)return;mouseflow.newPageView()};Mouseflow.prototype.identify=function(identify){set(identify.traits())};Mouseflow.prototype.track=function(track){var props=track.properties();props.event=track.event();set(props)};function set(hash){each(hash,function(k,v){push("setVariable",k,v)})}});require.register("segmentio-analytics.js-integrations/lib/mousestats.js",function(exports,require,module){var each=require("each");var integration=require("integration");var is=require("is");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(MouseStats)};var MouseStats=exports.Integration=integration("MouseStats").assumesPageview().readyOnLoad().global("msaa").global("MouseStatsVisitorPlaybacks").option("accountNumber","");MouseStats.prototype.initialize=function(page){this.load()};MouseStats.prototype.loaded=function(){return is.array(window.MouseStatsVisitorPlaybacks)};MouseStats.prototype.load=function(callback){var number=this.options.accountNumber;var path=number.slice(0,1)+"/"+number.slice(1,2)+"/"+number;var cache=Math.floor((new Date).getTime()/6e4);var partial=".mousestats.com/js/"+path+".js?"+cache;var http="http://www2"+partial;var https="https://ssl"+partial;load({http:http,https:https},callback)};MouseStats.prototype.identify=function(identify){each(identify.traits(),function(key,value){window.MouseStatsVisitorPlaybacks.customVariable(key,value)})}});require.register("segmentio-analytics.js-integrations/lib/navilytics.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var push=require("global-queue")("__nls");module.exports=exports=function(analytics){analytics.addIntegration(Navilytics)};var Navilytics=exports.Integration=integration("Navilytics").assumesPageview().readyOnLoad().global("__nls").option("memberId","").option("projectId","");Navilytics.prototype.initialize=function(page){window.__nls=window.__nls||[];this.load()};Navilytics.prototype.loaded=function(){return!!(window.__nls&&[].push!=window.__nls.push)};Navilytics.prototype.load=function(callback){var mid=this.options.memberId;var pid=this.options.projectId;var url="//www.navilytics.com/nls.js?mid="+mid+"&pid="+pid;load(url,callback)};Navilytics.prototype.track=function(track){push("tagRecording",track.event())}});require.register("segmentio-analytics.js-integrations/lib/olark.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var https=require("use-https");module.exports=exports=function(analytics){analytics.addIntegration(Olark)};var Olark=exports.Integration=integration("Olark").assumesPageview().readyOnInitialize().global("olark").option("identify",true).option("page",true).option("siteId","").option("track",false);Olark.prototype.initialize=function(page){window.olark||function(c){var f=window,d=document,l=https()?"https:":"http:",z=c.name,r="load";var nt=function(){f[z]=function(){(a.s=a.s||[]).push(arguments)};var a=f[z]._={},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={0:+new Date};a.P=function(u){a.p[u]=new Date-a.p[0]};function s(){a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){hd="head";return["<",hd,"></",hd,"><",i," onl"+'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{b.contentWindow[g].open()}catch(w){c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{var t=b.contentWindow[g];t.write(p());t.close()}catch(x){b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()}({loader:"static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});window.olark.identify(this.options.siteId);var self=this;box("onExpand",function(){self._open=true});box("onShrink",function(){self._open=false})};Olark.prototype.page=function(page){if(!this.options.page||!this._open)return;var props=page.properties();var name=page.fullName();if(!name&&!props.url)return;var msg=name?name.toLowerCase()+" page":props.url;chat("sendNotificationToOperator",{body:"looking at "+msg})};Olark.prototype.identify=function(identify){if(!this.options.identify)return;var username=identify.username();var traits=identify.traits();var id=identify.userId();var email=identify.email();var phone=identify.phone();var name=identify.name()||identify.firstName();visitor("updateCustomFields",traits);if(email)visitor("updateEmailAddress",{emailAddress:email});if(phone)visitor("updatePhoneNumber",{phoneNumber:phone});if(name)visitor("updateFullName",{fullName:name});var nickname=name||email||username||id;if(name&&email)nickname+=" ("+email+")";if(nickname)chat("updateVisitorNickname",{snippet:nickname})};Olark.prototype.track=function(track){if(!this.options.track||!this._open)return;chat("sendNotificationToOperator",{body:'visitor triggered "'+track.event()+'"'})};function box(action,value){window.olark("api.box."+action,value)}function visitor(action,value){window.olark("api.visitor."+action,value)}function chat(action,value){window.olark("api.chat."+action,value)}});require.register("segmentio-analytics.js-integrations/lib/optimizely.js",function(exports,require,module){var bind=require("bind");var callback=require("callback");var each=require("each");var integration=require("integration");var push=require("global-queue")("optimizely");var tick=require("next-tick");var analytics;module.exports=exports=function(ajs){ajs.addIntegration(Optimizely);analytics=ajs};var Optimizely=exports.Integration=integration("Optimizely").readyOnInitialize().option("variations",true).option("trackNamedPages",true).option("trackCategorizedPages",true);Optimizely.prototype.initialize=function(){if(this.options.variations)tick(this.replay)};Optimizely.prototype.track=function(track){var props=track.properties();if(props.revenue)props.revenue*=100;push("trackEvent",track.event(),props)};Optimizely.prototype.page=function(page){var category=page.category();var name=page.fullName();var opts=this.options;if(category&&opts.trackCategorizedPages){this.track(page.track(category))}if(name&&opts.trackNamedPages){this.track(page.track(name))}};Optimizely.prototype.replay=function(){if(!window.optimizely)return;var data=window.optimizely.data;if(!data)return;var experiments=data.experiments;var map=data.state.variationNamesMap;var traits={};each(map,function(experimentId,variation){var experiment=experiments[experimentId].name;traits["Experiment: "+experiment]=variation});analytics.identify(traits)}});require.register("segmentio-analytics.js-integrations/lib/perfect-audience.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(PerfectAudience)};var PerfectAudience=exports.Integration=integration("Perfect Audience").assumesPageview().readyOnLoad().global("_pa").option("siteId","");PerfectAudience.prototype.initialize=function(page){window._pa=window._pa||{};this.load()};PerfectAudience.prototype.loaded=function(){return!!(window._pa&&window._pa.track)};PerfectAudience.prototype.load=function(callback){var id=this.options.siteId;load("//tag.perfectaudience.com/serve/"+id+".js",callback)};PerfectAudience.prototype.track=function(track){window._pa.track(track.event(),track.properties())}});require.register("segmentio-analytics.js-integrations/lib/pingdom.js",function(exports,require,module){var date=require("load-date");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_prum");module.exports=exports=function(analytics){analytics.addIntegration(Pingdom)};var Pingdom=exports.Integration=integration("Pingdom").assumesPageview().readyOnLoad().global("_prum").option("id","");Pingdom.prototype.initialize=function(page){window._prum=window._prum||[];push("id",this.options.id);push("mark","firstbyte",date.getTime());this.load()};Pingdom.prototype.loaded=function(){return!!(window._prum&&window._prum.push!==Array.prototype.push)};Pingdom.prototype.load=function(callback){load("//rum-static.pingdom.net/prum.min.js",callback)}});require.register("segmentio-analytics.js-integrations/lib/piwik.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_paq");var each=require("each");module.exports=exports=function(analytics){analytics.addIntegration(Piwik)};var Piwik=exports.Integration=integration("Piwik").global("_paq").option("url",null).option("siteId","").readyOnInitialize().mapping("goals");Piwik.prototype.initialize=function(){window._paq=window._paq||[];push("setSiteId",this.options.siteId);push("setTrackerUrl",this.options.url+"/piwik.php");push("enableLinkTracking");this.load()};Piwik.prototype.load=function(callback){load(this.options.url+"/piwik.js",callback)};Piwik.prototype.loaded=function(){return!!(window._paq&&window._paq.push!=[].push)};Piwik.prototype.page=function(page){push("trackPageView")};Piwik.prototype.track=function(track){var goals=this.goals(track.event());var revenue=track.revenue()||0;each(goals,function(goal){push("trackGoal",goal,revenue)})}});require.register("segmentio-analytics.js-integrations/lib/preact.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var convertDates=require("convert-dates");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_lnq");module.exports=exports=function(analytics){analytics.addIntegration(Preact)};var Preact=exports.Integration=integration("Preact").assumesPageview().readyOnInitialize().global("_lnq").option("projectCode","");Preact.prototype.initialize=function(page){window._lnq=window._lnq||[];push("_setCode",this.options.projectCode);this.load()};Preact.prototype.loaded=function(){return!!(window._lnq&&window._lnq.push!==Array.prototype.push)};Preact.prototype.load=function(callback){load("//d2bbvl6dq48fa6.cloudfront.net/js/ln-2.4.min.js",callback)};Preact.prototype.identify=function(identify){if(!identify.userId())return;var traits=identify.traits({created:"created_at"});traits=convertDates(traits,convertDate);push("_setPersonData",{name:identify.name(),email:identify.email(),uid:identify.userId(),properties:traits})};Preact.prototype.group=function(group){if(!group.groupId())return;push("_setAccount",group.traits())};Preact.prototype.track=function(track){var props=track.properties();var revenue=track.revenue();var event=track.event();var special={name:event};if(revenue){special.revenue=revenue*100;delete props.revenue}if(props.note){special.note=props.note;delete props.note}push("_logEvent",special,props)};function convertDate(date){return Math.floor(date/1e3)}});require.register("segmentio-analytics.js-integrations/lib/qualaroo.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_kiq");var Facade=require("facade");var Identify=Facade.Identify;module.exports=exports=function(analytics){analytics.addIntegration(Qualaroo)};var Qualaroo=exports.Integration=integration("Qualaroo").assumesPageview().readyOnInitialize().global("_kiq").option("customerId","").option("siteToken","").option("track",false);Qualaroo.prototype.initialize=function(page){window._kiq=window._kiq||[];this.load()};Qualaroo.prototype.loaded=function(){return!!(window._kiq&&window._kiq.push!==Array.prototype.push)};Qualaroo.prototype.load=function(callback){var token=this.options.siteToken;var id=this.options.customerId;load("//s3.amazonaws.com/ki.js/"+id+"/"+token+".js",callback)};Qualaroo.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();var email=identify.email();if(email)id=email;if(id)push("identify",id);if(traits)push("set",traits)};Qualaroo.prototype.track=function(track){if(!this.options.track)return;var event=track.event();var traits={};traits["Triggered: "+event]=true;this.identify(new Identify({traits:traits}))}});require.register("segmentio-analytics.js-integrations/lib/quantcast.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_qevents",{wrap:false});var user;module.exports=exports=function(analytics){analytics.addIntegration(Quantcast);user=analytics.user()};var Quantcast=exports.Integration=integration("Quantcast").assumesPageview().readyOnInitialize().global("_qevents").global("__qc").option("pCode",null).option("advertise",false);Quantcast.prototype.initialize=function(page){window._qevents=window._qevents||[];var opts=this.options;var settings={qacct:opts.pCode};if(user.id())settings.uid=user.id();if(page){settings.labels=this.labels("page",page.category(),page.name())}push(settings);this.load()};Quantcast.prototype.loaded=function(){return!!window.__qc};Quantcast.prototype.load=function(callback){load({http:"http://edge.quantserve.com/quant.js",https:"https://secure.quantserve.com/quant.js"},callback)};Quantcast.prototype.page=function(page){var category=page.category();var name=page.name();var settings={event:"refresh",labels:this.labels("page",category,name),qacct:this.options.pCode};if(user.id())settings.uid=user.id();push(settings)};Quantcast.prototype.identify=function(identify){var id=identify.userId();if(id)window._qevents[0].uid=id};Quantcast.prototype.track=function(track){var name=track.event();var revenue=track.revenue();var settings={event:"click",labels:this.labels("event",name),qacct:this.options.pCode};if(null!=revenue)settings.revenue=revenue+"";if(user.id())settings.uid=user.id();push(settings)};Quantcast.prototype.completedOrder=function(track){var name=track.event();var revenue=track.total();var labels=this.labels("event",name);var category=track.category();if(this.options.advertise&&category){labels+=","+this.labels("pcat",category)}var settings={event:"refresh",labels:labels,revenue:revenue+"",orderid:track.orderId(),qacct:this.options.pCode};push(settings)};Quantcast.prototype.labels=function(type){var args=[].slice.call(arguments,1);var advertise=this.options.advertise;var ret=[];if(advertise&&"page"==type)type="event";if(advertise)type="_fp."+type;for(var i=0;i<args.length;++i){if(null==args[i])continue;var value=String(args[i]);ret.push(value.replace(/,/g,";"))}ret=advertise?ret.join(" "):ret.join(".");return[type,ret].join(".")}});require.register("segmentio-analytics.js-integrations/lib/rollbar.js",function(exports,require,module){var integration=require("integration");var is=require("is");var extend=require("extend");module.exports=exports=function(analytics){analytics.addIntegration(RollbarIntegration)};var RollbarIntegration=exports.Integration=integration("Rollbar").readyOnInitialize().global("Rollbar").option("identify",true).option("accessToken","").option("environment","unknown").option("captureUncaught",true);RollbarIntegration.prototype.initialize=function(page){var _rollbarConfig=this.config={accessToken:this.options.accessToken,captureUncaught:this.options.captureUncaught,payload:{environment:this.options.environment}};!function(a){function b(b){this.shimId=++g,this.notifier=null,this.parentShim=b,this.logger=function(){},a.console&&void 0===a.console.shimId&&(this.logger=a.console.log)}function c(b,c,d){!d[4]&&a._rollbarWrappedError&&(d[4]=a._rollbarWrappedError,a._rollbarWrappedError=null),b.uncaughtError.apply(b,d),c&&c.apply(a,d)}function d(c){var d=b;return f(function(){if(this.notifier)return this.notifier[c].apply(this.notifier,arguments);var b=this,e="scope"===c;e&&(b=new d(this));var f=Array.prototype.slice.call(arguments,0),g={shim:b,method:c,args:f,ts:new Date};return a._rollbarShimQueue.push(g),e?b:void 0})}function e(a,b){if(b.hasOwnProperty&&b.hasOwnProperty("addEventListener")){var c=b.addEventListener;b.addEventListener=function(b,d,e){c.call(this,b,a.wrap(d),e)};var d=b.removeEventListener;b.removeEventListener=function(a,b,c){d.call(this,a,b._wrapped||b,c)}}}function f(a,b){return b=b||this.logger,function(){try{return a.apply(this,arguments)}catch(c){b("Rollbar internal error:",c)}}}var g=0;b.init=function(a,d){var g=d.globalAlias||"Rollbar";if("object"==typeof a[g])return a[g];a._rollbarShimQueue=[],a._rollbarWrappedError=null,d=d||{};var h=new b;return f(function(){if(h.configure(d),d.captureUncaught){var b=a.onerror;a.onerror=function(){var a=Array.prototype.slice.call(arguments,0);c(h,b,a)};var f,i,j=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];for(f=0;f<j.length;++f)i=j[f],a[i]&&a[i].prototype&&e(h,a[i].prototype)}return a[g]=h,h},h.logger)()},b.prototype.loadFull=function(a,b,c,d,e){var g=f(function(){var a=b.createElement("script"),e=b.getElementsByTagName("script")[0];a.src=d.rollbarJsUrl,a.async=!c,a.onload=h,e.parentNode.insertBefore(a,e)},this.logger),h=f(function(){var b;if(void 0===a._rollbarPayloadQueue){var c,d,f,g;for(b=new Error("rollbar.js did not load");c=a._rollbarShimQueue.shift();)for(f=c.args,g=0;g<f.length;++g)if(d=f[g],"function"==typeof d){d(b);break}}e&&e(b)},this.logger);f(function(){c?g():a.addEventListener?a.addEventListener("load",g,!1):a.attachEvent("onload",g)},this.logger)()},b.prototype.wrap=function(b){if("function"!=typeof b)return b;if(b._isWrap)return b;if(!b._wrapped){b._wrapped=function(){try{return b.apply(this,arguments)}catch(c){throw a._rollbarWrappedError=c,c}},b._wrapped._isWrap=!0;for(var c in b)b.hasOwnProperty(c)&&(b._wrapped[c]=b[c])}return b._wrapped};for(var h="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),i=0;i<h.length;++i)b.prototype[h[i]]=d(h[i]);var j="//d37gvrvc0wt4s1.cloudfront.net/js/v1.0/rollbar.min.js";_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||j,b.init(a,_rollbarConfig)}(window,document);this.load()};RollbarIntegration.prototype.loaded=function(){return is.object(window.Rollbar)&&null==window.Rollbar.shimId};RollbarIntegration.prototype.load=function(callback){window.Rollbar.loadFull(window,document,true,this.config,callback)};RollbarIntegration.prototype.identify=function(identify){if(!this.options.identify)return;var uid=identify.userId();if(uid===null||uid===undefined)return;var rollbar=window.Rollbar;var person={id:uid};extend(person,identify.traits());rollbar.configure({payload:{person:person}})}});require.register("segmentio-analytics.js-integrations/lib/saasquatch.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(SaaSquatch)};var SaaSquatch=exports.Integration=integration("SaaSquatch").readyOnInitialize().option("tenantAlias","").global("_sqh");SaaSquatch.prototype.initialize=function(page){};SaaSquatch.prototype.loaded=function(){return window._sqh&&window._sqh.push!=[].push};SaaSquatch.prototype.load=function(fn){load("//d2rcp9ak152ke1.cloudfront.net/assets/javascripts/squatch.min.js",fn)};SaaSquatch.prototype.identify=function(identify){var sqh=window._sqh=window._sqh||[];var accountId=identify.proxy("traits.accountId");var image=identify.proxy("traits.referralImage");var opts=identify.options(this.name);var id=identify.userId();var email=identify.email();if(!(id||email))return;if(this.called)return;var init={tenant_alias:this.options.tenantAlias,first_name:identify.firstName(),last_name:identify.lastName(),user_image:identify.avatar(),email:email,user_id:id};if(accountId)init.account_id=accountId;if(opts.checksum)init.checksum=opts.checksum;if(image)init.fb_share_image=image;sqh.push(["init",init]);this.called=true;this.load()}});require.register("segmentio-analytics.js-integrations/lib/sentry.js",function(exports,require,module){var integration=require("integration");var is=require("is");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Sentry)};var Sentry=exports.Integration=integration("Sentry").readyOnLoad().global("Raven").option("config","");Sentry.prototype.initialize=function(){var config=this.options.config;this.load(function(){window.Raven.config(config).install()})};Sentry.prototype.loaded=function(){return is.object(window.Raven)};Sentry.prototype.load=function(callback){load("//cdn.ravenjs.com/1.1.10/native/raven.min.js",callback)};Sentry.prototype.identify=function(identify){window.Raven.setUser(identify.traits())}});require.register("segmentio-analytics.js-integrations/lib/snapengage.js",function(exports,require,module){var integration=require("integration");var is=require("is");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(SnapEngage)};var SnapEngage=exports.Integration=integration("SnapEngage").assumesPageview().readyOnLoad().global("SnapABug").option("apiKey","");SnapEngage.prototype.initialize=function(page){this.load()};SnapEngage.prototype.loaded=function(){return is.object(window.SnapABug)};SnapEngage.prototype.load=function(callback){var key=this.options.apiKey;var url="//commondatastorage.googleapis.com/code.snapengage.com/js/"+key+".js";load(url,callback)};SnapEngage.prototype.identify=function(identify){var email=identify.email();if(!email)return;window.SnapABug.setUserEmail(email)}});require.register("segmentio-analytics.js-integrations/lib/spinnakr.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Spinnakr)};var Spinnakr=exports.Integration=integration("Spinnakr").assumesPageview().readyOnLoad().global("_spinnakr_site_id").global("_spinnakr").option("siteId","");Spinnakr.prototype.initialize=function(page){window._spinnakr_site_id=this.options.siteId;this.load()};Spinnakr.prototype.loaded=function(){return!!window._spinnakr};Spinnakr.prototype.load=function(callback){load("//d3ojzyhbolvoi5.cloudfront.net/js/so.js",callback)
}});require.register("segmentio-analytics.js-integrations/lib/tapstream.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");var slug=require("slug");var push=require("global-queue")("_tsq");module.exports=exports=function(analytics){analytics.addIntegration(Tapstream)};var Tapstream=exports.Integration=integration("Tapstream").assumesPageview().readyOnInitialize().global("_tsq").option("accountName","").option("trackAllPages",true).option("trackNamedPages",true).option("trackCategorizedPages",true);Tapstream.prototype.initialize=function(page){window._tsq=window._tsq||[];push("setAccountName",this.options.accountName);this.load()};Tapstream.prototype.loaded=function(){return!!(window._tsq&&window._tsq.push!==Array.prototype.push)};Tapstream.prototype.load=function(callback){load("//cdn.tapstream.com/static/js/tapstream.js",callback)};Tapstream.prototype.page=function(page){var category=page.category();var opts=this.options;var name=page.fullName();if(opts.trackAllPages){this.track(page.track())}if(name&&opts.trackNamedPages){this.track(page.track(name))}if(category&&opts.trackCategorizedPages){this.track(page.track(category))}};Tapstream.prototype.track=function(track){var props=track.properties();push("fireHit",slug(track.event()),[props.url])}});require.register("segmentio-analytics.js-integrations/lib/trakio.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var clone=require("clone");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Trakio)};var Trakio=exports.Integration=integration("trak.io").assumesPageview().readyOnInitialize().global("trak").option("token","").option("trackNamedPages",true).option("trackCategorizedPages",true);var optionsAliases={initialPageview:"auto_track_page_view"};Trakio.prototype.initialize=function(page){var self=this;var options=this.options;window.trak=window.trak||[];window.trak.io=window.trak.io||{};window.trak.io.load=function(e){self.load();var r=function(e){return function(){window.trak.push([e].concat(Array.prototype.slice.call(arguments,0)))}},i=["initialize","identify","track","alias","channel","source","host","protocol","page_view"];for(var s=0;s<i.length;s++)window.trak.io[i[s]]=r(i[s]);window.trak.io.initialize.apply(window.trak.io,arguments)};window.trak.io.load(options.token,alias(options,optionsAliases));this.load()};Trakio.prototype.loaded=function(){return!!(window.trak&&window.trak.loaded)};Trakio.prototype.load=function(callback){load("//d29p64779x43zo.cloudfront.net/v1/trak.io.min.js",callback)};Trakio.prototype.page=function(page){var category=page.category();var props=page.properties();var name=page.fullName();window.trak.io.page_view(props.path,name||props.title);if(name&&this.options.trackNamedPages){this.track(page.track(name))}if(category&&this.options.trackCategorizedPages){this.track(page.track(category))}};var traitAliases={avatar:"avatar_url",firstName:"first_name",lastName:"last_name"};Trakio.prototype.identify=function(identify){var traits=identify.traits(traitAliases);var id=identify.userId();if(id){window.trak.io.identify(id,traits)}else{window.trak.io.identify(traits)}};Trakio.prototype.track=function(track){window.trak.io.track(track.event(),track.properties())};Trakio.prototype.alias=function(alias){if(!window.trak.io.distinct_id)return;var from=alias.from();var to=alias.to();if(to===window.trak.io.distinct_id())return;if(from){window.trak.io.alias(from,to)}else{window.trak.io.alias(to)}}});require.register("segmentio-analytics.js-integrations/lib/twitter-ads.js",function(exports,require,module){var pixel=require("load-pixel")("//analytics.twitter.com/i/adsct");var integration=require("integration");module.exports=exports=function(analytics){analytics.addIntegration(TwitterAds)};exports.load=pixel;var has=Object.prototype.hasOwnProperty;var TwitterAds=exports.Integration=integration("Twitter Ads").readyOnInitialize().option("events",{});TwitterAds.prototype.track=function(track){var events=this.options.events;var event=track.event();if(!has.call(events,event))return;return exports.load({txn_id:events[event],p_id:"Twitter"})}});require.register("segmentio-analytics.js-integrations/lib/usercycle.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_uc");module.exports=exports=function(analytics){analytics.addIntegration(Usercycle)};var Usercycle=exports.Integration=integration("USERcycle").assumesPageview().readyOnInitialize().global("_uc").option("key","");Usercycle.prototype.initialize=function(page){push("_key",this.options.key);this.load()};Usercycle.prototype.loaded=function(){return!!(window._uc&&window._uc.push!==Array.prototype.push)};Usercycle.prototype.load=function(callback){load("//api.usercycle.com/javascripts/track.js",callback)};Usercycle.prototype.identify=function(identify){var traits=identify.traits();var id=identify.userId();if(id)push("uid",id);push("action","came_back",traits)};Usercycle.prototype.track=function(track){push("action",track.event(),track.properties({revenue:"revenue_amount"}))}});require.register("segmentio-analytics.js-integrations/lib/userfox.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var convertDates=require("convert-dates");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_ufq");module.exports=exports=function(analytics){analytics.addIntegration(Userfox)};var Userfox=exports.Integration=integration("userfox").assumesPageview().readyOnInitialize().global("_ufq").option("clientId","");Userfox.prototype.initialize=function(page){window._ufq=[];this.load()};Userfox.prototype.loaded=function(){return!!(window._ufq&&window._ufq.push!==Array.prototype.push)};Userfox.prototype.load=function(callback){load("//d2y71mjhnajxcg.cloudfront.net/js/userfox-stable.js",callback)};Userfox.prototype.identify=function(identify){var traits=identify.traits({created:"signup_date"});var email=identify.email();if(!email)return;push("init",{clientId:this.options.clientId,email:email});traits=convertDates(traits,formatDate);push("track",traits)};function formatDate(date){return Math.round(date.getTime()/1e3).toString()}});require.register("segmentio-analytics.js-integrations/lib/uservoice.js",function(exports,require,module){var alias=require("alias");var callback=require("callback");var clone=require("clone");var convertDates=require("convert-dates");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("UserVoice");var unix=require("to-unix-timestamp");module.exports=exports=function(analytics){analytics.addIntegration(UserVoice)};var UserVoice=exports.Integration=integration("UserVoice").assumesPageview().readyOnInitialize().global("UserVoice").global("showClassicWidget").option("apiKey","").option("classic",false).option("forumId",null).option("showWidget",true).option("mode","contact").option("accentColor","#448dd6").option("smartvote",true).option("trigger",null).option("triggerPosition","bottom-right").option("triggerColor","#ffffff").option("triggerBackgroundColor","rgba(46, 49, 51, 0.6)").option("classicMode","full").option("primaryColor","#cc6d00").option("linkColor","#007dbf").option("defaultMode","support").option("tabLabel","Feedback & Support").option("tabColor","#cc6d00").option("tabPosition","middle-right").option("tabInverted",false);UserVoice.on("construct",function(integration){if(!integration.options.classic)return;integration.group=undefined;integration.identify=integration.identifyClassic;integration.initialize=integration.initializeClassic});UserVoice.prototype.initialize=function(page){var options=this.options;var opts=formatOptions(options);push("set",opts);push("autoprompt",{});if(options.showWidget){options.trigger?push("addTrigger",options.trigger,opts):push("addTrigger",opts)}this.load()};UserVoice.prototype.loaded=function(){return!!(window.UserVoice&&window.UserVoice.push!==Array.prototype.push)};UserVoice.prototype.load=function(callback){var key=this.options.apiKey;load("//widget.uservoice.com/"+key+".js",callback)};UserVoice.prototype.identify=function(identify){var traits=identify.traits({created:"created_at"});traits=convertDates(traits,unix);push("identify",traits)};UserVoice.prototype.group=function(group){var traits=group.traits({created:"created_at"});traits=convertDates(traits,unix);push("identify",{account:traits})};UserVoice.prototype.initializeClassic=function(){var options=this.options;window.showClassicWidget=showClassicWidget;if(options.showWidget)showClassicWidget("showTab",formatClassicOptions(options));this.load()};UserVoice.prototype.identifyClassic=function(identify){push("setCustomFields",identify.traits())};function formatOptions(options){return alias(options,{forumId:"forum_id",accentColor:"accent_color",smartvote:"smartvote_enabled",triggerColor:"trigger_color",triggerBackgroundColor:"trigger_background_color",triggerPosition:"trigger_position"})}function formatClassicOptions(options){return alias(options,{forumId:"forum_id",classicMode:"mode",primaryColor:"primary_color",tabPosition:"tab_position",tabColor:"tab_color",linkColor:"link_color",defaultMode:"default_mode",tabLabel:"tab_label",tabInverted:"tab_inverted"})}function showClassicWidget(type,options){type=type||"showLightbox";push(type,"classic_widget",options)}});require.register("segmentio-analytics.js-integrations/lib/vero.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");var push=require("global-queue")("_veroq");module.exports=exports=function(analytics){analytics.addIntegration(Vero)};var Vero=exports.Integration=integration("Vero").readyOnInitialize().global("_veroq").option("apiKey","");Vero.prototype.initialize=function(pgae){push("init",{api_key:this.options.apiKey});this.load()};Vero.prototype.loaded=function(){return!!(window._veroq&&window._veroq.push!==Array.prototype.push)};Vero.prototype.load=function(callback){load("//d3qxef4rp70elm.cloudfront.net/m.js",callback)};Vero.prototype.page=function(page){push("trackPageview")};Vero.prototype.identify=function(identify){var traits=identify.traits();var email=identify.email();var id=identify.userId();if(!id||!email)return;push("user",traits)};Vero.prototype.track=function(track){push("track",track.event(),track.properties())}});require.register("segmentio-analytics.js-integrations/lib/visual-website-optimizer.js",function(exports,require,module){var callback=require("callback");var each=require("each");var integration=require("integration");var tick=require("next-tick");var analytics;module.exports=exports=function(ajs){ajs.addIntegration(VWO);analytics=ajs};var VWO=exports.Integration=integration("Visual Website Optimizer").readyOnInitialize().option("replay",true);VWO.prototype.initialize=function(){if(this.options.replay)this.replay()};VWO.prototype.replay=function(){tick(function(){experiments(function(err,traits){if(traits)analytics.identify(traits)})})};function experiments(callback){enqueue(function(){var data={};var ids=window._vwo_exp_ids;if(!ids)return callback();each(ids,function(id){var name=variation(id);if(name)data["Experiment: "+id]=name});callback(null,data)})}function enqueue(fn){window._vis_opt_queue=window._vis_opt_queue||[];window._vis_opt_queue.push(fn)}function variation(id){var experiments=window._vwo_exp;if(!experiments)return null;var experiment=experiments[id];var variationId=experiment.combination_chosen;return variationId?experiment.comb_n[variationId]:null}});require.register("segmentio-analytics.js-integrations/lib/webengage.js",function(exports,require,module){var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(WebEngage)};var WebEngage=exports.Integration=integration("WebEngage").assumesPageview().readyOnLoad().global("_weq").global("webengage").option("widgetVersion","4.0").option("licenseCode","");WebEngage.prototype.initialize=function(page){var _weq=window._weq=window._weq||{};_weq["webengage.licenseCode"]=this.options.licenseCode;_weq["webengage.widgetVersion"]=this.options.widgetVersion;this.load()};WebEngage.prototype.loaded=function(){return!!window.webengage};WebEngage.prototype.load=function(fn){var path="/js/widget/webengage-min-v-4.0.js";load({https:"https://ssl.widgets.webengage.com"+path,http:"http://cdn.widgets.webengage.com"+path},fn)}});require.register("segmentio-analytics.js-integrations/lib/woopra.js",function(exports,require,module){var integration=require("integration");var snake=require("to-snake-case");var load=require("load-script");var isEmail=require("is-email");var extend=require("extend");var each=require("each");var type=require("type");module.exports=exports=function(analytics){analytics.addIntegration(Woopra)};var Woopra=exports.Integration=integration("Woopra").readyOnLoad().global("woopra").option("domain","").option("cookieName","wooTracker").option("cookieDomain",null).option("cookiePath","/").option("ping",true).option("pingInterval",12e3).option("idleTimeout",3e5).option("downloadTracking",true).option("outgoingTracking",true).option("outgoingIgnoreSubdomain",true).option("downloadPause",200).option("outgoingPause",400).option("ignoreQueryUrl",true).option("hideCampaign",false);Woopra.prototype.initialize=function(page){(function(){var i,s,z,w=window,d=document,a=arguments,q="script",f=["config","track","identify","visit","push","call"],c=function(){var i,self=this;self._e=[];for(i=0;i<f.length;i++){(function(f){self[f]=function(){self._e.push([f].concat(Array.prototype.slice.call(arguments,0)));return self}})(f[i])}};w._w=w._w||{};for(i=0;i<a.length;i++){w._w[a[i]]=w[a[i]]=w[a[i]]||new c}})("woopra");this.load();each(this.options,function(key,value){key=snake(key);if(null==value)return;if(""==value)return;window.woopra.config(key,value)})};Woopra.prototype.loaded=function(){return!!(window.woopra&&window.woopra.loaded)};Woopra.prototype.load=function(callback){load("//static.woopra.com/js/w.js",callback)};Woopra.prototype.page=function(page){var props=page.properties();var name=page.fullName();if(name)props.title=name;window.woopra.track("pv",props)};Woopra.prototype.identify=function(identify){window.woopra.identify(identify.traits()).push()};Woopra.prototype.track=function(track){window.woopra.track(track.event(),track.properties())}});require.register("segmentio-analytics.js-integrations/lib/yandex-metrica.js",function(exports,require,module){var callback=require("callback");var integration=require("integration");var load=require("load-script");module.exports=exports=function(analytics){analytics.addIntegration(Yandex)};var Yandex=exports.Integration=integration("Yandex Metrica").assumesPageview().readyOnInitialize().global("yandex_metrika_callbacks").global("Ya").option("counterId",null);Yandex.prototype.initialize=function(page){var id=this.options.counterId;push(function(){window["yaCounter"+id]=new window.Ya.Metrika({id:id})});this.load()};Yandex.prototype.loaded=function(){return!!(window.Ya&&window.Ya.Metrika)};Yandex.prototype.load=function(callback){load("//mc.yandex.ru/metrika/watch.js",callback)};function push(callback){window.yandex_metrika_callbacks=window.yandex_metrika_callbacks||[];window.yandex_metrika_callbacks.push(callback)}});require.register("segmentio-canonical/index.js",function(exports,require,module){module.exports=function canonical(){var tags=document.getElementsByTagName("link");for(var i=0,tag;tag=tags[i];i++){if("canonical"==tag.getAttribute("rel"))return tag.getAttribute("href")}}});require.register("segmentio-extend/index.js",function(exports,require,module){module.exports=function extend(object){var args=Array.prototype.slice.call(arguments,1);for(var i=0,source;source=args[i];i++){if(!source)continue;for(var property in source){object[property]=source[property]}}return object}});require.register("camshaft-require-component/index.js",function(exports,require,module){module.exports=function(parent){function require(name,fallback){try{return parent(name)}catch(e){try{return parent(fallback||name+"-component")}catch(e2){throw e}}}for(var key in parent){require[key]=parent[key]}return require}});require.register("segmentio-facade/lib/index.js",function(exports,require,module){var Facade=require("./facade");module.exports=Facade;Facade.Alias=require("./alias");Facade.Group=require("./group");Facade.Identify=require("./identify");Facade.Track=require("./track");Facade.Page=require("./page");Facade.Screen=require("./screen")});require.register("segmentio-facade/lib/alias.js",function(exports,require,module){var Facade=require("./facade");var component=require("require-component")(require);var inherit=component("inherit");module.exports=Alias;function Alias(dictionary){Facade.call(this,dictionary)}inherit(Alias,Facade);Alias.prototype.type=Alias.prototype.action=function(){return"alias"};Alias.prototype.from=Alias.prototype.previousId=function(){return this.field("previousId")||this.field("from")};Alias.prototype.to=Alias.prototype.userId=function(){return this.field("userId")||this.field("to")}});require.register("segmentio-facade/lib/facade.js",function(exports,require,module){var component=require("require-component")(require);var clone=component("clone");var isEnabled=component("./is-enabled");var objCase=component("obj-case");var traverse=component("isodate-traverse");module.exports=Facade;function Facade(obj){if(!obj.hasOwnProperty("timestamp"))obj.timestamp=new Date;else obj.timestamp=new Date(obj.timestamp);this.obj=obj}Facade.prototype.proxy=function(field){var fields=field.split(".");field=fields.shift();var obj=this[field]||this.field(field);if(!obj)return obj;if(typeof obj==="function")obj=obj.call(this)||{};if(fields.length===0)return transform(obj);obj=objCase(obj,fields.join("."));return transform(obj)};Facade.prototype.field=function(field){var obj=this.obj[field];return transform(obj)};Facade.proxy=function(field){return function(){return this.proxy(field)}};Facade.field=function(field){return function(){return this.field(field)}};Facade.prototype.json=function(){return clone(this.obj)};Facade.prototype.context=Facade.prototype.options=function(integration){var options=clone(this.obj.options||this.obj.context)||{};if(!integration)return clone(options);if(!this.enabled(integration))return;var integrations=this.integrations();var value=integrations[integration]||objCase(integrations,integration);if("boolean"==typeof value)value={};return value||{}};Facade.prototype.enabled=function(integration){var allEnabled=this.proxy("options.providers.all");if(typeof allEnabled!=="boolean")allEnabled=this.proxy("options.all");if(typeof allEnabled!=="boolean")allEnabled=this.proxy("integrations.all");if(typeof allEnabled!=="boolean")allEnabled=true;var enabled=allEnabled&&isEnabled(integration);var options=this.integrations();if(options.providers&&options.providers.hasOwnProperty(integration)){enabled=options.providers[integration]}if(options.hasOwnProperty(integration)){var settings=options[integration];if(typeof settings==="boolean"){enabled=settings}else{enabled=true}}return enabled?true:false};Facade.prototype.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()};Facade.prototype.active=function(){var active=this.proxy("options.active");if(active===null||active===undefined)active=true;return active};Facade.prototype.sessionId=Facade.prototype.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")};Facade.prototype.library=function(){var library=this.proxy("options.library");if(!library)return{name:"unknown",version:null};if(typeof library==="string")return{name:library,version:null};return library};Facade.prototype.userId=Facade.field("userId");Facade.prototype.channel=Facade.field("channel");Facade.prototype.timestamp=Facade.field("timestamp");Facade.prototype.userAgent=Facade.proxy("options.userAgent");Facade.prototype.ip=Facade.proxy("options.ip");function transform(obj){var cloned=clone(obj);traverse(cloned);return cloned}});require.register("segmentio-facade/lib/group.js",function(exports,require,module){var Facade=require("./facade");var component=require("require-component")(require);var inherit=component("inherit");var newDate=component("new-date");module.exports=Group;function Group(dictionary){Facade.call(this,dictionary)}inherit(Group,Facade);Group.prototype.type=Group.prototype.action=function(){return"group"};Group.prototype.groupId=Facade.field("groupId");Group.prototype.created=function(){var created=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(created)return newDate(created)};Group.prototype.traits=function(aliases){var ret=this.properties();var id=this.groupId();aliases=aliases||{};if(id)ret.id=id;for(var alias in aliases){var value=null==this[alias]?this.proxy("traits."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;delete ret[alias]}return ret};Group.prototype.properties=function(){return this.field("traits")||this.field("properties")||{}}});require.register("segmentio-facade/lib/page.js",function(exports,require,module){var component=require("require-component")(require);var Facade=component("./facade");var inherit=component("inherit");var Track=require("./track");module.exports=Page;function Page(dictionary){Facade.call(this,dictionary)}inherit(Page,Facade);Page.prototype.type=Page.prototype.action=function(){return"page"};Page.prototype.category=Facade.field("category");Page.prototype.name=Facade.field("name");Page.prototype.properties=function(){var props=this.field("properties")||{};var category=this.category();var name=this.name();if(category)props.category=category;if(name)props.name=name;return props};Page.prototype.fullName=function(){var category=this.category();var name=this.name();return name&&category?category+" "+name:name};Page.prototype.event=function(name){return name?"Viewed "+name+" Page":"Loaded a Page"};Page.prototype.track=function(name){var props=this.properties();return new Track({event:this.event(name),properties:props})}});require.register("segmentio-facade/lib/identify.js",function(exports,require,module){var component=require("require-component")(require);var clone=component("clone");var Facade=component("./facade");var inherit=component("inherit");var isEmail=component("is-email");var newDate=component("new-date");var trim=component("trim");module.exports=Identify;function Identify(dictionary){Facade.call(this,dictionary)}inherit(Identify,Facade);Identify.prototype.type=Identify.prototype.action=function(){return"identify"};Identify.prototype.traits=function(aliases){var ret=this.field("traits")||{};var id=this.userId();aliases=aliases||{};if(id)ret.id=id;for(var alias in aliases){var value=null==this[alias]?this.proxy("traits."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;delete ret[alias]}return ret};Identify.prototype.email=function(){var email=this.proxy("traits.email");if(email)return email;var userId=this.userId();if(isEmail(userId))return userId};Identify.prototype.created=function(){var created=this.proxy("traits.created")||this.proxy("traits.createdAt");if(created)return newDate(created)};Identify.prototype.companyCreated=function(){var created=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(created)return newDate(created)};Identify.prototype.name=function(){var name=this.proxy("traits.name");if(typeof name==="string")return trim(name);var firstName=this.firstName();var lastName=this.lastName();if(firstName&&lastName)return trim(firstName+" "+lastName)};Identify.prototype.firstName=function(){var firstName=this.proxy("traits.firstName");if(typeof firstName==="string")return trim(firstName);var name=this.proxy("traits.name");if(typeof name==="string")return trim(name).split(" ")[0]};Identify.prototype.lastName=function(){var lastName=this.proxy("traits.lastName");if(typeof lastName==="string")return trim(lastName);var name=this.proxy("traits.name");if(typeof name!=="string")return;var space=trim(name).indexOf(" ");if(space===-1)return;return trim(name.substr(space+1))};Identify.prototype.uid=function(){return this.userId()||this.username()||this.email()};Identify.prototype.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")};Identify.prototype.username=Facade.proxy("traits.username");Identify.prototype.website=Facade.proxy("traits.website");Identify.prototype.phone=Facade.proxy("traits.phone");Identify.prototype.address=Facade.proxy("traits.address");Identify.prototype.avatar=Facade.proxy("traits.avatar")});require.register("segmentio-facade/lib/is-enabled.js",function(exports,require,module){var disabled={Salesforce:true,Marketo:true};module.exports=function(integration){return!disabled[integration]}});require.register("segmentio-facade/lib/track.js",function(exports,require,module){var component=require("require-component")(require);var clone=component("clone");var Facade=component("./facade");var Identify=component("./identify");var inherit=component("inherit");var isEmail=component("is-email");module.exports=Track;function Track(dictionary){Facade.call(this,dictionary)}inherit(Track,Facade);Track.prototype.type=Track.prototype.action=function(){return"track"};Track.prototype.event=Facade.field("event");Track.prototype.value=Facade.proxy("properties.value");Track.prototype.category=Facade.proxy("properties.category");Track.prototype.country=Facade.proxy("properties.country");Track.prototype.state=Facade.proxy("properties.state");Track.prototype.city=Facade.proxy("properties.city");Track.prototype.zip=Facade.proxy("properties.zip");Track.prototype.id=Facade.proxy("properties.id");Track.prototype.sku=Facade.proxy("properties.sku");Track.prototype.tax=Facade.proxy("properties.tax");Track.prototype.name=Facade.proxy("properties.name");Track.prototype.price=Facade.proxy("properties.price");Track.prototype.total=Facade.proxy("properties.total");Track.prototype.coupon=Facade.proxy("properties.coupon");Track.prototype.shipping=Facade.proxy("properties.shipping");Track.prototype.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.orderId")};Track.prototype.subtotal=function(){var subtotal=this.obj.properties.subtotal;var total=this.total();var n;if(subtotal)return subtotal;if(!total)return 0;if(n=this.tax())total-=n;if(n=this.shipping())total-=n;return total};Track.prototype.products=function(){var props=this.obj.properties||{};return props.products||[]};Track.prototype.quantity=function(){var props=this.obj.properties||{};return props.quantity||1};Track.prototype.currency=function(){var props=this.obj.properties||{};return props.currency||"USD"};Track.prototype.referrer=Facade.proxy("properties.referrer");Track.prototype.query=Facade.proxy("options.query");Track.prototype.properties=function(aliases){var ret=this.field("properties")||{};aliases=aliases||{};for(var alias in aliases){var value=null==this[alias]?this.proxy("properties."+alias):this[alias]();if(null==value)continue;ret[aliases[alias]]=value;delete ret[alias]}return ret};Track.prototype.traits=function(){return this.proxy("options.traits")||{}};Track.prototype.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()};Track.prototype.email=function(){var email=this.proxy("traits.email");email=email||this.proxy("properties.email");if(email)return email;var userId=this.userId();if(isEmail(userId))return userId};Track.prototype.revenue=function(){var revenue=this.proxy("properties.revenue");var event=this.event();if(!revenue&&event&&event.match(/completed ?order/i)){revenue=this.proxy("properties.total")}return currency(revenue)};Track.prototype.cents=function(){var revenue=this.revenue();return"number"!=typeof revenue?this.value()||0:revenue*100};Track.prototype.identify=function(){var json=this.json();json.traits=this.traits();return new Identify(json)};function currency(val){if(!val)return;if(typeof val==="number")return val;if(typeof val!=="string")return;val=val.replace(/\$/g,"");val=parseFloat(val);if(!isNaN(val))return val}});require.register("segmentio-facade/lib/screen.js",function(exports,require,module){var component=require("require-component")(require);var inherit=component("inherit");var Page=component("./page");var Track=require("./track");module.exports=Screen;function Screen(dictionary){Page.call(this,dictionary)}inherit(Screen,Page);Screen.prototype.type=Screen.prototype.action=function(){return"screen"};Screen.prototype.event=function(name){return name?"Viewed "+name+" Screen":"Loaded a Screen"};Screen.prototype.track=function(name){var props=this.properties();return new Track({event:this.event(name),properties:props})}});require.register("segmentio-is-email/index.js",function(exports,require,module){module.exports=isEmail;var matcher=/.+\@.+\..+/;function isEmail(string){return matcher.test(string)}});require.register("segmentio-is-meta/index.js",function(exports,require,module){module.exports=function isMeta(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return true;var which=e.which,button=e.button;if(!which&&button!==undefined){return!button&1&&!button&2&&button&4}else if(which===2){return true}return false}});require.register("segmentio-isodate/index.js",function(exports,require,module){var matcher=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;exports.parse=function(iso){var numericKeys=[1,5,6,7,8,11,12];var arr=matcher.exec(iso);var offset=0;if(!arr)return new Date(iso);for(var i=0,val;val=numericKeys[i];i++){arr[val]=parseInt(arr[val],10)||0}arr[2]=parseInt(arr[2],10)||1;arr[3]=parseInt(arr[3],10)||1;arr[2]--;if(arr[8])arr[8]=(arr[8]+"00").substring(0,3);if(arr[4]==" "){offset=(new Date).getTimezoneOffset()}else if(arr[9]!=="Z"&&arr[10]){offset=arr[11]*60+arr[12];if("+"==arr[10])offset=0-offset}var millis=Date.UTC(arr[1],arr[2],arr[3],arr[5],arr[6]+offset,arr[7],arr[8]);return new Date(millis)};exports.is=function(string,strict){if(strict&&false===/^\d{4}-\d{2}-\d{2}/.test(string))return false;return matcher.test(string)}});require.register("segmentio-isodate-traverse/index.js",function(exports,require,module){var is=require("is");var isodate=require("isodate");var each;try{each=require("each")}catch(err){each=require("each-component")}module.exports=traverse;function traverse(input,strict){if(strict===undefined)strict=true;if(is.object(input)){return object(input,strict)}else if(is.array(input)){return array(input,strict)}}function object(obj,strict){each(obj,function(key,val){if(isodate.is(val,strict)){obj[key]=isodate.parse(val)}else if(is.object(val)||is.array(val)){traverse(val,strict)}});return obj}function array(arr,strict){each(arr,function(val,x){if(is.object(val)){traverse(val,strict)}else if(isodate.is(val,strict)){arr[x]=isodate.parse(val)}});return arr}});require.register("component-json-fallback/index.js",function(exports,require,module){(function(){"use strict";var JSON=module.exports={};function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var cx,escapable,gap,indent,meta,rep;function quote(string){escapable.lastIndex=0;
return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else if(typeof space==="string"){indent=space}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})()});require.register("segmentio-json/index.js",function(exports,require,module){var json=window.JSON||{};var stringify=json.stringify;var parse=json.parse;module.exports=parse&&stringify?JSON:require("json-fallback")});require.register("segmentio-new-date/lib/index.js",function(exports,require,module){var is=require("is");var isodate=require("isodate");var milliseconds=require("./milliseconds");var seconds=require("./seconds");module.exports=function newDate(val){if(is.date(val))return val;if(is.number(val))return new Date(toMs(val));if(isodate.is(val))return isodate.parse(val);if(milliseconds.is(val))return milliseconds.parse(val);if(seconds.is(val))return seconds.parse(val);return new Date(val)};function toMs(num){if(num<315576e5)return num*1e3;return num}});require.register("segmentio-new-date/lib/milliseconds.js",function(exports,require,module){var matcher=/\d{13}/;exports.is=function(string){return matcher.test(string)};exports.parse=function(millis){millis=parseInt(millis,10);return new Date(millis)}});require.register("segmentio-new-date/lib/seconds.js",function(exports,require,module){var matcher=/\d{10}/;exports.is=function(string){return matcher.test(string)};exports.parse=function(seconds){var millis=parseInt(seconds,10)*1e3;return new Date(millis)}});require.register("segmentio-store.js/store.js",function(exports,require,module){(function(win){var store={},doc=win.document,localStorageName="localStorage",namespace="__storejs__",storage;store.disabled=false;store.set=function(key,value){};store.get=function(key){};store.remove=function(key){};store.clear=function(){};store.transact=function(key,defaultVal,transactionFn){var val=store.get(key);if(transactionFn==null){transactionFn=defaultVal;defaultVal=null}if(typeof val=="undefined"){val=defaultVal||{}}transactionFn(val);store.set(key,val)};store.getAll=function(){};store.serialize=function(value){return JSON.stringify(value)};store.deserialize=function(value){if(typeof value!="string"){return undefined}try{return JSON.parse(value)}catch(e){return value||undefined}};function isLocalStorageNameSupported(){try{return localStorageName in win&&win[localStorageName]}catch(err){return false}}if(isLocalStorageNameSupported()){storage=win[localStorageName];store.set=function(key,val){if(val===undefined){return store.remove(key)}storage.setItem(key,store.serialize(val));return val};store.get=function(key){return store.deserialize(storage.getItem(key))};store.remove=function(key){storage.removeItem(key)};store.clear=function(){storage.clear()};store.getAll=function(){var ret={};for(var i=0;i<storage.length;++i){var key=storage.key(i);ret[key]=store.get(key)}return ret}}else if(doc.documentElement.addBehavior){var storageOwner,storageContainer;try{storageContainer=new ActiveXObject("htmlfile");storageContainer.open();storageContainer.write("<s"+"cript>document.w=window</s"+'cript><iframe src="/favicon.ico"></iframe>');storageContainer.close();storageOwner=storageContainer.w.frames[0].document;storage=storageOwner.createElement("div")}catch(e){storage=doc.createElement("div");storageOwner=doc.body}function withIEStorage(storeFunction){return function(){var args=Array.prototype.slice.call(arguments,0);args.unshift(storage);storageOwner.appendChild(storage);storage.addBehavior("#default#userData");storage.load(localStorageName);var result=storeFunction.apply(store,args);storageOwner.removeChild(storage);return result}}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function ieKeyFix(key){return key.replace(forbiddenCharsRegex,"___")}store.set=withIEStorage(function(storage,key,val){key=ieKeyFix(key);if(val===undefined){return store.remove(key)}storage.setAttribute(key,store.serialize(val));storage.save(localStorageName);return val});store.get=withIEStorage(function(storage,key){key=ieKeyFix(key);return store.deserialize(storage.getAttribute(key))});store.remove=withIEStorage(function(storage,key){key=ieKeyFix(key);storage.removeAttribute(key);storage.save(localStorageName)});store.clear=withIEStorage(function(storage){var attributes=storage.XMLDocument.documentElement.attributes;storage.load(localStorageName);for(var i=0,attr;attr=attributes[i];i++){storage.removeAttribute(attr.name)}storage.save(localStorageName)});store.getAll=withIEStorage(function(storage){var attributes=storage.XMLDocument.documentElement.attributes;var ret={};for(var i=0,attr;attr=attributes[i];++i){var key=ieKeyFix(attr.name);ret[attr.name]=store.deserialize(storage.getAttribute(key))}return ret})}try{store.set(namespace,namespace);if(store.get(namespace)!=namespace){store.disabled=true}store.remove(namespace)}catch(e){store.disabled=true}store.enabled=!store.disabled;if(typeof module!="undefined"&&module.exports){module.exports=store}else if(typeof define==="function"&&define.amd){define(store)}else{win.store=store}})(this.window||global)});require.register("segmentio-top-domain/index.js",function(exports,require,module){var parse=require("url").parse;module.exports=domain;var regexp=/[a-z0-9][a-z0-9\-]*[a-z0-9]\.[a-z\.]{2,6}$/i;function domain(url){var host=parse(url).hostname;var match=host.match(regexp);return match?match[0]:""}});require.register("visionmedia-debug/index.js",function(exports,require,module){if("undefined"==typeof window){module.exports=require("./lib/debug")}else{module.exports=require("./debug")}});require.register("visionmedia-debug/debug.js",function(exports,require,module){module.exports=debug;function debug(name){if(!debug.enabled(name))return function(){};return function(fmt){fmt=coerce(fmt);var curr=new Date;var ms=curr-(debug[name]||curr);debug[name]=curr;fmt=name+" "+fmt+" +"+debug.humanize(ms);window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}}debug.names=[];debug.skips=[];debug.enable=function(name){try{localStorage.debug=name}catch(e){}var split=(name||"").split(/[\s,]+/),len=split.length;for(var i=0;i<len;i++){name=split[i].replace("*",".*?");if(name[0]==="-"){debug.skips.push(new RegExp("^"+name.substr(1)+"$"))}else{debug.names.push(new RegExp("^"+name+"$"))}}};debug.disable=function(){debug.enable("")};debug.humanize=function(ms){var sec=1e3,min=60*1e3,hour=60*min;if(ms>=hour)return(ms/hour).toFixed(1)+"h";if(ms>=min)return(ms/min).toFixed(1)+"m";if(ms>=sec)return(ms/sec|0)+"s";return ms+"ms"};debug.enabled=function(name){for(var i=0,len=debug.skips.length;i<len;i++){if(debug.skips[i].test(name)){return false}}for(var i=0,len=debug.names.length;i<len;i++){if(debug.names[i].test(name)){return true}}return false};function coerce(val){if(val instanceof Error)return val.stack||val.message;return val}try{if(window.localStorage)debug.enable(localStorage.debug)}catch(e){}});require.register("yields-prevent/index.js",function(exports,require,module){module.exports=function(e){e=e||window.event;return e.preventDefault?e.preventDefault():e.returnValue=false}});require.register("analytics/lib/index.js",function(exports,require,module){var Integrations=require("integrations");var Analytics=require("./analytics");var each=require("each");var analytics=module.exports=exports=new Analytics;analytics.require=require;exports.VERSION="1.5.3";each(Integrations,function(name,Integration){analytics.use(Integration)})});require.register("analytics/lib/analytics.js",function(exports,require,module){var after=require("after");var bind=require("bind");var callback=require("callback");var canonical=require("canonical");var clone=require("clone");var cookie=require("./cookie");var debug=require("debug");var defaults=require("defaults");var each=require("each");var Emitter=require("emitter");var group=require("./group");var is=require("is");var isEmail=require("is-email");var isMeta=require("is-meta");var newDate=require("new-date");var on=require("event").bind;var prevent=require("prevent");var querystring=require("querystring");var size=require("object").length;var store=require("./store");var url=require("url");var user=require("./user");var Facade=require("facade");var Identify=Facade.Identify;var Group=Facade.Group;var Alias=Facade.Alias;var Track=Facade.Track;var Page=Facade.Page;module.exports=Analytics;function Analytics(){this.Integrations={};this._integrations={};this._readied=false;this._timeout=300;this._user=user;bind.all(this);var self=this;this.on("initialize",function(settings,options){if(options.initialPageview)self.page()});this.on("initialize",function(){self._parseQuery()})}Emitter(Analytics.prototype);Analytics.prototype.use=function(plugin){plugin(this);return this};Analytics.prototype.addIntegration=function(Integration){var name=Integration.prototype.name;if(!name)throw new TypeError("attempted to add an invalid integration");this.Integrations[name]=Integration;return this};Analytics.prototype.init=Analytics.prototype.initialize=function(settings,options){settings=settings||{};options=options||{};this._options(options);this._readied=false;this._integrations={};user.load();group.load();var self=this;each(settings,function(name){var Integration=self.Integrations[name];if(!Integration)delete settings[name]});var ready=after(size(settings),function(){self._readied=true;self.emit("ready")});each(settings,function(name,opts){var Integration=self.Integrations[name];if(options.initialPageview&&opts.initialPageview===false){Integration.prototype.page=after(2,Integration.prototype.page)}var integration=new Integration(clone(opts));integration.once("ready",ready);integration.initialize();self._integrations[name]=integration});this.initialized=true;this.emit("initialize",settings,options);return this};Analytics.prototype.identify=function(id,traits,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(traits))fn=traits,options=null,traits=null;if(is.object(id))options=traits,traits=id,id=user.id();user.identify(id,traits);id=user.id();traits=user.traits();this._invoke("identify",new Identify({options:options,traits:traits,userId:id}));this.emit("identify",id,traits,options);this._callback(fn);return this};Analytics.prototype.user=function(){return user};Analytics.prototype.group=function(id,traits,options,fn){if(0===arguments.length)return group;if(is.fn(options))fn=options,options=null;if(is.fn(traits))fn=traits,options=null,traits=null;if(is.object(id))options=traits,traits=id,id=group.id();group.identify(id,traits);id=group.id();traits=group.traits();this._invoke("group",new Group({options:options,traits:traits,groupId:id}));this.emit("group",id,traits,options);this._callback(fn);return this};Analytics.prototype.track=function(event,properties,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(properties))fn=properties,options=null,properties=null;this._invoke("track",new Track({properties:properties,options:options,event:event}));this.emit("track",event,properties,options);this._callback(fn);return this};Analytics.prototype.trackClick=Analytics.prototype.trackLink=function(links,event,properties){if(!links)return this;if(is.element(links))links=[links];var self=this;each(links,function(el){on(el,"click",function(e){var ev=is.fn(event)?event(el):event;var props=is.fn(properties)?properties(el):properties;self.track(ev,props);if(el.href&&el.target!=="_blank"&&!isMeta(e)){prevent(e);self._callback(function(){window.location.href=el.href})}})});return this};Analytics.prototype.trackSubmit=Analytics.prototype.trackForm=function(forms,event,properties){if(!forms)return this;if(is.element(forms))forms=[forms];var self=this;each(forms,function(el){function handler(e){prevent(e);var ev=is.fn(event)?event(el):event;var props=is.fn(properties)?properties(el):properties;self.track(ev,props);self._callback(function(){el.submit()})}var $=window.jQuery||window.Zepto;if($){$(el).submit(handler)}else{on(el,"submit",handler)}});return this};Analytics.prototype.page=function(category,name,properties,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(properties))fn=properties,options=properties=null;if(is.fn(name))fn=name,options=properties=name=null;if(is.object(category))options=name,properties=category,name=category=null;if(is.object(name))options=properties,properties=name,name=null;if(is.string(category)&&!is.string(name))name=category,category=null;var defs={path:canonicalPath(),referrer:document.referrer,title:document.title,search:location.search};if(name)defs.name=name;if(category)defs.category=category;properties=clone(properties)||{};defaults(properties,defs);properties.url=properties.url||canonicalUrl(properties.search);this._invoke("page",new Page({properties:properties,category:category,options:options,name:name}));this.emit("page",category,name,properties,options);this._callback(fn);return this};Analytics.prototype.pageview=function(url,options){var properties={};if(url)properties.path=url;this.page(properties);return this};Analytics.prototype.alias=function(to,from,options,fn){if(is.fn(options))fn=options,options=null;if(is.fn(from))fn=from,options=null,from=null;if(is.object(from))options=from,from=null;this._invoke("alias",new Alias({options:options,from:from,to:to}));this.emit("alias",to,from,options);this._callback(fn);return this};Analytics.prototype.ready=function(fn){if(!is.fn(fn))return this;this._readied?callback.async(fn):this.once("ready",fn);return this};Analytics.prototype.timeout=function(timeout){this._timeout=timeout};Analytics.prototype.debug=function(str){if(0==arguments.length||str){debug.enable("analytics:"+(str||"*"))}else{debug.disable()}};Analytics.prototype._options=function(options){options=options||{};cookie.options(options.cookie);store.options(options.localStorage);user.options(options.user);group.options(options.group);return this};Analytics.prototype._callback=function(fn){callback.async(fn,this._timeout);return this};Analytics.prototype._invoke=function(method,facade){var options=facade.options();this.emit("invoke",facade);each(this._integrations,function(name,integration){if(!facade.enabled(name))return;integration.invoke.call(integration,method,facade)});return this};Analytics.prototype.push=function(args){var method=args.shift();if(!this[method])return;this[method].apply(this,args)};Analytics.prototype._parseQuery=function(){var q=querystring.parse(window.location.search);if(q.ajs_uid)this.identify(q.ajs_uid);if(q.ajs_event)this.track(q.ajs_event);return this};function canonicalPath(){var canon=canonical();if(!canon)return window.location.pathname;var parsed=url.parse(canon);return parsed.pathname}function canonicalUrl(search){var canon=canonical();if(canon)return~canon.indexOf("?")?canon:canon+search;var url=window.location.href;var i=url.indexOf("#");return-1==i?url:url.slice(0,i)}});require.register("analytics/lib/cookie.js",function(exports,require,module){var bind=require("bind");var cookie=require("cookie");var clone=require("clone");var defaults=require("defaults");var json=require("json");var topDomain=require("top-domain");function Cookie(options){this.options(options)}Cookie.prototype.options=function(options){if(arguments.length===0)return this._options;options=options||{};var domain="."+topDomain(window.location.href);if("."==domain)domain="";defaults(options,{maxage:31536e6,path:"/",domain:domain});this._options=options};Cookie.prototype.set=function(key,value){try{value=json.stringify(value);cookie(key,value,clone(this._options));return true}catch(e){return false}};Cookie.prototype.get=function(key){try{var value=cookie(key);value=value?json.parse(value):null;return value}catch(e){return null}};Cookie.prototype.remove=function(key){try{cookie(key,null,clone(this._options));return true}catch(e){return false}};module.exports=bind.all(new Cookie);module.exports.Cookie=Cookie});require.register("analytics/lib/entity.js",function(exports,require,module){var traverse=require("isodate-traverse");var defaults=require("defaults");var cookie=require("./cookie");var store=require("./store");var extend=require("extend");var clone=require("clone");module.exports=Entity;function Entity(options){this.options(options)}Entity.prototype.options=function(options){if(arguments.length===0)return this._options;options||(options={});defaults(options,this.defaults||{});this._options=options};Entity.prototype.id=function(id){switch(arguments.length){case 0:return this._getId();case 1:return this._setId(id)}};Entity.prototype._getId=function(){var ret=this._options.persist?cookie.get(this._options.cookie.key):this._id;return ret===undefined?null:ret};Entity.prototype._setId=function(id){if(this._options.persist){cookie.set(this._options.cookie.key,id)}else{this._id=id}};Entity.prototype.properties=Entity.prototype.traits=function(traits){switch(arguments.length){case 0:return this._getTraits();case 1:return this._setTraits(traits)}};Entity.prototype._getTraits=function(){var ret=this._options.persist?store.get(this._options.localStorage.key):this._traits;return ret?traverse(clone(ret)):{}};Entity.prototype._setTraits=function(traits){traits||(traits={});if(this._options.persist){store.set(this._options.localStorage.key,traits)}else{this._traits=traits}};Entity.prototype.identify=function(id,traits){traits||(traits={});var current=this.id();if(current===null||current===id)traits=extend(this.traits(),traits);if(id)this.id(id);this.debug("identify %o, %o",id,traits);this.traits(traits);this.save()};Entity.prototype.save=function(){if(!this._options.persist)return false;cookie.set(this._options.cookie.key,this.id());store.set(this._options.localStorage.key,this.traits());return true};Entity.prototype.logout=function(){this.id(null);this.traits({});cookie.remove(this._options.cookie.key);store.remove(this._options.localStorage.key)};Entity.prototype.reset=function(){this.logout();this.options({})};Entity.prototype.load=function(){this.id(cookie.get(this._options.cookie.key));this.traits(store.get(this._options.localStorage.key))}});require.register("analytics/lib/group.js",function(exports,require,module){var debug=require("debug")("analytics:group");var Entity=require("./entity");var inherit=require("inherit");var bind=require("bind");Group.defaults={persist:true,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}};function Group(options){this.defaults=Group.defaults;this.debug=debug;Entity.call(this,options)}inherit(Group,Entity);module.exports=bind.all(new Group);module.exports.Group=Group});require.register("analytics/lib/store.js",function(exports,require,module){var bind=require("bind");var defaults=require("defaults");var store=require("store");function Store(options){this.options(options)}Store.prototype.options=function(options){if(arguments.length===0)return this._options;options=options||{};defaults(options,{enabled:true});this.enabled=options.enabled&&store.enabled;this._options=options};Store.prototype.set=function(key,value){if(!this.enabled)return false;return store.set(key,value)};Store.prototype.get=function(key){if(!this.enabled)return null;return store.get(key)};Store.prototype.remove=function(key){if(!this.enabled)return false;return store.remove(key)};module.exports=bind.all(new Store);module.exports.Store=Store});require.register("analytics/lib/user.js",function(exports,require,module){var debug=require("debug")("analytics:user");var Entity=require("./entity");var inherit=require("inherit");var bind=require("bind");var cookie=require("./cookie");User.defaults={persist:true,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}};function User(options){this.defaults=User.defaults;this.debug=debug;Entity.call(this,options)}inherit(User,Entity);User.prototype.load=function(){if(this._loadOldCookie())return;Entity.prototype.load.call(this)};User.prototype._loadOldCookie=function(){var user=cookie.get(this._options.cookie.oldKey);if(!user)return false;this.id(user.id);this.traits(user.traits);cookie.remove(this._options.cookie.oldKey);return true};module.exports=bind.all(new User);module.exports.User=User});require.register("segmentio-analytics.js-integrations/lib/slugs.json",function(exports,require,module){module.exports=["adroll","adwords","alexa","amplitude","awesm","awesomatic","bing-ads","bronto","bugherd","bugsnag","chartbeat","churnbee","clicky","comscore","crazy-egg","curebit","customerio","drip","errorception","evergage","facebook-ads","foxmetrics","frontleaf","gauges","get-satisfaction","google-analytics","google-tag-manager","gosquared","heap","hellobar","hittail","hubspot","improvely","inspectlet","intercom","keen-io","kenshoo","kissmetrics","klaviyo","leadlander","livechat","lucky-orange","lytics","mixpanel","mojn","mouseflow","mousestats","navilytics","olark","optimizely","perfect-audience","pingdom","piwik","preact","qualaroo","quantcast","rollbar","saasquatch","sentry","snapengage","spinnakr","tapstream","trakio","twitter-ads","usercycle","userfox","uservoice","vero","visual-website-optimizer","webengage","woopra","yandex-metrica"]});require.alias("avetisk-defaults/index.js","analytics/deps/defaults/index.js");require.alias("avetisk-defaults/index.js","defaults/index.js");require.alias("component-clone/index.js","analytics/deps/clone/index.js");require.alias("component-clone/index.js","clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("component-cookie/index.js","analytics/deps/cookie/index.js");require.alias("component-cookie/index.js","cookie/index.js");require.alias("component-each/index.js","analytics/deps/each/index.js");require.alias("component-each/index.js","each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("component-emitter/index.js","analytics/deps/emitter/index.js");require.alias("component-emitter/index.js","emitter/index.js");require.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js");require.alias("component-event/index.js","analytics/deps/event/index.js");require.alias("component-event/index.js","event/index.js");require.alias("component-inherit/index.js","analytics/deps/inherit/index.js");require.alias("component-inherit/index.js","inherit/index.js");require.alias("component-object/index.js","analytics/deps/object/index.js");require.alias("component-object/index.js","object/index.js");require.alias("component-querystring/index.js","analytics/deps/querystring/index.js");require.alias("component-querystring/index.js","querystring/index.js");require.alias("component-trim/index.js","component-querystring/deps/trim/index.js");require.alias("component-type/index.js","component-querystring/deps/type/index.js");require.alias("component-url/index.js","analytics/deps/url/index.js");require.alias("component-url/index.js","url/index.js");require.alias("ianstormtaylor-bind/index.js","analytics/deps/bind/index.js");require.alias("ianstormtaylor-bind/index.js","bind/index.js");require.alias("component-bind/index.js","ianstormtaylor-bind/deps/bind/index.js");require.alias("segmentio-bind-all/index.js","ianstormtaylor-bind/deps/bind-all/index.js");require.alias("component-bind/index.js","segmentio-bind-all/deps/bind/index.js");require.alias("component-type/index.js","segmentio-bind-all/deps/type/index.js");require.alias("ianstormtaylor-callback/index.js","analytics/deps/callback/index.js");require.alias("ianstormtaylor-callback/index.js","callback/index.js");require.alias("timoxley-next-tick/index.js","ianstormtaylor-callback/deps/next-tick/index.js");require.alias("ianstormtaylor-is/index.js","analytics/deps/is/index.js");require.alias("ianstormtaylor-is/index.js","is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-after/index.js","analytics/deps/after/index.js");require.alias("segmentio-after/index.js","after/index.js");require.alias("segmentio-analytics.js-integrations/index.js","analytics/deps/integrations/index.js");require.alias("segmentio-analytics.js-integrations/lib/adroll.js","analytics/deps/integrations/lib/adroll.js");require.alias("segmentio-analytics.js-integrations/lib/adwords.js","analytics/deps/integrations/lib/adwords.js");require.alias("segmentio-analytics.js-integrations/lib/alexa.js","analytics/deps/integrations/lib/alexa.js");require.alias("segmentio-analytics.js-integrations/lib/amplitude.js","analytics/deps/integrations/lib/amplitude.js");require.alias("segmentio-analytics.js-integrations/lib/awesm.js","analytics/deps/integrations/lib/awesm.js");require.alias("segmentio-analytics.js-integrations/lib/awesomatic.js","analytics/deps/integrations/lib/awesomatic.js");require.alias("segmentio-analytics.js-integrations/lib/bing-ads.js","analytics/deps/integrations/lib/bing-ads.js");require.alias("segmentio-analytics.js-integrations/lib/bronto.js","analytics/deps/integrations/lib/bronto.js");require.alias("segmentio-analytics.js-integrations/lib/bugherd.js","analytics/deps/integrations/lib/bugherd.js");require.alias("segmentio-analytics.js-integrations/lib/bugsnag.js","analytics/deps/integrations/lib/bugsnag.js");require.alias("segmentio-analytics.js-integrations/lib/chartbeat.js","analytics/deps/integrations/lib/chartbeat.js");require.alias("segmentio-analytics.js-integrations/lib/churnbee.js","analytics/deps/integrations/lib/churnbee.js");require.alias("segmentio-analytics.js-integrations/lib/clicky.js","analytics/deps/integrations/lib/clicky.js");require.alias("segmentio-analytics.js-integrations/lib/comscore.js","analytics/deps/integrations/lib/comscore.js");require.alias("segmentio-analytics.js-integrations/lib/crazy-egg.js","analytics/deps/integrations/lib/crazy-egg.js");require.alias("segmentio-analytics.js-integrations/lib/curebit.js","analytics/deps/integrations/lib/curebit.js");require.alias("segmentio-analytics.js-integrations/lib/customerio.js","analytics/deps/integrations/lib/customerio.js");require.alias("segmentio-analytics.js-integrations/lib/drip.js","analytics/deps/integrations/lib/drip.js");require.alias("segmentio-analytics.js-integrations/lib/errorception.js","analytics/deps/integrations/lib/errorception.js");require.alias("segmentio-analytics.js-integrations/lib/evergage.js","analytics/deps/integrations/lib/evergage.js");require.alias("segmentio-analytics.js-integrations/lib/facebook-ads.js","analytics/deps/integrations/lib/facebook-ads.js");require.alias("segmentio-analytics.js-integrations/lib/foxmetrics.js","analytics/deps/integrations/lib/foxmetrics.js");require.alias("segmentio-analytics.js-integrations/lib/frontleaf.js","analytics/deps/integrations/lib/frontleaf.js");require.alias("segmentio-analytics.js-integrations/lib/gauges.js","analytics/deps/integrations/lib/gauges.js");require.alias("segmentio-analytics.js-integrations/lib/get-satisfaction.js","analytics/deps/integrations/lib/get-satisfaction.js");require.alias("segmentio-analytics.js-integrations/lib/google-analytics.js","analytics/deps/integrations/lib/google-analytics.js");require.alias("segmentio-analytics.js-integrations/lib/google-tag-manager.js","analytics/deps/integrations/lib/google-tag-manager.js");require.alias("segmentio-analytics.js-integrations/lib/gosquared.js","analytics/deps/integrations/lib/gosquared.js");require.alias("segmentio-analytics.js-integrations/lib/heap.js","analytics/deps/integrations/lib/heap.js");require.alias("segmentio-analytics.js-integrations/lib/hellobar.js","analytics/deps/integrations/lib/hellobar.js");require.alias("segmentio-analytics.js-integrations/lib/hittail.js","analytics/deps/integrations/lib/hittail.js");require.alias("segmentio-analytics.js-integrations/lib/hubspot.js","analytics/deps/integrations/lib/hubspot.js");require.alias("segmentio-analytics.js-integrations/lib/improvely.js","analytics/deps/integrations/lib/improvely.js");require.alias("segmentio-analytics.js-integrations/lib/inspectlet.js","analytics/deps/integrations/lib/inspectlet.js");require.alias("segmentio-analytics.js-integrations/lib/intercom.js","analytics/deps/integrations/lib/intercom.js");require.alias("segmentio-analytics.js-integrations/lib/keen-io.js","analytics/deps/integrations/lib/keen-io.js");require.alias("segmentio-analytics.js-integrations/lib/kenshoo.js","analytics/deps/integrations/lib/kenshoo.js");require.alias("segmentio-analytics.js-integrations/lib/kissmetrics.js","analytics/deps/integrations/lib/kissmetrics.js");require.alias("segmentio-analytics.js-integrations/lib/klaviyo.js","analytics/deps/integrations/lib/klaviyo.js");require.alias("segmentio-analytics.js-integrations/lib/leadlander.js","analytics/deps/integrations/lib/leadlander.js");require.alias("segmentio-analytics.js-integrations/lib/livechat.js","analytics/deps/integrations/lib/livechat.js");require.alias("segmentio-analytics.js-integrations/lib/lucky-orange.js","analytics/deps/integrations/lib/lucky-orange.js");require.alias("segmentio-analytics.js-integrations/lib/lytics.js","analytics/deps/integrations/lib/lytics.js");require.alias("segmentio-analytics.js-integrations/lib/mixpanel.js","analytics/deps/integrations/lib/mixpanel.js");require.alias("segmentio-analytics.js-integrations/lib/mojn.js","analytics/deps/integrations/lib/mojn.js");require.alias("segmentio-analytics.js-integrations/lib/mouseflow.js","analytics/deps/integrations/lib/mouseflow.js");
require.alias("segmentio-analytics.js-integrations/lib/mousestats.js","analytics/deps/integrations/lib/mousestats.js");require.alias("segmentio-analytics.js-integrations/lib/navilytics.js","analytics/deps/integrations/lib/navilytics.js");require.alias("segmentio-analytics.js-integrations/lib/olark.js","analytics/deps/integrations/lib/olark.js");require.alias("segmentio-analytics.js-integrations/lib/optimizely.js","analytics/deps/integrations/lib/optimizely.js");require.alias("segmentio-analytics.js-integrations/lib/perfect-audience.js","analytics/deps/integrations/lib/perfect-audience.js");require.alias("segmentio-analytics.js-integrations/lib/pingdom.js","analytics/deps/integrations/lib/pingdom.js");require.alias("segmentio-analytics.js-integrations/lib/piwik.js","analytics/deps/integrations/lib/piwik.js");require.alias("segmentio-analytics.js-integrations/lib/preact.js","analytics/deps/integrations/lib/preact.js");require.alias("segmentio-analytics.js-integrations/lib/qualaroo.js","analytics/deps/integrations/lib/qualaroo.js");require.alias("segmentio-analytics.js-integrations/lib/quantcast.js","analytics/deps/integrations/lib/quantcast.js");require.alias("segmentio-analytics.js-integrations/lib/rollbar.js","analytics/deps/integrations/lib/rollbar.js");require.alias("segmentio-analytics.js-integrations/lib/saasquatch.js","analytics/deps/integrations/lib/saasquatch.js");require.alias("segmentio-analytics.js-integrations/lib/sentry.js","analytics/deps/integrations/lib/sentry.js");require.alias("segmentio-analytics.js-integrations/lib/snapengage.js","analytics/deps/integrations/lib/snapengage.js");require.alias("segmentio-analytics.js-integrations/lib/spinnakr.js","analytics/deps/integrations/lib/spinnakr.js");require.alias("segmentio-analytics.js-integrations/lib/tapstream.js","analytics/deps/integrations/lib/tapstream.js");require.alias("segmentio-analytics.js-integrations/lib/trakio.js","analytics/deps/integrations/lib/trakio.js");require.alias("segmentio-analytics.js-integrations/lib/twitter-ads.js","analytics/deps/integrations/lib/twitter-ads.js");require.alias("segmentio-analytics.js-integrations/lib/usercycle.js","analytics/deps/integrations/lib/usercycle.js");require.alias("segmentio-analytics.js-integrations/lib/userfox.js","analytics/deps/integrations/lib/userfox.js");require.alias("segmentio-analytics.js-integrations/lib/uservoice.js","analytics/deps/integrations/lib/uservoice.js");require.alias("segmentio-analytics.js-integrations/lib/vero.js","analytics/deps/integrations/lib/vero.js");require.alias("segmentio-analytics.js-integrations/lib/visual-website-optimizer.js","analytics/deps/integrations/lib/visual-website-optimizer.js");require.alias("segmentio-analytics.js-integrations/lib/webengage.js","analytics/deps/integrations/lib/webengage.js");require.alias("segmentio-analytics.js-integrations/lib/woopra.js","analytics/deps/integrations/lib/woopra.js");require.alias("segmentio-analytics.js-integrations/lib/yandex-metrica.js","analytics/deps/integrations/lib/yandex-metrica.js");require.alias("segmentio-analytics.js-integrations/index.js","integrations/index.js");require.alias("avetisk-defaults/index.js","segmentio-analytics.js-integrations/deps/defaults/index.js");require.alias("component-clone/index.js","segmentio-analytics.js-integrations/deps/clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("component-domify/index.js","segmentio-analytics.js-integrations/deps/domify/index.js");require.alias("component-each/index.js","segmentio-analytics.js-integrations/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("component-once/index.js","segmentio-analytics.js-integrations/deps/once/index.js");require.alias("component-type/index.js","segmentio-analytics.js-integrations/deps/type/index.js");require.alias("component-url/index.js","segmentio-analytics.js-integrations/deps/url/index.js");require.alias("ianstormtaylor-callback/index.js","segmentio-analytics.js-integrations/deps/callback/index.js");require.alias("timoxley-next-tick/index.js","ianstormtaylor-callback/deps/next-tick/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","segmentio-analytics.js-integrations/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-bind/index.js","segmentio-analytics.js-integrations/deps/bind/index.js");require.alias("component-bind/index.js","ianstormtaylor-bind/deps/bind/index.js");require.alias("segmentio-bind-all/index.js","ianstormtaylor-bind/deps/bind-all/index.js");require.alias("component-bind/index.js","segmentio-bind-all/deps/bind/index.js");require.alias("component-type/index.js","segmentio-bind-all/deps/type/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-analytics.js-integrations/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("ianstormtaylor-is-empty/index.js","segmentio-analytics.js-integrations/deps/is-empty/index.js");require.alias("segmentio-alias/index.js","segmentio-analytics.js-integrations/deps/alias/index.js");require.alias("component-clone/index.js","segmentio-alias/deps/clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("component-type/index.js","segmentio-alias/deps/type/index.js");require.alias("segmentio-analytics.js-integration/lib/index.js","segmentio-analytics.js-integrations/deps/integration/lib/index.js");require.alias("segmentio-analytics.js-integration/lib/protos.js","segmentio-analytics.js-integrations/deps/integration/lib/protos.js");require.alias("segmentio-analytics.js-integration/lib/events.js","segmentio-analytics.js-integrations/deps/integration/lib/events.js");require.alias("segmentio-analytics.js-integration/lib/statics.js","segmentio-analytics.js-integrations/deps/integration/lib/statics.js");require.alias("segmentio-analytics.js-integration/lib/index.js","segmentio-analytics.js-integrations/deps/integration/index.js");require.alias("avetisk-defaults/index.js","segmentio-analytics.js-integration/deps/defaults/index.js");require.alias("component-clone/index.js","segmentio-analytics.js-integration/deps/clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("component-emitter/index.js","segmentio-analytics.js-integration/deps/emitter/index.js");require.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js");require.alias("ianstormtaylor-bind/index.js","segmentio-analytics.js-integration/deps/bind/index.js");require.alias("component-bind/index.js","ianstormtaylor-bind/deps/bind/index.js");require.alias("segmentio-bind-all/index.js","ianstormtaylor-bind/deps/bind-all/index.js");require.alias("component-bind/index.js","segmentio-bind-all/deps/bind/index.js");require.alias("component-type/index.js","segmentio-bind-all/deps/type/index.js");require.alias("ianstormtaylor-callback/index.js","segmentio-analytics.js-integration/deps/callback/index.js");require.alias("timoxley-next-tick/index.js","ianstormtaylor-callback/deps/next-tick/index.js");require.alias("ianstormtaylor-to-no-case/index.js","segmentio-analytics.js-integration/deps/to-no-case/index.js");require.alias("component-type/index.js","segmentio-analytics.js-integration/deps/type/index.js");require.alias("segmentio-after/index.js","segmentio-analytics.js-integration/deps/after/index.js");require.alias("timoxley-next-tick/index.js","segmentio-analytics.js-integration/deps/next-tick/index.js");require.alias("yields-slug/index.js","segmentio-analytics.js-integration/deps/slug/index.js");require.alias("visionmedia-debug/index.js","segmentio-analytics.js-integration/deps/debug/index.js");require.alias("visionmedia-debug/debug.js","segmentio-analytics.js-integration/deps/debug/debug.js");require.alias("segmentio-analytics.js-integration/lib/index.js","segmentio-analytics.js-integration/index.js");require.alias("segmentio-canonical/index.js","segmentio-analytics.js-integrations/deps/canonical/index.js");require.alias("segmentio-convert-dates/index.js","segmentio-analytics.js-integrations/deps/convert-dates/index.js");require.alias("component-clone/index.js","segmentio-convert-dates/deps/clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-convert-dates/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-extend/index.js","segmentio-analytics.js-integrations/deps/extend/index.js");require.alias("segmentio-facade/lib/index.js","segmentio-analytics.js-integrations/deps/facade/lib/index.js");require.alias("segmentio-facade/lib/alias.js","segmentio-analytics.js-integrations/deps/facade/lib/alias.js");require.alias("segmentio-facade/lib/facade.js","segmentio-analytics.js-integrations/deps/facade/lib/facade.js");require.alias("segmentio-facade/lib/group.js","segmentio-analytics.js-integrations/deps/facade/lib/group.js");require.alias("segmentio-facade/lib/page.js","segmentio-analytics.js-integrations/deps/facade/lib/page.js");require.alias("segmentio-facade/lib/identify.js","segmentio-analytics.js-integrations/deps/facade/lib/identify.js");require.alias("segmentio-facade/lib/is-enabled.js","segmentio-analytics.js-integrations/deps/facade/lib/is-enabled.js");require.alias("segmentio-facade/lib/track.js","segmentio-analytics.js-integrations/deps/facade/lib/track.js");require.alias("segmentio-facade/lib/screen.js","segmentio-analytics.js-integrations/deps/facade/lib/screen.js");require.alias("segmentio-facade/lib/index.js","segmentio-analytics.js-integrations/deps/facade/index.js");require.alias("camshaft-require-component/index.js","segmentio-facade/deps/require-component/index.js");require.alias("segmentio-isodate-traverse/index.js","segmentio-facade/deps/isodate-traverse/index.js");require.alias("component-each/index.js","segmentio-isodate-traverse/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-isodate-traverse/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-isodate/index.js","segmentio-isodate-traverse/deps/isodate/index.js");require.alias("component-clone/index.js","segmentio-facade/deps/clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("component-inherit/index.js","segmentio-facade/deps/inherit/index.js");require.alias("component-trim/index.js","segmentio-facade/deps/trim/index.js");require.alias("segmentio-is-email/index.js","segmentio-facade/deps/is-email/index.js");require.alias("segmentio-new-date/lib/index.js","segmentio-facade/deps/new-date/lib/index.js");require.alias("segmentio-new-date/lib/milliseconds.js","segmentio-facade/deps/new-date/lib/milliseconds.js");require.alias("segmentio-new-date/lib/seconds.js","segmentio-facade/deps/new-date/lib/seconds.js");require.alias("segmentio-new-date/lib/index.js","segmentio-facade/deps/new-date/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-new-date/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-isodate/index.js","segmentio-new-date/deps/isodate/index.js");require.alias("segmentio-new-date/lib/index.js","segmentio-new-date/index.js");require.alias("segmentio-obj-case/index.js","segmentio-facade/deps/obj-case/index.js");require.alias("segmentio-obj-case/index.js","segmentio-facade/deps/obj-case/index.js");require.alias("ianstormtaylor-case/lib/index.js","segmentio-obj-case/deps/case/lib/index.js");require.alias("ianstormtaylor-case/lib/cases.js","segmentio-obj-case/deps/case/lib/cases.js");require.alias("ianstormtaylor-case/lib/index.js","segmentio-obj-case/deps/case/index.js");require.alias("ianstormtaylor-to-camel-case/index.js","ianstormtaylor-case/deps/to-camel-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-camel-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-capital-case/index.js","ianstormtaylor-case/deps/to-capital-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-capital-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-constant-case/index.js","ianstormtaylor-case/deps/to-constant-case/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","ianstormtaylor-to-constant-case/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-dot-case/index.js","ianstormtaylor-case/deps/to-dot-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-dot-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-pascal-case/index.js","ianstormtaylor-case/deps/to-pascal-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-pascal-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-sentence-case/index.js","ianstormtaylor-case/deps/to-sentence-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-sentence-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-slug-case/index.js","ianstormtaylor-case/deps/to-slug-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-slug-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","ianstormtaylor-case/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-title-case/index.js","ianstormtaylor-case/deps/to-title-case/index.js");require.alias("component-escape-regexp/index.js","ianstormtaylor-to-title-case/deps/escape-regexp/index.js");require.alias("ianstormtaylor-map/index.js","ianstormtaylor-to-title-case/deps/map/index.js");require.alias("component-each/index.js","ianstormtaylor-map/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("ianstormtaylor-title-case-minors/index.js","ianstormtaylor-to-title-case/deps/title-case-minors/index.js");require.alias("ianstormtaylor-to-capital-case/index.js","ianstormtaylor-to-title-case/deps/to-capital-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-capital-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-case/lib/index.js","ianstormtaylor-case/index.js");require.alias("segmentio-obj-case/index.js","segmentio-obj-case/index.js");require.alias("segmentio-facade/lib/index.js","segmentio-facade/index.js");require.alias("segmentio-global-queue/index.js","segmentio-analytics.js-integrations/deps/global-queue/index.js");require.alias("segmentio-is-email/index.js","segmentio-analytics.js-integrations/deps/is-email/index.js");require.alias("segmentio-load-date/index.js","segmentio-analytics.js-integrations/deps/load-date/index.js");require.alias("segmentio-load-script/index.js","segmentio-analytics.js-integrations/deps/load-script/index.js");require.alias("component-type/index.js","segmentio-load-script/deps/type/index.js");require.alias("segmentio-script-onload/index.js","segmentio-analytics.js-integrations/deps/script-onload/index.js");require.alias("segmentio-script-onload/index.js","segmentio-analytics.js-integrations/deps/script-onload/index.js");require.alias("segmentio-script-onload/index.js","segmentio-script-onload/index.js");require.alias("segmentio-on-body/index.js","segmentio-analytics.js-integrations/deps/on-body/index.js");require.alias("component-each/index.js","segmentio-on-body/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("segmentio-on-error/index.js","segmentio-analytics.js-integrations/deps/on-error/index.js");require.alias("segmentio-to-iso-string/index.js","segmentio-analytics.js-integrations/deps/to-iso-string/index.js");require.alias("segmentio-to-unix-timestamp/index.js","segmentio-analytics.js-integrations/deps/to-unix-timestamp/index.js");require.alias("segmentio-use-https/index.js","segmentio-analytics.js-integrations/deps/use-https/index.js");require.alias("segmentio-when/index.js","segmentio-analytics.js-integrations/deps/when/index.js");require.alias("ianstormtaylor-callback/index.js","segmentio-when/deps/callback/index.js");require.alias("timoxley-next-tick/index.js","ianstormtaylor-callback/deps/next-tick/index.js");require.alias("timoxley-next-tick/index.js","segmentio-analytics.js-integrations/deps/next-tick/index.js");require.alias("yields-slug/index.js","segmentio-analytics.js-integrations/deps/slug/index.js");require.alias("visionmedia-batch/index.js","segmentio-analytics.js-integrations/deps/batch/index.js");require.alias("component-emitter/index.js","visionmedia-batch/deps/emitter/index.js");require.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js");require.alias("visionmedia-debug/index.js","segmentio-analytics.js-integrations/deps/debug/index.js");require.alias("visionmedia-debug/debug.js","segmentio-analytics.js-integrations/deps/debug/debug.js");require.alias("segmentio-load-pixel/index.js","segmentio-analytics.js-integrations/deps/load-pixel/index.js");require.alias("segmentio-load-pixel/index.js","segmentio-analytics.js-integrations/deps/load-pixel/index.js");require.alias("component-querystring/index.js","segmentio-load-pixel/deps/querystring/index.js");require.alias("component-trim/index.js","component-querystring/deps/trim/index.js");require.alias("component-type/index.js","component-querystring/deps/type/index.js");require.alias("segmentio-substitute/index.js","segmentio-load-pixel/deps/substitute/index.js");require.alias("segmentio-substitute/index.js","segmentio-load-pixel/deps/substitute/index.js");require.alias("segmentio-substitute/index.js","segmentio-substitute/index.js");require.alias("segmentio-load-pixel/index.js","segmentio-load-pixel/index.js");require.alias("segmentio-replace-document-write/index.js","segmentio-analytics.js-integrations/deps/replace-document-write/index.js");require.alias("segmentio-replace-document-write/index.js","segmentio-analytics.js-integrations/deps/replace-document-write/index.js");require.alias("component-domify/index.js","segmentio-replace-document-write/deps/domify/index.js");require.alias("segmentio-replace-document-write/index.js","segmentio-replace-document-write/index.js");require.alias("component-indexof/index.js","segmentio-analytics.js-integrations/deps/indexof/index.js");require.alias("component-object/index.js","segmentio-analytics.js-integrations/deps/object/index.js");require.alias("segmentio-obj-case/index.js","segmentio-analytics.js-integrations/deps/obj-case/index.js");require.alias("segmentio-obj-case/index.js","segmentio-analytics.js-integrations/deps/obj-case/index.js");require.alias("ianstormtaylor-case/lib/index.js","segmentio-obj-case/deps/case/lib/index.js");require.alias("ianstormtaylor-case/lib/cases.js","segmentio-obj-case/deps/case/lib/cases.js");require.alias("ianstormtaylor-case/lib/index.js","segmentio-obj-case/deps/case/index.js");require.alias("ianstormtaylor-to-camel-case/index.js","ianstormtaylor-case/deps/to-camel-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-camel-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-capital-case/index.js","ianstormtaylor-case/deps/to-capital-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-capital-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-constant-case/index.js","ianstormtaylor-case/deps/to-constant-case/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","ianstormtaylor-to-constant-case/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-dot-case/index.js","ianstormtaylor-case/deps/to-dot-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-dot-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-pascal-case/index.js","ianstormtaylor-case/deps/to-pascal-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-pascal-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-sentence-case/index.js","ianstormtaylor-case/deps/to-sentence-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-sentence-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-slug-case/index.js","ianstormtaylor-case/deps/to-slug-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-slug-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","ianstormtaylor-case/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-title-case/index.js","ianstormtaylor-case/deps/to-title-case/index.js");require.alias("component-escape-regexp/index.js","ianstormtaylor-to-title-case/deps/escape-regexp/index.js");require.alias("ianstormtaylor-map/index.js","ianstormtaylor-to-title-case/deps/map/index.js");require.alias("component-each/index.js","ianstormtaylor-map/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("ianstormtaylor-title-case-minors/index.js","ianstormtaylor-to-title-case/deps/title-case-minors/index.js");require.alias("ianstormtaylor-to-capital-case/index.js","ianstormtaylor-to-title-case/deps/to-capital-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-capital-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-case/lib/index.js","ianstormtaylor-case/index.js");require.alias("segmentio-obj-case/index.js","segmentio-obj-case/index.js");require.alias("segmentio-canonical/index.js","analytics/deps/canonical/index.js");require.alias("segmentio-canonical/index.js","canonical/index.js");require.alias("segmentio-extend/index.js","analytics/deps/extend/index.js");require.alias("segmentio-extend/index.js","extend/index.js");require.alias("segmentio-facade/lib/index.js","analytics/deps/facade/lib/index.js");require.alias("segmentio-facade/lib/alias.js","analytics/deps/facade/lib/alias.js");require.alias("segmentio-facade/lib/facade.js","analytics/deps/facade/lib/facade.js");require.alias("segmentio-facade/lib/group.js","analytics/deps/facade/lib/group.js");require.alias("segmentio-facade/lib/page.js","analytics/deps/facade/lib/page.js");require.alias("segmentio-facade/lib/identify.js","analytics/deps/facade/lib/identify.js");require.alias("segmentio-facade/lib/is-enabled.js","analytics/deps/facade/lib/is-enabled.js");require.alias("segmentio-facade/lib/track.js","analytics/deps/facade/lib/track.js");require.alias("segmentio-facade/lib/screen.js","analytics/deps/facade/lib/screen.js");require.alias("segmentio-facade/lib/index.js","analytics/deps/facade/index.js");require.alias("segmentio-facade/lib/index.js","facade/index.js");require.alias("camshaft-require-component/index.js","segmentio-facade/deps/require-component/index.js");require.alias("segmentio-isodate-traverse/index.js","segmentio-facade/deps/isodate-traverse/index.js");require.alias("component-each/index.js","segmentio-isodate-traverse/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-isodate-traverse/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-isodate/index.js","segmentio-isodate-traverse/deps/isodate/index.js");require.alias("component-clone/index.js","segmentio-facade/deps/clone/index.js");require.alias("component-type/index.js","component-clone/deps/type/index.js");require.alias("component-inherit/index.js","segmentio-facade/deps/inherit/index.js");require.alias("component-trim/index.js","segmentio-facade/deps/trim/index.js");require.alias("segmentio-is-email/index.js","segmentio-facade/deps/is-email/index.js");require.alias("segmentio-new-date/lib/index.js","segmentio-facade/deps/new-date/lib/index.js");require.alias("segmentio-new-date/lib/milliseconds.js","segmentio-facade/deps/new-date/lib/milliseconds.js");require.alias("segmentio-new-date/lib/seconds.js","segmentio-facade/deps/new-date/lib/seconds.js");require.alias("segmentio-new-date/lib/index.js","segmentio-facade/deps/new-date/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-new-date/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-isodate/index.js","segmentio-new-date/deps/isodate/index.js");require.alias("segmentio-new-date/lib/index.js","segmentio-new-date/index.js");require.alias("segmentio-obj-case/index.js","segmentio-facade/deps/obj-case/index.js");require.alias("segmentio-obj-case/index.js","segmentio-facade/deps/obj-case/index.js");require.alias("ianstormtaylor-case/lib/index.js","segmentio-obj-case/deps/case/lib/index.js");require.alias("ianstormtaylor-case/lib/cases.js","segmentio-obj-case/deps/case/lib/cases.js");require.alias("ianstormtaylor-case/lib/index.js","segmentio-obj-case/deps/case/index.js");require.alias("ianstormtaylor-to-camel-case/index.js","ianstormtaylor-case/deps/to-camel-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-camel-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-capital-case/index.js","ianstormtaylor-case/deps/to-capital-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-capital-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-constant-case/index.js","ianstormtaylor-case/deps/to-constant-case/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","ianstormtaylor-to-constant-case/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-dot-case/index.js","ianstormtaylor-case/deps/to-dot-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-dot-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-pascal-case/index.js","ianstormtaylor-case/deps/to-pascal-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-pascal-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-sentence-case/index.js","ianstormtaylor-case/deps/to-sentence-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-sentence-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-slug-case/index.js","ianstormtaylor-case/deps/to-slug-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-slug-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-snake-case/index.js","ianstormtaylor-case/deps/to-snake-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-to-snake-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-space-case/index.js","ianstormtaylor-case/deps/to-space-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-space-case/deps/to-no-case/index.js");require.alias("ianstormtaylor-to-title-case/index.js","ianstormtaylor-case/deps/to-title-case/index.js");require.alias("component-escape-regexp/index.js","ianstormtaylor-to-title-case/deps/escape-regexp/index.js");require.alias("ianstormtaylor-map/index.js","ianstormtaylor-to-title-case/deps/map/index.js");require.alias("component-each/index.js","ianstormtaylor-map/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("ianstormtaylor-title-case-minors/index.js","ianstormtaylor-to-title-case/deps/title-case-minors/index.js");require.alias("ianstormtaylor-to-capital-case/index.js","ianstormtaylor-to-title-case/deps/to-capital-case/index.js");require.alias("ianstormtaylor-to-no-case/index.js","ianstormtaylor-to-capital-case/deps/to-no-case/index.js");
require.alias("ianstormtaylor-case/lib/index.js","ianstormtaylor-case/index.js");require.alias("segmentio-obj-case/index.js","segmentio-obj-case/index.js");require.alias("segmentio-facade/lib/index.js","segmentio-facade/index.js");require.alias("segmentio-is-email/index.js","analytics/deps/is-email/index.js");require.alias("segmentio-is-email/index.js","is-email/index.js");require.alias("segmentio-is-meta/index.js","analytics/deps/is-meta/index.js");require.alias("segmentio-is-meta/index.js","is-meta/index.js");require.alias("segmentio-isodate-traverse/index.js","analytics/deps/isodate-traverse/index.js");require.alias("segmentio-isodate-traverse/index.js","isodate-traverse/index.js");require.alias("component-each/index.js","segmentio-isodate-traverse/deps/each/index.js");require.alias("component-type/index.js","component-each/deps/type/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-isodate-traverse/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-isodate/index.js","segmentio-isodate-traverse/deps/isodate/index.js");require.alias("segmentio-json/index.js","analytics/deps/json/index.js");require.alias("segmentio-json/index.js","json/index.js");require.alias("component-json-fallback/index.js","segmentio-json/deps/json-fallback/index.js");require.alias("segmentio-new-date/lib/index.js","analytics/deps/new-date/lib/index.js");require.alias("segmentio-new-date/lib/milliseconds.js","analytics/deps/new-date/lib/milliseconds.js");require.alias("segmentio-new-date/lib/seconds.js","analytics/deps/new-date/lib/seconds.js");require.alias("segmentio-new-date/lib/index.js","analytics/deps/new-date/index.js");require.alias("segmentio-new-date/lib/index.js","new-date/index.js");require.alias("ianstormtaylor-is/index.js","segmentio-new-date/deps/is/index.js");require.alias("component-type/index.js","ianstormtaylor-is/deps/type/index.js");require.alias("ianstormtaylor-is-empty/index.js","ianstormtaylor-is/deps/is-empty/index.js");require.alias("segmentio-isodate/index.js","segmentio-new-date/deps/isodate/index.js");require.alias("segmentio-new-date/lib/index.js","segmentio-new-date/index.js");require.alias("segmentio-store.js/store.js","analytics/deps/store/store.js");require.alias("segmentio-store.js/store.js","analytics/deps/store/index.js");require.alias("segmentio-store.js/store.js","store/index.js");require.alias("segmentio-store.js/store.js","segmentio-store.js/index.js");require.alias("segmentio-top-domain/index.js","analytics/deps/top-domain/index.js");require.alias("segmentio-top-domain/index.js","analytics/deps/top-domain/index.js");require.alias("segmentio-top-domain/index.js","top-domain/index.js");require.alias("component-url/index.js","segmentio-top-domain/deps/url/index.js");require.alias("segmentio-top-domain/index.js","segmentio-top-domain/index.js");require.alias("visionmedia-debug/index.js","analytics/deps/debug/index.js");require.alias("visionmedia-debug/debug.js","analytics/deps/debug/debug.js");require.alias("visionmedia-debug/index.js","debug/index.js");require.alias("yields-prevent/index.js","analytics/deps/prevent/index.js");require.alias("yields-prevent/index.js","prevent/index.js");require.alias("analytics/lib/index.js","analytics/index.js");if(typeof exports=="object"){module.exports=require("analytics")}else if(typeof define=="function"&&define.amd){define([],function(){return require("analytics")})}else{this["analytics"]=require("analytics")}})(); |
ajax/libs/forerunnerdb/1.3.345/fdb-legacy.min.js | extend1994/cdnjs | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("../lib/Core");a("../lib/CollectionGroup"),a("../lib/View"),a("../lib/Highchart"),a("../lib/Persist"),a("../lib/Document"),a("../lib/Overview"),a("../lib/OldView"),a("../lib/OldView.Bind"),a("../lib/Grid");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/CollectionGroup":5,"../lib/Core":6,"../lib/Document":9,"../lib/Grid":10,"../lib/Highchart":11,"../lib/OldView":26,"../lib/OldView.Bind":25,"../lib/Overview":29,"../lib/Persist":31,"../lib/View":37}],2:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){var b;this._primaryKey="_id",this._keyArr=[],this._data=[],this._objLookup={},this._count=0;for(b in a)a.hasOwnProperty(b)&&this._keyArr.push({key:b,dir:a[b]})};d.addModule("ActiveBucket",e),d.mixin(e.prototype,"Mixin.Sorting"),d.synthesize(e.prototype,"primaryKey"),e.prototype.qs=function(a,b,c,d){if(!b.length)return 0;for(var e,f,g,h=-1,i=0,j=b.length-1;j>=i&&(e=Math.floor((i+j)/2),h!==e);)f=b[e],void 0!==f&&(g=d(this,a,c,f),g>0&&(i=e+1),0>g&&(j=e-1)),h=e;return g>0?e+1:e},e.prototype._sortFunc=function(a,b,c,d){var e,f,g,h=c.split(".:."),i=d.split(".:."),j=a._keyArr,k=j.length;for(e=0;k>e;e++)if(f=j[e],g=typeof b[f.key],"number"===g&&(h[e]=Number(h[e]),i[e]=Number(i[e])),h[e]!==i[e]){if(1===f.dir)return a.sortAsc(h[e],i[e]);if(-1===f.dir)return a.sortDesc(h[e],i[e])}},e.prototype.insert=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c?(c=this.qs(a,this._data,b,this._sortFunc),this._data.splice(c,0,b)):this._data.splice(c,0,b),this._objLookup[a[this._primaryKey]]=b,this._count++,c},e.prototype.remove=function(a){var b,c;return b=this._objLookup[a[this._primaryKey]],b?(c=this._data.indexOf(b),c>-1?(this._data.splice(c,1),delete this._objLookup[a[this._primaryKey]],this._count--,!0):!1):!1},e.prototype.index=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c&&(c=this.qs(a,this._data,b,this._sortFunc)),c},e.prototype.documentKey=function(a){var b,c,d="",e=this._keyArr,f=e.length;for(b=0;f>b;b++)c=e[b],d&&(d+=".:."),d+=a[c.key];return d+=".:."+a[this._primaryKey]},e.prototype.count=function(){return this._count},d.finishModule("ActiveBucket"),b.exports=e},{"./Shared":36}],3:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a,b,c){this.init.apply(this,arguments)};e.prototype.init=function(a,b,c,d){this._store=[],void 0!==b&&this.index(b),void 0!==c&&this.compareFunc(c),void 0!==d&&this.hashFunc(d),void 0!==a&&this.data(a)},d.addModule("BinaryTree",e),d.mixin(e.prototype,"Mixin.ChainReactor"),d.mixin(e.prototype,"Mixin.Sorting"),d.mixin(e.prototype,"Mixin.Common"),d.synthesize(e.prototype,"compareFunc"),d.synthesize(e.prototype,"hashFunc"),d.synthesize(e.prototype,"indexDir"),d.synthesize(e.prototype,"index",function(a){return void 0!==a&&(a instanceof Array||(a=this.keys(a))),this.$super.call(this,a)}),e.prototype.keys=function(a){var b,c=[];for(b in a)a.hasOwnProperty(b)&&c.push({key:b,val:a[b]});return c},e.prototype.data=function(a){return void 0!==a?(this._data=a,this._hashFunc&&(this._hash=this._hashFunc(a)),this):this._data},e.prototype.push=function(a){return void 0!==a?(this._store.push(a),this):!1},e.prototype.pull=function(a){if(void 0!==a){var b=this._store.indexOf(a);if(b>-1)return this._store.splice(b,1),!0}return!1},e.prototype._compareFunc=function(a,b){var c,d,e=0;for(c=0;c<this._index.length;c++)if(d=this._index[c],1===d.val?e=this.sortAsc(a[d.key],b[d.key]):-1===d.val&&(e=this.sortDesc(a[d.key],b[d.key])),0!==e)return e;return e},e.prototype._hashFunc=function(a){return a[this._index[0].key]},e.prototype.insert=function(a){var b,c,d,f;if(a instanceof Array){for(c=[],d=[],f=0;f<a.length;f++)this.insert(a[f])?c.push(a[f]):d.push(a[f]);return{inserted:c,failed:d}}return this._data?(b=this._compareFunc(this._data,a),0===b?(this.push(a),this._left?this._left.insert(a):this._left=new e(a,this._index,this._compareFunc,this._hashFunc),!0):-1===b?(this._right?this._right.insert(a):this._right=new e(a,this._index,this._compareFunc,this._hashFunc),!0):1===b?(this._left?this._left.insert(a):this._left=new e(a,this._index,this._compareFunc,this._hashFunc),!0):!1):(this.data(a),!0)},e.prototype.lookup=function(a,b){var c=this._compareFunc(this._data,a);return b=b||[],0===c&&(this._left&&this._left.lookup(a,b),b.push(this._data),this._right&&this._right.lookup(a,b)),-1===c&&this._right&&this._right.lookup(a,b),1===c&&this._left&&this._left.lookup(a,b),b},e.prototype.inOrder=function(a,b){switch(b=b||[],this._left&&this._left.inOrder(a,b),a){case"hash":b.push(this._hash);break;case"key":b.push(this._data);break;default:b.push({key:this._key,arr:this._store})}return this._right&&this._right.inOrder(a,b),b},d.finishModule("BinaryTree"),b.exports=e},{"./Shared":36}],4:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m;d=a("./Shared");var n=function(a){this.init.apply(this,arguments)};n.prototype.init=function(a,b){this._primaryKey="_id",this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._name=a,this._data=[],this._metrics=new f,this._options=b||{changeTimestamp:!1},this._metaData={},this._deferQueue={insert:[],update:[],remove:[],upsert:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100},this._deferTime={insert:1,update:1,remove:1,upsert:1},this.subsetOf(this)},d.addModule("Collection",n),d.mixin(n.prototype,"Mixin.Common"),d.mixin(n.prototype,"Mixin.Events"),d.mixin(n.prototype,"Mixin.ChainReactor"),d.mixin(n.prototype,"Mixin.CRUD"),d.mixin(n.prototype,"Mixin.Constants"),d.mixin(n.prototype,"Mixin.Triggers"),d.mixin(n.prototype,"Mixin.Sorting"),d.mixin(n.prototype,"Mixin.Matching"),d.mixin(n.prototype,"Mixin.Updating"),f=a("./Metrics"),g=a("./KeyValueStore"),h=a("./Path"),i=a("./IndexHashMap"),j=a("./IndexBinaryTree"),k=a("./Crc"),e=d.modules.Db,l=a("./Overload"),m=a("./ReactorIO"),n.prototype.crc=k,d.synthesize(n.prototype,"state"),d.synthesize(n.prototype,"name"),d.synthesize(n.prototype,"metaData"),n.prototype.data=function(){return this._data},n.prototype.drop=function(a){var b;if(this.isDropped())return a&&a(!1,!0),!0;if(this._db&&this._db._collection&&this._name){if(this.debug()&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this.emit("drop",this),delete this._db._collection[this._name],this._collate)for(b in this._collate)this._collate.hasOwnProperty(b)&&this.collateRemove(b);return delete this._primaryKey,delete this._primaryIndex,delete this._primaryCrc,delete this._crcLookup,delete this._name,delete this._data,delete this._metrics,a&&a(!1,!0),!0}return a&&a(!1,!0),!1},n.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey!==a&&(this._primaryKey=a,this._primaryIndex.primaryKey(a),this.rebuildPrimaryKeyIndex()),this):this._primaryKey},n.prototype._onInsert=function(a,b){this.emit("insert",a,b)},n.prototype._onUpdate=function(a){this.emit("update",a)},n.prototype._onRemove=function(a){this.emit("remove",a)},n.prototype._onChange=function(){this._options.changeTimestamp&&(this._metaData.lastChange=new Date)},d.synthesize(n.prototype,"db",function(a){return a&&"_id"===this.primaryKey()&&(this.primaryKey(a.primaryKey()),this.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(n.prototype,"mongoEmulation"),n.prototype.setData=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var d=this._metrics.create("setData");d.start(),b=this.options(b),this.preSetData(a,b,c),b.$decouple&&(a=this.decouple(a)),a instanceof Array||(a=[a]),d.time("transformIn"),a=this.transformIn(a),d.time("transformIn");var e=[].concat(this._data);this._dataReplace(a),d.time("Rebuild Primary Key Index"),this.rebuildPrimaryKeyIndex(b),d.time("Rebuild Primary Key Index"),d.time("Rebuild All Other Indexes"),this._rebuildIndexes(),d.time("Rebuild All Other Indexes"),d.time("Resolve chains"),this.chainSend("setData",a,{oldData:e}),d.time("Resolve chains"),d.stop(),this._onChange(),this.emit("setData",this._data,e)}return c&&c(!1),this},n.prototype.rebuildPrimaryKeyIndex=function(a){a=a||{$ensureKeys:void 0,$violationCheck:void 0};var b,c,d,e,f=a&&void 0!==a.$ensureKeys?a.$ensureKeys:!0,g=a&&void 0!==a.$violationCheck?a.$violationCheck:!0,h=this._primaryIndex,i=this._primaryCrc,j=this._crcLookup,k=this._primaryKey;for(h.truncate(),i.truncate(),j.truncate(),b=this._data,c=b.length;c--;){if(d=b[c],f&&this.ensurePrimaryKey(d),g){if(!h.uniqueSet(d[k],d))throw this.logIdentifier()+" Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: "+d[this._primaryKey]}else h.set(d[k],d);e=this.jStringify(d),i.set(d[k],e),j.set(e,d)}},n.prototype.ensurePrimaryKey=function(a){void 0===a[this._primaryKey]&&(a[this._primaryKey]=this.objectId())},n.prototype.truncate=function(){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.emit("truncate",this._data),this._data.length=0,this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._onChange(),this.deferEmit("change",{type:"truncate"}),this},n.prototype.upsert=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var c,d,e=this._deferQueue.upsert,f=this._deferThreshold.upsert,g={};if(a instanceof Array){if(a.length>f)return this._deferQueue.upsert=e.concat(a),this.processQueue("upsert",b),{};for(g=[],d=0;d<a.length;d++)g.push(this.upsert(a[d]));return b&&b(),g}switch(a[this._primaryKey]?(c={},c[this._primaryKey]=a[this._primaryKey],this._primaryIndex.lookup(c)[0]?g.op="update":g.op="insert"):g.op="insert",g.op){case"insert":g.result=this.insert(a);break;case"update":g.result=this.update(c,a)}return g}return b&&b(),{}},n.prototype.filter=function(a,b,c){return this.find(a,c).filter(b)},n.prototype.filterUpdate=function(a,b,c){var d,e,f,g,h=this.find(a,c),i=[],j=this.primaryKey();for(g=0;g<h.length;g++)d=h[g],f=b(d),f&&(e={},e[j]=d[j],i.push(this.update(e,f)));return i},n.prototype.update=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";b=this.decouple(b),this.mongoEmulation()&&(this.convertToFdb(a),this.convertToFdb(b)),b=this.transformIn(b),this.debug()&&console.log(this.logIdentifier()+" Updating some data");var d,e,f=this,g=this._metrics.create("update"),h=function(d){var e,h,i,j=f.decouple(d);return f.willTrigger(f.TYPE_UPDATE,f.PHASE_BEFORE)||f.willTrigger(f.TYPE_UPDATE,f.PHASE_AFTER)?(e=f.decouple(d),h={type:"update",query:f.decouple(a),update:f.decouple(b),options:f.decouple(c),op:g},i=f.updateObject(e,h.update,h.query,h.options,""),f.processTrigger(h,f.TYPE_UPDATE,f.PHASE_BEFORE,d,e)!==!1?(i=f.updateObject(d,e,h.query,h.options,""),f.processTrigger(h,f.TYPE_UPDATE,f.PHASE_AFTER,j,e)):i=!1):i=f.updateObject(d,b,a,c,""),f._updateIndexes(j,d),i};return g.start(),g.time("Retrieve documents to update"),d=this.find(a,{$decouple:!1}),g.time("Retrieve documents to update"),d.length&&(g.time("Update documents"),e=d.filter(h),g.time("Update documents"),e.length&&(g.time("Resolve chains"),this.chainSend("update",{query:a,update:b,dataSet:d},c),g.time("Resolve chains"),this._onUpdate(e),this._onChange(),this.deferEmit("change",{type:"update",data:e}))),g.stop(),e||[]},n.prototype._replaceObj=function(a,b){var c;this._removeFromIndexes(a);for(c in a)a.hasOwnProperty(c)&&delete a[c];for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);if(!this._insertIntoIndexes(a))throw this.logIdentifier()+" Primary key violation in update! Key violated: "+a[this._primaryKey];return this},n.prototype.updateById=function(a,b){var c={};return c[this._primaryKey]=a,this.update(c,b)},n.prototype.updateObject=function(a,b,c,d,e,f){b=this.decouple(b),e=e||"","."===e.substr(0,1)&&(e=e.substr(1,e.length-1));var g,i,j,k,l,m,n,o,p,q=!1,r=!1;for(p in b)if(b.hasOwnProperty(p)){if(g=!1,"$"===p.substr(0,1))switch(p){case"$key":case"$index":case"$data":case"$min":case"$max":g=!0;break;case"$each":for(g=!0,k=b.$each.length,j=0;k>j;j++)r=this.updateObject(a,b.$each[j],c,d,e),r&&(q=!0);q=q||r;break;default:g=!0,r=this.updateObject(a,b[p],c,d,e,p),q=q||r}if(this._isPositionalKey(p)&&(g=!0,p=p.substr(0,p.length-2),m=new h(e+"."+p),a[p]&&a[p]instanceof Array&&a[p].length)){for(i=[],j=0;j<a[p].length;j++)this._match(a[p][j],m.value(c)[0],d,"",{})&&i.push(j);for(j=0;j<i.length;j++)r=this.updateObject(a[p][i[j]],b[p+".$"],c,d,e+"."+p,f),q=q||r}if(!g)if(f||"object"!=typeof b[p])switch(f){case"$inc":var s=!0;b[p]>0?b.$max&&a[p]>=b.$max&&(s=!1):b[p]<0&&b.$min&&a[p]<=b.$min&&(s=!1),s&&(this._updateIncrement(a,p,b[p]),q=!0);break;case"$cast":switch(b[p]){case"array":a[p]instanceof Array||(this._updateProperty(a,p,b.$data||[]),q=!0);break;case"object":(!(a[p]instanceof Object)||a[p]instanceof Array)&&(this._updateProperty(a,p,b.$data||{}),q=!0);break;case"number":"number"!=typeof a[p]&&(this._updateProperty(a,p,Number(a[p])),q=!0);break;case"string":"string"!=typeof a[p]&&(this._updateProperty(a,p,String(a[p])),q=!0);break;default:throw this.logIdentifier()+" Cannot update cast to unknown type: "+b[p]}break;case"$push":if(void 0===a[p]&&this._updateProperty(a,p,[]),!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot push to a key that is not an array! ("+p+")";if(void 0!==b[p].$position&&b[p].$each instanceof Array)for(l=b[p].$position,k=b[p].$each.length,j=0;k>j;j++)this._updateSplicePush(a[p],l+j,b[p].$each[j]);else if(b[p].$each instanceof Array)for(k=b[p].$each.length,j=0;k>j;j++)this._updatePush(a[p],b[p].$each[j]);else this._updatePush(a[p],b[p]);q=!0;break;case"$pull":if(a[p]instanceof Array){for(i=[],j=0;j<a[p].length;j++)this._match(a[p][j],b[p],d,"",{})&&i.push(j);for(k=i.length;k--;)this._updatePull(a[p],i[k]),q=!0}break;case"$pullAll":if(a[p]instanceof Array){if(!(b[p]instanceof Array))throw this.logIdentifier()+" Cannot pullAll without being given an array of values to pull! ("+p+")";if(i=a[p],k=i.length,k>0)for(;k--;){for(l=0;l<b[p].length;l++)i[k]===b[p][l]&&(this._updatePull(a[p],k),k--,q=!0);if(0>k)break}}break;case"$addToSet":if(void 0===a[p]&&this._updateProperty(a,p,[]),!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot addToSet on a key that is not an array! ("+p+")";var t,u,v,w,x=a[p],y=x.length,z=!0,A=d&&d.$addToSet;for(b[p].$key?(v=!1,w=new h(b[p].$key),u=w.value(b[p])[0],delete b[p].$key):A&&A.key?(v=!1,w=new h(A.key),u=w.value(b[p])[0]):(u=this.jStringify(b[p]),v=!0),t=0;y>t;t++)if(v){if(this.jStringify(x[t])===u){z=!1;break}}else if(u===w.value(x[t])[0]){z=!1;break}z&&(this._updatePush(a[p],b[p]),q=!0);break;case"$splicePush":if(void 0===a[p]&&this._updateProperty(a,p,[]),!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot splicePush with a key that is not an array! ("+p+")";if(l=b.$index,void 0===l)throw this.logIdentifier()+" Cannot splicePush without a $index integer value!";delete b.$index,l>a[p].length&&(l=a[p].length),this._updateSplicePush(a[p],l,b[p]),q=!0;break;case"$move":if(!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot move on a key that is not an array! ("+p+")";for(j=0;j<a[p].length;j++)if(this._match(a[p][j],b[p],d,"",{})){var B=b.$index;if(void 0===B)throw this.logIdentifier()+" Cannot move without a $index integer value!";delete b.$index,this._updateSpliceMove(a[p],j,B),q=!0;break}break;case"$mul":this._updateMultiply(a,p,b[p]),q=!0;break;case"$rename":this._updateRename(a,p,b[p]),q=!0;break;case"$overwrite":this._updateOverwrite(a,p,b[p]),q=!0;break;case"$unset":this._updateUnset(a,p),q=!0;break;case"$clear":this._updateClear(a,p),q=!0;break;case"$pop":if(!(a[p]instanceof Array))throw this.logIdentifier()+" Cannot pop from a key that is not an array! ("+p+")";this._updatePop(a[p],b[p])&&(q=!0);break;case"$toggle":this._updateProperty(a,p,!a[p]),q=!0;break;default:a[p]!==b[p]&&(this._updateProperty(a,p,b[p]),q=!0)}else if(null!==a[p]&&"object"==typeof a[p])if(n=a[p]instanceof Array,o=b[p]instanceof Array,n||o)if(!o&&n)for(j=0;j<a[p].length;j++)r=this.updateObject(a[p][j],b[p],c,d,e+"."+p,f),q=q||r;else a[p]!==b[p]&&(this._updateProperty(a,p,b[p]),q=!0);else r=this.updateObject(a[p],b[p],c,d,e+"."+p,f),q=q||r;else a[p]!==b[p]&&(this._updateProperty(a,p,b[p]),q=!0)}return q},n.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},n.prototype.remove=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f,g,h,i,j,k,l=this;if("function"==typeof b&&(c=b,b={}),this.mongoEmulation()&&this.convertToFdb(a),a instanceof Array){for(g=[],f=0;f<a.length;f++)g.push(this.remove(a[f],{noEmit:!0}));return(!b||b&&!b.noEmit)&&this._onRemove(g),c&&c(!1,g),g}if(d=this.find(a,{$decouple:!1}),d.length){h=function(a){l._removeFromIndexes(a),e=l._data.indexOf(a),l._dataRemoveAtIndex(e)};for(var m=0;m<d.length;m++)j=d[m],l.willTrigger(l.TYPE_REMOVE,l.PHASE_BEFORE)||l.willTrigger(l.TYPE_REMOVE,l.PHASE_AFTER)?(i={type:"remove"},k=l.decouple(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_BEFORE,k,k)!==!1&&(h(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_AFTER,k,k))):h(j);this.chainSend("remove",{query:a,dataSet:d},b),(!b||b&&!b.noEmit)&&this._onRemove(d),this._onChange(),this.deferEmit("change",{type:"remove",data:d})}return c&&c(!1,d),d},n.prototype.removeById=function(a){var b={};return b[this._primaryKey]=a,this.remove(b)},n.prototype.processQueue=function(a,b,c){var d,e,f=this,g=this._deferQueue[a],h=this._deferThreshold[a],i=this._deferTime[a];if(c=c||{deferred:!0},g.length){if(g.length)switch(d=g.length>h?g.splice(0,h):g.splice(0,g.length),e=f[a](d),a){case"insert":c.inserted=c.inserted||[],c.failed=c.failed||[],c.inserted=c.inserted.concat(e.inserted),c.failed=c.failed.concat(e.failed)}setTimeout(function(){f.processQueue.call(f,a,b,c)},i)}else b&&b(c);this.isProcessingQueue()||this.emit("queuesComplete")},n.prototype.isProcessingQueue=function(){var a;for(a in this._deferQueue)if(this._deferQueue.hasOwnProperty(a)&&this._deferQueue[a].length)return!0;return!1},n.prototype.insert=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return"function"==typeof b?(c=b,b=this._data.length):void 0===b&&(b=this._data.length),a=this.transformIn(a),this._insertHandle(a,b,c)},n.prototype._insertHandle=function(a,b,c){var d,e,f,g=this._deferQueue.insert,h=this._deferThreshold.insert,i=[],j=[];if(a instanceof Array){if(a.length>h)return this._deferQueue.insert=g.concat(a),void this.processQueue("insert",c);for(f=0;f<a.length;f++)d=this._insert(a[f],b+f),d===!0?i.push(a[f]):j.push({doc:a[f],reason:d})}else d=this._insert(a,b),d===!0?i.push(a):j.push({doc:a,reason:d});return this.chainSend("insert",a,{index:b}),e={deferred:!1,inserted:i,failed:j},this._onInsert(i,j),c&&c(e),this._onChange(),this.deferEmit("change",{type:"insert",data:i}),e},n.prototype._insert=function(a,b){if(a){var c,d,e,f,g=this;if(this.ensurePrimaryKey(a),c=this.insertIndexViolation(a),e=function(a){g._insertIntoIndexes(a),b>g._data.length&&(b=g._data.length),g._dataInsertAtIndex(b,a)},c)return"Index violation in index: "+c;if(g.willTrigger(g.TYPE_INSERT,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)){if(d={type:"insert"},g.processTrigger(d,g.TYPE_INSERT,g.PHASE_BEFORE,{},a)===!1)return!1;e(a),g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)&&(f=g.decouple(a),g.processTrigger(d,g.TYPE_INSERT,g.PHASE_AFTER,{},f))}else e(a);return!0}return"No document passed to insert"},n.prototype._dataInsertAtIndex=function(a,b){this._data.splice(a,0,b)},n.prototype._dataRemoveAtIndex=function(a){this._data.splice(a,1)},n.prototype._dataReplace=function(a){for(;this._data.length;)this._data.pop();this._data=this._data.concat(a)},n.prototype._insertIntoIndexes=function(a){var b,c,d=this._indexByName,e=this.jStringify(a);c=this._primaryIndex.uniqueSet(a[this._primaryKey],a),this._primaryCrc.uniqueSet(a[this._primaryKey],e),this._crcLookup.uniqueSet(e,a);for(b in d)d.hasOwnProperty(b)&&d[b].insert(a);return c},n.prototype._removeFromIndexes=function(a){var b,c=this._indexByName,d=this.jStringify(a);this._primaryIndex.unSet(a[this._primaryKey]),this._primaryCrc.unSet(a[this._primaryKey]),this._crcLookup.unSet(d);for(b in c)c.hasOwnProperty(b)&&c[b].remove(a)},n.prototype._updateIndexes=function(a,b){this._removeFromIndexes(a),this._insertIntoIndexes(b)},n.prototype._rebuildIndexes=function(){var a,b=this._indexByName;for(a in b)b.hasOwnProperty(a)&&b[a].rebuild()},n.prototype.subset=function(a,b){var c=this.find(a,b);return(new n).subsetOf(this).primaryKey(this._primaryKey).setData(c)},d.synthesize(n.prototype,"subsetOf"),n.prototype.isSubsetOf=function(a){return this._subsetOf===a},n.prototype.distinct=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f=this.find(b,c),g=new h(a),i={},j=[];for(e=0;e<f.length;e++)d=g.value(f[e])[0],d&&!i[d]&&(i[d]=!0,j.push(d));return j},n.prototype.findById=function(a,b){var c={};return c[this._primaryKey]=a,this.find(c,b)[0]},n.prototype.peek=function(a,b){var c,d,e=this._data,f=e.length,g=new n,h=typeof a;if("string"===h){for(c=0;f>c;c++)d=this.jStringify(e[c]),d.indexOf(a)>-1&&g.insert(e[c]);return g.find({},b)}return this.find(a,b)},n.prototype.explain=function(a,b){var c=this.find(a,b);return c.__fdbOp._data},n.prototype.options=function(a){return a=a||{},a.$decouple=void 0!==a.$decouple?a.$decouple:!0,a.$explain=void 0!==a.$explain?a.$explain:!1,a},n.prototype.find=function(a,b,c){return this.mongoEmulation()&&this.convertToFdb(a),c?(c("Callbacks for the find() operation are not yet implemented!",[]),[]):this._find.apply(this,arguments)},n.prototype._find=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";a=a||{},b=this.options(b);var c,d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=this._metrics.create("find"),I=this.primaryKey(),J=this,K=!0,L={},M=[],N=[],O=[],P={},Q={},R=function(c){return J._match(c,a,b,"and",P)};if(H.start(),a){if(H.time("analyseQuery"),c=this._analyseQuery(J.decouple(a),b,H),H.time("analyseQuery"),H.data("analysis",c),c.hasJoin&&c.queriesJoin){for(H.time("joinReferences"),g=0;g<c.joinsOn.length;g++)k=c.joinsOn[g],j=new h(c.joinQueries[k]),i=j.value(a)[0],L[c.joinsOn[g]]=this._db.collection(c.joinsOn[g]).subset(i),delete a[c.joinQueries[k]];H.time("joinReferences")}if(c.indexMatch.length&&(!b||b&&!b.$skipIndex)?(H.data("index.potential",c.indexMatch),H.data("index.used",c.indexMatch[0].index),H.time("indexLookup"),e=c.indexMatch[0].lookup||[],H.time("indexLookup"),c.indexMatch[0].keyData.totalKeyCount===c.indexMatch[0].keyData.score&&(K=!1)):H.flag("usedIndex",!1),K&&(e&&e.length?(d=e.length,H.time("tableScan: "+d),e=e.filter(R)):(d=this._data.length,H.time("tableScan: "+d),e=this._data.filter(R)),H.time("tableScan: "+d)),b.$orderBy&&(H.time("sort"),e=this.sort(b.$orderBy,e),H.time("sort")),void 0!==b.$page&&void 0!==b.$limit&&(Q.page=b.$page,Q.pages=Math.ceil(e.length/b.$limit),Q.records=e.length,b.$page&&b.$limit>0&&(H.data("cursor",Q),e.splice(0,b.$page*b.$limit))),b.$skip&&(Q.skip=b.$skip,e.splice(0,b.$skip),H.data("skip",b.$skip)),b.$limit&&e&&e.length>b.$limit&&(Q.limit=b.$limit,e.length=b.$limit,H.data("limit",b.$limit)),b.$decouple&&(H.time("decouple"),e=this.decouple(e),H.time("decouple"),H.data("flag.decouple",!0)),b.$join){for(f=0;f<b.$join.length;f++)for(k in b.$join[f])if(b.$join[f].hasOwnProperty(k))for(w=k,l=L[k]?L[k]:this._db.collection(k),m=b.$join[f][k],x=0;x<e.length;x++){o={},q=!1,r=!1,v="";for(n in m)if(m.hasOwnProperty(n))if("$"===n.substr(0,1))switch(n){case"$where":m[n].query&&(o=m[n].query),m[n].options&&(p=m[n].options);break;case"$as":w=m[n];break;case"$multi":q=m[n];break;case"$require":r=m[n];break;case"$prefix":v=m[n]}else o[n]=J._resolveDynamicQuery(m[n],e[x]);if(s=l.find(o,p),!r||r&&s[0])if("$root"===w){if(q!==!1)throw this.logIdentifier()+' Cannot combine [$as: "$root"] with [$joinMulti: true] in $join clause!';t=s[0],u=e[x];for(C in t)t.hasOwnProperty(C)&&void 0===u[v+C]&&(u[v+C]=t[C])}else e[x][w]=q===!1?s[0]:s;else M.push(e[x])}H.data("flag.join",!0)}if(M.length){for(H.time("removalQueue"),z=0;z<M.length;z++)y=e.indexOf(M[z]),y>-1&&e.splice(y,1);H.time("removalQueue")}if(b.$transform){for(H.time("transform"),z=0;z<e.length;z++)e.splice(z,1,b.$transform(e[z]));H.time("transform"),H.data("flag.transform",!0)}this._transformEnabled&&this._transformOut&&(H.time("transformOut"),e=this.transformOut(e),H.time("transformOut")),H.data("results",e.length)}else e=[];H.time("scanFields");for(z in b)b.hasOwnProperty(z)&&0!==z.indexOf("$")&&(1===b[z]?N.push(z):0===b[z]&&O.push(z));if(H.time("scanFields"),N.length||O.length){for(H.data("flag.limitFields",!0),H.data("limitFields.on",N),H.data("limitFields.off",O),H.time("limitFields"),z=0;z<e.length;z++){G=e[z];for(A in G)G.hasOwnProperty(A)&&(N.length&&A!==I&&-1===N.indexOf(A)&&delete G[A],O.length&&O.indexOf(A)>-1&&delete G[A])}H.time("limitFields")}if(b.$elemMatch){H.data("flag.elemMatch",!0),H.time("projection-elemMatch");for(z in b.$elemMatch)if(b.$elemMatch.hasOwnProperty(z))for(D=new h(z),A=0;A<e.length;A++)if(E=D.value(e[A])[0],E&&E.length)for(B=0;B<E.length;B++)if(J._match(E[B],b.$elemMatch[z],b,"",{})){D.set(e[A],z,[E[B]]);break}H.time("projection-elemMatch")}if(b.$elemsMatch){H.data("flag.elemsMatch",!0),H.time("projection-elemsMatch");for(z in b.$elemsMatch)if(b.$elemsMatch.hasOwnProperty(z))for(D=new h(z),A=0;A<e.length;A++)if(E=D.value(e[A])[0],E&&E.length){for(F=[],B=0;B<E.length;B++)J._match(E[B],b.$elemsMatch[z],b,"",{})&&F.push(E[B]);D.set(e[A],z,F)}H.time("projection-elemsMatch")}return H.stop(),e.__fdbOp=H,e.$cursor=Q,e},n.prototype._resolveDynamicQuery=function(a,b){var c,d,e,f,g=this;if("string"==typeof a)return"$$."===a.substr(0,3)?new h(a.substr(3,a.length-3)).value(b)[0]:new h(a).value(b)[0];c={};for(f in a)if(a.hasOwnProperty(f))switch(d=typeof a[f],e=a[f],d){case"string":"$$."===e.substr(0,3)?c[f]=new h(e.substr(3,e.length-3)).value(b)[0]:c[f]=e;break;case"object":c[f]=g._resolveDynamicQuery(e,b);break;default:c[f]=e}return c},n.prototype.findOne=function(){return this.find.apply(this,arguments)[0]},n.prototype.indexOf=function(a,b){var c,d=this.find(a,{$decouple:!1})[0];return d?!b||b&&!b.$orderBy?this._data.indexOf(d):(b.$decouple=!1,c=this.find(a,b),c.indexOf(d)):-1},n.prototype.indexOfDocById=function(a,b){var c,d;return c="object"!=typeof a?this._primaryIndex.get(a):this._primaryIndex.get(a[this._primaryKey]),c?!b||b&&!b.$orderBy?this._data.indexOf(c):(b.$decouple=!1,d=this.find({},b),d.indexOf(c)):-1},n.prototype.removeByIndex=function(a){var b,c;return b=this._data[a],void 0!==b?(b=this.decouple(b),c=b[this.primaryKey()],this.removeById(c)):!1},n.prototype.transform=function(a){return void 0!==a?("object"==typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=a!==!1,this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}},n.prototype.transformIn=function(a){if(this._transformEnabled&&this._transformIn){if(a instanceof Array){var b,c=[];for(b=0;b<a.length;b++)c[b]=this._transformIn(a[b]);return c}return this._transformIn(a)}return a},n.prototype.transformOut=function(a){if(this._transformEnabled&&this._transformOut){if(a instanceof Array){var b,c=[];for(b=0;b<a.length;b++)c[b]=this._transformOut(a[b]);return c}return this._transformOut(a)}return a},n.prototype.sort=function(a,b){b=b||[];var c,d,e=[];for(c in a)a.hasOwnProperty(c)&&(d={},d[c]=a[c],d.___fdbKey=String(c),e.push(d));return e.length<2?this._sort(a,b):this._bucketSort(e,b)},n.prototype._bucketSort=function(a,b){var c,d,e,f,g,h,i=a.shift(),j=[];if(a.length>0){for(b=this._sort(i,b),d=this.bucket(i.___fdbKey,b),e=d.order,g=d.buckets,h=0;h<e.length;h++)f=e[h],c=[].concat(a),j=j.concat(this._bucketSort(c,g[f]));return j}return this._sort(i,b)},n.prototype._sort=function(a,b){var c,d=this,e=new h,f=e.parse(a,!0)[0];if(e.path(f.path),1===f.value)c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortAsc(c,f)};else{if(-1!==f.value)throw this.logIdentifier()+" $orderBy clause has invalid direction: "+f.value+", accepted values are 1 or -1 for ascending or descending!";c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortDesc(c,f)}}return b.sort(c)},n.prototype.bucket=function(a,b){var c,d,e,f=[],g={};for(c=0;c<b.length;c++)e=String(b[c][a]),d!==e&&(f.push(e),d=e),g[e]=g[e]||[],g[e].push(b[c]);return{buckets:g,order:f}},n.prototype._analyseQuery=function(a,b,c){var d,e,f,g,i,j,k,l,m,n,o,p={queriesOn:[this._name],indexMatch:[],hasJoin:!1,queriesJoin:!1,joinQueries:{},query:a,options:b},q=[],r=[];if(c.time("checkIndexes"),m=new h,n=m.countKeys(a)){void 0!==a[this._primaryKey]&&(c.time("checkIndexMatch: Primary Key"),p.indexMatch.push({lookup:this._primaryIndex.lookup(a,b),keyData:{matchedKeys:[this._primaryKey],totalKeyCount:n,score:1},index:this._primaryIndex}),c.time("checkIndexMatch: Primary Key"));for(o in this._indexById)if(this._indexById.hasOwnProperty(o)&&(j=this._indexById[o],k=j.name(),c.time("checkIndexMatch: "+k),i=j.match(a,b),i.score>0&&(l=j.lookup(a,b),p.indexMatch.push({lookup:l,keyData:i,index:j})),c.time("checkIndexMatch: "+k),i.score===n))break;c.time("checkIndexes"),p.indexMatch.length>1&&(c.time("findOptimalIndex"),p.indexMatch.sort(function(a,b){return a.keyData.score>b.keyData.score?-1:a.keyData.score<b.keyData.score?1:a.keyData.score===b.keyData.score?a.lookup.length-b.lookup.length:void 0}),c.time("findOptimalIndex"))}if(b.$join){for(p.hasJoin=!0,d=0;d<b.$join.length;d++)for(e in b.$join[d])b.$join[d].hasOwnProperty(e)&&(q.push(e),"$as"in b.$join[d][e]?r.push(b.$join[d][e].$as):r.push(e));for(g=0;g<r.length;g++)f=this._queryReferencesCollection(a,r[g],""),f&&(p.joinQueries[q[g]]=f,p.queriesJoin=!0);p.joinsOn=q,p.queriesOn=p.queriesOn.concat(q)}return p},n.prototype._queryReferencesCollection=function(a,b,c){var d;for(d in a)if(a.hasOwnProperty(d)){if(d===b)return c&&(c+="."),c+d;if("object"==typeof a[d])return c&&(c+="."),c+=d,this._queryReferencesCollection(a[d],b,c)}return!1},n.prototype.count=function(a,b){return a?this.find(a,b).length:this._data.length},n.prototype.findSub=function(a,b,c,d){var e,f,g,i=new h(b),j=this.find(a),k=j.length,l=this._db.collection("__FDB_temp_"+this.objectId()),m={parents:k,subDocTotal:0,subDocs:[],pathFound:!1,err:""};for(d=d||{},e=0;k>e;e++)if(f=i.value(j[e])[0]){if(l.setData(f),g=l.find(c,d),d.returnFirst&&g.length)return g[0];d.$split?m.subDocs.push(g):m.subDocs=m.subDocs.concat(g),m.subDocTotal+=g.length,m.pathFound=!0}return l.drop(),d.$stats?m:m.subDocs},n.prototype.insertIndexViolation=function(a){var b,c,d,e=this._indexByName;if(this._primaryIndex.get(a[this._primaryKey]))b=this._primaryIndex;else for(c in e)if(e.hasOwnProperty(c)&&(d=e[c],d.unique()&&d.violation(a))){b=d;break}return b?b.name():!1},n.prototype.ensureIndex=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";this._indexByName=this._indexByName||{},this._indexById=this._indexById||{};var c,d={start:(new Date).getTime()};if(b)switch(b.type){case"hashed":c=new i(a,b,this);break;case"btree":c=new j(a,b,this);break;default:c=new i(a,b,this)}else c=new i(a,b,this);return this._indexByName[c.name()]?{err:"Index with that name already exists"}:this._indexById[c.id()]?{err:"Index with those keys already exists"
}:(c.rebuild(),this._indexByName[c.name()]=c,this._indexById[c.id()]=c,d.end=(new Date).getTime(),d.total=d.end-d.start,this._lastOp={type:"ensureIndex",stats:{time:d}},{index:c,id:c.id(),name:c.name(),state:c.state()})},n.prototype.index=function(a){return this._indexByName?this._indexByName[a]:void 0},n.prototype.lastOp=function(){return this._metrics.list()},n.prototype.diff=function(a){var b,c,d,e,f={insert:[],update:[],remove:[]},g=this.primaryKey();if(g!==a.primaryKey())throw this.logIdentifier()+" Diffing requires that both collections have the same primary key!";for(b=a._data;b&&!(b instanceof Array);)a=b,b=a._data;for(e=b.length,c=0;e>c;c++)d=b[c],this._primaryIndex.get(d[g])?this._primaryCrc.get(d[g])!==a._primaryCrc.get(d[g])&&f.update.push(d):f.insert.push(d);for(b=this._data,e=b.length,c=0;e>c;c++)d=b[c],a._primaryIndex.get(d[g])||f.remove.push(d);return f},n.prototype.collateAdd=new l({"object, string":function(a,b){var c=this;c.collateAdd(a,function(d){var e,f;switch(d.type){case"insert":b?(e={$push:{}},e.$push[b]=c.decouple(d.data),c.update({},e)):c.insert(d.data);break;case"update":b?(e={},f={},e[b]=d.data.query,f[b+".$"]=d.data.update,c.update(e,f)):c.update(d.data.query,d.data.update);break;case"remove":b?(e={$pull:{}},e.$pull[b]={},e.$pull[b][c.primaryKey()]=d.data.dataSet[0][a.primaryKey()],c.update({},e)):c.remove(d.data)}})},"object, function":function(a,b){if("string"==typeof a&&(a=this._db.collection(a,{autoCreate:!1,throwError:!1})),a)return this._collate=this._collate||{},this._collate[a.name()]=new m(a,this,b),this;throw"Cannot collate from a non-existent collection!"}}),n.prototype.collateRemove=function(a){if("object"==typeof a&&(a=a.name()),a)return this._collate[a].drop(),delete this._collate[a],this;throw"No collection name passed to collateRemove() or collection not found!"},e.prototype.collection=new l({"":function(){return this.$main.call(this,{name:this.objectId()})},object:function(a){return a instanceof n?"droppped"!==a.state()?a:this.$main.call(this,{name:a.name()}):this.$main.call(this,a)},string:function(a){return this.$main.call(this,{name:a})},"string, string":function(a,b){return this.$main.call(this,{name:a,primaryKey:b})},"string, object":function(a,b){return b.name=a,this.$main.call(this,b)},"string, string, object":function(a,b,c){return c.name=a,c.primaryKey=b,this.$main.call(this,c)},$main:function(a){var b=a.name;if(b){if(!this._collection[b]){if(a&&a.autoCreate===!1&&a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection "+b+" because it does not exist and auto-create has been disabled!";this.debug()&&console.log(this.logIdentifier()+" Creating collection "+b)}return this._collection[b]=this._collection[b]||new n(b,a).db(this),this._collection[b].mongoEmulation(this.mongoEmulation()),void 0!==a.primaryKey&&this._collection[b].primaryKey(a.primaryKey),this._collection[b]}if(!a||a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection with undefined name!"}}),e.prototype.collectionExists=function(a){return Boolean(this._collection[a])},e.prototype.collections=function(a){var b,c,d=[],e=this._collection;a&&(a instanceof RegExp||(a=new RegExp(a)));for(c in e)e.hasOwnProperty(c)&&(b=e[c],a?a.exec(c)&&d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}):d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}));return d.sort(function(a,b){return a.name.localeCompare(b.name)}),d},d.finishModule("Collection"),b.exports=n},{"./Crc":7,"./IndexBinaryTree":12,"./IndexHashMap":13,"./KeyValueStore":14,"./Metrics":15,"./Overload":28,"./Path":30,"./ReactorIO":34,"./Shared":36}],5:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){var b=this;b._name=a,b._data=new g("__FDB__cg_data_"+b._name),b._collections=[],b._view=[]},d.addModule("CollectionGroup",h),d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.ChainReactor"),d.mixin(h.prototype,"Mixin.Constants"),d.mixin(h.prototype,"Mixin.Triggers"),g=a("./Collection"),e=d.modules.Db,f=d.modules.Db.prototype.init,h.prototype.on=function(){this._data.on.apply(this._data,arguments)},h.prototype.off=function(){this._data.off.apply(this._data,arguments)},h.prototype.emit=function(){this._data.emit.apply(this._data,arguments)},h.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},d.synthesize(h.prototype,"state"),d.synthesize(h.prototype,"db"),d.synthesize(h.prototype,"name"),h.prototype.addCollection=function(a){if(a&&-1===this._collections.indexOf(a)){if(this._collections.length){if(this._primaryKey!==a.primaryKey())throw this.logIdentifier()+" All collections in a collection group must have the same primary key!"}else this.primaryKey(a.primaryKey());this._collections.push(a),a._groups=a._groups||[],a._groups.push(this),a.chain(this),a.on("drop",function(){if(a._groups&&a._groups.length){var b,c=[];for(b=0;b<a._groups.length;b++)c.push(a._groups[b]);for(b=0;b<c.length;b++)a._groups[b].removeCollection(a)}delete a._groups}),this._data.insert(a.find())}return this},h.prototype.removeCollection=function(a){if(a){var b,c=this._collections.indexOf(a);-1!==c&&(a.unChain(this),this._collections.splice(c,1),a._groups=a._groups||[],b=a._groups.indexOf(this),-1!==b&&a._groups.splice(b,1),a.off("drop")),0===this._collections.length&&delete this._primaryKey}return this},h.prototype._chainHandler=function(a){switch(a.type){case"setData":a.data=this.decouple(a.data),this._data.remove(a.options.oldData),this._data.insert(a.data);break;case"insert":a.data=this.decouple(a.data),this._data.insert(a.data);break;case"update":this._data.update(a.data.query,a.data.update,a.options);break;case"remove":this._data.remove(a.data.query,a.options)}},h.prototype.insert=function(){this._collectionsRun("insert",arguments)},h.prototype.update=function(){this._collectionsRun("update",arguments)},h.prototype.updateById=function(){this._collectionsRun("updateById",arguments)},h.prototype.remove=function(){this._collectionsRun("remove",arguments)},h.prototype._collectionsRun=function(a,b){for(var c=0;c<this._collections.length;c++)this._collections[c][a].apply(this._collections[c],b)},h.prototype.find=function(a,b){return this._data.find(a,b)},h.prototype.removeById=function(a){for(var b=0;b<this._collections.length;b++)this._collections[b].removeById(a)},h.prototype.subset=function(a,b){var c=this.find(a,b);return(new g).subsetOf(this).primaryKey(this._primaryKey).setData(c)},h.prototype.drop=function(){if(!this.isDropped()){var a,b,c;if(this._debug&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._collections&&this._collections.length)for(b=[].concat(this._collections),a=0;a<b.length;a++)this.removeCollection(b[a]);if(this._view&&this._view.length)for(c=[].concat(this._view),a=0;a<c.length;a++)this._removeView(c[a]);this.emit("drop",this)}return!0},e.prototype.init=function(){this._collectionGroup={},f.apply(this,arguments)},e.prototype.collectionGroup=function(a){return a?a instanceof h?a:(this._collectionGroup[a]=this._collectionGroup[a]||new h(a).db(this),this._collectionGroup[a]):this._collectionGroup},e.prototype.collectionGroups=function(){var a,b=[];for(a in this._collectionGroup)this._collectionGroup.hasOwnProperty(a)&&b.push({name:a});return b},b.exports=h},{"./Collection":4,"./Shared":36}],6:[function(a,b,c){"use strict";var d,e,f,g,h=[];d=a("./Shared"),g=a("./Overload");var i=function(a){this.init.apply(this,arguments)};i.prototype.init=function(a){this._db={},this._debug={},this._name=a||"ForerunnerDB",h.push(this)},i.prototype.instantiatedCount=function(){return h.length},i.prototype.instances=function(a){return void 0!==a?h[a]:h},i.prototype.namedInstances=function(a){var b,c;{if(void 0===a){for(c=[],b=0;b<h.length;b++)c.push(h[b].name);return c}for(b=0;b<h.length;b++)if(h[b].name===a)return h[b]}},i.prototype.moduleLoaded=new g({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b()}},"array, function":function(a,b){var c,e;for(e=0;e<a.length;e++)if(c=a[e],void 0!==c){c=c.replace(/ /g,"");var f,g=c.split(",");for(f=0;f<g.length;f++)if(!d.modules[g[f]])return!1}b()},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),i.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},i.moduleLoaded=i.prototype.moduleLoaded,i.version=i.prototype.version,i.instances=i.prototype.instances,i.instantiatedCount=i.prototype.instantiatedCount,i.shared=d,i.prototype.shared=d,d.addModule("Core",i),d.mixin(i.prototype,"Mixin.Common"),d.mixin(i.prototype,"Mixin.Constants"),e=a("./Db.js"),f=a("./Metrics.js"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"mongoEmulation"),i.prototype._isServer=!1,i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.collection=function(){throw"ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"},b.exports=i},{"./Db.js":8,"./Metrics.js":15,"./Overload":28,"./Shared":36}],7:[function(a,b,c){"use strict";var d=function(){var a,b,c,d=[];for(b=0;256>b;b++){for(a=b,c=0;8>c;c++)a=1&a?3988292384^a>>>1:a>>>1;d[b]=a}return d}();b.exports=function(a){var b,c=-1;for(b=0;b<a.length;b++)c=c>>>8^d[255&(c^a.charCodeAt(b))];return(-1^c)>>>0}},{}],8:[function(a,b,c){"use strict";var d,e,f,g,h,i;d=a("./Shared"),i=a("./Overload");var j=function(a,b){this.init.apply(this,arguments)};j.prototype.init=function(a,b){this.core(b),this._primaryKey="_id",this._name=a,this._collection={},this._debug={}},d.addModule("Db",j),j.prototype.moduleLoaded=new i({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b()}},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),j.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},j.moduleLoaded=j.prototype.moduleLoaded,j.version=j.prototype.version,j.shared=d,j.prototype.shared=d,d.addModule("Db",j),d.mixin(j.prototype,"Mixin.Common"),d.mixin(j.prototype,"Mixin.ChainReactor"),d.mixin(j.prototype,"Mixin.Constants"),e=d.modules.Core,f=a("./Collection.js"),g=a("./Metrics.js"),h=a("./Crc.js"),j.prototype._isServer=!1,d.synthesize(j.prototype,"core"),d.synthesize(j.prototype,"primaryKey"),d.synthesize(j.prototype,"state"),d.synthesize(j.prototype,"name"),d.synthesize(j.prototype,"mongoEmulation"),j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.crc=h,j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.arrayToCollection=function(a){return(new f).setData(a)},j.prototype.on=function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(b),this},j.prototype.off=function(a,b){if(a in this._listeners){var c=this._listeners[a],d=c.indexOf(b);d>-1&&c.splice(d,1)}return this},j.prototype.emit=function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d=this._listeners[a],e=d.length;for(c=0;e>c;c++)d[c].apply(this,Array.prototype.slice.call(arguments,1))}return this},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peekCat=function(a){var b,c,d,e={},f=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],"string"===f?(d=c.peek(a),d&&d.length&&(e[c.name()]=d)):(d=c.find(a),d&&d.length&&(e[c.name()]=d)));return e},j.prototype.drop=new i({"":function(){if(!this.isDropped()){var a,b=this.collections(),c=b.length;for(this._state="dropped",a=0;c>a;a++)this.collection(b[a].name).drop(),delete this._collection[b[a].name];this.emit("drop",this),delete this._core._db[this._name]}return!0},"function":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length,e=0,f=function(){e++,e===d&&a&&a()};for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(f),delete this._collection[c[b].name];this.emit("drop",this),delete this._core._db[this._name]}return!0},"boolean":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length;for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(a),delete this._collection[c[b].name];this.emit("drop",this),delete this._core._db[this._name]}return!0},"boolean, function":function(a,b){if(!this.isDropped()){var c,d=this.collections(),e=d.length,f=0,g=function(){f++,f===e&&b&&b()};for(this._state="dropped",c=0;e>c;c++)this.collection(d[c].name).drop(a,g),delete this._collection[d[c].name];this.emit("drop",this),delete this._core._db[this._name]}return!0}}),e.prototype.db=function(a){return a instanceof j?a:(a||(a=this.objectId()),this._db[a]=this._db[a]||new j(a,this),this._db[a].mongoEmulation(this.mongoEmulation()),this._db[a])},e.prototype.databases=function(a){var b,c,d,e=[];a&&(a instanceof RegExp||(a=new RegExp(a)));for(d in this._db)this._db.hasOwnProperty(d)&&(c=!0,a&&(a.exec(d)||(c=!1)),c&&(b={name:d,children:[]},this.shared.moduleExists("Collection")&&b.children.push({module:"collection",moduleName:"Collections",count:this._db[d].collections().length}),this.shared.moduleExists("CollectionGroup")&&b.children.push({module:"collectionGroup",moduleName:"Collection Groups",count:this._db[d].collectionGroups().length}),this.shared.moduleExists("Document")&&b.children.push({module:"document",moduleName:"Documents",count:this._db[d].documents().length}),this.shared.moduleExists("Grid")&&b.children.push({module:"grid",moduleName:"Grids",count:this._db[d].grids().length}),this.shared.moduleExists("Overview")&&b.children.push({module:"overview",moduleName:"Overviews",count:this._db[d].overviews().length}),this.shared.moduleExists("View")&&b.children.push({module:"view",moduleName:"Views",count:this._db[d].views().length}),e.push(b)));return e.sort(function(a,b){return a.name.localeCompare(b.name)}),e},d.finishModule("Db"),b.exports=j},{"./Collection.js":4,"./Crc.js":7,"./Metrics.js":15,"./Overload":28,"./Shared":36}],9:[function(a,b,c){"use strict";var d,e,f;d=a("./Shared");var g=function(){this.init.apply(this,arguments)};g.prototype.init=function(a){this._name=a,this._data={}},d.addModule("Document",g),d.mixin(g.prototype,"Mixin.Common"),d.mixin(g.prototype,"Mixin.Events"),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Constants"),d.mixin(g.prototype,"Mixin.Triggers"),d.mixin(g.prototype,"Mixin.Matching"),d.mixin(g.prototype,"Mixin.Updating"),e=a("./Collection"),f=d.modules.Db,d.synthesize(g.prototype,"state"),d.synthesize(g.prototype,"db"),d.synthesize(g.prototype,"name"),g.prototype.setData=function(a,b){var c,d;if(a){if(b=b||{$decouple:!0},b&&b.$decouple===!0&&(a=this.decouple(a)),this._linked){d={};for(c in this._data)"jQuery"!==c.substr(0,6)&&this._data.hasOwnProperty(c)&&void 0===a[c]&&(d[c]=1);a.$unset=d,this.updateObject(this._data,a,{})}else this._data=a;this.deferEmit("change",{type:"setData",data:this.decouple(this._data)})}return this},g.prototype.find=function(a,b){var c;return c=b&&b.$decouple===!1?this._data:this.decouple(this._data)},g.prototype.update=function(a,b,c){var d=this.updateObject(this._data,b,a,c);d&&this.deferEmit("change",{type:"update",data:this.decouple(this._data)})},g.prototype.updateObject=e.prototype.updateObject,g.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},g.prototype._updateProperty=function(a,b,c){this._linked?(window.jQuery.observable(a).setProperty(b,c),this.debug()&&console.log(this.logIdentifier()+' Setting data-bound document property "'+b+'"')):(a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'"'))},g.prototype._updateIncrement=function(a,b,c){this._linked?window.jQuery.observable(a).setProperty(b,a[b]+c):a[b]+=c},g.prototype._updateSpliceMove=function(a,b,c){this._linked?(window.jQuery.observable(a).move(b,c),this.debug()&&console.log(this.logIdentifier()+' Moving data-bound document array index from "'+b+'" to "'+c+'"')):(a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"'))},g.prototype._updateSplicePush=function(a,b,c){a.length>b?this._linked?window.jQuery.observable(a).insert(b,c):a.splice(b,0,c):this._linked?window.jQuery.observable(a).insert(c):a.push(c)},g.prototype._updatePush=function(a,b){this._linked?window.jQuery.observable(a).insert(b):a.push(b)},g.prototype._updatePull=function(a,b){this._linked?window.jQuery.observable(a).remove(b):a.splice(b,1)},g.prototype._updateMultiply=function(a,b,c){this._linked?window.jQuery.observable(a).setProperty(b,a[b]*c):a[b]*=c},g.prototype._updateRename=function(a,b,c){var d=a[b];this._linked?(window.jQuery.observable(a).setProperty(c,d),window.jQuery.observable(a).removeProperty(b)):(a[c]=d,delete a[b])},g.prototype._updateUnset=function(a,b){this._linked?window.jQuery.observable(a).removeProperty(b):delete a[b]},g.prototype.drop=function(){return this.isDropped()?!0:this._db&&this._name&&this._db&&this._db._document&&this._db._document[this._name]?(this._state="dropped",delete this._db._document[this._name],delete this._data,this.emit("drop",this),!0):!1},f.prototype.document=function(a){if(a){if(a instanceof g){if("droppped"!==a.state())return a;a=a.name()}return this._document=this._document||{},this._document[a]=this._document[a]||new g(a).db(this),this._document[a]}return this._document},f.prototype.documents=function(){var a,b,c=[];for(b in this._document)this._document.hasOwnProperty(b)&&(a=this._document[b],c.push({name:b,linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("Document"),b.exports=g},{"./Collection":4,"./Shared":36}],10:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k;d=a("./Shared");var l=function(a,b,c){this.init.apply(this,arguments)};l.prototype.init=function(a,b,c){var d=this;this._selector=a,this._template=b,this._options=c||{},this._debug={},this._id=this.objectId(),this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)}},d.addModule("Grid",l),d.mixin(l.prototype,"Mixin.Common"),d.mixin(l.prototype,"Mixin.ChainReactor"),d.mixin(l.prototype,"Mixin.Constants"),d.mixin(l.prototype,"Mixin.Triggers"),d.mixin(l.prototype,"Mixin.Events"),f=a("./Collection"),g=a("./CollectionGroup"),h=a("./View"),k=a("./ReactorIO"),i=f.prototype.init,e=d.modules.Db,j=e.prototype.init,d.synthesize(l.prototype,"state"),d.synthesize(l.prototype,"name"),l.prototype.insert=function(){this._from.insert.apply(this._from,arguments)},l.prototype.update=function(){this._from.update.apply(this._from,arguments)},l.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)},l.prototype.remove=function(){this._from.remove.apply(this._from,arguments)},l.prototype.from=function(a){return void 0!==a&&(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeGrid(this)),"string"==typeof a&&(a=this._db.collection(a)),this._from=a,this._from.on("drop",this._collectionDroppedWrap),this.refresh()),this},d.synthesize(l.prototype,"db",function(a){return a&&this.debug(a.debug()),this.$super.apply(this,arguments)}),l.prototype._collectionDropped=function(a){a&&delete this._from},l.prototype.drop=function(){return this.isDropped()?!0:this._from?(this._from.unlink(this._selector,this.template()),this._from.off("drop",this._collectionDroppedWrap),this._from._removeGrid(this),(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Dropping grid "+this._selector),this._state="dropped",this._db&&this._selector&&delete this._db._grid[this._selector],this.emit("drop",this),delete this._selector,delete this._template,delete this._from,delete this._db,!0):!1},l.prototype.template=function(a){return void 0!==a?(this._template=a,this):this._template},l.prototype._sortGridClick=function(a){var b,c=window.jQuery(a.currentTarget),e=c.attr("data-grid-sort")||"",f=-1===parseInt(c.attr("data-grid-dir")||"-1",10)?1:-1,g=e.split(","),h={};for(window.jQuery(this._selector).find("[data-grid-dir]").removeAttr("data-grid-dir"),c.attr("data-grid-dir",f),b=0;b<g.length;b++)h[g]=f;d.mixin(h,this._options.$orderBy),this._from.orderBy(h),this.emit("sort",h)},l.prototype.refresh=function(){if(this._from){if(!this._from.link)throw"Grid requires the AutoBind module in order to operate!";var a=this,b=window.jQuery(this._selector),c=function(){a._sortGridClick.apply(a,arguments)};if(b.html(""),a._from.orderBy&&b.off("click","[data-grid-sort]",c),a._from.query&&b.off("click","[data-grid-filter]",c),a._options.$wrap=a._options.$wrap||"gridRow",a._from.link(a._selector,a.template(),a._options),a._from.orderBy&&b.on("click","[data-grid-sort]",c),a._from.query){var d={};b.find("[data-grid-filter]").each(function(c,e){e=window.jQuery(e);var f,g,h,i,j=e.attr("data-grid-filter"),k=e.attr("data-grid-vartype"),l={},m=e.html(),n=a._db.view("tmpGridFilter_"+a._id+"_"+j);l[j]=1,i={$distinct:l},n.query(i).orderBy(l).from(a._from._from),h=['<div class="dropdown" id="'+a._id+"_"+j+'">','<button class="btn btn-default dropdown-toggle" type="button" id="'+a._id+"_"+j+'_dropdownButton" data-toggle="dropdown" aria-expanded="true">',m+' <span class="caret"></span>',"</button>","</div>"],f=window.jQuery(h.join("")),g=window.jQuery('<ul class="dropdown-menu" role="menu" id="'+a._id+"_"+j+'_dropdownMenu"></ul>'),f.append(g),e.html(f),n.link(g,{template:['<li role="presentation" class="input-group" style="width: 240px; padding-left: 10px; padding-right: 10px; padding-top: 5px;">','<input type="search" class="form-control gridFilterSearch" placeholder="Search...">','<span class="input-group-btn">','<button class="btn btn-default gridFilterClearSearch" type="button"><span class="glyphicon glyphicon-remove-circle glyphicons glyphicons-remove"></span></button>',"</span>","</li>",'<li role="presentation" class="divider"></li>','<li role="presentation" data-val="$all">','<a role="menuitem" tabindex="-1">','<input type="checkbox" checked> All',"</a>","</li>",'<li role="presentation" class="divider"></li>',"{^{for options}}",'<li role="presentation" data-link="data-val{:'+j+'}">','<a role="menuitem" tabindex="-1">','<input type="checkbox"> {^{:'+j+"}}","</a>","</li>","{{/for}}"].join("")},{$wrap:"options"}),b.on("keyup","#"+a._id+"_"+j+"_dropdownMenu .gridFilterSearch",function(a){var b=window.jQuery(this),c=n.query(),d=b.val();d?c[j]=new RegExp(d,"gi"):delete c[j],n.query(c)}),b.on("click","#"+a._id+"_"+j+"_dropdownMenu .gridFilterClearSearch",function(a){window.jQuery(this).parents("li").find(".gridFilterSearch").val("");var b=n.query();delete b[j],n.query(b)}),b.on("click","#"+a._id+"_"+j+"_dropdownMenu li",function(b){b.stopPropagation();var c,e,f,g,h,i=$(this),l=i.find('input[type="checkbox"]'),m=!0;if(window.jQuery(b.target).is("input")?(l.prop("checked",l.prop("checked")),e=l.is(":checked")):(l.prop("checked",!l.prop("checked")),e=l.is(":checked")),g=window.jQuery(this),c=g.attr("data-val"),"$all"===c)delete d[j],g.parent().find('li[data-val!="$all"]').find('input[type="checkbox"]').prop("checked",!1);else{switch(g.parent().find('[data-val="$all"]').find('input[type="checkbox"]').prop("checked",!1),k){case"integer":c=parseInt(c,10);break;case"float":c=parseFloat(c)}for(d[j]=d[j]||{$in:[]},f=d[j].$in,h=0;h<f.length;h++)if(f[h]===c){e===!1&&f.splice(h,1),m=!1;break}m&&e&&f.push(c),f.length||delete d[j]}a._from.queryData(d),a._from.pageFirst&&a._from.pageFirst()})})}a.emit("refresh")}return this},l.prototype.count=function(){return this._from.count()},f.prototype.grid=h.prototype.grid=function(a,b,c){if(this._db&&this._db._grid){if(void 0!==a){if(void 0!==b){if(this._db._grid[a])throw this.logIdentifier()+" Cannot create a grid because a grid with this name already exists: "+a;var d=new l(a,b,c).db(this._db).from(this);return this._grid=this._grid||[],this._grid.push(d),this._db._grid[a]=d,d}return this._db._grid[a]}return this._db._grid}},f.prototype.unGrid=h.prototype.unGrid=function(a,b,c){var d,e;if(this._db&&this._db._grid){if(a&&b){if(this._db._grid[a])return e=this._db._grid[a],delete this._db._grid[a],e.drop();throw this.logIdentifier()+" Cannot remove grid because a grid with this name does not exist: "+name}for(d in this._db._grid)this._db._grid.hasOwnProperty(d)&&(e=this._db._grid[d],delete this._db._grid[d],e.drop(),this.debug()&&console.log(this.logIdentifier()+' Removed grid binding "'+d+'"'));this._db._grid={}}},f.prototype._addGrid=g.prototype._addGrid=h.prototype._addGrid=function(a){return void 0!==a&&(this._grid=this._grid||[],this._grid.push(a)),this},f.prototype._removeGrid=g.prototype._removeGrid=h.prototype._removeGrid=function(a){if(void 0!==a&&this._grid){var b=this._grid.indexOf(a);b>-1&&this._grid.splice(b,1)}return this},e.prototype.init=function(){this._grid={},j.apply(this,arguments)},e.prototype.gridExists=function(a){return Boolean(this._grid[a])},e.prototype.grid=function(a,b,c){return this._grid[a]||(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating grid "+a),this._grid[a]=this._grid[a]||new l(a,b,c).db(this),this._grid[a]},e.prototype.unGrid=function(a,b,c){return this._grid[a]||(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating grid "+a),this._grid[a]=this._grid[a]||new l(a,b,c).db(this),this._grid[a]},e.prototype.grids=function(){var a,b,c=[];for(b in this._grid)this._grid.hasOwnProperty(b)&&(a=this._grid[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("Grid"),b.exports=l},{"./Collection":4,"./CollectionGroup":5,"./ReactorIO":34,"./Shared":36,"./View":37}],11:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared"),g=a("./Overload");var h=function(a,b){this.init.apply(this,arguments)};h.prototype.init=function(a,b){if(this._options=b,this._selector=window.jQuery(this._options.selector),!this._selector[0])throw this.classIdentifier()+' "'+a.name()+'": Chart target element does not exist via selector: '+this._options.selector;this._listeners={},this._collection=a,this._options.series=[],b.chartOptions=b.chartOptions||{},b.chartOptions.credits=!1;var c,d,e;switch(this._options.type){case"pie":this._selector.highcharts(this._options.chartOptions),this._chart=this._selector.highcharts(),c=this._collection.find(),d={allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b>: {y} ({point.percentage:.0f}%)",style:{color:window.Highcharts.theme&&window.Highcharts.theme.contrastTextColor||"black"}}},e=this.pieDataFromCollectionData(c,this._options.keyField,this._options.valField),window.jQuery.extend(d,this._options.seriesOptions),window.jQuery.extend(d,{name:this._options.seriesName,data:e}),this._chart.addSeries(d,!0,!0);break;case"line":case"area":case"column":case"bar":e=this.seriesDataFromCollectionData(this._options.seriesField,this._options.keyField,this._options.valField,this._options.orderBy),this._options.chartOptions.xAxis=e.xAxis,this._options.chartOptions.series=e.series,this._selector.highcharts(this._options.chartOptions),this._chart=this._selector.highcharts();break;default:throw this.classIdentifier()+' "'+a.name()+'": Chart type specified is not currently supported by ForerunnerDB: '+this._options.type}this._hookEvents()},d.addModule("Highchart",h),e=d.modules.Collection,f=e.prototype.init,d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.Events"),d.synthesize(h.prototype,"state"),h.prototype.pieDataFromCollectionData=function(a,b,c){var d,e=[];for(d=0;d<a.length;d++)e.push([a[d][b],a[d][c]]);return e},h.prototype.seriesDataFromCollectionData=function(a,b,c,d){var e,f,g,h,i,j,k=this._collection.distinct(a),l=[],m={categories:[]};for(i=0;i<k.length;i++){for(e=k[i],f={},f[a]=e,h=[],g=this._collection.find(f,{orderBy:d}),j=0;j<g.length;j++)m.categories.push(g[j][b]),h.push(g[j][c]);l.push({name:e,data:h})}return{xAxis:m,series:l}},h.prototype._hookEvents=function(){var a=this;a._collection.on("change",function(){a._changeListener.apply(a,arguments)}),a._collection.on("drop",function(){a.drop.apply(a,arguments)})},h.prototype._changeListener=function(){var a=this;if("undefined"!=typeof a._collection&&a._chart){var b,c=a._collection.find();switch(a._options.type){case"pie":a._chart.series[0].setData(a.pieDataFromCollectionData(c,a._options.keyField,a._options.valField),!0,!0);break;case"bar":case"line":case"area":case"column":var d=a.seriesDataFromCollectionData(a._options.seriesField,a._options.keyField,a._options.valField,a._options.orderBy);for(a._chart.xAxis[0].setCategories(d.xAxis.categories),b=0;b<d.series.length;b++)a._chart.series[b]?a._chart.series[b].setData(d.series[b].data,!0,!0):a._chart.addSeries(d.series[b],!0,!0)}}},h.prototype.drop=function(){return this.isDropped()?!0:(this._state="dropped",this._chart&&this._chart.destroy(),this._collection&&(this._collection.off("change",this._changeListener),this._collection.off("drop",this.drop),this._collection._highcharts&&delete this._collection._highcharts[this._options.selector]),delete this._chart,delete this._options,delete this._collection,this.emit("drop",this),!0)},e.prototype.init=function(){this._highcharts={},f.apply(this,arguments)},e.prototype.pieChart=new g({object:function(a){return a.type="pie",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="pie",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.selector=a,e.keyField=b,e.valField=c,e.seriesName=d,this.pieChart(e)}}),e.prototype.lineChart=new g({object:function(a){return a.type="line",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="line",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.lineChart(e)}}),e.prototype.areaChart=new g({object:function(a){return a.type="area",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="area",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.areaChart(e)}}),e.prototype.columnChart=new g({object:function(a){return a.type="column",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="column",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){
e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.columnChart(e)}}),e.prototype.barChart=new g({object:function(a){return a.type="bar",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="bar",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.barChart(e)}}),e.prototype.stackedBarChart=new g({object:function(a){return a.type="bar",a.chartOptions=a.chartOptions||{},a.chartOptions.chart=a.chartOptions.chart||{},a.chartOptions.chart.type="bar",a.plotOptions=a.plotOptions||{},a.plotOptions.series=a.plotOptions.series||{},a.plotOptions.series.stacking=a.plotOptions.series.stacking||"normal",this._highcharts[a.selector]||(this._highcharts[a.selector]=new h(this,a)),this._highcharts[a.selector]},"*, string, string, string, ...":function(a,b,c,d,e){e=e||{},e.seriesField=b,e.selector=a,e.keyField=c,e.valField=d,this.stackedBarChart(e)}}),e.prototype.dropChart=function(a){this._highcharts&&this._highcharts[a]&&this._highcharts[a].drop()},d.finishModule("Highchart"),b.exports=h},{"./Overload":28,"./Shared":36}],12:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=new f,h=function(){};g.inOrder("hash");var i=function(){this.init.apply(this,arguments)};i.prototype.init=function(a,b,c){this._btree=new(h.create(2,this.sortAsc)),this._size=0,this._id=this._itemKeyHash(a,a),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexBinaryTree",i),d.mixin(i.prototype,"Mixin.ChainReactor"),d.mixin(i.prototype,"Mixin.Sorting"),i.prototype.id=function(){return this._id},i.prototype.state=function(){return this._state},i.prototype.size=function(){return this._size},d.synthesize(i.prototype,"data"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"collection"),d.synthesize(i.prototype,"type"),d.synthesize(i.prototype,"unique"),i.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},i.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree=new(h.create(2,this.sortAsc)),this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},i.prototype.insert=function(a,b){var c,d,e=this._unique,f=this._itemKeyHash(a,this._keys);e&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._btree.get(f),void 0===d&&(d=[],this._btree.put(f,d)),d.push(a),this._size++},i.prototype.remove=function(a,b){var c,d,e,f=this._unique,g=this._itemKeyHash(a,this._keys);f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._btree.get(g),void 0!==d&&(e=d.indexOf(a),e>-1&&(1===d.length?this._btree.del(g):d.splice(e,1),this._size--))},i.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},i.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},i.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},i.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},i.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},i.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},i.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.finishModule("IndexBinaryTree"),b.exports=i},{"./BinaryTree":3,"./Path":30,"./Shared":36}],13:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a,b,c){this._crossRef={},this._size=0,this._id=this._itemKeyHash(a,a),this.data({}),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexHashMap",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.id=function(){return this._id},f.prototype.state=function(){return this._state},f.prototype.size=function(){return this._size},d.synthesize(f.prototype,"data"),d.synthesize(f.prototype,"name"),d.synthesize(f.prototype,"collection"),d.synthesize(f.prototype,"type"),d.synthesize(f.prototype,"unique"),f.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},f.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._data={},this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},f.prototype.insert=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pushToPathValue(d[e],a)},f.prototype.update=function(a,b){},f.prototype.remove=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pullFromPathValue(d[e],a)},f.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},f.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},f.prototype.pushToPathValue=function(a,b){var c=this._data[a]=this._data[a]||[];-1===c.indexOf(b)&&(c.push(b),this._size++,this.pushToCrossRef(b,c))},f.prototype.pullFromPathValue=function(a,b){var c,d=this._data[a];c=d.indexOf(b),c>-1&&(d.splice(c,1),this._size--,this.pullFromCrossRef(b,d)),d.length||delete this._data[a]},f.prototype.pull=function(a){var b,c,d=a[this._collection.primaryKey()],e=this._crossRef[d],f=e.length;for(b=0;f>b;b++)c=e[b],this._pullFromArray(c,a);this._size--,delete this._crossRef[d]},f.prototype._pullFromArray=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1)},f.prototype.pushToCrossRef=function(a,b){var c,d=a[this._collection.primaryKey()];this._crossRef[d]=this._crossRef[d]||[],c=this._crossRef[d],-1===c.indexOf(b)&&c.push(b)},f.prototype.pullFromCrossRef=function(a,b){var c=a[this._collection.primaryKey()];delete this._crossRef[c]},f.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},f.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},f.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},f.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},f.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.finishModule("IndexHashMap"),b.exports=f},{"./Path":30,"./Shared":36}],14:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){this._name=a,this._data={},this._primaryKey="_id"},d.addModule("KeyValueStore",e),d.mixin(e.prototype,"Mixin.ChainReactor"),d.synthesize(e.prototype,"name"),e.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},e.prototype.truncate=function(){return this._data={},this},e.prototype.set=function(a,b){return this._data[a]=b?b:!0,this},e.prototype.get=function(a){return this._data[a]},e.prototype.lookup=function(a){var b,c,d,e,f=a[this._primaryKey];if(f instanceof Array){for(c=f.length,e=[],b=0;c>b;b++)d=this._data[f[b]],d&&e.push(d);return e}if(f instanceof RegExp){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&f.test(b)&&e.push(this._data[b]);return e}if("object"!=typeof f)return d=this._data[f],void 0!==d?[d]:[];if(f.$ne){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&b!==f.$ne&&e.push(this._data[b]);return e}if(f.$in&&f.$in instanceof Array){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&f.$in.indexOf(b)>-1&&e.push(this._data[b]);return e}if(f.$nin&&f.$nin instanceof Array){e=[];for(b in this._data)this._data.hasOwnProperty(b)&&-1===f.$nin.indexOf(b)&&e.push(this._data[b]);return e}if(f.$or&&f.$or instanceof Array){for(e=[],b=0;b<f.$or.length;b++)e=e.concat(this.lookup(f.$or[b]));return e}},e.prototype.unSet=function(a){return delete this._data[a],this},e.prototype.uniqueSet=function(a,b){return void 0===this._data[a]?(this._data[a]=b,!0):!1},d.finishModule("KeyValueStore"),b.exports=e},{"./Shared":36}],15:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Operation"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(){this._data=[]},d.addModule("Metrics",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.create=function(a){var b=new e(a);return this._enabled&&this._data.push(b),b},f.prototype.start=function(){return this._enabled=!0,this},f.prototype.stop=function(){return this._enabled=!1,this},f.prototype.clear=function(){return this._data=[],this},f.prototype.list=function(){return this._data},d.finishModule("Metrics"),b.exports=f},{"./Operation":27,"./Shared":36}],16:[function(a,b,c){"use strict";var d={preSetData:function(){},postSetData:function(){}};b.exports=d},{}],17:[function(a,b,c){"use strict";var d={chain:function(a){this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Adding target "'+a._reactorOut.instanceIdentifier()+'" to the chain reactor target list'):console.log(this.logIdentifier()+' Adding target "'+a.instanceIdentifier()+'" to the chain reactor target list')),this._chain=this._chain||[];var b=this._chain.indexOf(a);-1===b&&this._chain.push(a)},unChain:function(a){if(this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Removing target "'+a._reactorOut.instanceIdentifier()+'" from the chain reactor target list'):console.log(this.logIdentifier()+' Removing target "'+a.instanceIdentifier()+'" from the chain reactor target list')),this._chain){var b=this._chain.indexOf(a);b>-1&&this._chain.splice(b,1)}},chainSend:function(a,b,c){if(this._chain){var d,e,f=this._chain,g=f.length;for(e=0;g>e;e++){if(d=f[e],d._state&&(!d._state||d.isDropped()))throw console.log("Reactor Data:",a,b,c),console.log("Reactor Node:",d),"Chain reactor attempting to send data to target reactor node that is in a dropped state!";this.debug&&this.debug()&&(d._reactorIn&&d._reactorOut?console.log(d._reactorIn.logIdentifier()+' Sending data down the chain reactor pipe to "'+d._reactorOut.instanceIdentifier()+'"'):console.log(this.logIdentifier()+' Sending data down the chain reactor pipe to "'+d.instanceIdentifier()+'"')),d.chainReceive(this,a,b,c)}}},chainReceive:function(a,b,c,d){var e={sender:a,type:b,data:c,options:d};this.debug&&this.debug()&&console.log(this.logIdentifier()+"Received data from parent reactor node"),(!this._chainHandler||this._chainHandler&&!this._chainHandler(e))&&this.chainSend(e.type,e.data,e.options)}};b.exports=d},{}],18:[function(a,b,c){"use strict";var d,e=0,f=a("./Overload"),g=a("./Serialiser");d={store:function(a,b){if(void 0!==a){if(void 0!==b)return this._store=this._store||{},this._store[a]=b,this;if(this._store)return this._store[a]}},unStore:function(a){return void 0!==a&&delete this._store[a],this},decouple:function(a,b){if(void 0!==a){if(b){var c,d=this.jStringify(a),e=[];for(c=0;b>c;c++)e.push(this.jParse(d));return e}return this.jParse(this.jStringify(a))}},jParse:function(a){return g.parse(a)},jStringify:function(a){return g.stringify(a)},objectId:function(a){var b,c=Math.pow(10,17);if(a){var d,f=0,g=a.length;for(d=0;g>d;d++)f+=a.charCodeAt(d)*c;b=f.toString(16)}else e++,b=(e+(Math.random()*c+Math.random()*c+Math.random()*c+Math.random()*c)).toString(16);return b},debug:new f([function(){return this._debug&&this._debug.all},function(a){return void 0!==a?"boolean"==typeof a?(this._debug=this._debug||{},this._debug.all=a,this.chainSend("debug",this._debug),this):this._debug&&this._debug[a]||this._db&&this._db._debug&&this._db._debug[a]||this._debug&&this._debug.all:this._debug&&this._debug.all},function(a,b){return void 0!==a?void 0!==b?(this._debug=this._debug||{},this._debug[a]=b,this.chainSend("debug",this._debug),this):this._debug&&this._debug[b]||this._db&&this._db._debug&&this._db._debug[a]:this._debug&&this._debug.all}]),classIdentifier:function(){return"ForerunnerDB."+this.className},instanceIdentifier:function(){return"["+this.className+"]"+this.name()},logIdentifier:function(){return this.classIdentifier()+": "+this.instanceIdentifier()},convertToFdb:function(a){var b,c,d,e;for(e in a)if(a.hasOwnProperty(e)&&(d=a,e.indexOf(".")>-1)){for(e=e.replace(".$","[|$|]"),c=e.split(".");b=c.shift();)b=b.replace("[|$|]",".$"),c.length?d[b]={}:d[b]=a[e],d=d[b];delete a[e]}},isDropped:function(){return"dropped"===this._state}},b.exports=d},{"./Overload":28,"./Serialiser":35}],19:[function(a,b,c){"use strict";var d={TYPE_INSERT:0,TYPE_UPDATE:1,TYPE_REMOVE:2,PHASE_BEFORE:0,PHASE_AFTER:1};b.exports=d},{}],20:[function(a,b,c){"use strict";var d=a("./Overload"),e={on:new d({"string, function":function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a]["*"]=this._listeners[a]["*"]||[],this._listeners[a]["*"].push(b),this},"string, *, function":function(a,b,c){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a][b]=this._listeners[a][b]||[],this._listeners[a][b].push(c),this}}),once:new d({"string, function":function(a,b){var c=this,d=function(){c.off(a,d),b.apply(c,arguments)};return this.on(a,d)},"string, *, function":function(a,b,c){var d=this,e=function(){d.off(a,b,e),c.apply(d,arguments)};return this.on(a,b,e)}}),off:new d({string:function(a){return this._listeners&&this._listeners[a]&&a in this._listeners&&delete this._listeners[a],this},"string, function":function(a,b){var c,d;return"string"==typeof b?this._listeners&&this._listeners[a]&&this._listeners[a][b]&&delete this._listeners[a][b]:this._listeners&&a in this._listeners&&(c=this._listeners[a]["*"],d=c.indexOf(b),d>-1&&c.splice(d,1)),this},"string, *, function":function(a,b,c){if(this._listeners&&a in this._listeners&&b in this.listeners[a]){var d=this._listeners[a][b],e=d.indexOf(c);e>-1&&d.splice(e,1)}},"string, *":function(a,b){this._listeners&&a in this._listeners&&b in this._listeners[a]&&delete this._listeners[a][b]}}),emit:function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d,e,f,g,h,i;if(this._listeners[a]["*"])for(f=this._listeners[a]["*"],d=f.length,c=0;d>c;c++)e=f[c],"function"==typeof e&&e.apply(this,Array.prototype.slice.call(arguments,1));if(b instanceof Array&&b[0]&&b[0][this._primaryKey])for(g=this._listeners[a],d=b.length,c=0;d>c;c++)if(g[b[c][this._primaryKey]])for(h=g[b[c][this._primaryKey]].length,i=0;h>i;i++)e=g[b[c][this._primaryKey]][i],"function"==typeof e&&g[b[c][this._primaryKey]][i].apply(this,Array.prototype.slice.call(arguments,1))}return this},deferEmit:function(a,b){var c,d=this;return this._noEmitDefer||this._db&&(!this._db||this._db._noEmitDefer)?this.emit.apply(this,arguments):(c=arguments,this._deferTimeout=this._deferTimeout||{},this._deferTimeout[a]&&clearTimeout(this._deferTimeout[a]),this._deferTimeout[a]=setTimeout(function(){d.debug()&&console.log(d.logIdentifier()+" Emitting "+c[0]),d.emit.apply(d,c)},1)),this}};b.exports=e},{"./Overload":28}],21:[function(a,b,c){"use strict";var d={_match:function(a,b,c,d,e){var f,g,h,i,j,k,l=d,m=typeof a,n=typeof b,o=!0;if(e=e||{},c=c||{},e.$rootQuery||(e.$rootQuery=b),e.$rootData=e.$rootData||{},"string"!==m&&"number"!==m||"string"!==n&&"number"!==n){for(k in b)if(b.hasOwnProperty(k)){if(f=!1,j=k.substr(0,2),"//"===j)continue;if(0===j.indexOf("$")&&(i=this._matchOp(k,a,b[k],c,e),i>-1)){if(i){if("or"===d)return!0}else o=i;f=!0}if(!f&&b[k]instanceof RegExp)if(f=!0,"object"===m&&void 0!==a[k]&&b[k].test(a[k])){if("or"===d)return!0}else o=!1;if(!f)if("object"==typeof b[k])if(void 0!==a[k])if(a[k]instanceof Array&&!(b[k]instanceof Array)){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if(!(a[k]instanceof Array)&&b[k]instanceof Array){for(g=!1,h=0;h<b[k].length&&!(g=this._match(a[k],b[k][h],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if("object"==typeof a)if(g=this._match(a[k],b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(b[k]&&void 0!==b[k].$exists)if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else o=!1;else if(a&&a[k]===b[k]){if("or"===d)return!0}else if(a&&a[k]&&a[k]instanceof Array&&b[k]&&"object"!=typeof b[k]){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else o=!1;if("and"===d&&!o)return!1}}else"number"===m?a!==b&&(o=!1):a.localeCompare(b)&&(o=!1);return o},_matchOp:function(a,b,c,d,e){switch(a){case"$gt":return b>c;case"$gte":return b>=c;case"$lt":return c>b;case"$lte":return c>=b;case"$exists":return void 0===b!==c;case"$ne":return b!=c;case"$nee":return b!==c;case"$or":for(var f=0;f<c.length;f++)if(this._match(b,c[f],d,"and",e))return!0;return!1;case"$and":for(var g=0;g<c.length;g++)if(!this._match(b,c[g],d,"and",e))return!1;return!0;case"$in":if(c instanceof Array){var h,i=c,j=i.length;for(h=0;j>h;h++){if(i[h]instanceof RegExp&&i[h].test(b))return!0;if(i[h]===b)return!0}return!1}throw this.logIdentifier()+" Cannot use an $in operator on a non-array key: "+a;case"$nin":if(c instanceof Array){var k,l=c,m=l.length;for(k=0;m>k;k++)if(l[k]===b)return!1;return!0}throw this.logIdentifier()+" Cannot use a $nin operator on a non-array key: "+a;case"$distinct":e.$rootData["//distinctLookup"]=e.$rootData["//distinctLookup"]||{};for(var n in c)if(c.hasOwnProperty(n))return e.$rootData["//distinctLookup"][n]=e.$rootData["//distinctLookup"][n]||{},e.$rootData["//distinctLookup"][n][b[n]]?!1:(e.$rootData["//distinctLookup"][n][b[n]]=!0,!0);break;case"$count":var o,p,q;for(o in c)if(c.hasOwnProperty(o)&&(p=b[o],q="object"==typeof p&&p instanceof Array?p.length:0,!this._match(q,c[o],d,"and",e)))return!1;return!0}return-1}};b.exports=d},{}],22:[function(a,b,c){"use strict";var d={sortAsc:function(a,b){return"string"==typeof a&&"string"==typeof b?a.localeCompare(b):a>b?1:b>a?-1:0},sortDesc:function(a,b){return"string"==typeof a&&"string"==typeof b?b.localeCompare(a):a>b?-1:b>a?1:0}};b.exports=d},{}],23:[function(a,b,c){"use strict";var d=a("./Overload"),e={addTrigger:function(a,b,c,d){var e,f=this;return e=f._triggerIndexOf(a,b,c),-1===e?(f._trigger=f._trigger||{},f._trigger[b]=f._trigger[b]||{},f._trigger[b][c]=f._trigger[b][c]||[],f._trigger[b][c].push({id:a,method:d,enabled:!0}),!0):!1},removeTrigger:function(a,b,c){var d,e=this;return d=e._triggerIndexOf(a,b,c),d>-1&&e._trigger[b][c].splice(d,1),!1},enableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!0,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!0,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!0,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!0,!0):!1}}),disableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!1,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!1,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!1,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!1,!0):!1}}),willTrigger:function(a,b){if(this._trigger&&this._trigger[a]&&this._trigger[a][b]&&this._trigger[a][b].length){var c,d=this._trigger[a][b];for(c=0;c<d.length;c++)if(d[c].enabled)return!0}return!1},processTrigger:function(a,b,c,d,e){var f,g,h,i,j,k=this;if(k._trigger&&k._trigger[b]&&k._trigger[b][c]){for(f=k._trigger[b][c],h=f.length,g=0;h>g;g++)if(i=f[g],i.enabled){if(this.debug()){var l,m;switch(b){case this.TYPE_INSERT:l="insert";break;case this.TYPE_UPDATE:l="update";break;case this.TYPE_REMOVE:l="remove";break;default:l=""}switch(c){case this.PHASE_BEFORE:m="before";break;case this.PHASE_AFTER:m="after";break;default:m=""}}if(j=i.method.call(k,a,d,e),j===!1)return!1;if(void 0!==j&&j!==!0&&j!==!1)throw"ForerunnerDB.Mixin.Triggers: Trigger error: "+j}return!0}},_triggerIndexOf:function(a,b,c){var d,e,f,g=this;if(g._trigger&&g._trigger[b]&&g._trigger[b][c])for(d=g._trigger[b][c],e=d.length,f=0;e>f;f++)if(d[f].id===a)return f;return-1}};b.exports=e},{"./Overload":28}],24:[function(a,b,c){"use strict";var d={_updateProperty:function(a,b,c){a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'"')},_updateIncrement:function(a,b,c){a[b]+=c},_updateSpliceMove:function(a,b,c){a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"')},_updateSplicePush:function(a,b,c){a.length>b?a.splice(b,0,c):a.push(c)},_updatePush:function(a,b){a.push(b)},_updatePull:function(a,b){a.splice(b,1)},_updateMultiply:function(a,b,c){a[b]*=c},_updateRename:function(a,b,c){a[c]=a[b],delete a[b]},_updateOverwrite:function(a,b,c){a[b]=c},_updateUnset:function(a,b){delete a[b]},_updateClear:function(a,b){var c,d=a[b];if(d&&"object"==typeof d)for(c in d)d.hasOwnProperty(c)&&this._updateUnset(d,c)},_updatePop:function(a,b){var c,d=!1;if(a.length>0)if(b>0){for(c=0;b>c;c++)a.pop();d=!0}else if(0>b){for(c=0;c>b;c--)a.shift();d=!0}return d}};b.exports=d},{}],25:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared"),e=d.modules.Core,f=d.modules.OldView,g=f.prototype.init,f.prototype.init=function(){var a=this;this._binds=[],this._renderStart=0,this._renderEnd=0,this._deferQueue={insert:[],update:[],remove:[],upsert:[],_bindInsert:[],_bindUpdate:[],_bindRemove:[],_bindUpsert:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100,_bindInsert:100,_bindUpdate:100,_bindRemove:100,_bindUpsert:100},this._deferTime={insert:100,update:1,remove:1,upsert:1,_bindInsert:100,_bindUpdate:1,_bindRemove:1,_bindUpsert:1},g.apply(this,arguments),this.on("insert",function(b,c){a._bindEvent("insert",b,c)}),this.on("update",function(b,c){a._bindEvent("update",b,c)}),this.on("remove",function(b,c){a._bindEvent("remove",b,c)}),this.on("change",a._bindChange)},f.prototype.bind=function(a,b){if(!b||!b.template)throw'ForerunnerDB.OldView "'+this.name()+'": Cannot bind data to element, missing options information!';return this._binds[a]=b,this},f.prototype.unBind=function(a){return delete this._binds[a],this},f.prototype.isBound=function(a){return Boolean(this._binds[a])},f.prototype.bindSortDom=function(a,b){var c,d,e,f=window.jQuery(a);for(this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sorting data in DOM...",b),c=0;c<b.length;c++)d=b[c],e=f.find("#"+d[this._primaryKey]),e.length?0===c?(this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sort, moving to index 0...",e),f.prepend(e)):(this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sort, moving to index "+c+"...",e),e.insertAfter(f.children(":eq("+(c-1)+")"))):this.debug()&&console.log("ForerunnerDB.OldView.Bind: Warning, element for array item not found!",d)},f.prototype.bindRefresh=function(a){var b,c,d=this._binds;a||(a={data:this.find()});for(b in d)d.hasOwnProperty(b)&&(c=d[b],this.debug()&&console.log("ForerunnerDB.OldView.Bind: Sorting DOM..."),this.bindSortDom(b,a.data),c.afterOperation&&c.afterOperation(),c.refresh&&c.refresh())},f.prototype.bindRender=function(a,b){var c,d,e,f,g,h=this._binds[a],i=window.jQuery(a),j=window.jQuery("<ul></ul>");if(h){for(c=this._data.find(),f=function(a){j.append(a)},g=0;g<c.length;g++)d=c[g],e=h.template(d,f);b?b(a,j.html()):i.append(j.html())}},f.prototype.processQueue=function(a,b){var c=this._deferQueue[a],d=this._deferThreshold[a],e=this._deferTime[a];if(c.length){var f,g=this;c.length&&(f=c.length>d?c.splice(0,d):c.splice(0,c.length),this._bindEvent(a,f,[])),setTimeout(function(){g.processQueue(a,b)},e)}else b&&b(),this.emit("bindQueueComplete")},f.prototype._bindEvent=function(a,b,c){var d,e,f=this._binds,g=this.find({});for(e in f)if(f.hasOwnProperty(e))switch(d=f[e].reduce?this.find(f[e].reduce.query,f[e].reduce.options):g,a){case"insert":this._bindInsert(e,f[e],b,c,d);break;case"update":this._bindUpdate(e,f[e],b,c,d);break;case"remove":this._bindRemove(e,f[e],b,c,d)}},f.prototype._bindChange=function(a){this.debug()&&console.log("ForerunnerDB.OldView.Bind: Bind data change, refreshing bind...",a),this.bindRefresh(a)},f.prototype._bindInsert=function(a,b,c,d,e){var f,g,h,i,j=window.jQuery(a);for(h=function(a,c,d,e){return function(a){b.insert?b.insert(a,c,d,e):b.prependInsert?j.prepend(a):j.append(a),b.afterInsert&&b.afterInsert(a,c,d,e)}},i=0;i<c.length;i++)f=j.find("#"+c[i][this._primaryKey]),f.length||(g=b.template(c[i],h(f,c[i],d,e)))},f.prototype._bindUpdate=function(a,b,c,d,e){var f,g,h,i=window.jQuery(a);for(g=function(a,c){return function(d){b.update?b.update(d,c,e,a.length?"update":"append"):a.length?a.replaceWith(d):b.prependUpdate?i.prepend(d):i.append(d),b.afterUpdate&&b.afterUpdate(d,c,e)}},h=0;h<c.length;h++)f=i.find("#"+c[h][this._primaryKey]),b.template(c[h],g(f,c[h]))},f.prototype._bindRemove=function(a,b,c,d,e){var f,g,h,i=window.jQuery(a);for(g=function(a,c,d){return function(){b.remove?b.remove(a,c,d):(a.remove(),b.afterRemove&&b.afterRemove(a,c,d))}},h=0;h<c.length;h++)f=i.find("#"+c[h][this._primaryKey]),f.length&&(b.beforeRemove?b.beforeRemove(f,c[h],e,g(f,c[h],e)):b.remove?b.remove(f,c[h],e):(f.remove(),b.afterRemove&&b.afterRemove(f,c[h],e)))}},{"./Shared":36}],26:[function(a,b,c){"use strict";var d,e,f,g,h,i,j;d=a("./Shared");var k=function(a){this.init.apply(this,arguments)};k.prototype.init=function(a){var b=this;this._name=a,this._listeners={},this._query={query:{},options:{}},this._onFromSetData=function(){b._onSetData.apply(b,arguments)},this._onFromInsert=function(){b._onInsert.apply(b,arguments)},this._onFromUpdate=function(){b._onUpdate.apply(b,arguments)},this._onFromRemove=function(){b._onRemove.apply(b,arguments)},this._onFromChange=function(){b.debug()&&console.log("ForerunnerDB.OldView: Received change"),b._onChange.apply(b,arguments)}},d.addModule("OldView",k),f=a("./CollectionGroup"),g=a("./Collection"),h=g.prototype.init,i=f.prototype.init,e=d.modules.Db,j=e.prototype.init,d.mixin(k.prototype,"Mixin.Events"),k.prototype.drop=function(){return(this._db||this._from)&&this._name?(this.debug()&&console.log("ForerunnerDB.OldView: Dropping view "+this._name),this._state="dropped",this.emit("drop",this),this._db&&this._db._oldViews&&delete this._db._oldViews[this._name],this._from&&this._from._oldViews&&delete this._from._oldViews[this._name],!0):!1},k.prototype.debug=function(){return!1},k.prototype.db=function(a){return void 0!==a?(this._db=a,this):this._db},k.prototype.from=function(a){if(void 0!==a){if("string"==typeof a){if(!this._db.collectionExists(a))throw'ForerunnerDB.OldView "'+this.name()+'": Invalid collection in view.from() call.';a=this._db.collection(a)}return this._from!==a&&(this._from&&this.removeFrom(),this.addFrom(a)),this}return this._from},k.prototype.addFrom=function(a){if(this._from=a,this._from)return this._from.on("setData",this._onFromSetData),this._from.on("change",this._onFromChange),this._from._addOldView(this),this._primaryKey=this._from._primaryKey,this.refresh(),this;throw'ForerunnerDB.OldView "'+this.name()+'": Cannot determine collection type in view.from()'},k.prototype.removeFrom=function(){this._from.off("setData",this._onFromSetData),this._from.off("change",this._onFromChange),this._from._removeOldView(this)},k.prototype.primaryKey=function(){return this._from?this._from.primaryKey():void 0},k.prototype.queryData=function(a,b,c){return void 0!==a&&(this._query.query=a),void 0!==b&&(this._query.options=b),void 0!==a||void 0!==b?((void 0===c||c===!0)&&this.refresh(),this):this._query},k.prototype.queryAdd=function(a,b,c){var d,e=this._query.query;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||void 0!==e[d]&&b)&&(e[d]=a[d]);(void 0===c||c===!0)&&this.refresh()},k.prototype.queryRemove=function(a,b){var c,d=this._query.query;if(void 0!==a)for(c in a)a.hasOwnProperty(c)&&delete d[c];(void 0===b||b===!0)&&this.refresh()},k.prototype.query=function(a,b){return void 0!==a?(this._query.query=a,(void 0===b||b===!0)&&this.refresh(),this):this._query.query},k.prototype.queryOptions=function(a,b){return void 0!==a?(this._query.options=a,(void 0===b||b===!0)&&this.refresh(),this):this._query.options},k.prototype.refresh=function(a){if(this._from){var b,c,d,e,f,g,h,i,j=this._data,k=[],l=[],m=[],n=!1;if(this.debug()&&(console.log("ForerunnerDB.OldView: Refreshing view "+this._name),console.log("ForerunnerDB.OldView: Existing data: "+("undefined"!=typeof this._data)),"undefined"!=typeof this._data&&console.log("ForerunnerDB.OldView: Current data rows: "+this._data.find().length)),this._query?(this.debug()&&console.log("ForerunnerDB.OldView: View has query and options, getting subset..."),this._data=this._from.subset(this._query.query,this._query.options)):this._query.options?(this.debug()&&console.log("ForerunnerDB.OldView: View has options, getting subset..."),this._data=this._from.subset({},this._query.options)):(this.debug()&&console.log("ForerunnerDB.OldView: View has no query or options, getting subset..."),this._data=this._from.subset({})),!a&&j)if(this.debug()&&console.log("ForerunnerDB.OldView: Refresh not forced, old data detected..."),d=this._data,j.subsetOf()===d.subsetOf()){for(this.debug()&&console.log("ForerunnerDB.OldView: Old and new data are from same collection..."),e=d.find(),b=j.find(),g=d._primaryKey,i=0;i<e.length;i++)h=e[i],f={},f[g]=h[g],c=j.find(f)[0],c?JSON.stringify(c)!==JSON.stringify(h)&&l.push(h):k.push(h);for(i=0;i<b.length;i++)h=b[i],f={},f[g]=h[g],d.find(f)[0]||m.push(h);this.debug()&&(console.log("ForerunnerDB.OldView: Removed "+m.length+" rows"),console.log("ForerunnerDB.OldView: Inserted "+k.length+" rows"),console.log("ForerunnerDB.OldView: Updated "+l.length+" rows")),k.length&&(this._onInsert(k,[]),n=!0),l.length&&(this._onUpdate(l,[]),n=!0),m.length&&(this._onRemove(m,[]),
n=!0)}else this.debug()&&console.log("ForerunnerDB.OldView: Old and new data are from different collections..."),m=j.find(),m.length&&(this._onRemove(m),n=!0),k=d.find(),k.length&&(this._onInsert(k),n=!0);else this.debug()&&console.log("ForerunnerDB.OldView: Forcing data update",e),this._data=this._from.subset(this._query.query,this._query.options),e=this._data.find(),this.debug()&&console.log("ForerunnerDB.OldView: Emitting change event with data",e),this._onInsert(e,[]);this.debug()&&console.log("ForerunnerDB.OldView: Emitting change"),this.emit("change")}return this},k.prototype.count=function(){return this._data&&this._data._data?this._data._data.length:0},k.prototype.find=function(){return this._data?(this.debug()&&console.log("ForerunnerDB.OldView: Finding data in view collection...",this._data),this._data.find.apply(this._data,arguments)):[]},k.prototype.insert=function(){return this._from?this._from.insert.apply(this._from,arguments):[]},k.prototype.update=function(){return this._from?this._from.update.apply(this._from,arguments):[]},k.prototype.remove=function(){return this._from?this._from.remove.apply(this._from,arguments):[]},k.prototype._onSetData=function(a,b){this.emit("remove",b,[]),this.emit("insert",a,[])},k.prototype._onInsert=function(a,b){this.emit("insert",a,b)},k.prototype._onUpdate=function(a,b){this.emit("update",a,b)},k.prototype._onRemove=function(a,b){this.emit("remove",a,b)},k.prototype._onChange=function(){this.debug()&&console.log("ForerunnerDB.OldView: Refreshing data"),this.refresh()},g.prototype.init=function(){this._oldViews=[],h.apply(this,arguments)},g.prototype._addOldView=function(a){return void 0!==a&&(this._oldViews[a._name]=a),this},g.prototype._removeOldView=function(a){return void 0!==a&&delete this._oldViews[a._name],this},f.prototype.init=function(){this._oldViews=[],i.apply(this,arguments)},f.prototype._addOldView=function(a){return void 0!==a&&(this._oldViews[a._name]=a),this},f.prototype._removeOldView=function(a){return void 0!==a&&delete this._oldViews[a._name],this},e.prototype.init=function(){this._oldViews={},j.apply(this,arguments)},e.prototype.oldView=function(a){return this._oldViews[a]||this.debug()&&console.log("ForerunnerDB.OldView: Creating view "+a),this._oldViews[a]=this._oldViews[a]||new k(a).db(this),this._oldViews[a]},e.prototype.oldViewExists=function(a){return Boolean(this._oldViews[a])},e.prototype.oldViews=function(){var a,b=[];for(a in this._oldViews)this._oldViews.hasOwnProperty(a)&&b.push({name:a,count:this._oldViews[a].count()});return b},d.finishModule("OldView"),b.exports=k},{"./Collection":4,"./CollectionGroup":5,"./Shared":36}],27:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(a){this.pathSolver=new e,this.counter=0,this.init.apply(this,arguments)};f.prototype.init=function(a){this._data={operation:a,index:{potential:[],used:!1},steps:[],time:{startMs:0,stopMs:0,totalMs:0,process:{}},flag:{},log:[]}},d.addModule("Operation",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.start=function(){this._data.time.startMs=(new Date).getTime()},f.prototype.log=function(a){if(a){var b=this._log.length>0?this._data.log[this._data.log.length-1].time:0,c={event:a,time:(new Date).getTime(),delta:0};return this._data.log.push(c),b&&(c.delta=c.time-b),this}return this._data.log},f.prototype.time=function(a){if(void 0!==a){var b=this._data.time.process,c=b[a]=b[a]||{};return c.startMs?(c.stopMs=(new Date).getTime(),c.totalMs=c.stopMs-c.startMs,c.stepObj.totalMs=c.totalMs,delete c.stepObj):(c.startMs=(new Date).getTime(),c.stepObj={name:a},this._data.steps.push(c.stepObj)),this}return this._data.time},f.prototype.flag=function(a,b){return void 0===a||void 0===b?void 0!==a?this._data.flag[a]:this._data.flag:void(this._data.flag[a]=b)},f.prototype.data=function(a,b,c){return void 0!==b?(this.pathSolver.set(this._data,a,b),this):this.pathSolver.get(this._data,a)},f.prototype.pushData=function(a,b,c){this.pathSolver.push(this._data,a,b)},f.prototype.stop=function(){this._data.time.stopMs=(new Date).getTime(),this._data.time.totalMs=this._data.time.stopMs-this._data.time.startMs},d.finishModule("Operation"),b.exports=f},{"./Path":30,"./Shared":36}],28:[function(a,b,c){"use strict";var d=function(a){if(a){var b,c,d,e,f,g,h=this;if(!(a instanceof Array)){d={};for(b in a)if(a.hasOwnProperty(b))if(e=b.replace(/ /g,""),-1===e.indexOf("*"))d[e]=a[b];else for(g=this.generateSignaturePermutations(e),f=0;f<g.length;f++)d[g[f]]||(d[g[f]]=a[b]);a=d}return function(){var d,e,f,g=[];if(a instanceof Array){for(c=a.length,b=0;c>b;b++)if(a[b].length===arguments.length)return h.callExtend(this,"$main",a,a[b],arguments)}else{for(b=0;b<arguments.length&&(e=typeof arguments[b],"object"===e&&arguments[b]instanceof Array&&(e="array"),1!==arguments.length||"undefined"!==e);b++)g.push(e);if(d=g.join(","),a[d])return h.callExtend(this,"$main",a,a[d],arguments);for(b=g.length;b>=0;b--)if(d=g.slice(0,b).join(","),a[d+",..."])return h.callExtend(this,"$main",a,a[d+",..."],arguments)}throw f="function"==typeof this.name?this.name():"Unknown",'ForerunnerDB.Overload "'+f+'": Overloaded method does not have a matching signature for the passed arguments: '+this.jStringify(g)}}return function(){}};d.prototype.generateSignaturePermutations=function(a){var b,c,d=[],e=["string","object","number","function","undefined"];if(a.indexOf("*")>-1)for(c=0;c<e.length;c++)b=a.replace("*",e[c]),d=d.concat(this.generateSignaturePermutations(b));else d.push(a);return d},d.prototype.callExtend=function(a,b,c,d,e){var f,g;return a&&c[b]?(f=a[b],a[b]=c[b],g=d.apply(a,e),a[b]=f,g):d.apply(a,e)},b.exports=d},{}],29:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){var b=this;this._name=a,this._data=new g("__FDB__dc_data_"+this._name),this._collData=new f,this._sources=[],this._sourceDroppedWrap=function(){b._sourceDropped.apply(b,arguments)}},d.addModule("Overview",h),d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.ChainReactor"),d.mixin(h.prototype,"Mixin.Constants"),d.mixin(h.prototype,"Mixin.Triggers"),d.mixin(h.prototype,"Mixin.Events"),f=a("./Collection"),g=a("./Document"),e=d.modules.Db,d.synthesize(h.prototype,"state"),d.synthesize(h.prototype,"db"),d.synthesize(h.prototype,"name"),d.synthesize(h.prototype,"query",function(a){var b=this.$super(a);return void 0!==a&&this._refresh(),b}),d.synthesize(h.prototype,"queryOptions",function(a){var b=this.$super(a);return void 0!==a&&this._refresh(),b}),d.synthesize(h.prototype,"reduce",function(a){var b=this.$super(a);return void 0!==a&&this._refresh(),b}),h.prototype.from=function(a){return void 0!==a?("string"==typeof a&&(a=this._db.collection(a)),this._setFrom(a),this):this._sources},h.prototype.find=function(){return this._collData.find.apply(this._collData,arguments)},h.prototype.exec=function(){var a=this.reduce();return a?a.apply(this):void 0},h.prototype.count=function(){return this._collData.count.apply(this._collData,arguments)},h.prototype._setFrom=function(a){for(;this._sources.length;)this._removeSource(this._sources[0]);return this._addSource(a),this},h.prototype._addSource=function(a){return a&&"View"===a.className&&(a=a.privateData(),this.debug()&&console.log(this.logIdentifier()+' Using internal private data "'+a.instanceIdentifier()+'" for IO graph linking')),-1===this._sources.indexOf(a)&&(this._sources.push(a),a.chain(this),a.on("drop",this._sourceDroppedWrap),this._refresh()),this},h.prototype._removeSource=function(a){a&&"View"===a.className&&(a=a.privateData(),this.debug()&&console.log(this.logIdentifier()+' Using internal private data "'+a.instanceIdentifier()+'" for IO graph linking'));var b=this._sources.indexOf(a);return b>-1&&(this._sources.splice(a,1),a.unChain(this),a.off("drop",this._sourceDroppedWrap),this._refresh()),this},h.prototype._sourceDropped=function(a){a&&this._removeSource(a)},h.prototype._refresh=function(){if(!this.isDropped()){if(this._sources&&this._sources[0]){this._collData.primaryKey(this._sources[0].primaryKey());var a,b=[];for(a=0;a<this._sources.length;a++)b=b.concat(this._sources[a].find(this._query,this._queryOptions));this._collData.setData(b)}if(this._reduce){var c=this._reduce.apply(this);this._data.setData(c)}}},h.prototype._chainHandler=function(a){switch(a.type){case"setData":case"insert":case"update":case"remove":this._refresh()}},h.prototype.data=function(){return this._data},h.prototype.drop=function(){if(!this.isDropped()){for(this._state="dropped",delete this._data,delete this._collData;this._sources.length;)this._removeSource(this._sources[0]);delete this._sources,this._db&&this._name&&delete this._db._overview[this._name],delete this._name,this.emit("drop",this)}return!0},e.prototype.overview=function(a){return a?a instanceof h?a:(this._overview=this._overview||{},this._overview[a]=this._overview[a]||new h(a).db(this),this._overview[a]):this._overview||{}},e.prototype.overviews=function(){var a,b,c=[];for(b in this._overview)this._overview.hasOwnProperty(b)&&(a=this._overview[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("Overview"),b.exports=h},{"./Collection":4,"./Document":9,"./Shared":36}],30:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){a&&this.path(a)},d.addModule("Path",e),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),e.prototype.path=function(a){return void 0!==a?(this._path=this.clean(a),this._pathParts=this._path.split("."),this):this._path},e.prototype.hasObjectPaths=function(a,b){var c,d=!0;for(c in a)if(a.hasOwnProperty(c)){if(void 0===b[c])return!1;if("object"==typeof a[c]&&(d=this.hasObjectPaths(a[c],b[c]),!d))return!1}return d},e.prototype.countKeys=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&void 0!==a[b]&&("object"!=typeof a[b]?c++:c+=this.countKeys(a[b]));return c},e.prototype.countObjectPaths=function(a,b){var c,d,e={},f=0,g=0;for(d in b)b.hasOwnProperty(d)&&("object"==typeof b[d]?(c=this.countObjectPaths(a[d],b[d]),e[d]=c.matchedKeys,g+=c.totalKeyCount,f+=c.matchedKeyCount):(g++,a&&a[d]&&"object"!=typeof a[d]?(e[d]=!0,f++):e[d]=!1));return{matchedKeys:e,matchedKeyCount:f,totalKeyCount:g}},e.prototype.parse=function(a,b){var c,d,e,f=[],g="";for(d in a)if(a.hasOwnProperty(d))if(g=d,"object"==typeof a[d])if(b)for(c=this.parse(a[d],b),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path,value:c[e].value});else for(c=this.parse(a[d]),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path});else b?f.push({path:g,value:a[d]}):f.push({path:g});return f},e.prototype.parseArr=function(a,b){return b=b||{},this._parseArr(a,"",[],b)},e.prototype._parseArr=function(a,b,c,d){var e,f="";b=b||"",c=c||[];for(e in a)a.hasOwnProperty(e)&&(!d.ignore||d.ignore&&!d.ignore.test(e))&&(f=b?b+"."+e:e,"object"==typeof a[e]?this._parseArr(a[e],f,c,d):c.push(f));return c},e.prototype.value=function(a,b){if(void 0!==a&&"object"==typeof a){var c,d,e,f,g,h,i,j=[];for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,h=0;e>h;h++){if(f=f[d[h]],g instanceof Array){for(i=0;i<g.length;i++)j=j.concat(this.value(g,i+"."+d[h]));return j}if(!f||"object"!=typeof f)break;g=f}return[f]}return[]},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.get=function(a,b){return this.value(a,b)[0]},e.prototype.push=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;if(b=this.clean(b),d=b.split("."),e=d.shift(),d.length)a[e]=a[e]||{},this.set(a[e],d.join("."),c);else{if(a[e]=a[e]||[],!(a[e]instanceof Array))throw"ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!";a[e].push(c)}}return a},e.prototype.keyValue=function(a,b){var c,d,e,f,g,h,i;for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,i=0;e>i;i++){if(f=f[d[i]],!f||"object"!=typeof f){h=d[i]+":"+f;break}g=f}return h},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.clean=function(a){return"."===a.substr(0,1)&&(a=a.substr(1,a.length-1)),a},d.finishModule("Path"),b.exports=e},{"./Shared":36}],31:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m=a("./Shared"),n=a("async"),o=a("localforage");a("./PersistCompress"),a("./PersistCrypto");k=function(){this.init.apply(this,arguments)},k.prototype.localforage=o,k.prototype.init=function(a){var b=this;this._encodeSteps=[function(){return b._encode.apply(b,arguments)}],this._decodeSteps=[function(){return b._decode.apply(b,arguments)}],a.isClient()&&void 0!==window.Storage&&(this.mode("localforage"),o.config({driver:[o.INDEXEDDB,o.WEBSQL,o.LOCALSTORAGE],name:String(a.core().name()),storeName:"FDB"}))},m.addModule("Persist",k),m.mixin(k.prototype,"Mixin.ChainReactor"),m.mixin(k.prototype,"Mixin.Common"),d=m.modules.Db,e=a("./Collection"),f=e.prototype.drop,g=a("./CollectionGroup"),h=e.prototype.init,i=d.prototype.init,j=d.prototype.drop,l=m.overload,k.prototype.mode=function(a){return void 0!==a?(this._mode=a,this):this._mode},k.prototype.driver=function(a){if(void 0!==a){switch(a.toUpperCase()){case"LOCALSTORAGE":o.setDriver(o.LOCALSTORAGE);break;case"WEBSQL":o.setDriver(o.WEBSQL);break;case"INDEXEDDB":o.setDriver(o.INDEXEDDB);break;default:throw"ForerunnerDB.Persist: The persistence driver you have specified is not found. Please use either IndexedDB, WebSQL or LocalStorage!"}return this}return o.driver()},k.prototype.decode=function(a,b){n.waterfall([function(b){b(!1,a,{})}].concat(this._decodeSteps),b)},k.prototype.encode=function(a,b){n.waterfall([function(b){b(!1,a,{})}].concat(this._encodeSteps),b)},m.synthesize(k.prototype,"encodeSteps"),m.synthesize(k.prototype,"decodeSteps"),k.prototype.addStep=new l({object:function(a){this.$main.call(this,function(){a.encode.apply(a,arguments)},function(){a.decode.apply(a,arguments)},0)},"function, function":function(a,b){this.$main.call(this,a,b,0)},"function, function, number":function(a,b,c){this.$main.call(this,a,b,c)},$main:function(a,b,c){0===c||void 0===c?(this._encodeSteps.push(a),this._decodeSteps.unshift(b)):(this._encodeSteps.splice(c,0,a),this._decodeSteps.splice(this._decodeSteps.length-c,0,b))}}),k.prototype.unwrap=function(a){var b,c=a.split("::fdb::");switch(c[0]){case"json":b=this.jParse(c[1]);break;case"raw":b=c[1]}},k.prototype._decode=function(a,b,c){var d,e;if(a){switch(d=a.split("::fdb::"),d[0]){case"json":e=this.jParse(d[1]);break;case"raw":e=d[1]}e?(b.foundData=!0,b.rowCount=e.length):b.foundData=!1,c&&c(!1,e,b)}else b.foundData=!1,b.rowCount=0,c&&c(!1,a,b)},k.prototype._encode=function(a,b,c){var d=a;a="object"==typeof a?"json::fdb::"+this.jStringify(a):"raw::fdb::"+a,d?(b.foundData=!0,b.rowCount=d.length):b.foundData=!1,c&&c(!1,a,b)},k.prototype.save=function(a,b,c){switch(this.mode()){case"localforage":this.encode(b,function(b,d,e){o.setItem(a,d).then(function(a){c&&c(!1,a,e)},function(a){c&&c(a)})});break;default:c&&c("No data handler.")}},k.prototype.load=function(a,b){var c=this;switch(this.mode()){case"localforage":o.getItem(a).then(function(a){c.decode(a,b)},function(a){b&&b(a)});break;default:b&&b("No data handler or unrecognised data type.")}},k.prototype.drop=function(a,b){switch(this.mode()){case"localforage":o.removeItem(a).then(function(){b&&b(!1)},function(a){b&&b(a)});break;default:b&&b("No data handler or unrecognised data type.")}},e.prototype.drop=new l({"":function(){this.isDropped()||this.drop(!0)},"function":function(a){this.isDropped()||this.drop(!0,a)},"boolean":function(a){if(!this.isDropped()){if(a){if(!this._name)throw"ForerunnerDB.Persist: Cannot drop a collection's persistent storage when no name assigned to collection!";this._db&&(this._db.persist.drop(this._db._name+"::"+this._name),this._db.persist.drop(this._db._name+"::"+this._name+"::metaData"))}f.apply(this)}},"boolean, function":function(a,b){var c=this;this.isDropped()||(a&&(this._name?this._db?this._db.persist.drop(this._db._name+"::"+this._name,function(){c._db.persist.drop(c._db._name+"::"+c._name+"::metaData",b)}):b&&b("Cannot drop a collection's persistent storage when the collection is not attached to a database!"):b&&b("Cannot drop a collection's persistent storage when no name assigned to collection!")),f.apply(this,b))}}),e.prototype.save=function(a){var b,c=this;c._name?c._db?(b=function(){c._db.persist.save(c._db._name+"::"+c._name,c._data,function(b,d,e){b?a&&a(b):c._db.persist.save(c._db._name+"::"+c._name+"::metaData",c.metaData(),function(b,c,d){a&&a(b,c,e,d)})})},c.isProcessingQueue()?c.on("queuesComplete",function(){b()}):b()):a&&a("Cannot save a collection that is not attached to a database!"):a&&a("Cannot save a collection with no assigned name!")},e.prototype.load=function(a){var b=this;b._name?b._db?b._db.persist.load(b._db._name+"::"+b._name,function(c,d,e){c?a&&a(c):(d&&b.setData(d),b._db.persist.load(b._db._name+"::"+b._name+"::metaData",function(c,d,f){c||d&&b.metaData(d),a&&a(c,e,f)}))}):a&&a("Cannot load a collection that is not attached to a database!"):a&&a("Cannot load a collection with no assigned name!")},d.prototype.init=function(){i.apply(this,arguments),this.persist=new k(this)},d.prototype.load=function(a){var b,c,d=this._collection,e=d.keys(),f=e.length;b=function(b){b?a&&a(b):(f--,0===f&&a&&a(!1))};for(c in d)d.hasOwnProperty(c)&&d[c].load(b)},d.prototype.save=function(a){var b,c,d=this._collection,e=d.keys(),f=e.length;b=function(b){b?a&&a(b):(f--,0===f&&a&&a(!1))};for(c in d)d.hasOwnProperty(c)&&d[c].save(b)},m.finishModule("Persist"),b.exports=k},{"./Collection":4,"./CollectionGroup":5,"./PersistCompress":32,"./PersistCrypto":33,"./Shared":36,async:38,localforage:80}],32:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("pako"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a){},d.mixin(f.prototype,"Mixin.Common"),f.prototype.encode=function(a,b,c){var d,f,g,h={data:a,type:"fdbCompress",enabled:!1};d=a.length,g=e.deflate(a,{to:"string"}),f=g.length,d>f&&(h.data=g,h.enabled=!0),b.compression={enabled:h.enabled,compressedBytes:f,uncompressedBytes:d,effect:Math.round(100/d*f)+"%"},c(!1,this.jStringify(h),b)},f.prototype.decode=function(a,b,c){var d,f=!1;a?(a=this.jParse(a),a.enabled?(d=e.inflate(a.data,{to:"string"}),f=!0):(d=a.data,f=!1),b.compression={enabled:f},c&&c(!1,d,b)):c&&c(!1,d,b)},d.plugins.FdbCompress=f,b.exports=f},{"./Shared":36,pako:82}],33:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("crypto-js"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a){if(!a||!a.pass)throw'Cannot initialise persistent storage encryption without a passphrase provided in the passed options object as the "pass" field.';this._algo=a.algo||"AES",this._pass=a.pass},d.mixin(f.prototype,"Mixin.Common"),d.synthesize(f.prototype,"pass"),f.prototype.stringify=function(a){var b={ct:a.ciphertext.toString(e.enc.Base64)};return a.iv&&(b.iv=a.iv.toString()),a.salt&&(b.s=a.salt.toString()),this.jStringify(b)},f.prototype.parse=function(a){var b=this.jParse(a),c=e.lib.CipherParams.create({ciphertext:e.enc.Base64.parse(b.ct)});return b.iv&&(c.iv=e.enc.Hex.parse(b.iv)),b.s&&(c.salt=e.enc.Hex.parse(b.s)),c},f.prototype.encode=function(a,b,c){var d,f=this,g={type:"fdbCrypto"};d=e[this._algo].encrypt(a,this._pass,{format:{stringify:function(){return f.stringify.apply(f,arguments)},parse:function(){return f.parse.apply(f,arguments)}}}),g.data=d.toString(),g.enabled=!0,b.encryption={enabled:g.enabled},c&&c(!1,this.jStringify(g),b)},f.prototype.decode=function(a,b,c){var d,f=this;a?(a=this.jParse(a),d=e[this._algo].decrypt(a.data,this._pass,{format:{stringify:function(){return f.stringify.apply(f,arguments)},parse:function(){return f.parse.apply(f,arguments)}}}).toString(e.enc.Utf8),c&&c(!1,d,b)):c&&c(!1,a,b)},d.plugins.FdbCrypto=f,b.exports=f},{"./Shared":36,"crypto-js":47}],34:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a,b,c){if(!(a&&b&&c))throw"ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!";if(this._reactorIn=a,this._reactorOut=b,this._chainHandler=c,!a.chain||!b.chainReceive)throw"ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!";a.chain(this),this.chain(b)};d.addModule("ReactorIO",e),e.prototype.drop=function(){return this.isDropped()||(this._state="dropped",this._reactorIn&&this._reactorIn.unChain(this),this._reactorOut&&this.unChain(this._reactorOut),delete this._reactorIn,delete this._reactorOut,delete this._chainHandler,this.emit("drop",this)),!0},d.synthesize(e.prototype,"state"),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),d.mixin(e.prototype,"Mixin.Events"),d.finishModule("ReactorIO"),b.exports=e},{"./Shared":36}],35:[function(a,b,c){"use strict";var d=function(){};d.prototype.parse=function(a){return this._parse(JSON.parse(a))},d.prototype._parse=function(a){var b;if("object"==typeof a)for(b in a)if(a.hasOwnProperty(b))if("$"===b.substr(0,1))switch(b){case"$date":return new Date(a[b])}else a[b]=this._parse(a[b]);return a},d.prototype.stringify=function(a){return JSON.stringify(this._stringify(a))},d.prototype._stringify=function(a){var b;if("object"==typeof a){if(a instanceof Date)return{$date:a.toISOString()};for(b in a)a.hasOwnProperty(b)&&(a[b]=this._stringify(a[b]))}return a},b.exports=new d},{}],36:[function(a,b,c){"use strict";var d=a("./Overload"),e={version:"1.3.345",modules:{},plugins:{},_synth:{},addModule:function(a,b){this.modules[a]=b,this.emit("moduleLoad",[a,b])},finishModule:function(a){if(!this.modules[a])throw"ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): "+a;this.modules[a]._fdbFinished=!0,this.modules[a].prototype?this.modules[a].prototype.className=a:this.modules[a].className=a,this.emit("moduleFinished",[a,this.modules[a]])},moduleFinished:function(a,b){this.modules[a]&&this.modules[a]._fdbFinished?b&&b(a,this.modules[a]):this.on("moduleFinished",b)},moduleExists:function(a){return Boolean(this.modules[a])},mixin:new d({"object, string":function(a,b){var c;if("string"==typeof b&&(c=this.mixins[b],!c))throw"ForerunnerDB.Shared: Cannot find mixin named: "+b;return this.$main.call(this,a,c)},"object, *":function(a,b){return this.$main.call(this,a,b)},$main:function(a,b){if(b&&"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}}),synthesize:function(a,b,c){if(this._synth[b]=this._synth[b]||function(a){return void 0!==a?(this["_"+b]=a,this):this["_"+b]},c){var d=this;a[b]=function(){var a,e=this.$super;return this.$super=d._synth[b],a=c.apply(this,arguments),this.$super=e,a}}else a[b]=this._synth[b]},overload:d,mixins:{"Mixin.Common":a("./Mixin.Common"),"Mixin.Events":a("./Mixin.Events"),"Mixin.ChainReactor":a("./Mixin.ChainReactor"),"Mixin.CRUD":a("./Mixin.CRUD"),"Mixin.Constants":a("./Mixin.Constants"),"Mixin.Triggers":a("./Mixin.Triggers"),"Mixin.Sorting":a("./Mixin.Sorting"),"Mixin.Matching":a("./Mixin.Matching"),"Mixin.Updating":a("./Mixin.Updating")}};e.mixin(e,"Mixin.Events"),b.exports=e},{"./Mixin.CRUD":16,"./Mixin.ChainReactor":17,"./Mixin.Common":18,"./Mixin.Constants":19,"./Mixin.Events":20,"./Mixin.Matching":21,"./Mixin.Sorting":22,"./Mixin.Triggers":23,"./Mixin.Updating":24,"./Overload":28}],37:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k;d=a("./Shared");var l=function(a,b,c){this.init.apply(this,arguments)};l.prototype.init=function(a,b,c){var d=this;this._name=a,this._listeners={},this._querySettings={},this._debug={},this.query(b,!1),this.queryOptions(c,!1),this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)},this._privateData=new f(this.name()+"_internalPrivate")},d.addModule("View",l),d.mixin(l.prototype,"Mixin.Common"),d.mixin(l.prototype,"Mixin.ChainReactor"),d.mixin(l.prototype,"Mixin.Constants"),d.mixin(l.prototype,"Mixin.Triggers"),f=a("./Collection"),g=a("./CollectionGroup"),k=a("./ActiveBucket"),j=a("./ReactorIO"),h=f.prototype.init,e=d.modules.Db,i=e.prototype.init,d.synthesize(l.prototype,"state"),d.synthesize(l.prototype,"name"),d.synthesize(l.prototype,"cursor",function(a){return void 0===a?this._cursor||{}:void this.$super.apply(this,arguments)}),l.prototype.insert=function(){this._from.insert.apply(this._from,arguments)},l.prototype.update=function(){this._from.update.apply(this._from,arguments)},l.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)},l.prototype.remove=function(){this._from.remove.apply(this._from,arguments)},l.prototype.find=function(a,b){return this.publicData().find(a,b)},l.prototype.findById=function(a,b){return this.publicData().findById(a,b)},l.prototype.data=function(){return this._privateData},l.prototype.from=function(a){var b=this;if(void 0!==a){this._from&&(this._from.off("drop",this._collectionDroppedWrap),delete this._from),"string"==typeof a&&(a=this._db.collection(a)),"View"===a.className&&(a=a.privateData(),this.debug()&&console.log(this.logIdentifier()+' Using internal private data "'+a.instanceIdentifier()+'" for IO graph linking')),this._from=a,this._from.on("drop",this._collectionDroppedWrap),this._io=new j(a,this,function(a){var c,d,e,f,g,h,i;if(b&&!b.isDropped()&&b._querySettings.query){if("insert"===a.type){if(c=a.data,c instanceof Array)for(f=[],i=0;i<c.length;i++)b._privateData._match(c[i],b._querySettings.query,b._querySettings.options,"and",{})&&(f.push(c[i]),g=!0);else b._privateData._match(c,b._querySettings.query,b._querySettings.options,"and",{})&&(f=c,g=!0);return g&&this.chainSend("insert",f),!0}if("update"===a.type){if(d=b._privateData.diff(b._from.subset(b._querySettings.query,b._querySettings.options)),d.insert.length||d.remove.length){if(d.insert.length&&this.chainSend("insert",d.insert),d.update.length)for(h=b._privateData.primaryKey(),i=0;i<d.update.length;i++)e={},e[h]=d.update[i][h],this.chainSend("update",{query:e,update:d.update[i]});if(d.remove.length){h=b._privateData.primaryKey();var j=[],k={query:{$or:j}};for(i=0;i<d.remove.length;i++)j.push({_id:d.remove[i][h]});this.chainSend("remove",k)}return!0}return!1}}return!1});var c=a.find(this._querySettings.query,this._querySettings.options);return this._transformPrimaryKey(a.primaryKey()),this._transformSetData(c),this._privateData.primaryKey(a.primaryKey()),this._privateData.setData(c),this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this}return this._from},l.prototype._collectionDropped=function(a){a&&delete this._from},l.prototype.ensureIndex=function(){return this._privateData.ensureIndex.apply(this._privateData,arguments)},l.prototype._chainHandler=function(a){var b,c,d,e,f,g,h,i,j,k;switch(this.debug()&&console.log(this.logIdentifier()+" Received chain reactor data"),a.type){case"setData":this.debug()&&console.log(this.logIdentifier()+' Setting data in underlying (internal) view collection "'+this._privateData.name()+'"');var l=this._from.find(this._querySettings.query,this._querySettings.options);this._transformSetData(l),this._privateData.setData(l);break;case"insert":if(this.debug()&&console.log(this.logIdentifier()+' Inserting some data into underlying (internal) view collection "'+this._privateData.name()+'"'),a.data=this.decouple(a.data),a.data instanceof Array||(a.data=[a.data]),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data,c=b.length,d=0;c>d;d++)e=this._activeBucket.insert(b[d]),this._transformInsert(a.data,e),this._privateData._insertHandle(a.data,e);else e=this._privateData._data.length,this._transformInsert(a.data,e),this._privateData._insertHandle(a.data,e);break;case"update":if(this.debug()&&console.log(this.logIdentifier()+' Updating some data in underlying (internal) view collection "'+this._privateData.name()+'"'),g=this._privateData.primaryKey(),f=this._privateData.update(a.data.query,a.data.update,a.data.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(c=f.length,d=0;c>d;d++)i=f[d],this._activeBucket.remove(i),j=this._privateData._data.indexOf(i),e=this._activeBucket.insert(i),j!==e&&this._privateData._updateSpliceMove(this._privateData._data,j,e);if(this._transformEnabled&&this._transformIn)for(g=this._publicData.primaryKey(),k=0;k<f.length;k++)h={},i=f[k],h[g]=i[g],this._transformUpdate(h,i);break;case"remove":this.debug()&&console.log(this.logIdentifier()+' Removing some data from underlying (internal) view collection "'+this._privateData.name()+'"'),this._transformRemove(a.data.query,a.options),this._privateData.remove(a.data.query,a.options)}},l.prototype.on=function(){return this._privateData.on.apply(this._privateData,arguments)},l.prototype.off=function(){return this._privateData.off.apply(this._privateData,arguments)},l.prototype.emit=function(){return this._privateData.emit.apply(this._privateData,arguments)},l.prototype.distinct=function(a,b,c){return this._privateData.distinct.apply(this._privateData,arguments)},l.prototype.primaryKey=function(){return this._privateData.primaryKey()},l.prototype.drop=function(){return this.isDropped()?!0:(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeView(this)),(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._io&&this._io.drop(),this._privateData&&this._privateData.drop(),this._publicData&&this._publicData!==this._privateData&&this._publicData.drop(),this._db&&this._name&&delete this._db._view[this._name],this.emit("drop",this),delete this._chain,delete this._from,delete this._privateData,delete this._io,delete this._listeners,delete this._querySettings,delete this._db,!0)},d.synthesize(l.prototype,"db",function(a){return a&&(this.privateData().db(a),this.publicData().db(a),this.debug(a.debug()),this.privateData().debug(a.debug()),this.publicData().debug(a.debug())),this.$super.apply(this,arguments)}),l.prototype.queryData=function(a,b,c){return void 0!==a&&(this._querySettings.query=a),void 0!==b&&(this._querySettings.options=b),void 0!==a||void 0!==b?((void 0===c||c===!0)&&this.refresh(),this):this._querySettings},l.prototype.queryAdd=function(a,b,c){this._querySettings.query=this._querySettings.query||{};var d,e=this._querySettings.query;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||void 0!==e[d]&&b!==!1)&&(e[d]=a[d]);(void 0===c||c===!0)&&this.refresh()},l.prototype.queryRemove=function(a,b){var c,d=this._querySettings.query;if(d){if(void 0!==a)for(c in a)a.hasOwnProperty(c)&&delete d[c];(void 0===b||b===!0)&&this.refresh()}},l.prototype.query=function(a,b){return void 0!==a?(this._querySettings.query=a,(void 0===b||b===!0)&&this.refresh(),this):this._querySettings.query},l.prototype.orderBy=function(a){if(void 0!==a){var b=this.queryOptions()||{};return b.$orderBy=a,this.queryOptions(b),this}return(this.queryOptions()||{}).$orderBy},l.prototype.page=function(a){if(void 0!==a){var b=this.queryOptions()||{};return a!==b.$page&&(b.$page=a,this.queryOptions(b)),this}return(this.queryOptions()||{}).$page},l.prototype.pageFirst=function(){return this.page(0)},l.prototype.pageLast=function(){var a=this.cursor().pages,b=void 0!==a?a:0;return this.page(b-1)},l.prototype.pageScan=function(a){if(void 0!==a){var b=this.cursor().pages,c=this.queryOptions()||{},d=void 0!==c.$page?c.$page:0;return d+=a,0>d&&(d=0),d>=b&&(d=b-1),this.page(d)}},l.prototype.queryOptions=function(a,b){return void 0!==a?(this._querySettings.options=a,void 0===a.$decouple&&(a.$decouple=!0),void 0===b||b===!0?this.refresh():this.rebuildActiveBucket(a.$orderBy),this):this._querySettings.options},l.prototype.rebuildActiveBucket=function(a){if(a){
var b=this._privateData._data,c=b.length;this._activeBucket=new k(a),this._activeBucket.primaryKey(this._privateData.primaryKey());for(var d=0;c>d;d++)this._activeBucket.insert(b[d])}else delete this._activeBucket},l.prototype.refresh=function(){if(this._from){var a,b=this.publicData();this._privateData.remove(),b.remove(),a=this._from.find(this._querySettings.query,this._querySettings.options),this.cursor(a.$cursor),this._privateData.insert(a),this._privateData._data.$cursor=a.$cursor,b._data.$cursor=a.$cursor}return this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this},l.prototype.count=function(){return this.publicData()?this.publicData().count.apply(this.publicData(),arguments):0},l.prototype.subset=function(){return this.publicData().subset.apply(this._privateData,arguments)},l.prototype.transform=function(a){return void 0!==a?("object"==typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=a!==!1,this._transformPrimaryKey(this.privateData().primaryKey()),this._transformSetData(this.privateData().find()),this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}},l.prototype.filter=function(a,b,c){return this.publicData().filter(a,b,c)},l.prototype.privateData=function(){return this._privateData},l.prototype.publicData=function(){return this._transformEnabled?this._publicData:this._privateData},l.prototype._transformSetData=function(a){this._transformEnabled&&(this._publicData=new f("__FDB__view_publicData_"+this._name),this._publicData.db(this._privateData._db),this._publicData.transform({enabled:!0,dataIn:this._transformIn,dataOut:this._transformOut}),this._publicData.setData(a))},l.prototype._transformInsert=function(a,b){this._transformEnabled&&this._publicData&&this._publicData.insert(a,b)},l.prototype._transformUpdate=function(a,b,c){this._transformEnabled&&this._publicData&&this._publicData.update(a,b,c)},l.prototype._transformRemove=function(a,b){this._transformEnabled&&this._publicData&&this._publicData.remove(a,b)},l.prototype._transformPrimaryKey=function(a){this._transformEnabled&&this._publicData&&this._publicData.primaryKey(a)},f.prototype.init=function(){this._view=[],h.apply(this,arguments)},f.prototype.view=function(a,b,c){if(this._db&&this._db._view){if(this._db._view[a])throw this.logIdentifier()+" Cannot create a view using this collection because a view with this name already exists: "+a;var d=new l(a,b,c).db(this._db).from(this);return this._view=this._view||[],this._view.push(d),d}},f.prototype._addView=g.prototype._addView=function(a){return void 0!==a&&this._view.push(a),this},f.prototype._removeView=g.prototype._removeView=function(a){if(void 0!==a){var b=this._view.indexOf(a);b>-1&&this._view.splice(b,1)}return this},e.prototype.init=function(){this._view={},i.apply(this,arguments)},e.prototype.view=function(a){return a instanceof l?a:(this._view[a]||(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating view "+a),this._view[a]=this._view[a]||new l(a).db(this),this._view[a])},e.prototype.viewExists=function(a){return Boolean(this._view[a])},e.prototype.views=function(){var a,b,c=[];for(b in this._view)this._view.hasOwnProperty(b)&&(a=this._view[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("View"),b.exports=l},{"./ActiveBucket":2,"./Collection":4,"./CollectionGroup":5,"./ReactorIO":34,"./Shared":36}],38:[function(a,b,c){(function(a,c){!function(){function d(){}function e(a){return a}function f(a){return!!a}function g(a){return!a}function h(a){return function(){if(null===a)throw new Error("Callback was already called.");a.apply(this,arguments),a=null}}function i(a){return function(){null!==a&&(a.apply(this,arguments),a=null)}}function j(a){return N(a)||"number"==typeof a.length&&a.length>=0&&a.length%1===0}function k(a,b){for(var c=-1,d=a.length;++c<d;)b(a[c],c,a)}function l(a,b){for(var c=-1,d=a.length,e=Array(d);++c<d;)e[c]=b(a[c],c,a);return e}function m(a){return l(Array(a),function(a,b){return b})}function n(a,b,c){return k(a,function(a,d,e){c=b(c,a,d,e)}),c}function o(a,b){k(P(a),function(c){b(a[c],c)})}function p(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function q(a){var b,c,d=-1;return j(a)?(b=a.length,function(){return d++,b>d?d:null}):(c=P(a),b=c.length,function(){return d++,b>d?c[d]:null})}function r(a,b){return b=null==b?a.length-1:+b,function(){for(var c=Math.max(arguments.length-b,0),d=Array(c),e=0;c>e;e++)d[e]=arguments[e+b];switch(b){case 0:return a.call(this,d);case 1:return a.call(this,arguments[0],d)}}}function s(a){return function(b,c,d){return a(b,d)}}function t(a){return function(b,c,e){e=i(e||d),b=b||[];var f=q(b);if(0>=a)return e(null);var g=!1,j=0,k=!1;!function l(){if(g&&0>=j)return e(null);for(;a>j&&!k;){var d=f();if(null===d)return g=!0,void(0>=j&&e(null));j+=1,c(b[d],d,h(function(a){j-=1,a?(e(a),k=!0):l()}))}}()}}function u(a){return function(b,c,d){return a(K.eachOf,b,c,d)}}function v(a){return function(b,c,d,e){return a(t(c),b,d,e)}}function w(a){return function(b,c,d){return a(K.eachOfSeries,b,c,d)}}function x(a,b,c,e){e=i(e||d),b=b||[];var f=j(b)?[]:{};a(b,function(a,b,d){c(a,function(a,c){f[b]=c,d(a)})},function(a){e(a,f)})}function y(a,b,c,d){var e=[];a(b,function(a,b,d){c(a,function(c){c&&e.push({index:b,value:a}),d()})},function(){d(l(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})}function z(a,b,c,d){y(a,b,function(a,b){c(a,function(a){b(!a)})},d)}function A(a,b,c){return function(d,e,f,g){function h(){g&&g(c(!1,void 0))}function i(a,d,e){return g?void f(a,function(d){g&&b(d)&&(g(c(!0,a)),g=f=!1),e()}):e()}arguments.length>3?a(d,e,i,h):(g=f,f=e,a(d,i,h))}}function B(a,b){return b}function C(a,b,c){c=c||d;var e=j(b)?[]:{};a(b,function(a,b,c){a(r(function(a,d){d.length<=1&&(d=d[0]),e[b]=d,c(a)}))},function(a){c(a,e)})}function D(a,b,c,d){var e=[];a(b,function(a,b,d){c(a,function(a,b){e=e.concat(b||[]),d(a)})},function(a){d(a,e)})}function E(a,b,c){function e(a,b,c,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");return a.started=!0,N(b)||(b=[b]),0===b.length&&a.idle()?K.setImmediate(function(){a.drain()}):(k(b,function(b){var f={data:b,callback:e||d};c?a.tasks.unshift(f):a.tasks.push(f),a.tasks.length===a.concurrency&&a.saturated()}),void K.setImmediate(a.process))}function f(a,b){return function(){g-=1;var c=!1,d=arguments;k(b,function(a){k(i,function(b,d){b!==a||c||(i.splice(d,1),c=!0)}),a.callback.apply(a,d)}),a.tasks.length+g===0&&a.drain(),a.process()}}if(null==b)b=1;else if(0===b)throw new Error("Concurrency must not be zero");var g=0,i=[],j={tasks:[],concurrency:b,payload:c,saturated:d,empty:d,drain:d,started:!1,paused:!1,push:function(a,b){e(j,a,!1,b)},kill:function(){j.drain=d,j.tasks=[]},unshift:function(a,b){e(j,a,!0,b)},process:function(){if(!j.paused&&g<j.concurrency&&j.tasks.length)for(;g<j.concurrency&&j.tasks.length;){var b=j.payload?j.tasks.splice(0,j.payload):j.tasks.splice(0,j.tasks.length),c=l(b,function(a){return a.data});0===j.tasks.length&&j.empty(),g+=1,i.push(b[0]);var d=h(f(j,b));a(c,d)}},length:function(){return j.tasks.length},running:function(){return g},workersList:function(){return i},idle:function(){return j.tasks.length+g===0},pause:function(){j.paused=!0},resume:function(){if(j.paused!==!1){j.paused=!1;for(var a=Math.min(j.concurrency,j.tasks.length),b=1;a>=b;b++)K.setImmediate(j.process)}}};return j}function F(a){return r(function(b,c){b.apply(null,c.concat([r(function(b,c){"object"==typeof console&&(b?console.error&&console.error(b):console[a]&&k(c,function(b){console[a](b)}))})]))})}function G(a){return function(b,c,d){a(m(b),c,d)}}function H(a){return r(function(b,c){var d=r(function(c){var d=this,e=c.pop();return a(b,function(a,b,e){a.apply(d,c.concat([e]))},e)});return c.length?d.apply(this,c):d})}function I(a){return r(function(b){var c=b.pop();b.push(function(){var a=arguments;d?K.setImmediate(function(){c.apply(null,a)}):c.apply(null,a)});var d=!0;a.apply(this,b),d=!1})}var J,K={},L="object"==typeof self&&self.self===self&&self||"object"==typeof c&&c.global===c&&c||this;null!=L&&(J=L.async),K.noConflict=function(){return L.async=J,K};var M=Object.prototype.toString,N=Array.isArray||function(a){return"[object Array]"===M.call(a)},O=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},P=Object.keys||function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},Q="function"==typeof setImmediate&&setImmediate,R=Q?function(a){Q(a)}:function(a){setTimeout(a,0)};"object"==typeof a&&"function"==typeof a.nextTick?K.nextTick=a.nextTick:K.nextTick=R,K.setImmediate=Q?R:K.nextTick,K.forEach=K.each=function(a,b,c){return K.eachOf(a,s(b),c)},K.forEachSeries=K.eachSeries=function(a,b,c){return K.eachOfSeries(a,s(b),c)},K.forEachLimit=K.eachLimit=function(a,b,c,d){return t(b)(a,s(c),d)},K.forEachOf=K.eachOf=function(a,b,c){function e(a){j--,a?c(a):null===f&&0>=j&&c(null)}c=i(c||d),a=a||[];for(var f,g=q(a),j=0;null!=(f=g());)j+=1,b(a[f],f,h(e));0===j&&c(null)},K.forEachOfSeries=K.eachOfSeries=function(a,b,c){function e(){var d=!0;return null===g?c(null):(b(a[g],g,h(function(a){if(a)c(a);else{if(g=f(),null===g)return c(null);d?K.setImmediate(e):e()}})),void(d=!1))}c=i(c||d),a=a||[];var f=q(a),g=f();e()},K.forEachOfLimit=K.eachOfLimit=function(a,b,c,d){t(b)(a,c,d)},K.map=u(x),K.mapSeries=w(x),K.mapLimit=v(x),K.inject=K.foldl=K.reduce=function(a,b,c,d){K.eachOfSeries(a,function(a,d,e){c(b,a,function(a,c){b=c,e(a)})},function(a){d(a,b)})},K.foldr=K.reduceRight=function(a,b,c,d){var f=l(a,e).reverse();K.reduce(f,b,c,d)},K.transform=function(a,b,c,d){3===arguments.length&&(d=c,c=b,b=N(a)?[]:{}),K.eachOf(a,function(a,d,e){c(b,a,d,e)},function(a){d(a,b)})},K.select=K.filter=u(y),K.selectLimit=K.filterLimit=v(y),K.selectSeries=K.filterSeries=w(y),K.reject=u(z),K.rejectLimit=v(z),K.rejectSeries=w(z),K.any=K.some=A(K.eachOf,f,e),K.someLimit=A(K.eachOfLimit,f,e),K.all=K.every=A(K.eachOf,g,g),K.everyLimit=A(K.eachOfLimit,g,g),K.detect=A(K.eachOf,e,B),K.detectSeries=A(K.eachOfSeries,e,B),K.detectLimit=A(K.eachOfLimit,e,B),K.sortBy=function(a,b,c){function d(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0}K.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){return a?c(a):void c(null,l(b.sort(d),function(a){return a.value}))})},K.auto=function(a,b,c){function e(a){q.unshift(a)}function f(a){var b=p(q,a);b>=0&&q.splice(b,1)}function g(){j--,k(q.slice(0),function(a){a()})}c||(c=b,b=null),c=i(c||d);var h=P(a),j=h.length;if(!j)return c(null);b||(b=j);var l={},m=0,q=[];e(function(){j||c(null,l)}),k(h,function(d){function h(){return b>m&&n(s,function(a,b){return a&&l.hasOwnProperty(b)},!0)&&!l.hasOwnProperty(d)}function i(){h()&&(m++,f(i),k[k.length-1](q,l))}for(var j,k=N(a[d])?a[d]:[a[d]],q=r(function(a,b){if(m--,b.length<=1&&(b=b[0]),a){var e={};o(l,function(a,b){e[b]=a}),e[d]=b,c(a,e)}else l[d]=b,K.setImmediate(g)}),s=k.slice(0,k.length-1),t=s.length;t--;){if(!(j=a[s[t]]))throw new Error("Has inexistant dependency");if(N(j)&&p(j,d)>=0)throw new Error("Has cyclic dependencies")}h()?(m++,k[k.length-1](q,l)):e(i)})},K.retry=function(a,b,c){function d(a,b){if("number"==typeof b)a.times=parseInt(b,10)||f;else{if("object"!=typeof b)throw new Error("Unsupported argument type for 'times': "+typeof b);a.times=parseInt(b.times,10)||f,a.interval=parseInt(b.interval,10)||g}}function e(a,b){function c(a,c){return function(d){a(function(a,b){d(!a||c,{err:a,result:b})},b)}}function d(a){return function(b){setTimeout(function(){b(null)},a)}}for(;i.times;){var e=!(i.times-=1);h.push(c(i.task,e)),!e&&i.interval>0&&h.push(d(i.interval))}K.series(h,function(b,c){c=c[c.length-1],(a||i.callback)(c.err,c.result)})}var f=5,g=0,h=[],i={times:f,interval:g},j=arguments.length;if(1>j||j>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=j&&"function"==typeof a&&(c=b,b=a),"function"!=typeof a&&d(i,a),i.callback=c,i.task=b,i.callback?e():e},K.waterfall=function(a,b){function c(a){return r(function(d,e){if(d)b.apply(null,[d].concat(e));else{var f=a.next();f?e.push(c(f)):e.push(b),I(a).apply(null,e)}})}if(b=i(b||d),!N(a)){var e=new Error("First argument to waterfall must be an array of functions");return b(e)}return a.length?void c(K.iterator(a))():b()},K.parallel=function(a,b){C(K.eachOf,a,b)},K.parallelLimit=function(a,b,c){C(t(b),a,c)},K.series=function(a,b){C(K.eachOfSeries,a,b)},K.iterator=function(a){function b(c){function d(){return a.length&&a[c].apply(null,arguments),d.next()}return d.next=function(){return c<a.length-1?b(c+1):null},d}return b(0)},K.apply=r(function(a,b){return r(function(c){return a.apply(null,b.concat(c))})}),K.concat=u(D),K.concatSeries=w(D),K.whilst=function(a,b,c){if(c=c||d,a()){var e=r(function(d,f){d?c(d):a.apply(this,f)?b(e):c(null)});b(e)}else c(null)},K.doWhilst=function(a,b,c){var d=0;return K.whilst(function(){return++d<=1||b.apply(this,arguments)},a,c)},K.until=function(a,b,c){return K.whilst(function(){return!a.apply(this,arguments)},b,c)},K.doUntil=function(a,b,c){return K.doWhilst(a,function(){return!b.apply(this,arguments)},c)},K.during=function(a,b,c){c=c||d;var e=r(function(b,d){b?c(b):(d.push(f),a.apply(this,d))}),f=function(a,d){a?c(a):d?b(e):c(null)};a(f)},K.doDuring=function(a,b,c){var d=0;K.during(function(a){d++<1?a(null,!0):b.apply(this,arguments)},a,c)},K.queue=function(a,b){var c=E(function(b,c){a(b[0],c)},b,1);return c},K.priorityQueue=function(a,b){function c(a,b){return a.priority-b.priority}function e(a,b,c){for(var d=-1,e=a.length-1;e>d;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function f(a,b,f,g){if(null!=g&&"function"!=typeof g)throw new Error("task callback must be a function");return a.started=!0,N(b)||(b=[b]),0===b.length?K.setImmediate(function(){a.drain()}):void k(b,function(b){var h={data:b,priority:f,callback:"function"==typeof g?g:d};a.tasks.splice(e(a.tasks,h,c)+1,0,h),a.tasks.length===a.concurrency&&a.saturated(),K.setImmediate(a.process)})}var g=K.queue(a,b);return g.push=function(a,b,c){f(g,a,b,c)},delete g.unshift,g},K.cargo=function(a,b){return E(a,1,b)},K.log=F("log"),K.dir=F("dir"),K.memoize=function(a,b){var c={},d={};b=b||e;var f=r(function(e){var f=e.pop(),g=b.apply(null,e);g in c?K.setImmediate(function(){f.apply(null,c[g])}):g in d?d[g].push(f):(d[g]=[f],a.apply(null,e.concat([r(function(a){c[g]=a;var b=d[g];delete d[g];for(var e=0,f=b.length;f>e;e++)b[e].apply(null,a)})])))});return f.memo=c,f.unmemoized=a,f},K.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},K.times=G(K.map),K.timesSeries=G(K.mapSeries),K.timesLimit=function(a,b,c,d){return K.mapLimit(m(a),b,c,d)},K.seq=function(){var a=arguments;return r(function(b){var c=this,e=b[b.length-1];"function"==typeof e?b.pop():e=d,K.reduce(a,b,function(a,b,d){b.apply(c,a.concat([r(function(a,b){d(a,b)})]))},function(a,b){e.apply(c,[a].concat(b))})})},K.compose=function(){return K.seq.apply(null,Array.prototype.reverse.call(arguments))},K.applyEach=H(K.eachOf),K.applyEachSeries=H(K.eachOfSeries),K.forever=function(a,b){function c(a){return a?e(a):void f(c)}var e=h(b||d),f=I(a);c()},K.ensureAsync=I,K.constant=r(function(a){var b=[null].concat(a);return function(a){return a.apply(this,b)}}),K.wrapSync=K.asyncify=function(a){return r(function(b){var c,d=b.pop();try{c=a.apply(this,b)}catch(e){return d(e)}O(c)&&"function"==typeof c.then?c.then(function(a){d(null,a)})["catch"](function(a){d(a.message?a:new Error(a))}):d(null,c)})},"object"==typeof b&&b.exports?b.exports=K:"function"==typeof define&&define.amd?define([],function(){return K}):L.async=K}()}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:73}],39:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.BlockCipher,e=b.algo,f=[],g=[],h=[],i=[],j=[],k=[],l=[],m=[],n=[],o=[];!function(){for(var a=[],b=0;256>b;b++)128>b?a[b]=b<<1:a[b]=b<<1^283;for(var c=0,d=0,b=0;256>b;b++){var e=d^d<<1^d<<2^d<<3^d<<4;e=e>>>8^255&e^99,f[c]=e,g[e]=c;var p=a[c],q=a[p],r=a[q],s=257*a[e]^16843008*e;h[c]=s<<24|s>>>8,i[c]=s<<16|s>>>16,j[c]=s<<8|s>>>24,k[c]=s;var s=16843009*r^65537*q^257*p^16843008*c;l[e]=s<<24|s>>>8,m[e]=s<<16|s>>>16,n[e]=s<<8|s>>>24,o[e]=s,c?(c=p^a[a[a[r^p]]],d^=a[a[d]]):c=d=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],q=e.AES=d.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes/4,d=this._nRounds=c+6,e=4*(d+1),g=this._keySchedule=[],h=0;e>h;h++)if(c>h)g[h]=b[h];else{var i=g[h-1];h%c?c>6&&h%c==4&&(i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i]):(i=i<<8|i>>>24,i=f[i>>>24]<<24|f[i>>>16&255]<<16|f[i>>>8&255]<<8|f[255&i],i^=p[h/c|0]<<24),g[h]=g[h-c]^i}for(var j=this._invKeySchedule=[],k=0;e>k;k++){var h=e-k;if(k%4)var i=g[h];else var i=g[h-4];4>k||4>=h?j[k]=i:j[k]=l[f[i>>>24]]^m[f[i>>>16&255]]^n[f[i>>>8&255]]^o[f[255&i]]}},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,h,i,j,k,f)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c,this._doCryptBlock(a,b,this._invKeySchedule,l,m,n,o,g);var c=a[b+1];a[b+1]=a[b+3],a[b+3]=c},_doCryptBlock:function(a,b,c,d,e,f,g,h){for(var i=this._nRounds,j=a[b]^c[0],k=a[b+1]^c[1],l=a[b+2]^c[2],m=a[b+3]^c[3],n=4,o=1;i>o;o++){var p=d[j>>>24]^e[k>>>16&255]^f[l>>>8&255]^g[255&m]^c[n++],q=d[k>>>24]^e[l>>>16&255]^f[m>>>8&255]^g[255&j]^c[n++],r=d[l>>>24]^e[m>>>16&255]^f[j>>>8&255]^g[255&k]^c[n++],s=d[m>>>24]^e[j>>>16&255]^f[k>>>8&255]^g[255&l]^c[n++];j=p,k=q,l=r,m=s}var p=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[255&m])^c[n++],q=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[255&j])^c[n++],r=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[255&k])^c[n++],s=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[255&l])^c[n++];a[b]=p,a[b+1]=q,a[b+2]=r,a[b+3]=s},keySize:8});b.AES=d._createHelper(q)}(),a.AES})},{"./cipher-core":40,"./core":41,"./enc-base64":42,"./evpkdf":44,"./md5":49}],40:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){a.lib.Cipher||function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=d.BufferedBlockAlgorithm,h=c.enc,i=(h.Utf8,h.Base64),j=c.algo,k=j.EvpKDF,l=d.Cipher=g.extend({cfg:e.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c),this._xformMode=a,this._key=b,this.reset()},reset:function(){g.reset.call(this),this._doReset()},process:function(a){return this._append(a),this._process()},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function a(a){return"string"==typeof a?x:u}return function(b){return{encrypt:function(c,d,e){return a(d).encrypt(b,c,d,e)},decrypt:function(c,d,e){return a(d).decrypt(b,c,d,e)}}}}()}),m=(d.StreamCipher=l.extend({_doFinalize:function(){var a=this._process(!0);return a},blockSize:1}),c.mode={}),n=d.BlockCipherMode=e.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a,this._iv=b}}),o=m.CBC=function(){function a(a,c,d){var e=this._iv;if(e){var f=e;this._iv=b}else var f=this._prevBlock;for(var g=0;d>g;g++)a[c+g]^=f[g]}var c=n.extend();return c.Encryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize;a.call(this,b,c,e),d.encryptBlock(b,c),this._prevBlock=b.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(b,c){var d=this._cipher,e=d.blockSize,f=b.slice(c,c+e);d.decryptBlock(b,c),a.call(this,b,c,e),this._prevBlock=f}}),c}(),p=c.pad={},q=p.Pkcs7={pad:function(a,b){for(var c=4*b,d=c-a.sigBytes%c,e=d<<24|d<<16|d<<8|d,g=[],h=0;d>h;h+=4)g.push(e);var i=f.create(g,d);a.concat(i)},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},r=(d.BlockCipher=l.extend({cfg:l.cfg.extend({mode:o,padding:q}),reset:function(){l.reset.call(this);var a=this.cfg,b=a.iv,c=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=c.createEncryptor;else{var d=c.createDecryptor;this._minBufferSize=1}this._mode=d.call(c,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else{var b=this._process(!0);a.unpad(b)}return b},blockSize:4}),d.CipherParams=e.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}})),s=c.format={},t=s.OpenSSL={stringify:function(a){var b=a.ciphertext,c=a.salt;if(c)var d=f.create([1398893684,1701076831]).concat(c).concat(b);else var d=b;return d.toString(i)},parse:function(a){var b=i.parse(a),c=b.words;if(1398893684==c[0]&&1701076831==c[1]){var d=f.create(c.slice(2,4));c.splice(0,4),b.sigBytes-=16}return r.create({ciphertext:b,salt:d})}},u=d.SerializableCipher=e.extend({cfg:e.extend({format:t}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=a.createEncryptor(c,d),f=e.finalize(b),g=e.cfg;return r.create({ciphertext:f,key:c,iv:g.iv,algorithm:a,mode:g.mode,padding:g.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=a.createDecryptor(c,d).finalize(b.ciphertext);return e},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),v=c.kdf={},w=v.OpenSSL={execute:function(a,b,c,d){d||(d=f.random(8));var e=k.create({keySize:b+c}).compute(a,d),g=f.create(e.words.slice(b),4*c);return e.sigBytes=4*b,r.create({key:e,iv:g,salt:d})}},x=d.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:w}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);var e=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=e.iv;var f=u.encrypt.call(this,a,b,e.key,d);return f.mixIn(e),f},decrypt:function(a,b,c,d){d=this.cfg.extend(d),b=this._parse(b,d.format);var e=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=e.iv;var f=u.decrypt.call(this,a,b,e.key,d);return f}})}()})},{"./core":41}],41:[function(a,b,c){!function(a,d){"object"==typeof c?b.exports=c=d():"function"==typeof define&&define.amd?define([],d):a.CryptoJS=d()}(this,function(){var a=a||function(a,b){var c={},d=c.lib={},e=d.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;return b&&c.mixIn(b),c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)}),c.init.prototype=c,c.$super=this,c},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=d.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;e>f;f++){var g=c[f>>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;e>f;f+=4)b[d+f>>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=e.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c,d=[],e=function(b){var b=b,c=987654321,d=4294967295;return function(){c=36969*(65535&c)+(c>>16)&d,b=18e3*(65535&b)+(b>>16)&d;var e=(c<<16)+b&d;return e/=4294967296,e+=.5,e*(a.random()>.5?1:-1)}},g=0;b>g;g+=4){var h=e(4294967296*(c||a.random()));c=987654071*h(),d.push(4294967296*h()|0)}return new f.init(d,b)}}),g=c.enc={},h=g.Hex={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new f.init(c,b/2)}},i=g.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e++){var f=b[e>>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new f.init(c,b)}},j=g.Utf8={stringify:function(a){try{return decodeURIComponent(escape(i.stringify(a)))}catch(b){throw new Error("Malformed UTF-8 data")}},parse:function(a){return i.parse(unescape(encodeURIComponent(a)))}},k=d.BufferedBlockAlgorithm=e.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,g=this.blockSize,h=4*g,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*g,k=a.min(4*j,e);if(j){for(var l=0;j>l;l+=g)this._doProcessBlock(d,l);var m=d.splice(0,j);c.sigBytes-=k}return new f.init(m,k)},clone:function(){var a=e.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0}),l=(d.Hasher=k.extend({cfg:e.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){k.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){a&&this._append(a);var b=this._doFinalize();return b},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new l.HMAC.init(a,c).finalize(b)}}}),c.algo={});return c}(Math);return a})},{}],42:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=b.enc;e.Base64={stringify:function(a){var b=a.words,c=a.sigBytes,d=this._map;a.clamp();for(var e=[],f=0;c>f;f+=3)for(var g=b[f>>>2]>>>24-f%4*8&255,h=b[f+1>>>2]>>>24-(f+1)%4*8&255,i=b[f+2>>>2]>>>24-(f+2)%4*8&255,j=g<<16|h<<8|i,k=0;4>k&&c>f+.75*k;k++)e.push(d.charAt(j>>>6*(3-k)&63));var l=d.charAt(64);if(l)for(;e.length%4;)e.push(l);return e.join("")},parse:function(a){var b=a.length,c=this._map,e=c.charAt(64);if(e){var f=a.indexOf(e);-1!=f&&(b=f)}for(var g=[],h=0,i=0;b>i;i++)if(i%4){var j=c.indexOf(a.charAt(i-1))<<i%4*2,k=c.indexOf(a.charAt(i))>>>6-i%4*2;g[h>>>2]|=(j|k)<<24-h%4*8,h++}return d.create(g,h)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),a.enc.Base64})},{"./core":41}],43:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a){return a<<8&4278255360|a>>>8&16711935}var c=a,d=c.lib,e=d.WordArray,f=c.enc;f.Utf16=f.Utf16BE={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;c>e;e+=2){var f=b[e>>>2]>>>16-e%4*8&65535;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>1]|=a.charCodeAt(d)<<16-d%2*16;return e.create(c,2*b)}};f.Utf16LE={stringify:function(a){for(var c=a.words,d=a.sigBytes,e=[],f=0;d>f;f+=2){var g=b(c[f>>>2]>>>16-f%4*8&65535);e.push(String.fromCharCode(g))}return e.join("")},parse:function(a){for(var c=a.length,d=[],f=0;c>f;f++)d[f>>>1]|=b(a.charCodeAt(f)<<16-f%2*16);return e.create(d,2*c)}}}(),a.enc.Utf16})},{"./core":41}],44:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.MD5,h=f.EvpKDF=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),f=e.create(),g=f.words,h=c.keySize,i=c.iterations;g.length<h;){j&&d.update(j);var j=d.update(a).finalize(b);d.reset();for(var k=1;i>k;k++)j=d.finalize(j),d.reset();f.concat(j)}return f.sigBytes=4*h,f}});b.EvpKDF=function(a,b,c){return h.create(c).compute(a,b)}}(),a.EvpKDF})},{"./core":41,"./hmac":46,"./sha1":65}],45:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.CipherParams,f=c.enc,g=f.Hex,h=c.format;h.Hex={stringify:function(a){return a.ciphertext.toString(g)},parse:function(a){var b=g.parse(a);return e.create({ciphertext:b})}}}(),a.format.Hex})},{"./cipher-core":40,"./core":41}],46:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){!function(){var b=a,c=b.lib,d=c.Base,e=b.enc,f=e.Utf8,g=b.algo;g.HMAC=d.extend({init:function(a,b){a=this._hasher=new a.init,"string"==typeof b&&(b=f.parse(b));var c=a.blockSize,d=4*c;b.sigBytes>d&&(b=a.finalize(b)),b.clamp();for(var e=this._oKey=b.clone(),g=this._iKey=b.clone(),h=e.words,i=g.words,j=0;c>j;j++)h[j]^=1549556828,i[j]^=909522486;e.sigBytes=g.sigBytes=d,this.reset()},reset:function(){var a=this._hasher;a.reset(),a.update(this._iKey)},update:function(a){return this._hasher.update(a),this},finalize:function(a){var b=this._hasher,c=b.finalize(a);b.reset();var d=b.finalize(this._oKey.clone().concat(c));return d}})}()})},{"./core":41}],47:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./lib-typedarrays"),a("./enc-utf16"),a("./enc-base64"),a("./md5"),a("./sha1"),a("./sha256"),a("./sha224"),a("./sha512"),a("./sha384"),a("./sha3"),a("./ripemd160"),a("./hmac"),a("./pbkdf2"),a("./evpkdf"),a("./cipher-core"),a("./mode-cfb"),a("./mode-ctr"),a("./mode-ctr-gladman"),a("./mode-ofb"),a("./mode-ecb"),a("./pad-ansix923"),a("./pad-iso10126"),a("./pad-iso97971"),a("./pad-zeropadding"),a("./pad-nopadding"),a("./format-hex"),a("./aes"),a("./tripledes"),a("./rc4"),a("./rabbit"),a("./rabbit-legacy")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],e):d.CryptoJS=e(d.CryptoJS)}(this,function(a){return a})},{"./aes":39,"./cipher-core":40,"./core":41,"./enc-base64":42,"./enc-utf16":43,"./evpkdf":44,"./format-hex":45,"./hmac":46,"./lib-typedarrays":48,"./md5":49,"./mode-cfb":50,"./mode-ctr":52,"./mode-ctr-gladman":51,"./mode-ecb":53,"./mode-ofb":54,"./pad-ansix923":55,"./pad-iso10126":56,"./pad-iso97971":57,"./pad-nopadding":58,"./pad-zeropadding":59,"./pbkdf2":60,"./rabbit":62,"./rabbit-legacy":61,"./rc4":63,"./ripemd160":64,"./sha1":65,"./sha224":66,"./sha256":67,"./sha3":68,"./sha384":69,"./sha512":70,"./tripledes":71,"./x64-core":72}],48:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS);
}(this,function(a){return function(){if("function"==typeof ArrayBuffer){var b=a,c=b.lib,d=c.WordArray,e=d.init,f=d.init=function(a){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var b=a.byteLength,c=[],d=0;b>d;d++)c[d>>>2]|=a[d]<<24-d%4*8;e.call(this,c,b)}else e.apply(this,arguments)};f.prototype=d}}(),a.lib.WordArray})},{"./core":41}],49:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c,d,e,f,g){var h=a+(b&c|~b&d)+e+g;return(h<<f|h>>>32-f)+b}function d(a,b,c,d,e,f,g){var h=a+(b&d|c&~d)+e+g;return(h<<f|h>>>32-f)+b}function e(a,b,c,d,e,f,g){var h=a+(b^c^d)+e+g;return(h<<f|h>>>32-f)+b}function f(a,b,c,d,e,f,g){var h=a+(c^(b|~d))+e+g;return(h<<f|h>>>32-f)+b}var g=a,h=g.lib,i=h.WordArray,j=h.Hasher,k=g.algo,l=[];!function(){for(var a=0;64>a;a++)l[a]=4294967296*b.abs(b.sin(a+1))|0}();var m=k.MD5=j.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(a,b){for(var g=0;16>g;g++){var h=b+g,i=a[h];a[h]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var j=this._hash.words,k=a[b+0],m=a[b+1],n=a[b+2],o=a[b+3],p=a[b+4],q=a[b+5],r=a[b+6],s=a[b+7],t=a[b+8],u=a[b+9],v=a[b+10],w=a[b+11],x=a[b+12],y=a[b+13],z=a[b+14],A=a[b+15],B=j[0],C=j[1],D=j[2],E=j[3];B=c(B,C,D,E,k,7,l[0]),E=c(E,B,C,D,m,12,l[1]),D=c(D,E,B,C,n,17,l[2]),C=c(C,D,E,B,o,22,l[3]),B=c(B,C,D,E,p,7,l[4]),E=c(E,B,C,D,q,12,l[5]),D=c(D,E,B,C,r,17,l[6]),C=c(C,D,E,B,s,22,l[7]),B=c(B,C,D,E,t,7,l[8]),E=c(E,B,C,D,u,12,l[9]),D=c(D,E,B,C,v,17,l[10]),C=c(C,D,E,B,w,22,l[11]),B=c(B,C,D,E,x,7,l[12]),E=c(E,B,C,D,y,12,l[13]),D=c(D,E,B,C,z,17,l[14]),C=c(C,D,E,B,A,22,l[15]),B=d(B,C,D,E,m,5,l[16]),E=d(E,B,C,D,r,9,l[17]),D=d(D,E,B,C,w,14,l[18]),C=d(C,D,E,B,k,20,l[19]),B=d(B,C,D,E,q,5,l[20]),E=d(E,B,C,D,v,9,l[21]),D=d(D,E,B,C,A,14,l[22]),C=d(C,D,E,B,p,20,l[23]),B=d(B,C,D,E,u,5,l[24]),E=d(E,B,C,D,z,9,l[25]),D=d(D,E,B,C,o,14,l[26]),C=d(C,D,E,B,t,20,l[27]),B=d(B,C,D,E,y,5,l[28]),E=d(E,B,C,D,n,9,l[29]),D=d(D,E,B,C,s,14,l[30]),C=d(C,D,E,B,x,20,l[31]),B=e(B,C,D,E,q,4,l[32]),E=e(E,B,C,D,t,11,l[33]),D=e(D,E,B,C,w,16,l[34]),C=e(C,D,E,B,z,23,l[35]),B=e(B,C,D,E,m,4,l[36]),E=e(E,B,C,D,p,11,l[37]),D=e(D,E,B,C,s,16,l[38]),C=e(C,D,E,B,v,23,l[39]),B=e(B,C,D,E,y,4,l[40]),E=e(E,B,C,D,k,11,l[41]),D=e(D,E,B,C,o,16,l[42]),C=e(C,D,E,B,r,23,l[43]),B=e(B,C,D,E,u,4,l[44]),E=e(E,B,C,D,x,11,l[45]),D=e(D,E,B,C,A,16,l[46]),C=e(C,D,E,B,n,23,l[47]),B=f(B,C,D,E,k,6,l[48]),E=f(E,B,C,D,s,10,l[49]),D=f(D,E,B,C,z,15,l[50]),C=f(C,D,E,B,q,21,l[51]),B=f(B,C,D,E,x,6,l[52]),E=f(E,B,C,D,o,10,l[53]),D=f(D,E,B,C,v,15,l[54]),C=f(C,D,E,B,m,21,l[55]),B=f(B,C,D,E,t,6,l[56]),E=f(E,B,C,D,A,10,l[57]),D=f(D,E,B,C,r,15,l[58]),C=f(C,D,E,B,y,21,l[59]),B=f(B,C,D,E,p,6,l[60]),E=f(E,B,C,D,w,10,l[61]),D=f(D,E,B,C,n,15,l[62]),C=f(C,D,E,B,u,21,l[63]),j[0]=j[0]+B|0,j[1]=j[1]+C|0,j[2]=j[2]+D|0,j[3]=j[3]+E|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;c[e>>>5]|=128<<24-e%32;var f=b.floor(d/4294967296),g=d;c[(e+64>>>9<<4)+15]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c[(e+64>>>9<<4)+14]=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),a.sigBytes=4*(c.length+1),this._process();for(var h=this._hash,i=h.words,j=0;4>j;j++){var k=i[j];i[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}return h},clone:function(){var a=j.clone.call(this);return a._hash=this._hash.clone(),a}});g.MD5=j._createHelper(m),g.HmacMD5=j._createHmacHelper(m)}(Math),a.MD5})},{"./core":41}],50:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CFB=function(){function b(a,b,c,d){var e=this._iv;if(e){var f=e.slice(0);this._iv=void 0}else var f=this._prevBlock;d.encryptBlock(f,0);for(var g=0;c>g;g++)a[b+g]^=f[g]}var c=a.lib.BlockCipherMode.extend();return c.Encryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize;b.call(this,a,c,e,d),this._prevBlock=a.slice(c,c+e)}}),c.Decryptor=c.extend({processBlock:function(a,c){var d=this._cipher,e=d.blockSize,f=a.slice(c,c+e);b.call(this,a,c,e,d),this._prevBlock=f}}),c}(),a.mode.CFB})},{"./cipher-core":40,"./core":41}],51:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTRGladman=function(){function b(a){if(255===(a>>24&255)){var b=a>>16&255,c=a>>8&255,d=255&a;255===b?(b=0,255===c?(c=0,255===d?d=0:++d):++c):++b,a=0,a+=b<<16,a+=c<<8,a+=d}else a+=1<<24;return a}function c(a){return 0===(a[0]=b(a[0]))&&(a[1]=b(a[1])),a}var d=a.lib.BlockCipherMode.extend(),e=d.Encryptor=d.extend({processBlock:function(a,b){var d=this._cipher,e=d.blockSize,f=this._iv,g=this._counter;f&&(g=this._counter=f.slice(0),this._iv=void 0),c(g);var h=g.slice(0);d.encryptBlock(h,0);for(var i=0;e>i;i++)a[b+i]^=h[i]}});return d.Decryptor=e,d}(),a.mode.CTRGladman})},{"./cipher-core":40,"./core":41}],52:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.CTR=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._counter;e&&(f=this._counter=e.slice(0),this._iv=void 0);var g=f.slice(0);c.encryptBlock(g,0),f[d-1]=f[d-1]+1|0;for(var h=0;d>h;h++)a[b+h]^=g[h]}});return b.Decryptor=c,b}(),a.mode.CTR})},{"./cipher-core":40,"./core":41}],53:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.ECB=function(){var b=a.lib.BlockCipherMode.extend();return b.Encryptor=b.extend({processBlock:function(a,b){this._cipher.encryptBlock(a,b)}}),b.Decryptor=b.extend({processBlock:function(a,b){this._cipher.decryptBlock(a,b)}}),b}(),a.mode.ECB})},{"./cipher-core":40,"./core":41}],54:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.mode.OFB=function(){var b=a.lib.BlockCipherMode.extend(),c=b.Encryptor=b.extend({processBlock:function(a,b){var c=this._cipher,d=c.blockSize,e=this._iv,f=this._keystream;e&&(f=this._keystream=e.slice(0),this._iv=void 0),c.encryptBlock(f,0);for(var g=0;d>g;g++)a[b+g]^=f[g]}});return b.Decryptor=c,b}(),a.mode.OFB})},{"./cipher-core":40,"./core":41}],55:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.AnsiX923={pad:function(a,b){var c=a.sigBytes,d=4*b,e=d-c%d,f=c+e-1;a.clamp(),a.words[f>>>2]|=e<<24-f%4*8,a.sigBytes+=e},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Ansix923})},{"./cipher-core":40,"./core":41}],56:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso10126={pad:function(b,c){var d=4*c,e=d-b.sigBytes%d;b.concat(a.lib.WordArray.random(e-1)).concat(a.lib.WordArray.create([e<<24],1))},unpad:function(a){var b=255&a.words[a.sigBytes-1>>>2];a.sigBytes-=b}},a.pad.Iso10126})},{"./cipher-core":40,"./core":41}],57:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.Iso97971={pad:function(b,c){b.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(b,c)},unpad:function(b){a.pad.ZeroPadding.unpad(b),b.sigBytes--}},a.pad.Iso97971})},{"./cipher-core":40,"./core":41}],58:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding})},{"./cipher-core":40,"./core":41}],59:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return a.pad.ZeroPadding={pad:function(a,b){var c=4*b;a.clamp(),a.sigBytes+=c-(a.sigBytes%c||c)},unpad:function(a){for(var b=a.words,c=a.sigBytes-1;!(b[c>>>2]>>>24-c%4*8&255);)c--;a.sigBytes=c+1}},a.pad.ZeroPadding})},{"./cipher-core":40,"./core":41}],60:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha1"),a("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.Base,e=c.WordArray,f=b.algo,g=f.SHA1,h=f.HMAC,i=f.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:g,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=h.create(c.hasher,a),f=e.create(),g=e.create([1]),i=f.words,j=g.words,k=c.keySize,l=c.iterations;i.length<k;){var m=d.update(b).finalize(g);d.reset();for(var n=m.words,o=n.length,p=m,q=1;l>q;q++){p=d.finalize(p),d.reset();for(var r=p.words,s=0;o>s;s++)n[s]^=r[s]}f.concat(m),j[0]++}return f.sigBytes=4*k,f}});b.PBKDF2=function(a,b,c){return i.create(c).compute(a,b)}}(),a.PBKDF2})},{"./core":41,"./hmac":46,"./sha1":65}],61:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;8>c;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;8>c;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.RabbitLegacy=e.extend({_doReset:function(){var a=this._key.words,c=this.cfg.iv,d=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],e=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var f=0;4>f;f++)b.call(this);for(var f=0;8>f;f++)e[f]^=d[f+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;e[0]^=j,e[1]^=l,e[2]^=k,e[3]^=m,e[4]^=j,e[5]^=l,e[6]^=k,e[7]^=m;for(var f=0;4>f;f++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;4>e;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.RabbitLegacy=e._createHelper(j)}(),a.RabbitLegacy})},{"./cipher-core":40,"./core":41,"./enc-base64":42,"./evpkdf":44,"./md5":49}],62:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._X,b=this._C,c=0;8>c;c++)h[c]=b[c];b[0]=b[0]+1295307597+this._b|0,b[1]=b[1]+3545052371+(b[0]>>>0<h[0]>>>0?1:0)|0,b[2]=b[2]+886263092+(b[1]>>>0<h[1]>>>0?1:0)|0,b[3]=b[3]+1295307597+(b[2]>>>0<h[2]>>>0?1:0)|0,b[4]=b[4]+3545052371+(b[3]>>>0<h[3]>>>0?1:0)|0,b[5]=b[5]+886263092+(b[4]>>>0<h[4]>>>0?1:0)|0,b[6]=b[6]+1295307597+(b[5]>>>0<h[5]>>>0?1:0)|0,b[7]=b[7]+3545052371+(b[6]>>>0<h[6]>>>0?1:0)|0,this._b=b[7]>>>0<h[7]>>>0?1:0;for(var c=0;8>c;c++){var d=a[c]+b[c],e=65535&d,f=d>>>16,g=((e*e>>>17)+e*f>>>15)+f*f,j=((4294901760&d)*d|0)+((65535&d)*d|0);i[c]=g^j}a[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,a[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,a[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,a[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,a[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,a[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,a[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,a[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=[],h=[],i=[],j=f.Rabbit=e.extend({_doReset:function(){for(var a=this._key.words,c=this.cfg.iv,d=0;4>d;d++)a[d]=16711935&(a[d]<<8|a[d]>>>24)|4278255360&(a[d]<<24|a[d]>>>8);var e=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],f=this._C=[a[2]<<16|a[2]>>>16,4294901760&a[0]|65535&a[1],a[3]<<16|a[3]>>>16,4294901760&a[1]|65535&a[2],a[0]<<16|a[0]>>>16,4294901760&a[2]|65535&a[3],a[1]<<16|a[1]>>>16,4294901760&a[3]|65535&a[0]];this._b=0;for(var d=0;4>d;d++)b.call(this);for(var d=0;8>d;d++)f[d]^=e[d+4&7];if(c){var g=c.words,h=g[0],i=g[1],j=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),k=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),l=j>>>16|4294901760&k,m=k<<16|65535&j;f[0]^=j,f[1]^=l,f[2]^=k,f[3]^=m,f[4]^=j,f[5]^=l,f[6]^=k,f[7]^=m;for(var d=0;4>d;d++)b.call(this)}},_doProcessBlock:function(a,c){var d=this._X;b.call(this),g[0]=d[0]^d[5]>>>16^d[3]<<16,g[1]=d[2]^d[7]>>>16^d[5]<<16,g[2]=d[4]^d[1]>>>16^d[7]<<16,g[3]=d[6]^d[3]>>>16^d[1]<<16;for(var e=0;4>e;e++)g[e]=16711935&(g[e]<<8|g[e]>>>24)|4278255360&(g[e]<<24|g[e]>>>8),a[c+e]^=g[e]},blockSize:4,ivSize:2});c.Rabbit=e._createHelper(j)}(),a.Rabbit})},{"./cipher-core":40,"./core":41,"./enc-base64":42,"./evpkdf":44,"./md5":49}],63:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){for(var a=this._S,b=this._i,c=this._j,d=0,e=0;4>e;e++){b=(b+1)%256,c=(c+a[b])%256;var f=a[b];a[b]=a[c],a[c]=f,d|=a[(a[b]+a[c])%256]<<24-8*e}return this._i=b,this._j=c,d}var c=a,d=c.lib,e=d.StreamCipher,f=c.algo,g=f.RC4=e.extend({_doReset:function(){for(var a=this._key,b=a.words,c=a.sigBytes,d=this._S=[],e=0;256>e;e++)d[e]=e;for(var e=0,f=0;256>e;e++){var g=e%c,h=b[g>>>2]>>>24-g%4*8&255;f=(f+d[e]+h)%256;var i=d[e];d[e]=d[f],d[f]=i}this._i=this._j=0},_doProcessBlock:function(a,c){a[c]^=b.call(this)},keySize:8,ivSize:0});c.RC4=e._createHelper(g);var h=f.RC4Drop=g.extend({cfg:g.cfg.extend({drop:192}),_doReset:function(){g._doReset.call(this);for(var a=this.cfg.drop;a>0;a--)b.call(this)}});c.RC4Drop=e._createHelper(h)}(),a.RC4})},{"./cipher-core":40,"./core":41,"./enc-base64":42,"./evpkdf":44,"./md5":49}],64:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){function c(a,b,c){return a^b^c}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return(a|~b)^c}function f(a,b,c){return a&c|b&~c}function g(a,b,c){return a^(b|~c)}function h(a,b){return a<<b|a>>>32-b}var i=a,j=i.lib,k=j.WordArray,l=j.Hasher,m=i.algo,n=k.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=k.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),p=k.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),q=k.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),r=k.create([0,1518500249,1859775393,2400959708,2840853838]),s=k.create([1352829926,1548603684,1836072691,2053994217,0]),t=m.RIPEMD160=l.extend({_doReset:function(){this._hash=k.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var i=0;16>i;i++){var j=b+i,k=a[j];a[j]=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8)}var l,m,t,u,v,w,x,y,z,A,B=this._hash.words,C=r.words,D=s.words,E=n.words,F=o.words,G=p.words,H=q.words;w=l=B[0],x=m=B[1],y=t=B[2],z=u=B[3],A=v=B[4];for(var I,i=0;80>i;i+=1)I=l+a[b+E[i]]|0,I+=16>i?c(m,t,u)+C[0]:32>i?d(m,t,u)+C[1]:48>i?e(m,t,u)+C[2]:64>i?f(m,t,u)+C[3]:g(m,t,u)+C[4],I=0|I,I=h(I,G[i]),I=I+v|0,l=v,v=u,u=h(t,10),t=m,m=I,I=w+a[b+F[i]]|0,I+=16>i?g(x,y,z)+D[0]:32>i?f(x,y,z)+D[1]:48>i?e(x,y,z)+D[2]:64>i?d(x,y,z)+D[3]:c(x,y,z)+D[4],I=0|I,I=h(I,H[i]),I=I+A|0,w=A,A=z,z=h(y,10),y=x,x=I;I=B[1]+t+z|0,B[1]=B[2]+u+A|0,B[2]=B[3]+v+w|0,B[3]=B[4]+l+x|0,B[4]=B[0]+m+y|0,B[0]=I},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),a.sigBytes=4*(b.length+1),this._process();for(var e=this._hash,f=e.words,g=0;5>g;g++){var h=f[g];f[g]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return e},clone:function(){var a=l.clone.call(this);return a._hash=this._hash.clone(),a}});i.RIPEMD160=l._createHelper(t),i.HmacRIPEMD160=l._createHmacHelper(t)}(Math),a.RIPEMD160})},{"./core":41}],65:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=c.Hasher,f=b.algo,g=[],h=f.SHA1=e.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=0;80>j;j++){if(16>j)g[j]=0|a[b+j];else{var k=g[j-3]^g[j-8]^g[j-14]^g[j-16];g[j]=k<<1|k>>>31}var l=(d<<5|d>>>27)+i+g[j];l+=20>j?(e&f|~e&h)+1518500249:40>j?(e^f^h)+1859775393:60>j?(e&f|e&h|f&h)-1894007588:(e^f^h)-899497514,i=h,h=f,f=e<<30|e>>>2,e=d,d=l}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA1=e._createHelper(h),b.HmacSHA1=e._createHmacHelper(h)}(),a.SHA1})},{"./core":41}],66:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.lib,d=c.WordArray,e=b.algo,f=e.SHA256,g=e.SHA224=f.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=f._doFinalize.call(this);return a.sigBytes-=4,a}});b.SHA224=f._createHelper(g),b.HmacSHA224=f._createHmacHelper(g)}(),a.SHA224})},{"./core":41,"./sha256":67}],67:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.algo,h=[],i=[];!function(){function a(a){for(var c=b.sqrt(a),d=2;c>=d;d++)if(!(a%d))return!1;return!0}function c(a){return 4294967296*(a-(0|a))|0}for(var d=2,e=0;64>e;)a(d)&&(8>e&&(h[e]=c(b.pow(d,.5))),i[e]=c(b.pow(d,1/3)),e++),d++}();var j=[],k=g.SHA256=f.extend({_doReset:function(){this._hash=new e.init(h.slice(0))},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],k=c[5],l=c[6],m=c[7],n=0;64>n;n++){if(16>n)j[n]=0|a[b+n];else{var o=j[n-15],p=(o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3,q=j[n-2],r=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;j[n]=p+j[n-7]+r+j[n-16]}var s=h&k^~h&l,t=d&e^d&f^e&f,u=(d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22),v=(h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25),w=m+v+s+i[n]+j[n],x=u+t;m=l,l=k,k=h,h=g+w|0,g=f,f=e,e=d,d=w+x|0}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+g|0,c[4]=c[4]+h|0,c[5]=c[5]+k|0,c[6]=c[6]+l|0,c[7]=c[7]+m|0},_doFinalize:function(){var a=this._data,c=a.words,d=8*this._nDataBytes,e=8*a.sigBytes;return c[e>>>5]|=128<<24-e%32,c[(e+64>>>9<<4)+14]=b.floor(d/4294967296),c[(e+64>>>9<<4)+15]=d,a.sigBytes=4*c.length,this._process(),this._hash},clone:function(){var a=f.clone.call(this);return a._hash=this._hash.clone(),a}});c.SHA256=f._createHelper(k),c.HmacSHA256=f._createHmacHelper(k)}(Math),a.SHA256})},{"./core":41}],68:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.WordArray,f=d.Hasher,g=c.x64,h=g.Word,i=c.algo,j=[],k=[],l=[];!function(){for(var a=1,b=0,c=0;24>c;c++){j[a+5*b]=(c+1)*(c+2)/2%64;var d=b%5,e=(2*a+3*b)%5;a=d,b=e}for(var a=0;5>a;a++)for(var b=0;5>b;b++)k[a+5*b]=b+(2*a+3*b)%5*5;for(var f=1,g=0;24>g;g++){for(var i=0,m=0,n=0;7>n;n++){if(1&f){var o=(1<<n)-1;32>o?m^=1<<o:i^=1<<o-32}128&f?f=f<<1^113:f<<=1}l[g]=h.create(i,m)}}();var m=[];!function(){for(var a=0;25>a;a++)m[a]=h.create()}();var n=i.SHA3=f.extend({cfg:f.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],b=0;25>b;b++)a[b]=new h.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,b){for(var c=this._state,d=this.blockSize/2,e=0;d>e;e++){var f=a[b+2*e],g=a[b+2*e+1];f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8);var h=c[e];h.high^=g,h.low^=f}for(var i=0;24>i;i++){for(var n=0;5>n;n++){for(var o=0,p=0,q=0;5>q;q++){var h=c[n+5*q];o^=h.high,p^=h.low}var r=m[n];r.high=o,r.low=p}for(var n=0;5>n;n++)for(var s=m[(n+4)%5],t=m[(n+1)%5],u=t.high,v=t.low,o=s.high^(u<<1|v>>>31),p=s.low^(v<<1|u>>>31),q=0;5>q;q++){var h=c[n+5*q];h.high^=o,h.low^=p}for(var w=1;25>w;w++){var h=c[w],x=h.high,y=h.low,z=j[w];if(32>z)var o=x<<z|y>>>32-z,p=y<<z|x>>>32-z;else var o=y<<z-32|x>>>64-z,p=x<<z-32|y>>>64-z;var A=m[k[w]];A.high=o,A.low=p}var B=m[0],C=c[0];B.high=C.high,B.low=C.low;for(var n=0;5>n;n++)for(var q=0;5>q;q++){var w=n+5*q,h=c[w],D=m[w],E=m[(n+1)%5+5*q],F=m[(n+2)%5+5*q];h.high=D.high^~E.high&F.high,h.low=D.low^~E.low&F.low}var h=c[0],G=l[i];h.high^=G.high,h.low^=G.low}},_doFinalize:function(){var a=this._data,c=a.words,d=(8*this._nDataBytes,8*a.sigBytes),f=32*this.blockSize;c[d>>>5]|=1<<24-d%32,c[(b.ceil((d+1)/f)*f>>>5)-1]|=128,a.sigBytes=4*c.length,this._process();for(var g=this._state,h=this.cfg.outputLength/8,i=h/8,j=[],k=0;i>k;k++){var l=g[k],m=l.high,n=l.low;m=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),j.push(n),j.push(m)}return new e.init(j,h)},clone:function(){for(var a=f.clone.call(this),b=a._state=this._state.slice(0),c=0;25>c;c++)b[c]=b[c].clone();return a}});c.SHA3=f._createHelper(n),c.HmacSHA3=f._createHmacHelper(n)}(Math),a.SHA3})},{"./core":41,"./x64-core":72}],69:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core"),a("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],e):e(d.CryptoJS)}(this,function(a){return function(){var b=a,c=b.x64,d=c.Word,e=c.WordArray,f=b.algo,g=f.SHA512,h=f.SHA384=g.extend({_doReset:function(){this._hash=new e.init([new d.init(3418070365,3238371032),new d.init(1654270250,914150663),new d.init(2438529370,812702999),new d.init(355462360,4144912697),new d.init(1731405415,4290775857),new d.init(2394180231,1750603025),new d.init(3675008525,1694076839),new d.init(1203062813,3204075428)])},_doFinalize:function(){var a=g._doFinalize.call(this);return a.sigBytes-=16,a}});b.SHA384=g._createHelper(h),b.HmacSHA384=g._createHmacHelper(h)}(),a.SHA384})},{"./core":41,"./sha512":70,"./x64-core":72}],70:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(){return g.create.apply(g,arguments)}var c=a,d=c.lib,e=d.Hasher,f=c.x64,g=f.Word,h=f.WordArray,i=c.algo,j=[b(1116352408,3609767458),b(1899447441,602891725),b(3049323471,3964484399),b(3921009573,2173295548),b(961987163,4081628472),b(1508970993,3053834265),b(2453635748,2937671579),b(2870763221,3664609560),b(3624381080,2734883394),b(310598401,1164996542),b(607225278,1323610764),b(1426881987,3590304994),b(1925078388,4068182383),b(2162078206,991336113),b(2614888103,633803317),b(3248222580,3479774868),b(3835390401,2666613458),b(4022224774,944711139),b(264347078,2341262773),b(604807628,2007800933),b(770255983,1495990901),b(1249150122,1856431235),b(1555081692,3175218132),b(1996064986,2198950837),b(2554220882,3999719339),b(2821834349,766784016),b(2952996808,2566594879),b(3210313671,3203337956),b(3336571891,1034457026),b(3584528711,2466948901),b(113926993,3758326383),b(338241895,168717936),b(666307205,1188179964),b(773529912,1546045734),b(1294757372,1522805485),b(1396182291,2643833823),b(1695183700,2343527390),b(1986661051,1014477480),b(2177026350,1206759142),b(2456956037,344077627),b(2730485921,1290863460),b(2820302411,3158454273),b(3259730800,3505952657),b(3345764771,106217008),b(3516065817,3606008344),b(3600352804,1432725776),b(4094571909,1467031594),b(275423344,851169720),b(430227734,3100823752),b(506948616,1363258195),b(659060556,3750685593),b(883997877,3785050280),b(958139571,3318307427),b(1322822218,3812723403),b(1537002063,2003034995),b(1747873779,3602036899),b(1955562222,1575990012),b(2024104815,1125592928),b(2227730452,2716904306),b(2361852424,442776044),b(2428436474,593698344),b(2756734187,3733110249),b(3204031479,2999351573),b(3329325298,3815920427),b(3391569614,3928383900),b(3515267271,566280711),b(3940187606,3454069534),b(4118630271,4000239992),b(116418474,1914138554),b(174292421,2731055270),b(289380356,3203993006),b(460393269,320620315),b(685471733,587496836),b(852142971,1086792851),b(1017036298,365543100),b(1126000580,2618297676),b(1288033470,3409855158),b(1501505948,4234509866),b(1607167915,987167468),b(1816402316,1246189591)],k=[];!function(){for(var a=0;80>a;a++)k[a]=b()}();var l=i.SHA512=e.extend({_doReset:function(){this._hash=new h.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=c[5],l=c[6],m=c[7],n=d.high,o=d.low,p=e.high,q=e.low,r=f.high,s=f.low,t=g.high,u=g.low,v=h.high,w=h.low,x=i.high,y=i.low,z=l.high,A=l.low,B=m.high,C=m.low,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v,M=w,N=x,O=y,P=z,Q=A,R=B,S=C,T=0;80>T;T++){var U=k[T];if(16>T)var V=U.high=0|a[b+2*T],W=U.low=0|a[b+2*T+1];else{var X=k[T-15],Y=X.high,Z=X.low,$=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,_=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),aa=k[T-2],ba=aa.high,ca=aa.low,da=(ba>>>19|ca<<13)^(ba<<3|ca>>>29)^ba>>>6,ea=(ca>>>19|ba<<13)^(ca<<3|ba>>>29)^(ca>>>6|ba<<26),fa=k[T-7],ga=fa.high,ha=fa.low,ia=k[T-16],ja=ia.high,ka=ia.low,W=_+ha,V=$+ga+(_>>>0>W>>>0?1:0),W=W+ea,V=V+da+(ea>>>0>W>>>0?1:0),W=W+ka,V=V+ja+(ka>>>0>W>>>0?1:0);U.high=V,U.low=W}var la=L&N^~L&P,ma=M&O^~M&Q,na=D&F^D&H^F&H,oa=E&G^E&I^G&I,pa=(D>>>28|E<<4)^(D<<30|E>>>2)^(D<<25|E>>>7),qa=(E>>>28|D<<4)^(E<<30|D>>>2)^(E<<25|D>>>7),ra=(L>>>14|M<<18)^(L>>>18|M<<14)^(L<<23|M>>>9),sa=(M>>>14|L<<18)^(M>>>18|L<<14)^(M<<23|L>>>9),ta=j[T],ua=ta.high,va=ta.low,wa=S+sa,xa=R+ra+(S>>>0>wa>>>0?1:0),wa=wa+ma,xa=xa+la+(ma>>>0>wa>>>0?1:0),wa=wa+va,xa=xa+ua+(va>>>0>wa>>>0?1:0),wa=wa+W,xa=xa+V+(W>>>0>wa>>>0?1:0),ya=qa+oa,za=pa+na+(qa>>>0>ya>>>0?1:0);R=P,S=Q,P=N,Q=O,N=L,O=M,M=K+wa|0,L=J+xa+(K>>>0>M>>>0?1:0)|0,J=H,K=I,H=F,I=G,F=D,G=E,E=wa+ya|0,D=xa+za+(wa>>>0>E>>>0?1:0)|0}o=d.low=o+E,d.high=n+D+(E>>>0>o>>>0?1:0),q=e.low=q+G,e.high=p+F+(G>>>0>q>>>0?1:0),s=f.low=s+I,f.high=r+H+(I>>>0>s>>>0?1:0),u=g.low=u+K,g.high=t+J+(K>>>0>u>>>0?1:0),w=h.low=w+M,h.high=v+L+(M>>>0>w>>>0?1:0),y=i.low=y+O,i.high=x+N+(O>>>0>y>>>0?1:0),A=l.low=A+Q,l.high=z+P+(Q>>>0>A>>>0?1:0),C=m.low=C+S,m.high=B+R+(S>>>0>C>>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32,b[(d+128>>>10<<5)+30]=Math.floor(c/4294967296),b[(d+128>>>10<<5)+31]=c,a.sigBytes=4*b.length,this._process();var e=this._hash.toX32();return e},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a},blockSize:32});c.SHA512=e._createHelper(l),c.HmacSHA512=e._createHmacHelper(l)}(),a.SHA512})},{"./core":41,"./x64-core":72}],71:[function(a,b,c){!function(d,e,f){"object"==typeof c?b.exports=c=e(a("./core"),a("./enc-base64"),a("./md5"),a("./evpkdf"),a("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(d.CryptoJS)}(this,function(a){return function(){function b(a,b){var c=(this._lBlock>>>a^this._rBlock)&b;this._rBlock^=c,this._lBlock^=c<<a}function c(a,b){var c=(this._rBlock>>>a^this._lBlock)&b;this._lBlock^=c,this._rBlock^=c<<a}var d=a,e=d.lib,f=e.WordArray,g=e.BlockCipher,h=d.algo,i=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],j=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],k=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,
3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],m=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],n=h.DES=g.extend({_doReset:function(){for(var a=this._key,b=a.words,c=[],d=0;56>d;d++){var e=i[d]-1;c[d]=b[e>>>5]>>>31-e%32&1}for(var f=this._subKeys=[],g=0;16>g;g++){for(var h=f[g]=[],l=k[g],d=0;24>d;d++)h[d/6|0]|=c[(j[d]-1+l)%28]<<31-d%6,h[4+(d/6|0)]|=c[28+(j[d+24]-1+l)%28]<<31-d%6;h[0]=h[0]<<1|h[0]>>>31;for(var d=1;7>d;d++)h[d]=h[d]>>>4*(d-1)+3;h[7]=h[7]<<5|h[7]>>>27}for(var m=this._invSubKeys=[],d=0;16>d;d++)m[d]=f[15-d]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._subKeys)},decryptBlock:function(a,b){this._doCryptBlock(a,b,this._invSubKeys)},_doCryptBlock:function(a,d,e){this._lBlock=a[d],this._rBlock=a[d+1],b.call(this,4,252645135),b.call(this,16,65535),c.call(this,2,858993459),c.call(this,8,16711935),b.call(this,1,1431655765);for(var f=0;16>f;f++){for(var g=e[f],h=this._lBlock,i=this._rBlock,j=0,k=0;8>k;k++)j|=l[k][((i^g[k])&m[k])>>>0];this._lBlock=i,this._rBlock=h^j}var n=this._lBlock;this._lBlock=this._rBlock,this._rBlock=n,b.call(this,1,1431655765),c.call(this,8,16711935),c.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),a[d]=this._lBlock,a[d+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});d.DES=g._createHelper(n);var o=h.TripleDES=g.extend({_doReset:function(){var a=this._key,b=a.words;this._des1=n.createEncryptor(f.create(b.slice(0,2))),this._des2=n.createEncryptor(f.create(b.slice(2,4))),this._des3=n.createEncryptor(f.create(b.slice(4,6)))},encryptBlock:function(a,b){this._des1.encryptBlock(a,b),this._des2.decryptBlock(a,b),this._des3.encryptBlock(a,b)},decryptBlock:function(a,b){this._des3.decryptBlock(a,b),this._des2.encryptBlock(a,b),this._des1.decryptBlock(a,b)},keySize:6,ivSize:2,blockSize:2});d.TripleDES=g._createHelper(o)}(),a.TripleDES})},{"./cipher-core":40,"./core":41,"./enc-base64":42,"./evpkdf":44,"./md5":49}],72:[function(a,b,c){!function(d,e){"object"==typeof c?b.exports=c=e(a("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(d.CryptoJS)}(this,function(a){return function(b){var c=a,d=c.lib,e=d.Base,f=d.WordArray,g=c.x64={};g.Word=e.extend({init:function(a,b){this.high=a,this.low=b}}),g.WordArray=e.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=8*a.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;b>d;d++){var e=a[d];c.push(e.high),c.push(e.low)}return f.create(c,this.sigBytes)},clone:function(){for(var a=e.clone.call(this),b=a.words=this.words.slice(0),c=b.length,d=0;c>d;d++)b[d]=b[d].clone();return a}})}(),a})},{"./core":41}],73:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h&&h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],74:[function(a,b,c){"use strict";function d(a){function b(a){return null===j?void l.push(a):void g(function(){var b=j?a.onFulfilled:a.onRejected;if(null===b)return void(j?a.resolve:a.reject)(k);var c;try{c=b(k)}catch(d){return void a.reject(d)}a.resolve(c)})}function c(a){try{if(a===m)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var b=a.then;if("function"==typeof b)return void f(b.bind(a),c,h)}j=!0,k=a,i()}catch(d){h(d)}}function h(a){j=!1,k=a,i()}function i(){for(var a=0,c=l.length;c>a;a++)b(l[a]);l=null}if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");var j=null,k=null,l=[],m=this;this.then=function(a,c){return new d(function(d,f){b(new e(a,c,d,f))})},f(a,c,h)}function e(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function f(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var g=a("asap");b.exports=d},{asap:76}],75:[function(a,b,c){"use strict";function d(a){this.then=function(b){return"function"!=typeof b?this:new e(function(c,d){f(function(){try{c(b(a))}catch(e){d(e)}})})}}var e=a("./core.js"),f=a("asap");b.exports=e,d.prototype=Object.create(e.prototype);var g=new d(!0),h=new d(!1),i=new d(null),j=new d(void 0),k=new d(0),l=new d("");e.resolve=function(a){if(a instanceof e)return a;if(null===a)return i;if(void 0===a)return j;if(a===!0)return g;if(a===!1)return h;if(0===a)return k;if(""===a)return l;if("object"==typeof a||"function"==typeof a)try{var b=a.then;if("function"==typeof b)return new e(b.bind(a))}catch(c){return new e(function(a,b){b(c)})}return new d(a)},e.from=e.cast=function(a){var b=new Error("Promise.from and Promise.cast are deprecated, use Promise.resolve instead");return b.name="Warning",console.warn(b.stack),e.resolve(a)},e.denodeify=function(a,b){return b=b||1/0,function(){var c=this,d=Array.prototype.slice.call(arguments);return new e(function(e,f){for(;d.length&&d.length>b;)d.pop();d.push(function(a,b){a?f(a):e(b)}),a.apply(c,d)})}},e.nodeify=function(a){return function(){var b=Array.prototype.slice.call(arguments),c="function"==typeof b[b.length-1]?b.pop():null;try{return a.apply(this,arguments).nodeify(c)}catch(d){if(null===c||"undefined"==typeof c)return new e(function(a,b){b(d)});f(function(){c(d)})}}},e.all=function(){var a=1===arguments.length&&Array.isArray(arguments[0]),b=Array.prototype.slice.call(a?arguments[0]:arguments);if(!a){var c=new Error("Promise.all should be called with a single array, calling it with multiple arguments is deprecated");c.name="Warning",console.warn(c.stack)}return new e(function(a,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}b[f]=g,0===--e&&a(b)}catch(i){c(i)}}if(0===b.length)return a([]);for(var e=b.length,f=0;f<b.length;f++)d(f,b[f])})},e.reject=function(a){return new e(function(b,c){c(a)})},e.race=function(a){return new e(function(b,c){a.forEach(function(a){e.resolve(a).then(b,c)})})},e.prototype.done=function(a,b){var c=arguments.length?this.then.apply(this,arguments):this;c.then(null,function(a){f(function(){throw a})})},e.prototype.nodeify=function(a){return"function"!=typeof a?this:void this.then(function(b){f(function(){a(null,b)})},function(b){f(function(){a(b)})})},e.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":74,asap:76}],76:[function(a,b,c){(function(a){function c(){for(;e.next;){e=e.next;var a=e.task;e.task=void 0;var b=e.domain;b&&(e.domain=void 0,b.enter());try{a()}catch(d){if(i)throw b&&b.exit(),setTimeout(c,0),b&&b.enter(),d;setTimeout(function(){throw d},0)}b&&b.exit()}g=!1}function d(b){f=f.next={task:b,domain:i&&a.domain,next:null},g||(g=!0,h())}var e={task:void 0,next:null},f=e,g=!1,h=void 0,i=!1;if("undefined"!=typeof a&&a.nextTick)i=!0,h=function(){a.nextTick(c)};else if("function"==typeof setImmediate)h="undefined"!=typeof window?setImmediate.bind(window,c):function(){setImmediate(c)};else if("undefined"!=typeof MessageChannel){var j=new MessageChannel;j.port1.onmessage=c,h=function(){j.port2.postMessage(0)}}else h=function(){setTimeout(c,0)};b.exports=d}).call(this,a("_process"))},{_process:73}],77:[function(a,b,c){(function(){"use strict";function c(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(c){if("TypeError"!==c.name)throw c;for(var d=window.BlobBuilder||window.MSBlobBuilder||window.MozBlobBuilder||window.WebKitBlobBuilder,e=new d,f=0;f<a.length;f+=1)e.append(a[f]);return e.getBlob(b.type)}}function d(a){for(var b=a.length,c=new ArrayBuffer(b),d=new Uint8Array(c),e=0;b>e;e++)d[e]=a.charCodeAt(e);return c}function e(a){return new u(function(b,c){var d=new XMLHttpRequest;d.open("GET",a),d.withCredentials=!0,d.responseType="arraybuffer",d.onreadystatechange=function(){return 4===d.readyState?200===d.status?b({response:d.response,type:d.getResponseHeader("Content-Type")}):void c({status:d.status,response:d.response}):void 0},d.send()})}function f(a){return new u(function(b,d){var f=c([""],{type:"image/png"}),g=a.transaction([x],"readwrite");g.objectStore(x).put(f,"key"),g.oncomplete=function(){var c=a.transaction([x],"readwrite"),f=c.objectStore(x).get("key");f.onerror=d,f.onsuccess=function(a){var c=a.target.result,d=URL.createObjectURL(c);e(d).then(function(a){b(!(!a||"image/png"!==a.type))},function(){b(!1)}).then(function(){URL.revokeObjectURL(d)})}}})["catch"](function(){return!1})}function g(a){return"boolean"==typeof w?u.resolve(w):f(a).then(function(a){return w=a})}function h(a){return new u(function(b,c){var d=new FileReader;d.onerror=c,d.onloadend=function(c){var d=btoa(c.target.result||"");b({__local_forage_encoded_blob:!0,data:d,type:a.type})},d.readAsBinaryString(a)})}function i(a){var b=d(atob(a.data));return c([b],{type:a.type})}function j(a){return a&&a.__local_forage_encoded_blob}function k(a){var b=this,c={db:null};if(a)for(var d in a)c[d]=a[d];return new u(function(a,d){var e=v.open(c.name,c.version);e.onerror=function(){d(e.error)},e.onupgradeneeded=function(a){e.result.createObjectStore(c.storeName),a.oldVersion<=1&&e.result.createObjectStore(x)},e.onsuccess=function(){c.db=e.result,b._dbInfo=c,a()}})}function l(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new u(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=f.get(a);g.onsuccess=function(){var a=g.result;void 0===a&&(a=null),j(a)&&(a=i(a)),b(a)},g.onerror=function(){d(g.error)}})["catch"](d)});return t(d,b),d}function m(a,b){var c=this,d=new u(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=f.openCursor(),h=1;g.onsuccess=function(){var c=g.result;if(c){var d=c.value;j(d)&&(d=i(d));var e=a(d,c.key,h++);void 0!==e?b(e):c["continue"]()}else b()},g.onerror=function(){d(g.error)}})["catch"](d)});return t(d,b),d}function n(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new u(function(c,e){var f;d.ready().then(function(){return f=d._dbInfo,g(f.db)}).then(function(a){return!a&&b instanceof Blob?h(b):b}).then(function(b){var d=f.db.transaction(f.storeName,"readwrite"),g=d.objectStore(f.storeName);null===b&&(b=void 0);var h=g.put(b,a);d.oncomplete=function(){void 0===b&&(b=null),c(b)},d.onabort=d.onerror=function(){var a=h.error?h.error:h.transaction.error;e(a)}})["catch"](e)});return t(e,c),e}function o(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new u(function(b,d){c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readwrite"),g=f.objectStore(e.storeName),h=g["delete"](a);f.oncomplete=function(){b()},f.onerror=function(){d(h.error)},f.onabort=function(){var a=h.error?h.error:h.transaction.error;d(a)}})["catch"](d)});return t(d,b),d}function p(a){var b=this,c=new u(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readwrite"),f=e.objectStore(d.storeName),g=f.clear();e.oncomplete=function(){a()},e.onabort=e.onerror=function(){var a=g.error?g.error:g.transaction.error;c(a)}})["catch"](c)});return t(c,a),c}function q(a){var b=this,c=new u(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName),f=e.count();f.onsuccess=function(){a(f.result)},f.onerror=function(){c(f.error)}})["catch"](c)});return t(c,a),c}function r(a,b){var c=this,d=new u(function(b,d){return 0>a?void b(null):void c.ready().then(function(){var e=c._dbInfo,f=e.db.transaction(e.storeName,"readonly").objectStore(e.storeName),g=!1,h=f.openCursor();h.onsuccess=function(){var c=h.result;return c?void(0===a?b(c.key):g?b(c.key):(g=!0,c.advance(a))):void b(null)},h.onerror=function(){d(h.error)}})["catch"](d)});return t(d,b),d}function s(a){var b=this,c=new u(function(a,c){b.ready().then(function(){var d=b._dbInfo,e=d.db.transaction(d.storeName,"readonly").objectStore(d.storeName),f=e.openCursor(),g=[];f.onsuccess=function(){var b=f.result;return b?(g.push(b.key),void b["continue"]()):void a(g)},f.onerror=function(){c(f.error)}})["catch"](c)});return t(c,a),c}function t(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var u="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,v=v||this.indexedDB||this.webkitIndexedDB||this.mozIndexedDB||this.OIndexedDB||this.msIndexedDB;if(v){var w,x="local-forage-detect-blob-support",y={_driver:"asyncStorage",_initStorage:k,iterate:m,getItem:l,setItem:n,removeItem:o,clear:p,length:q,key:r,keys:s};"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?b.exports=y:"function"==typeof define&&define.amd?define("asyncStorage",function(){return y}):this.asyncStorage=y}}).call(window)},{promise:75}],78:[function(a,b,c){(function(){"use strict";function c(b){var c=this,d={};if(b)for(var e in b)d[e]=b[e];d.keyPrefix=d.name+"/",c._dbInfo=d;var f=new m(function(b){s===r.DEFINE?a(["localforageSerializer"],b):b(s===r.EXPORT?a("./../utils/serializer"):n.localforageSerializer)});return f.then(function(a){return o=a,m.resolve()})}function d(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo.keyPrefix,c=p.length-1;c>=0;c--){var d=p.key(c);0===d.indexOf(a)&&p.removeItem(d)}});return l(c,a),c}function e(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo,d=p.getItem(b.keyPrefix+a);return d&&(d=o.deserialize(d)),d});return l(d,b),d}function f(a,b){var c=this,d=c.ready().then(function(){for(var b=c._dbInfo.keyPrefix,d=b.length,e=p.length,f=0;e>f;f++){var g=p.key(f),h=p.getItem(g);if(h&&(h=o.deserialize(h)),h=a(h,g.substring(d),f+1),void 0!==h)return h}});return l(d,b),d}function g(a,b){var c=this,d=c.ready().then(function(){var b,d=c._dbInfo;try{b=p.key(a)}catch(e){b=null}return b&&(b=b.substring(d.keyPrefix.length)),b});return l(d,b),d}function h(a){var b=this,c=b.ready().then(function(){for(var a=b._dbInfo,c=p.length,d=[],e=0;c>e;e++)0===p.key(e).indexOf(a.keyPrefix)&&d.push(p.key(e).substring(a.keyPrefix.length));return d});return l(c,a),c}function i(a){var b=this,c=b.keys().then(function(a){return a.length});return l(c,a),c}function j(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=c.ready().then(function(){var b=c._dbInfo;p.removeItem(b.keyPrefix+a)});return l(d,b),d}function k(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=d.ready().then(function(){void 0===b&&(b=null);var c=b;return new m(function(e,f){o.serialize(b,function(b,g){if(g)f(g);else try{var h=d._dbInfo;p.setItem(h.keyPrefix+a,b),e(c)}catch(i){("QuotaExceededError"===i.name||"NS_ERROR_DOM_QUOTA_REACHED"===i.name)&&f(i),f(i)}})})});return l(e,c),e}function l(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var m="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,n=this,o=null,p=null;try{if(!(this.localStorage&&"setItem"in this.localStorage))return;p=this.localStorage}catch(q){return}var r={DEFINE:1,EXPORT:2,WINDOW:3},s=r.WINDOW;"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?s=r.EXPORT:"function"==typeof define&&define.amd&&(s=r.DEFINE);var t={_driver:"localStorageWrapper",_initStorage:c,iterate:f,getItem:e,setItem:k,removeItem:j,clear:d,length:i,key:g,keys:h};s===r.EXPORT?b.exports=t:s===r.DEFINE?define("localStorageWrapper",function(){return t}):this.localStorageWrapper=t}).call(window)},{"./../utils/serializer":81,promise:75}],79:[function(a,b,c){(function(){"use strict";function c(b){var c=this,d={db:null};if(b)for(var e in b)d[e]="string"!=typeof b[e]?b[e].toString():b[e];var f=new m(function(b){r===q.DEFINE?a(["localforageSerializer"],b):b(r===q.EXPORT?a("./../utils/serializer"):n.localforageSerializer)}),g=new m(function(a,e){try{d.db=p(d.name,String(d.version),d.description,d.size)}catch(f){return c.setDriver(c.LOCALSTORAGE).then(function(){return c._initStorage(b)}).then(a)["catch"](e)}d.db.transaction(function(b){b.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){c._dbInfo=d,a()},function(a,b){e(b)})})});return f.then(function(a){return o=a,g})}function d(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName+" WHERE key = ? LIMIT 1",[a],function(a,c){var d=c.rows.length?c.rows.item(0).value:null;d&&(d=o.deserialize(d)),b(d)},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function e(a,b){var c=this,d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT * FROM "+e.storeName,[],function(c,d){for(var e=d.rows,f=e.length,g=0;f>g;g++){var h=e.item(g),i=h.value;if(i&&(i=o.deserialize(i)),i=a(i,h.key,g+1),void 0!==i)return void b(i)}b()},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function f(a,b,c){var d=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var e=new m(function(c,e){d.ready().then(function(){void 0===b&&(b=null);var f=b;o.serialize(b,function(b,g){if(g)e(g);else{var h=d._dbInfo;h.db.transaction(function(d){d.executeSql("INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[a,b],function(){c(f)},function(a,b){e(b)})},function(a){a.code===a.QUOTA_ERR&&e(a)})}})})["catch"](e)});return l(e,c),e}function g(a,b){var c=this;"string"!=typeof a&&(window.console.warn(a+" used as a key, but it is not a string."),a=String(a));var d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("DELETE FROM "+e.storeName+" WHERE key = ?",[a],function(){b()},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function h(a){var b=this,c=new m(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("DELETE FROM "+d.storeName,[],function(){a()},function(a,b){c(b)})})})["catch"](c)});return l(c,a),c}function i(a){var b=this,c=new m(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT COUNT(key) as c FROM "+d.storeName,[],function(b,c){var d=c.rows.item(0).c;a(d)},function(a,b){c(b)})})})["catch"](c)});return l(c,a),c}function j(a,b){var c=this,d=new m(function(b,d){c.ready().then(function(){var e=c._dbInfo;e.db.transaction(function(c){c.executeSql("SELECT key FROM "+e.storeName+" WHERE id = ? LIMIT 1",[a+1],function(a,c){var d=c.rows.length?c.rows.item(0).key:null;b(d)},function(a,b){d(b)})})})["catch"](d)});return l(d,b),d}function k(a){var b=this,c=new m(function(a,c){b.ready().then(function(){var d=b._dbInfo;d.db.transaction(function(b){b.executeSql("SELECT key FROM "+d.storeName,[],function(b,c){for(var d=[],e=0;e<c.rows.length;e++)d.push(c.rows.item(e).key);a(d)},function(a,b){c(b)})})})["catch"](c)});return l(c,a),c}function l(a,b){b&&a.then(function(a){b(null,a)},function(a){b(a)})}var m="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,n=this,o=null,p=this.openDatabase;if(p){var q={DEFINE:1,EXPORT:2,WINDOW:3},r=q.WINDOW;"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?r=q.EXPORT:"function"==typeof define&&define.amd&&(r=q.DEFINE);var s={_driver:"webSQLStorage",_initStorage:c,iterate:e,getItem:d,setItem:f,removeItem:g,clear:h,length:i,key:j,keys:k};r===q.DEFINE?define("webSQLStorage",function(){return s}):r===q.EXPORT?b.exports=s:this.webSQLStorage=s}}).call(window)},{"./../utils/serializer":81,promise:75}],80:[function(a,b,c){(function(){"use strict";function c(a,b){a[b]=function(){var c=arguments;return a.ready().then(function(){return a[b].apply(a,c)})}}function d(){for(var a=1;a<arguments.length;a++){var b=arguments[a];if(b)for(var c in b)b.hasOwnProperty(c)&&(p(b[c])?arguments[0][c]=b[c].slice():arguments[0][c]=b[c])}return arguments[0]}function e(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b]===a)return!0;return!1}function f(a){this._config=d({},m,a),this._driverSet=null,this._ready=!1,this._dbInfo=null;for(var b=0;b<k.length;b++)c(this,k[b]);this.setDriver(this._config.driver)}var g="undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?a("promise"):this.Promise,h={},i={INDEXEDDB:"asyncStorage",LOCALSTORAGE:"localStorageWrapper",WEBSQL:"webSQLStorage"},j=[i.INDEXEDDB,i.WEBSQL,i.LOCALSTORAGE],k=["clear","getItem","iterate","key","keys","length","removeItem","setItem"],l={DEFINE:1,EXPORT:2,WINDOW:3},m={description:"",driver:j.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},n=l.WINDOW;"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?n=l.EXPORT:"function"==typeof define&&define.amd&&(n=l.DEFINE);var o=function(a){var b=b||a.indexedDB||a.webkitIndexedDB||a.mozIndexedDB||a.OIndexedDB||a.msIndexedDB,c={};return c[i.WEBSQL]=!!a.openDatabase,c[i.INDEXEDDB]=!!function(){if("undefined"!=typeof a.openDatabase&&a.navigator&&a.navigator.userAgent&&/Safari/.test(a.navigator.userAgent)&&!/Chrome/.test(a.navigator.userAgent))return!1;try{return b&&"function"==typeof b.open&&"undefined"!=typeof a.IDBKeyRange}catch(c){return!1}}(),c[i.LOCALSTORAGE]=!!function(){try{return a.localStorage&&"setItem"in a.localStorage&&a.localStorage.setItem}catch(b){return!1}}(),c}(this),p=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},q=this;f.prototype.INDEXEDDB=i.INDEXEDDB,f.prototype.LOCALSTORAGE=i.LOCALSTORAGE,f.prototype.WEBSQL=i.WEBSQL,f.prototype.config=function(a){if("object"==typeof a){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var b in a)"storeName"===b&&(a[b]=a[b].replace(/\W/g,"_")),this._config[b]=a[b];return"driver"in a&&a.driver&&this.setDriver(this._config.driver),!0}return"string"==typeof a?this._config[a]:this._config},f.prototype.defineDriver=function(a,b,c){var d=new g(function(b,c){try{var d=a._driver,f=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),i=new Error("Custom driver name already in use: "+a._driver);if(!a._driver)return void c(f);if(e(a._driver))return void c(i);for(var j=k.concat("_initStorage"),l=0;l<j.length;l++){var m=j[l];if(!m||!a[m]||"function"!=typeof a[m])return void c(f)}var n=g.resolve(!0);"_support"in a&&(n=a._support&&"function"==typeof a._support?a._support():g.resolve(!!a._support)),n.then(function(c){o[d]=c,h[d]=a,b()},c)}catch(p){c(p)}});return d.then(b,c),d},f.prototype.driver=function(){return this._driver||null},f.prototype.ready=function(a){var b=this,c=new g(function(a,c){b._driverSet.then(function(){null===b._ready&&(b._ready=b._initStorage(b._config)),b._ready.then(a,c)})["catch"](c)});return c.then(a,a),c},f.prototype.setDriver=function(b,c,d){function f(){i._config.driver=i.driver()}var i=this;return"string"==typeof b&&(b=[b]),this._driverSet=new g(function(c,d){var f=i._getFirstSupportedDriver(b),j=new Error("No available storage method found.");if(!f)return i._driverSet=g.reject(j),void d(j);if(i._dbInfo=null,i._ready=null,e(f)){var k=new g(function(b){if(n===l.DEFINE)a([f],b);else if(n===l.EXPORT)switch(f){case i.INDEXEDDB:b(a("./drivers/indexeddb"));break;case i.LOCALSTORAGE:b(a("./drivers/localstorage"));break;case i.WEBSQL:b(a("./drivers/websql"))}else b(q[f])});k.then(function(a){i._extend(a),c()})}else h[f]?(i._extend(h[f]),c()):(i._driverSet=g.reject(j),d(j))}),this._driverSet.then(f,f),this._driverSet.then(c,d),this._driverSet},f.prototype.supports=function(a){return!!o[a]},f.prototype._extend=function(a){d(this,a)},f.prototype._getFirstSupportedDriver=function(a){if(a&&p(a))for(var b=0;b<a.length;b++){var c=a[b];if(this.supports(c))return c}return null},f.prototype.createInstance=function(a){return new f(a)};var r=new f;n===l.DEFINE?define("localforage",function(){
return r}):n===l.EXPORT?b.exports=r:this.localforage=r}).call(window)},{"./drivers/indexeddb":77,"./drivers/localstorage":78,"./drivers/websql":79,promise:75}],81:[function(a,b,c){(function(){"use strict";function c(a,b){a=a||[],b=b||{};try{return new Blob(a,b)}catch(c){if("TypeError"!==c.name)throw c;for(var d=y.BlobBuilder||y.MSBlobBuilder||y.MozBlobBuilder||y.WebKitBlobBuilder,e=new d,f=0;f<a.length;f+=1)e.append(a[f]);return e.getBlob(b.type)}}function d(a,b){var c="";if(a&&(c=a.toString()),a&&("[object ArrayBuffer]"===a.toString()||a.buffer&&"[object ArrayBuffer]"===a.buffer.toString())){var d,e=k;a instanceof ArrayBuffer?(d=a,e+=m):(d=a.buffer,"[object Int8Array]"===c?e+=o:"[object Uint8Array]"===c?e+=p:"[object Uint8ClampedArray]"===c?e+=q:"[object Int16Array]"===c?e+=r:"[object Uint16Array]"===c?e+=t:"[object Int32Array]"===c?e+=s:"[object Uint32Array]"===c?e+=u:"[object Float32Array]"===c?e+=v:"[object Float64Array]"===c?e+=w:b(new Error("Failed to get type for BinaryArray"))),b(e+g(d))}else if("[object Blob]"===c){var f=new FileReader;f.onload=function(){var c=i+a.type+"~"+g(this.result);b(k+n+c)},f.readAsArrayBuffer(a)}else try{b(JSON.stringify(a))}catch(h){console.error("Couldn't convert value into a JSON string: ",a),b(null,h)}}function e(a){if(a.substring(0,l)!==k)return JSON.parse(a);var b,d=a.substring(x),e=a.substring(l,x);if(e===n&&j.test(d)){var g=d.match(j);b=g[1],d=d.substring(g[0].length)}var h=f(d);switch(e){case m:return h;case n:return c([h],{type:b});case o:return new Int8Array(h);case p:return new Uint8Array(h);case q:return new Uint8ClampedArray(h);case r:return new Int16Array(h);case t:return new Uint16Array(h);case s:return new Int32Array(h);case u:return new Uint32Array(h);case v:return new Float32Array(h);case w:return new Float64Array(h);default:throw new Error("Unkown type: "+e)}}function f(a){var b,c,d,e,f,g=.75*a.length,i=a.length,j=0;"="===a[a.length-1]&&(g--,"="===a[a.length-2]&&g--);var k=new ArrayBuffer(g),l=new Uint8Array(k);for(b=0;i>b;b+=4)c=h.indexOf(a[b]),d=h.indexOf(a[b+1]),e=h.indexOf(a[b+2]),f=h.indexOf(a[b+3]),l[j++]=c<<2|d>>4,l[j++]=(15&d)<<4|e>>2,l[j++]=(3&e)<<6|63&f;return k}function g(a){var b,c=new Uint8Array(a),d="";for(b=0;b<c.length;b+=3)d+=h[c[b]>>2],d+=h[(3&c[b])<<4|c[b+1]>>4],d+=h[(15&c[b+1])<<2|c[b+2]>>6],d+=h[63&c[b+2]];return c.length%3===2?d=d.substring(0,d.length-1)+"=":c.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="~~local_forage_type~",j=/^~~local_forage_type~([^~]+)~/,k="__lfsc__:",l=k.length,m="arbf",n="blob",o="si08",p="ui08",q="uic8",r="si16",s="si32",t="ur16",u="ui32",v="fl32",w="fl64",x=l+m.length,y=this,z={serialize:d,deserialize:e,stringToBuffer:f,bufferToString:g};"undefined"!=typeof b&&b.exports&&"undefined"!=typeof a?b.exports=z:"function"==typeof define&&define.amd?define("localforageSerializer",function(){return z}):this.localforageSerializer=z}).call(window)},{}],82:[function(a,b,c){"use strict";var d=a("./lib/utils/common").assign,e=a("./lib/deflate"),f=a("./lib/inflate"),g=a("./lib/zlib/constants"),h={};d(h,e,f,g),b.exports=h},{"./lib/deflate":83,"./lib/inflate":84,"./lib/utils/common":85,"./lib/zlib/constants":88}],83:[function(a,b,c){"use strict";function d(a,b){var c=new u(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function e(a,b){return b=b||{},b.raw=!0,d(a,b)}function f(a,b){return b=b||{},b.gzip=!0,d(a,b)}var g=a("./zlib/deflate.js"),h=a("./utils/common"),i=a("./utils/strings"),j=a("./zlib/messages"),k=a("./zlib/zstream"),l=Object.prototype.toString,m=0,n=4,o=0,p=1,q=2,r=-1,s=0,t=8,u=function(a){this.options=h.assign({level:r,method:t,chunkSize:16384,windowBits:15,memLevel:8,strategy:s,to:""},a||{});var b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==o)throw new Error(j[c]);b.header&&g.deflateSetHeader(this.strm,b.header)};u.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?n:m,"string"==typeof a?e.input=i.string2buf(a):"[object ArrayBuffer]"===l.call(a)?e.input=new Uint8Array(a):e.input=a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new h.Buf8(f),e.next_out=0,e.avail_out=f),c=g.deflate(e,d),c!==p&&c!==o)return this.onEnd(c),this.ended=!0,!1;(0===e.avail_out||0===e.avail_in&&(d===n||d===q))&&("string"===this.options.to?this.onData(i.buf2binstring(h.shrinkBuf(e.output,e.next_out))):this.onData(h.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||0===e.avail_out)&&c!==p);return d===n?(c=g.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===o):d===q?(this.onEnd(o),e.avail_out=0,!0):!0},u.prototype.onData=function(a){this.chunks.push(a)},u.prototype.onEnd=function(a){a===o&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=u,c.deflate=d,c.deflateRaw=e,c.gzip=f},{"./utils/common":85,"./utils/strings":86,"./zlib/deflate.js":90,"./zlib/messages":95,"./zlib/zstream":97}],84:[function(a,b,c){"use strict";function d(a,b){var c=new n(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function e(a,b){return b=b||{},b.raw=!0,d(a,b)}var f=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),i=a("./zlib/constants"),j=a("./zlib/messages"),k=a("./zlib/zstream"),l=a("./zlib/gzheader"),m=Object.prototype.toString,n=function(a){this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowBits=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=f.inflateInit2(this.strm,b.windowBits);if(c!==i.Z_OK)throw new Error(j[c]);this.header=new l,f.inflateGetHeader(this.strm,this.header)};n.prototype.push=function(a,b){var c,d,e,j,k,l=this.strm,n=this.options.chunkSize,o=!1;if(this.ended)return!1;d=b===~~b?b:b===!0?i.Z_FINISH:i.Z_NO_FLUSH,"string"==typeof a?l.input=h.binstring2buf(a):"[object ArrayBuffer]"===m.call(a)?l.input=new Uint8Array(a):l.input=a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new g.Buf8(n),l.next_out=0,l.avail_out=n),c=f.inflate(l,i.Z_NO_FLUSH),c===i.Z_BUF_ERROR&&o===!0&&(c=i.Z_OK,o=!1),c!==i.Z_STREAM_END&&c!==i.Z_OK)return this.onEnd(c),this.ended=!0,!1;l.next_out&&(0===l.avail_out||c===i.Z_STREAM_END||0===l.avail_in&&(d===i.Z_FINISH||d===i.Z_SYNC_FLUSH))&&("string"===this.options.to?(e=h.utf8border(l.output,l.next_out),j=l.next_out-e,k=h.buf2string(l.output,e),l.next_out=j,l.avail_out=n-j,j&&g.arraySet(l.output,l.output,e,j,0),this.onData(k)):this.onData(g.shrinkBuf(l.output,l.next_out))),0===l.avail_in&&0===l.avail_out&&(o=!0)}while((l.avail_in>0||0===l.avail_out)&&c!==i.Z_STREAM_END);return c===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(c=f.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===i.Z_OK):d===i.Z_SYNC_FLUSH?(this.onEnd(i.Z_OK),l.avail_out=0,!0):!0},n.prototype.onData=function(a){this.chunks.push(a)},n.prototype.onEnd=function(a){a===i.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=n,c.inflate=d,c.inflateRaw=e,c.ungzip=d},{"./utils/common":85,"./utils/strings":86,"./zlib/constants":88,"./zlib/gzheader":91,"./zlib/inflate.js":93,"./zlib/messages":95,"./zlib/zstream":97}],85:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;c>b;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;c>b;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],86:[function(a,b,c){"use strict";function d(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c="",d=0;b>d;d++)c+=String.fromCharCode(a[d]);return c}var e=a("./common"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;256>j;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=new e.Buf8(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;d>c;c++)b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;h>c;)if(f=a[c++],128>f)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&h>c;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:65536>f?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":85}],87:[function(a,b,c){"use strict";function d(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=d},{}],88:[function(a,b,c){b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],89:[function(a,b,c){"use strict";function d(){for(var a,b=[],c=0;256>c;c++){a=c;for(var d=0;8>d;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function e(a,b,c,d){var e=f,g=d+c;a=-1^a;for(var h=d;g>h;h++)a=a>>>8^e[255&(a^b[h])];return-1^a}var f=d();b.exports=e},{}],90:[function(a,b,c){"use strict";function d(a,b){return a.msg=G[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(C.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){D._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}function j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,C.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=E(a.adler,b,e,c):2===a.state.wrap&&(a.adler=F(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-ja?a.strstart-(a.w_size-ja):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ia,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&m>f);if(d=ia-(m-f),f=m-ia,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-ja)){C.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=ha)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+ha-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,!(a.lookahead+a.insert<ha)););}while(a.lookahead<ja&&0!==a.strm.avail_in)}function n(a,b){var c=65535;for(c>a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===H)return sa;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.strstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return sa;if(a.strstart-a.block_start>=a.w_size-ja&&(h(a,!1),0===a.strm.avail_out))return sa}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ua:va):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?sa:sa}function o(a,b){for(var c,d;;){if(a.lookahead<ja){if(m(a),a.lookahead<ja&&b===H)return sa;if(0===a.lookahead)break}if(c=0,a.lookahead>=ha&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ha-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),0!==c&&a.strstart-c<=a.w_size-ja&&(a.match_length=l(a,c)),a.match_length>=ha)if(d=D._tr_tally(a,a.strstart-a.match_start,a.match_length-ha),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=ha){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ha-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return sa}return a.insert=a.strstart<ha-1?a.strstart:ha-1,b===K?(h(a,!0),0===a.strm.avail_out?ua:va):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sa:ta}function p(a,b){for(var c,d,e;;){if(a.lookahead<ja){if(m(a),a.lookahead<ja&&b===H)return sa;if(0===a.lookahead)break}if(c=0,a.lookahead>=ha&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ha-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=ha-1,0!==c&&a.prev_length<a.max_lazy_match&&a.strstart-c<=a.w_size-ja&&(a.match_length=l(a,c),a.match_length<=5&&(a.strategy===S||a.match_length===ha&&a.strstart-a.match_start>4096)&&(a.match_length=ha-1)),a.prev_length>=ha&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-ha,d=D._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-ha),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+ha-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=ha-1,a.strstart++,d&&(h(a,!1),0===a.strm.avail_out))return sa}else if(a.match_available){if(d=D._tr_tally(a,0,a.window[a.strstart-1]),d&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return sa}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(d=D._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<ha-1?a.strstart:ha-1,b===K?(h(a,!0),0===a.strm.avail_out?ua:va):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sa:ta}function q(a,b){for(var c,d,e,f,g=a.window;;){if(a.lookahead<=ia){if(m(a),a.lookahead<=ia&&b===H)return sa;if(0===a.lookahead)break}if(a.match_length=0,a.lookahead>=ha&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ia;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&f>e);a.match_length=ia-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=ha?(c=D._tr_tally(a,1,a.match_length-ha),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return sa}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ua:va):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sa:ta}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===H)return sa;break}if(a.match_length=0,c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return sa}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ua:va):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sa:ta}function s(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=B[a.level].max_lazy,a.good_match=B[a.level].good_length,a.nice_match=B[a.level].nice_length,a.max_chain_length=B[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=ha-1,a.match_available=0,a.ins_h=0}function t(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new C.Buf16(2*fa),this.dyn_dtree=new C.Buf16(2*(2*da+1)),this.bl_tree=new C.Buf16(2*(2*ea+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new C.Buf16(ga+1),this.heap=new C.Buf16(2*ca+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new C.Buf16(2*ca+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function u(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=X,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?la:qa,a.adler=2===b.wrap?0:1,b.last_flush=H,D._tr_init(b),M):d(a,O)}function v(a){var b=u(a);return b===M&&s(a.state),b}function w(a,b){return a&&a.state?2!==a.state.wrap?O:(a.state.gzhead=b,M):O}function x(a,b,c,e,f,g){if(!a)return O;var h=1;if(b===R&&(b=6),0>e?(h=0,e=-e):e>15&&(h=2,e-=16),1>f||f>Z||c!==Y||8>e||e>15||0>b||b>9||0>g||g>V)return d(a,O);8===e&&(e=9);var i=new t;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<<i.w_bits,i.w_mask=i.w_size-1,i.hash_bits=f+7,i.hash_size=1<<i.hash_bits,i.hash_mask=i.hash_size-1,i.hash_shift=~~((i.hash_bits+ha-1)/ha),i.window=new C.Buf8(2*i.w_size),i.head=new C.Buf16(i.hash_size),i.prev=new C.Buf16(i.w_size),i.lit_bufsize=1<<f+6,i.pending_buf_size=4*i.lit_bufsize,i.pending_buf=new C.Buf8(i.pending_buf_size),i.d_buf=i.lit_bufsize>>1,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,v(a)}function y(a,b){return x(a,b,Y,$,_,W)}function z(a,b){var c,h,k,l;if(!a||!a.state||b>L||0>b)return a?d(a,O):O;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===ra&&b!==K)return d(a,0===a.avail_out?Q:O);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===la)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.time>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=F(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=ma):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,wa),h.status=qa);else{var m=Y+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=T||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=ka),m+=31-m%31,h.status=qa,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===ma)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=na)}else h.status=na;if(h.status===na)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=oa)}else h.status=oa;if(h.status===oa)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=pa)}else h.status=pa;if(h.status===pa&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=qa)):h.status=qa),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,M}else if(0===a.avail_in&&e(b)<=e(c)&&b!==K)return d(a,Q);if(h.status===ra&&0!==a.avail_in)return d(a,Q);if(0!==a.avail_in||0!==h.lookahead||b!==H&&h.status!==ra){var o=h.strategy===T?r(h,b):h.strategy===U?q(h,b):B[h.level].func(h,b);if((o===ua||o===va)&&(h.status=ra),o===sa||o===ua)return 0===a.avail_out&&(h.last_flush=-1),M;if(o===ta&&(b===I?D._tr_align(h):b!==L&&(D._tr_stored_block(h,0,0,!1),b===J&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,M}return b!==K?M:h.wrap<=0?N:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>>>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?M:N)}function A(a){var b;return a&&a.state?(b=a.state.status,b!==la&&b!==ma&&b!==na&&b!==oa&&b!==pa&&b!==qa&&b!==ra?d(a,O):(a.state=null,b===qa?d(a,P):M)):O}var B,C=a("../utils/common"),D=a("./trees"),E=a("./adler32"),F=a("./crc32"),G=a("./messages"),H=0,I=1,J=3,K=4,L=5,M=0,N=1,O=-2,P=-3,Q=-5,R=-1,S=1,T=2,U=3,V=4,W=0,X=2,Y=8,Z=9,$=15,_=8,aa=29,ba=256,ca=ba+1+aa,da=30,ea=19,fa=2*ca+1,ga=15,ha=3,ia=258,ja=ia+ha+1,ka=32,la=42,ma=69,na=73,oa=91,pa=103,qa=113,ra=666,sa=1,ta=2,ua=3,va=4,wa=3,xa=function(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e};B=[new xa(0,0,0,0,n),new xa(4,4,8,4,o),new xa(4,5,16,8,o),new xa(4,6,32,32,o),new xa(4,4,16,16,p),new xa(8,16,32,32,p),new xa(8,16,128,128,p),new xa(8,32,128,256,p),new xa(32,128,258,1024,p),new xa(32,258,258,4096,p)],c.deflateInit=y,c.deflateInit2=x,c.deflateReset=v,c.deflateResetKeep=u,c.deflateSetHeader=w,c.deflate=z,c.deflateEnd=A,c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":85,"./adler32":87,"./crc32":89,"./messages":95,"./trees":96}],91:[function(a,b,c){"use strict";function d(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}b.exports=d},{}],92:[function(a,b,c){"use strict";var d=30,e=12;b.exports=function(a,b){var c,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;c=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=c.dmax,l=c.wsize,m=c.whave,n=c.wnext,o=c.window,p=c.hold,q=c.bits,r=c.lencode,s=c.distcode,t=(1<<c.lenbits)-1,u=(1<<c.distbits)-1;a:do{15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=r[p&t];b:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<<w)-1)];continue b}if(32&w){c.mode=e;break a}a.msg="invalid literal/length code",c.mode=d;break a}x=65535&v,w&=15,w&&(w>q&&(p+=B[f++]<<q,q+=8),x+=p&(1<<w)-1,p>>>=w,q-=w),15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=s[p&u];c:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<<w)-1)];continue c}a.msg="invalid distance code",c.mode=d;break a}if(y=65535&v,w&=15,w>q&&(p+=B[f++]<<q,q+=8,w>q&&(p+=B[f++]<<q,q+=8)),y+=p&(1<<w)-1,y>k){a.msg="invalid distance too far back",c.mode=d;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&c.sane){a.msg="invalid distance too far back",c.mode=d;break a}if(z=0,A=o,0===n){if(z+=l-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(w>n){if(z+=l+n-w,w-=n,x>w){x-=w;do C[h++]=o[z++];while(--w);if(z=0,x>n){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}break}}break}}while(g>f&&j>h);x=q>>3,f-=x,q-=x<<3,p&=(1<<q)-1,a.next_in=f,a.next_out=h,a.avail_in=g>f?5+(g-f):5-(f-g),a.avail_out=j>h?257+(j-h):257-(h-j),c.hold=p,c.bits=q}},{}],93:[function(a,b,c){"use strict";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=K,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new r.Buf32(oa),b.distcode=b.distdyn=new r.Buf32(pa),b.sane=1,b.back=-1,C):F}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):F}function h(a,b){var c,d;return a&&a.state?(d=a.state,0>b?(c=0,b=-b):(c=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||b>15)?F:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):F}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==C&&(a.state=null),c):F}function j(a){return i(a,ra)}function k(a){if(sa){var b;for(p=new r.Buf32(512),q=new r.Buf32(32),b=0;144>b;)a.lens[b++]=8;for(;256>b;)a.lens[b++]=9;for(;280>b;)a.lens[b++]=7;for(;288>b;)a.lens[b++]=8;for(v(x,a.lens,0,288,p,0,a.work,{bits:9}),b=0;32>b;)a.lens[b++]=5;v(y,a.lens,0,32,q,0,a.work,{bits:5}),sa=!1}a.lencode=p,a.lenbits=9,a.distcode=q,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<<f.wbits,f.wnext=0,f.whave=0,f.window=new r.Buf8(f.wsize)),d>=f.wsize?(r.arraySet(f.window,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),r.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(r.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave<f.wsize&&(f.whave+=e))),0}function m(a,b){var c,e,f,g,h,i,j,m,n,o,p,q,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa=0,Ba=new r.Buf8(4),Ca=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return F;c=a.state,c.mode===V&&(c.mode=W),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,o=i,p=j,xa=C;a:for(;;)switch(c.mode){case K:if(0===c.wrap){c.mode=W;break}for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(2&c.wrap&&35615===m){c.check=0,Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0),m=0,n=0,c.mode=L;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=la;break}if((15&m)!==J){a.msg="unknown compression method",c.mode=la;break}if(m>>>=4,n-=4,wa=(15&m)+8,0===c.wbits)c.wbits=wa;else if(wa>c.wbits){a.msg="invalid window size",c.mode=la;break}c.dmax=1<<wa,a.adler=c.check=1,c.mode=512&m?T:V,m=0,n=0;break;case L:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.flags=m,(255&c.flags)!==J){a.msg="unknown compression method",c.mode=la;break}if(57344&c.flags){a.msg="unknown header flags set",c.mode=la;break}c.head&&(c.head.text=m>>8&1),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0,c.mode=M;case M:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.time=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,Ba[2]=m>>>16&255,Ba[3]=m>>>24&255,c.check=t(c.check,Ba,4,0)),m=0,n=0,c.mode=N;case N:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.xflags=255&m,c.head.os=m>>8),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0,c.mode=O;case O:if(1024&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length=m,c.head&&(c.head.extra_len=m),512&c.flags&&(Ba[0]=255&m,Ba[1]=m>>>8&255,c.check=t(c.check,Ba,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=P;case P:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wa=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),r.arraySet(c.head.extra,e,g,q,wa)),512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=Q;case Q:if(2048&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.name+=String.fromCharCode(wa));while(wa&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=R;case R:if(4096&c.flags){if(0===i)break a;q=0;do wa=e[g+q++],c.head&&wa&&c.length<65536&&(c.head.comment+=String.fromCharCode(wa));while(wa&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wa)break a}else c.head&&(c.head.comment=null);c.mode=S;case S:
if(512&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(65535&c.check)){a.msg="header crc mismatch",c.mode=la;break}m=0,n=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=V;break;case T:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}a.adler=c.check=d(m),m=0,n=0,c.mode=U;case U:if(0===c.havedict)return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,E;a.adler=c.check=1,c.mode=V;case V:if(b===A||b===B)break a;case W:if(c.last){m>>>=7&n,n-=7&n,c.mode=ia;break}for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}switch(c.last=1&m,m>>>=1,n-=1,3&m){case 0:c.mode=X;break;case 1:if(k(c),c.mode=ba,b===B){m>>>=2,n-=2;break a}break;case 2:c.mode=$;break;case 3:a.msg="invalid block type",c.mode=la}m>>>=2,n-=2;break;case X:for(m>>>=7&n,n-=7&n;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if((65535&m)!==(m>>>16^65535)){a.msg="invalid stored block lengths",c.mode=la;break}if(c.length=65535&m,m=0,n=0,c.mode=Y,b===B)break a;case Y:c.mode=Z;case Z:if(q=c.length){if(q>i&&(q=i),q>j&&(q=j),0===q)break a;r.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=V;break;case $:for(;14>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.nlen=(31&m)+257,m>>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=la;break}c.have=0,c.mode=_;case _:for(;c.have<c.ncode;){for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.lens[Ca[c.have++]]=7&m,m>>>=3,n-=3}for(;c.have<19;)c.lens[Ca[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,ya={bits:c.lenbits},xa=v(w,c.lens,0,19,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid code lengths set",c.mode=la;break}c.have=0,c.mode=aa;case aa:for(;c.have<c.nlen+c.ndist;){for(;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(16>sa)m>>>=qa,n-=qa,c.lens[c.have++]=sa;else{if(16===sa){for(za=qa+2;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m>>>=qa,n-=qa,0===c.have){a.msg="invalid bit length repeat",c.mode=la;break}wa=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sa){for(za=qa+3;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=3+(7&m),m>>>=3,n-=3}else{for(za=qa+7;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qa,n-=qa,wa=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=la;break}for(;q--;)c.lens[c.have++]=wa}}if(c.mode===la)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=la;break}if(c.lenbits=9,ya={bits:c.lenbits},xa=v(x,c.lens,0,c.nlen,c.lencode,0,c.work,ya),c.lenbits=ya.bits,xa){a.msg="invalid literal/lengths set",c.mode=la;break}if(c.distbits=6,c.distcode=c.distdyn,ya={bits:c.distbits},xa=v(y,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,ya),c.distbits=ya.bits,xa){a.msg="invalid distances set",c.mode=la;break}if(c.mode=ba,b===B)break a;case ba:c.mode=ca;case ca:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,u(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===V&&(c.back=-1);break}for(c.back=0;Aa=c.lencode[m&(1<<c.lenbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(ra&&0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.lencode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=ta+qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,c.length=sa,0===ra){c.mode=ha;break}if(32&ra){c.back=-1,c.mode=V;break}if(64&ra){a.msg="invalid literal/length code",c.mode=la;break}c.extra=15&ra,c.mode=da;case da:if(c.extra){for(za=c.extra;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=ea;case ea:for(;Aa=c.distcode[m&(1<<c.distbits)-1],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(0===(240&ra)){for(ta=qa,ua=ra,va=sa;Aa=c.distcode[va+((m&(1<<ta+ua)-1)>>ta)],qa=Aa>>>24,ra=Aa>>>16&255,sa=65535&Aa,!(n>=ta+qa);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=ta,n-=ta,c.back+=ta}if(m>>>=qa,n-=qa,c.back+=qa,64&ra){a.msg="invalid distance code",c.mode=la;break}c.offset=sa,c.extra=15&ra,c.mode=fa;case fa:if(c.extra){for(za=c.extra;za>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.offset+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=la;break}c.mode=ga;case ga:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=la;break}q>c.wnext?(q-=c.wnext,oa=c.wsize-q):oa=c.wnext-q,q>c.length&&(q=c.length),pa=c.window}else pa=f,oa=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pa[oa++];while(--q);0===c.length&&(c.mode=ca);break;case ha:if(0===j)break a;f[h++]=c.length,j--,c.mode=ca;break;case ia:if(c.wrap){for(;32>n;){if(0===i)break a;i--,m|=e[g++]<<n,n+=8}if(p-=j,a.total_out+=p,c.total+=p,p&&(a.adler=c.check=c.flags?t(c.check,f,p,h-p):s(c.check,f,p,h-p)),p=j,(c.flags?m:d(m))!==c.check){a.msg="incorrect data check",c.mode=la;break}m=0,n=0}c.mode=ja;case ja:if(c.wrap&&c.flags){for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(4294967295&c.total)){a.msg="incorrect length check",c.mode=la;break}m=0,n=0}c.mode=ka;case ka:xa=D;break a;case la:xa=G;break a;case ma:return H;case na:default:return F}return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,(c.wsize||p!==a.avail_out&&c.mode<la&&(c.mode<ia||b!==z))&&l(a,a.output,a.next_out,p-a.avail_out)?(c.mode=ma,H):(o-=a.avail_in,p-=a.avail_out,a.total_in+=o,a.total_out+=p,c.total+=p,c.wrap&&p&&(a.adler=c.check=c.flags?t(c.check,f,p,a.next_out-p):s(c.check,f,p,a.next_out-p)),a.data_type=c.bits+(c.last?64:0)+(c.mode===V?128:0)+(c.mode===ba||c.mode===Y?256:0),(0===o&&0===p||b===z)&&xa===C&&(xa=I),xa)}function n(a){if(!a||!a.state)return F;var b=a.state;return b.window&&(b.window=null),a.state=null,C}function o(a,b){var c;return a&&a.state?(c=a.state,0===(2&c.wrap)?F:(c.head=b,b.done=!1,C)):F}var p,q,r=a("../utils/common"),s=a("./adler32"),t=a("./crc32"),u=a("./inffast"),v=a("./inftrees"),w=0,x=1,y=2,z=4,A=5,B=6,C=0,D=1,E=2,F=-2,G=-3,H=-4,I=-5,J=8,K=1,L=2,M=3,N=4,O=5,P=6,Q=7,R=8,S=9,T=10,U=11,V=12,W=13,X=14,Y=15,Z=16,$=17,_=18,aa=19,ba=20,ca=21,da=22,ea=23,fa=24,ga=25,ha=26,ia=27,ja=28,ka=29,la=30,ma=31,na=32,oa=852,pa=592,qa=15,ra=qa,sa=!0;c.inflateReset=g,c.inflateReset2=h,c.inflateResetKeep=f,c.inflateInit=j,c.inflateInit2=i,c.inflate=m,c.inflateEnd=n,c.inflateGetHeader=o,c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":85,"./adler32":87,"./crc32":89,"./inffast":92,"./inftrees":94}],94:[function(a,b,c){"use strict";var d=a("../utils/common"),e=15,f=852,g=592,h=0,i=1,j=2,k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],m=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],n=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];b.exports=function(a,b,c,o,p,q,r,s){var t,u,v,w,x,y,z,A,B,C=s.bits,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=null,O=0,P=new d.Buf16(e+1),Q=new d.Buf16(e+1),R=null,S=0;for(D=0;e>=D;D++)P[D]=0;for(E=0;o>E;E++)P[b[c+E]]++;for(H=C,G=e;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;G>F&&0===P[F];F++);for(F>H&&(H=F),K=1,D=1;e>=D;D++)if(K<<=1,K-=P[D],0>K)return-1;if(K>0&&(a===h||1!==G))return-1;for(Q[1]=0,D=1;e>D;D++)Q[D+1]=Q[D]+P[D];for(E=0;o>E;E++)0!==b[c+E]&&(r[Q[b[c+E]]++]=E);if(a===h?(N=R=r,y=19):a===i?(N=k,O-=257,R=l,S-=257,y=256):(N=m,R=n,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<<H,w=L-1,a===i&&L>f||a===j&&L>g)return 1;for(var T=0;;){T++,z=D-J,r[E]<y?(A=0,B=r[E]):r[E]>y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<<D-J,u=1<<I,F=u;do u-=t,p[x+(M>>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<<D-1;M&t;)t>>=1;if(0!==t?(M&=t-1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[c+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<<I;G>I+J&&(K-=P[I+J],!(0>=K));)I++,K<<=1;if(L+=1<<I,a===i&&L>f||a===j&&L>g)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":85}],95:[function(a,b,c){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],96:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a){return 256>a?ga[a]:ga[256+(a>>>7)]}function f(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function g(a,b,c){a.bi_valid>V-c?(a.bi_buf|=b<<a.bi_valid&65535,f(a,a.bi_buf),a.bi_buf=b>>V-a.bi_valid,a.bi_valid+=c-V):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=c)}function h(a,b,c){g(a,c[2*b],c[2*b+1])}function i(a,b){var c=0;do c|=1&a,a>>>=1,c<<=1;while(--b>0);return c>>>1}function j(a){16===a.bi_valid?(f(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function k(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;U>=f;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;T>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function l(a,b,c){var d,e,f=new Array(U+1),g=0;for(d=1;U>=d;d++)f[d]=g=g+c[d-1]<<1;for(e=0;b>=e;e++){var h=a[2*e+1];0!==h&&(a[2*e]=i(f[h]++,h))}}function m(){var a,b,c,d,e,f=new Array(U+1);for(c=0,d=0;O-1>d;d++)for(ia[d]=c,a=0;a<1<<_[d];a++)ha[c++]=d;for(ha[c-1]=d,e=0,d=0;16>d;d++)for(ja[d]=e,a=0;a<1<<aa[d];a++)ga[e++]=d;for(e>>=7;R>d;d++)for(ja[d]=e<<7,a=0;a<1<<aa[d]-7;a++)ga[256+e++]=d;for(b=0;U>=b;b++)f[b]=0;for(a=0;143>=a;)ea[2*a+1]=8,a++,f[8]++;for(;255>=a;)ea[2*a+1]=9,a++,f[9]++;for(;279>=a;)ea[2*a+1]=7,a++,f[7]++;for(;287>=a;)ea[2*a+1]=8,a++,f[8]++;for(l(ea,Q+1,f),a=0;R>a;a++)fa[2*a+1]=5,fa[2*a]=i(a,5);ka=new na(ea,_,P+1,Q,U),la=new na(fa,aa,0,R,U),ma=new na(new Array(0),ba,0,S,W)}function n(a){var b;for(b=0;Q>b;b++)a.dyn_ltree[2*b]=0;for(b=0;R>b;b++)a.dyn_dtree[2*b]=0;for(b=0;S>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*X]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function o(a){a.bi_valid>8?f(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function p(a,b,c,d){o(a),d&&(f(a,c),f(a,~c)),E.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function q(a,b,c,d){var e=2*b,f=2*c;return a[e]<a[f]||a[e]===a[f]&&d[b]<=d[c]}function r(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&q(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!q(b,d,a.heap[e],a.depth));)a.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}function s(a,b,c){var d,f,i,j,k=0;if(0!==a.last_lit)do d=a.pending_buf[a.d_buf+2*k]<<8|a.pending_buf[a.d_buf+2*k+1],f=a.pending_buf[a.l_buf+k],k++,0===d?h(a,f,b):(i=ha[f],h(a,i+P+1,b),j=_[i],0!==j&&(f-=ia[i],g(a,f,j)),d--,i=e(d),h(a,i,c),j=aa[i],0!==j&&(d-=ja[i],g(a,d,j)));while(k<a.last_lit);h(a,X,b)}function t(a,b){var c,d,e,f=b.dyn_tree,g=b.stat_desc.static_tree,h=b.stat_desc.has_stree,i=b.stat_desc.elems,j=-1;for(a.heap_len=0,a.heap_max=T,c=0;i>c;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=2>j?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)r(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],r(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,r(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],k(a,b),l(f,j,a.bl_count)}function u(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++h<i&&e===g||(j>h?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*Y]++):10>=h?a.bl_tree[2*Z]++:a.bl_tree[2*$]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function v(a,b,c){var d,e,f=-1,i=b[1],j=0,k=7,l=4;for(0===i&&(k=138,l=3),d=0;c>=d;d++)if(e=i,i=b[2*(d+1)+1],!(++j<k&&e===i)){if(l>j){do h(a,e,a.bl_tree);while(0!==--j)}else 0!==e?(e!==f&&(h(a,e,a.bl_tree),j--),h(a,Y,a.bl_tree),g(a,j-3,2)):10>=j?(h(a,Z,a.bl_tree),g(a,j-3,3)):(h(a,$,a.bl_tree),g(a,j-11,7));j=0,f=e,0===i?(k=138,l=3):e===i?(k=6,l=3):(k=7,l=4)}}function w(a){var b;for(u(a,a.dyn_ltree,a.l_desc.max_code),u(a,a.dyn_dtree,a.d_desc.max_code),t(a,a.bl_desc),b=S-1;b>=3&&0===a.bl_tree[2*ca[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function x(a,b,c,d){var e;for(g(a,b-257,5),g(a,c-1,5),g(a,d-4,4),e=0;d>e;e++)g(a,a.bl_tree[2*ca[e]+1],3);v(a,a.dyn_ltree,b-1),v(a,a.dyn_dtree,c-1)}function y(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return G;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return H;for(b=32;P>b;b++)if(0!==a.dyn_ltree[2*b])return H;return G}function z(a){pa||(m(),pa=!0),a.l_desc=new oa(a.dyn_ltree,ka),a.d_desc=new oa(a.dyn_dtree,la),a.bl_desc=new oa(a.bl_tree,ma),a.bi_buf=0,a.bi_valid=0,n(a)}function A(a,b,c,d){g(a,(J<<1)+(d?1:0),3),p(a,b,c,!0)}function B(a){g(a,K<<1,3),h(a,X,ea),j(a)}function C(a,b,c,d){var e,f,h=0;a.level>0?(a.strm.data_type===I&&(a.strm.data_type=y(a)),t(a,a.l_desc),t(a,a.d_desc),h=w(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,e>=f&&(e=f)):e=f=c+5,e>=c+4&&-1!==b?A(a,b,c,d):a.strategy===F||f===e?(g(a,(K<<1)+(d?1:0),3),s(a,ea,fa)):(g(a,(L<<1)+(d?1:0),3),x(a,a.l_desc.max_code+1,a.d_desc.max_code+1,h+1),s(a,a.dyn_ltree,a.dyn_dtree)),n(a),d&&o(a)}function D(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(ha[c]+P+1)]++,a.dyn_dtree[2*e(b)]++),a.last_lit===a.lit_bufsize-1}var E=a("../utils/common"),F=4,G=0,H=1,I=2,J=0,K=1,L=2,M=3,N=258,O=29,P=256,Q=P+1+O,R=30,S=19,T=2*Q+1,U=15,V=16,W=7,X=256,Y=16,Z=17,$=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],aa=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ba=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ca=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],da=512,ea=new Array(2*(Q+2));d(ea);var fa=new Array(2*R);d(fa);var ga=new Array(da);d(ga);var ha=new Array(N-M+1);d(ha);var ia=new Array(O);d(ia);var ja=new Array(R);d(ja);var ka,la,ma,na=function(a,b,c,d,e){this.static_tree=a,this.extra_bits=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length},oa=function(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b},pa=!1;c._tr_init=z,c._tr_stored_block=A,c._tr_flush_block=C,c._tr_tally=D,c._tr_align=B},{"../utils/common":85}],97:[function(a,b,c){"use strict";function d(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=d},{}]},{},[1]); |
packages/material-ui-icons/src/CardMembershipSharp.js | Kagami/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M22 2H2v15h6v5l4-2 4 2v-5h6V2zm-2 13H4v-2h16v2zm0-5H4V4h16v6z" /></g></React.Fragment>
, 'CardMembershipSharp');
|
tests/framework.spec.js | llukasxx/school-organizer-front | import assert from 'assert'
import React from 'react'
import {mount, render, shallow} from 'enzyme'
class Fixture extends React.Component {
render () {
return (
<div>
<input id='checked' defaultChecked />
<input id='not' defaultChecked={false} />
</div>
)
}
}
describe('(Framework) Karma Plugins', function () {
it('Should expose "expect" globally.', function () {
assert.ok(expect)
})
it('Should expose "should" globally.', function () {
assert.ok(should)
})
it('Should have chai-as-promised helpers.', function () {
const pass = new Promise(res => res('test'))
const fail = new Promise((res, rej) => rej())
return Promise.all([
expect(pass).to.be.fulfilled,
expect(fail).to.not.be.fulfilled
])
})
it('should have chai-enzyme working', function() {
let wrapper = shallow(<Fixture />)
expect(wrapper.find('#checked')).to.be.checked()
wrapper = mount(<Fixture />)
expect(wrapper.find('#checked')).to.be.checked()
wrapper = render(<Fixture />)
expect(wrapper.find('#checked')).to.be.checked()
})
})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.